From 72ef42680a8a2d9cd4d8ff904f888394cf128321 Mon Sep 17 00:00:00 2001 From: jamesagnew Date: Mon, 3 Mar 2014 18:22:14 -0500 Subject: [PATCH] Maven plugin now working --- .gitignore | 2 + hapi-fhir-base/pom.xml | 6 +- .../fhir/model/dstu/composite/AddressDt.java | 54 +- .../composite}/AttachmentDt.java | 7 +- .../dstu/composite/CodeableConceptDt.java | 120 + .../fhir/model/dstu/composite/CodingDt.java | 273 ++ .../fhir/model/dstu/composite/ContactDt.java | 58 +- .../model/dstu/composite/HumanNameDt.java | 50 +- .../model/dstu/composite/IdentifierDt.java | 284 ++ .../model/dstu/composite/NarrativeDt.java | 29 +- .../composite}/PeriodDt.java | 3 +- .../fhir/model/dstu/composite/QuantityDt.java | 41 +- .../composite}/RangeDt.java | 3 +- .../composite}/RatioDt.java | 3 +- .../composite}/SampledDataDt.java | 6 +- .../uhn/fhir/model/dstu/resource/Device.java | 55 +- .../uhn/fhir/model/dstu/resource/Group.java | 68 +- .../fhir/model/dstu/resource/Location.java | 103 +- .../fhir/model/dstu/resource/Medication.java | 68 +- .../fhir/model/dstu/resource/Observation.java | 152 +- .../model/dstu/resource/Organization.java | 59 +- .../uhn/fhir/model/dstu/resource/Patient.java | 136 +- .../model/dstu/resource/Practitioner.java | 72 +- .../uhn/fhir/model/dstu/resource/Profile.java | 3468 +++++++++++++++++ .../fhir/model/dstu/resource/Specimen.java | 128 +- .../fhir/model/dstu/resource/Substance.java | 40 +- .../fhir/model/dstu/resource/ValueSet.java | 202 +- .../model/dstu/valueset/AddressUseEnum.java | 103 + .../dstu/valueset/AggregationModeEnum.java | 87 + .../dstu/valueset/AnimalSpeciesEnum.java | 95 + .../dstu/valueset/BindingConformanceEnum.java | 95 + .../dstu/valueset/ConstraintSeverityEnum.java | 87 + .../dstu/valueset/ContactSystemEnum.java | 103 + .../model/dstu/valueset/ContactUseEnum.java | 111 + .../model/dstu/valueset/DataTypeEnum.java | 343 ++ .../dstu/valueset/ExtensionContextEnum.java | 103 + .../dstu/valueset/FHIRDefinedTypeEnum.java | 727 ++++ .../dstu/valueset/FilterOperatorEnum.java | 119 + .../model/dstu/valueset/GroupTypeEnum.java | 119 + .../HierarchicalRelationshipTypeEnum.java | 87 + .../dstu/valueset/IdentifierUseEnum.java | 103 + .../model/dstu/valueset/LinkTypeEnum.java | 95 + .../model/dstu/valueset/LocationModeEnum.java | 87 + .../dstu/valueset/LocationStatusEnum.java | 95 + .../model/dstu/valueset/LocationTypeEnum.java | 135 + .../dstu/valueset/MedicationKindEnum.java | 87 + .../fhir/model/dstu/valueset/NameUseEnum.java | 127 + .../dstu/valueset/NarrativeStatusEnum.java | 103 + .../ObservationRelationshipTypeEnum.java | 127 + .../valueset/ObservationReliabilityEnum.java | 127 + .../dstu/valueset/ObservationStatusEnum.java | 119 + .../dstu/valueset/OrganizationTypeEnum.java | 143 + .../dstu/valueset/PractitionerRoleEnum.java | 119 + .../valueset/PractitionerSpecialtyEnum.java | 111 + .../valueset/PropertyRepresentationEnum.java | 79 + .../valueset/QuantityCompararatorEnum.java | 103 + .../valueset/ResourceProfileStatusEnum.java | 95 + .../model/dstu/valueset/ResourceTypeEnum.java | 455 +++ .../dstu/valueset/SearchParamTypeEnum.java | 127 + .../model/dstu/valueset/SlicingRulesEnum.java | 95 + .../SpecimenCollectionMethodEnum.java | 71 + .../SpecimenTreatmentProcedureEnum.java | 71 + .../dstu/valueset/ValueSetStatusEnum.java | 95 + .../model/primitive/CodeableConceptDt.java | 37 - .../ca/uhn/fhir/model/primitive/CodingDt.java | 84 - .../fhir/model/primitive/IdentifierDt.java | 85 - .../ca/uhn/fhir/model/primitive/StringDt.java | 6 + .../java/ca/uhn/fhir/parser/ParserState.java | 2 +- .../ca/uhn/fhir/context/ModelScannerTest.java | 2 +- .../fhir/context/ResourceWithExtensionsA.java | 2 +- .../ca/uhn/fhir/parser/XmlParserTest.java | 4 +- hapi-tinder-plugin/.classpath | 272 +- hapi-tinder-plugin/.project | 27 +- .../.settings/org.eclipse.jdt.core.prefs | 17 +- hapi-tinder-plugin/pom.xml | 70 +- .../uhn/fhir/tinder/BaseStructureParser.java | 34 +- .../BaseStructureSpreadsheetParser.java | 128 +- .../DatatypeGeneratorUsingSpreadsheet.java | 45 + .../tinder/DatatypeSpreadsheetParser.java | 51 - .../ca/uhn/fhir/tinder/ProfileParser.java | 85 +- ...=> ResourceGeneratorUsingSpreadsheet.java} | 30 +- .../java/ca/uhn/fhir/tinder/TinderMojo.java | 126 +- ...eSetParser.java => ValueSetGenerator.java} | 113 +- .../ca/uhn/fhir/tinder/model/BaseElement.java | 17 + .../ca/uhn/fhir/tinder/model/Extension.java | 6 +- .../ca/uhn/fhir/tinder/model/ValueSetTm.java | 15 +- .../{test => main}/resources/dt/address.xml | 0 .../src/main/resources/dt/attachment.xml | 342 ++ .../src/main/resources/dt/codeableconcept.xml | 194 + .../src/main/resources/dt/coding.xml | 302 ++ .../{test => main}/resources/dt/contact.xml | 0 .../src/main/resources/dt/extension.xml | 181 + .../src/main/resources/dt/humanname.xml | 461 +++ .../resources/dt/identifier.xml | 0 .../{test => main}/resources/dt/narrative.xml | 0 .../src/main/resources/dt/period.xml | 211 + .../{test => main}/resources/dt/quantity.xml | 0 .../src/main/resources/dt/range.xml | 215 + .../src/main/resources/dt/ratio.xml | 185 + .../main/resources/dt/resourcereference.xml | 206 + .../src/main/resources/dt/sampleddata.xml | 221 ++ .../src/main/resources/dt/schedule.xml | 493 +++ .../resources/prof/allprofiles.xml | 952 ++--- .../resources/res/device-spreadsheet.xml | 0 .../resources/res/group-spreadsheet.xml | 0 .../resources/res/location-spreadsheet.xml | 0 .../resources/res/medication-spreadsheet.xml | 0 .../resources/res/observation-spreadsheet.xml | 0 .../res/organization-spreadsheet.xml | 0 .../resources/res/patient-spreadsheet.xml | 0 .../res/practitioner-spreadsheet.xml | 0 .../resources/res/profile-spreadsheet.xml | 0 .../resources/res/specimen-spreadsheet.xml | 0 .../resources/res/substance-spreadsheet.xml | 0 .../resources/res/valueset-spreadsheet.xml | 0 .../main/resources/{ => vm}/dt_composite.vm | 8 +- .../src/main/resources/{ => vm}/resource.vm | 8 +- .../src/main/resources/{ => vm}/templates.vm | 3 + .../src/main/resources/{ => vm}/valueset.vm | 10 +- .../resources/vs/all-valuesets-bundle.xml} | 0 .../src/test/resources/dt/humanname.xml | 750 ---- .../src/test/resources/prof/organization.xml | 3 +- .../src/test/resources/prof/patient.xml | 8 - .../res/valueset-extensions-spreadsheet.xml_ | 357 -- .../vs/valueset-cgta-patientidpool.xml | 26 + .../vs/valueset-cgta-provideridpool.xml | 2 +- hapi-tinder-test/.classpath | 39 + hapi-tinder-test/.gitignore | 4 + hapi-tinder-test/.project | 14 + .../.settings/org.eclipse.jdt.core.prefs | 5 + hapi-tinder-test/pom.xml | 54 + pom.xml | 6 +- 132 files changed, 14059 insertions(+), 2897 deletions(-) rename hapi-fhir-base/src/main/java/ca/uhn/fhir/model/{primitive => dstu/composite}/AttachmentDt.java (86%) create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/CodeableConceptDt.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/CodingDt.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/IdentifierDt.java rename hapi-fhir-base/src/main/java/ca/uhn/fhir/model/{primitive => dstu/composite}/PeriodDt.java (89%) rename hapi-fhir-base/src/main/java/ca/uhn/fhir/model/{primitive => dstu/composite}/RangeDt.java (89%) rename hapi-fhir-base/src/main/java/ca/uhn/fhir/model/{primitive => dstu/composite}/RatioDt.java (90%) rename hapi-fhir-base/src/main/java/ca/uhn/fhir/model/{primitive => dstu/composite}/SampledDataDt.java (91%) create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Profile.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AddressUseEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AggregationModeEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AnimalSpeciesEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/BindingConformanceEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ConstraintSeverityEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ContactSystemEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ContactUseEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/DataTypeEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ExtensionContextEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/FHIRDefinedTypeEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/FilterOperatorEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/GroupTypeEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/HierarchicalRelationshipTypeEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/IdentifierUseEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LinkTypeEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LocationModeEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LocationStatusEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LocationTypeEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/MedicationKindEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/NameUseEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/NarrativeStatusEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ObservationRelationshipTypeEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ObservationReliabilityEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ObservationStatusEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/OrganizationTypeEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/PractitionerRoleEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/PractitionerSpecialtyEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/PropertyRepresentationEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/QuantityCompararatorEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ResourceProfileStatusEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ResourceTypeEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SearchParamTypeEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SlicingRulesEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SpecimenCollectionMethodEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SpecimenTreatmentProcedureEnum.java create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ValueSetStatusEnum.java delete mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/CodeableConceptDt.java delete mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/CodingDt.java delete mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/IdentifierDt.java create mode 100644 hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/DatatypeGeneratorUsingSpreadsheet.java delete mode 100644 hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/DatatypeSpreadsheetParser.java rename hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/{ResourceSpreadsheetParser.java => ResourceGeneratorUsingSpreadsheet.java} (82%) rename hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/{ValueSetParser.java => ValueSetGenerator.java} (53%) rename hapi-tinder-plugin/src/{test => main}/resources/dt/address.xml (100%) create mode 100644 hapi-tinder-plugin/src/main/resources/dt/attachment.xml create mode 100644 hapi-tinder-plugin/src/main/resources/dt/codeableconcept.xml create mode 100644 hapi-tinder-plugin/src/main/resources/dt/coding.xml rename hapi-tinder-plugin/src/{test => main}/resources/dt/contact.xml (100%) create mode 100644 hapi-tinder-plugin/src/main/resources/dt/extension.xml create mode 100644 hapi-tinder-plugin/src/main/resources/dt/humanname.xml rename hapi-tinder-plugin/src/{test => main}/resources/dt/identifier.xml (100%) rename hapi-tinder-plugin/src/{test => main}/resources/dt/narrative.xml (100%) create mode 100644 hapi-tinder-plugin/src/main/resources/dt/period.xml rename hapi-tinder-plugin/src/{test => main}/resources/dt/quantity.xml (100%) create mode 100644 hapi-tinder-plugin/src/main/resources/dt/range.xml create mode 100644 hapi-tinder-plugin/src/main/resources/dt/ratio.xml create mode 100644 hapi-tinder-plugin/src/main/resources/dt/resourcereference.xml create mode 100644 hapi-tinder-plugin/src/main/resources/dt/sampleddata.xml create mode 100644 hapi-tinder-plugin/src/main/resources/dt/schedule.xml rename hapi-tinder-plugin/src/{test => main}/resources/prof/allprofiles.xml (98%) rename hapi-tinder-plugin/src/{test => main}/resources/res/device-spreadsheet.xml (100%) rename hapi-tinder-plugin/src/{test => main}/resources/res/group-spreadsheet.xml (100%) rename hapi-tinder-plugin/src/{test => main}/resources/res/location-spreadsheet.xml (100%) rename hapi-tinder-plugin/src/{test => main}/resources/res/medication-spreadsheet.xml (100%) rename hapi-tinder-plugin/src/{test => main}/resources/res/observation-spreadsheet.xml (100%) rename hapi-tinder-plugin/src/{test => main}/resources/res/organization-spreadsheet.xml (100%) rename hapi-tinder-plugin/src/{test => main}/resources/res/patient-spreadsheet.xml (100%) rename hapi-tinder-plugin/src/{test => main}/resources/res/practitioner-spreadsheet.xml (100%) rename hapi-tinder-plugin/src/{test => main}/resources/res/profile-spreadsheet.xml (100%) rename hapi-tinder-plugin/src/{test => main}/resources/res/specimen-spreadsheet.xml (100%) rename hapi-tinder-plugin/src/{test => main}/resources/res/substance-spreadsheet.xml (100%) rename hapi-tinder-plugin/src/{test => main}/resources/res/valueset-spreadsheet.xml (100%) rename hapi-tinder-plugin/src/main/resources/{ => vm}/dt_composite.vm (76%) rename hapi-tinder-plugin/src/main/resources/{ => vm}/resource.vm (80%) rename hapi-tinder-plugin/src/main/resources/{ => vm}/templates.vm (98%) rename hapi-tinder-plugin/src/main/resources/{ => vm}/valueset.vm (90%) rename hapi-tinder-plugin/src/{test/resources/vs/valuesets.xml => main/resources/vs/all-valuesets-bundle.xml} (100%) delete mode 100644 hapi-tinder-plugin/src/test/resources/dt/humanname.xml delete mode 100644 hapi-tinder-plugin/src/test/resources/res/valueset-extensions-spreadsheet.xml_ create mode 100644 hapi-tinder-plugin/src/test/resources/vs/valueset-cgta-patientidpool.xml create mode 100644 hapi-tinder-test/.classpath create mode 100644 hapi-tinder-test/.gitignore create mode 100644 hapi-tinder-test/.project create mode 100644 hapi-tinder-test/.settings/org.eclipse.jdt.core.prefs create mode 100644 hapi-tinder-test/pom.xml diff --git a/.gitignore b/.gitignore index 934e0e06ffa..211297c90f9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /bin /target +*.log +*.log* diff --git a/hapi-fhir-base/pom.xml b/hapi-fhir-base/pom.xml index 713823ce136..3de02ee81cf 100644 --- a/hapi-fhir-base/pom.xml +++ b/hapi-fhir-base/pom.xml @@ -83,11 +83,11 @@ test - org.apache.commons + commons-io commons-io - 1.3.2 + 2.4 test - + xmlunit xmlunit diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/AddressDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/AddressDt.java index 9f253491f1f..e228093f380 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/AddressDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/AddressDt.java @@ -17,9 +17,11 @@ package ca.uhn.fhir.model.dstu.composite; import java.util.*; + import ca.uhn.fhir.model.api.*; import ca.uhn.fhir.model.api.annotation.*; import ca.uhn.fhir.model.primitive.*; +import ca.uhn.fhir.model.dstu.valueset.*; /** * HAPI/FHIR Address Datatype @@ -39,7 +41,7 @@ import ca.uhn.fhir.model.primitive.*; public class AddressDt extends BaseElement implements ICompositeDatatype { @Child(name="use", type=CodeDt.class, order=0, min=0, max=1) - private CodeDt myUse; + private BoundCodeDt myUse; @Child(name="text", type=StringDt.class, order=1, min=0, max=1) private StringDt myText; @@ -72,9 +74,9 @@ public class AddressDt extends BaseElement implements ICompositeDatatype { * The purpose of this address *

*/ - public CodeDt getUse() { + public BoundCodeDt getUse() { if (myUse == null) { - myUse = new CodeDt(); + myUse = new BoundCodeDt(AddressUseEnum.VALUESET_BINDER); } return myUse; } @@ -87,11 +89,23 @@ public class AddressDt extends BaseElement implements ICompositeDatatype { * The purpose of this address *

*/ - public void setUse(CodeDt theValue) { + public void setUse(BoundCodeDt theValue) { myUse = theValue; } - - + + /** + * Sets the value(s) for use (home | work | temp | old - purpose of this address) + * + *

+ * Definition: + * The purpose of this address + *

+ */ + public void setUse(AddressUseEnum theValue) { + getUse().setValueAsEnum(theValue); + } + + /** * Gets the value(s) for text (Text representation of the address). * creating it if it does @@ -120,8 +134,8 @@ public class AddressDt extends BaseElement implements ICompositeDatatype { public void setText(StringDt theValue) { myText = theValue; } - - /** + + /** * Sets the value(s) for text (Text representation of the address) * *

@@ -163,8 +177,8 @@ P.O. Box number, delivery hints, and similar address information public void setLine(List theValue) { myLine = theValue; } - - /** + + /** * Sets the value(s) for line (Street name, number, direction & P.O. Box etc ) * *

@@ -208,8 +222,8 @@ P.O. Box number, delivery hints, and similar address information public void setCity(StringDt theValue) { myCity = theValue; } - - /** + + /** * Sets the value(s) for city (Name of city, town etc.) * *

@@ -249,8 +263,8 @@ P.O. Box number, delivery hints, and similar address information public void setState(StringDt theValue) { myState = theValue; } - - /** + + /** * Sets the value(s) for state (Sub-unit of country (abreviations ok)) * *

@@ -290,8 +304,8 @@ P.O. Box number, delivery hints, and similar address information public void setZip(StringDt theValue) { myZip = theValue; } - - /** + + /** * Sets the value(s) for zip (Postal code for area) * *

@@ -331,8 +345,8 @@ P.O. Box number, delivery hints, and similar address information public void setCountry(StringDt theValue) { myCountry = theValue; } - - /** + + /** * Sets the value(s) for country (Country (can be ISO 3166 3 letter code)) * *

@@ -372,8 +386,8 @@ P.O. Box number, delivery hints, and similar address information public void setPeriod(PeriodDt theValue) { myPeriod = theValue; } - - + + } \ No newline at end of file diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/AttachmentDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/AttachmentDt.java similarity index 86% rename from hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/AttachmentDt.java rename to hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/AttachmentDt.java index 971e6b9cef6..9e78de13f57 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/AttachmentDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/AttachmentDt.java @@ -1,10 +1,15 @@ -package ca.uhn.fhir.model.primitive; +package ca.uhn.fhir.model.dstu.composite; import ca.uhn.fhir.model.api.BaseElement; import ca.uhn.fhir.model.api.ICompositeDatatype; 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.model.primitive.Base64BinaryDt; +import ca.uhn.fhir.model.primitive.CodeDt; +import ca.uhn.fhir.model.primitive.IntegerDt; +import ca.uhn.fhir.model.primitive.StringDt; +import ca.uhn.fhir.model.primitive.UriDt; @DatatypeDef(name="Attachment") public class AttachmentDt extends BaseElement implements ICompositeDatatype { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/CodeableConceptDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/CodeableConceptDt.java new file mode 100644 index 00000000000..b89541fc55d --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/CodeableConceptDt.java @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + +package ca.uhn.fhir.model.dstu.composite; + +import java.util.*; +import ca.uhn.fhir.model.api.*; +import ca.uhn.fhir.model.api.annotation.*; +import ca.uhn.fhir.model.primitive.*; + +/** + * HAPI/FHIR CodeableConcept Datatype + * (Concept - reference to a terminology or just text) + * + *

+ * Definition: + * A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text + *

+ * + *

+ * Requirements: + * This is a common pattern in healthcare - a concept that may be defined by one or more codes from formal definitions including LOINC and SNOMED CT, and/or defined by the provision of text that captures a human sense of the concept + *

+ */ +@DatatypeDef(name="CodeableConcept") +public class CodeableConceptDt extends BaseElement implements ICompositeDatatype { + + @Child(name="coding", type=CodingDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) + private List myCoding; + + @Child(name="text", type=StringDt.class, order=1, min=0, max=1) + private StringDt myText; + + /** + * Gets the value(s) for coding (Code defined by a terminology system ). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A reference to a code defined by a terminology system + *

+ */ + public List getCoding() { + if (myCoding == null) { + myCoding = new ArrayList(); + } + return myCoding; + } + + /** + * Sets the value(s) for coding (Code defined by a terminology system ) + * + *

+ * Definition: + * A reference to a code defined by a terminology system + *

+ */ + public void setCoding(List theValue) { + myCoding = theValue; + } + + + /** + * Gets the value(s) for text (Plain text representation of the concept). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 StringDt getText() { + if (myText == null) { + myText = new StringDt(); + } + return myText; + } + + /** + * Sets the value(s) for text (Plain text representation of the concept) + * + *

+ * Definition: + * 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 void setText(StringDt theValue) { + myText = theValue; + } + + /** + * Sets the value(s) for text (Plain text representation of the concept) + * + *

+ * Definition: + * 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 void setText( String theString) { + myText = new StringDt(theString); + } + + + +} \ No newline at end of file diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/CodingDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/CodingDt.java new file mode 100644 index 00000000000..cc572b63d85 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/CodingDt.java @@ -0,0 +1,273 @@ + + + + + + + + + + + + + + + + +package ca.uhn.fhir.model.dstu.composite; + +import ca.uhn.fhir.model.api.BaseElement; +import ca.uhn.fhir.model.api.ICompositeDatatype; +import ca.uhn.fhir.model.api.ResourceReference; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.ChildResource; +import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.dstu.resource.ValueSet; +import ca.uhn.fhir.model.primitive.BooleanDt; +import ca.uhn.fhir.model.primitive.CodeDt; +import ca.uhn.fhir.model.primitive.StringDt; +import ca.uhn.fhir.model.primitive.UriDt; + +/** + * HAPI/FHIR Coding Datatype + * (A reference to a code defined by a terminology system ) + * + *

+ * Definition: + * A reference to a code defined by a terminology system + *

+ * + *

+ * Requirements: + * References to codes are very common in healthcare models + *

+ */ +@DatatypeDef(name="Coding") +public class CodingDt extends BaseElement implements ICompositeDatatype { + + @Child(name="system", type=UriDt.class, order=0, min=0, max=1) + private UriDt mySystem; + + @Child(name="version", type=StringDt.class, order=1, min=0, max=1) + private StringDt myVersion; + + @Child(name="code", type=CodeDt.class, order=2, min=0, max=1) + private CodeDt myCode; + + @Child(name="display", type=StringDt.class, order=3, min=0, max=1) + private StringDt myDisplay; + + @Child(name="primary", type=BooleanDt.class, order=4, min=0, max=1) + private BooleanDt myPrimary; + + @Child(name="valueSet", order=5, min=0, max=1) + @ChildResource(types= { + ValueSet.class, + }) + private ResourceReference myValueSet; + + /** + * Gets the value(s) for system (Identity of the terminology system ). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The identification of the code system that defines the meaning of the symbol in the code. + *

+ */ + public UriDt getSystem() { + if (mySystem == null) { + mySystem = new UriDt(); + } + return mySystem; + } + + /** + * Sets the value(s) for system (Identity of the terminology system ) + * + *

+ * Definition: + * The identification of the code system that defines the meaning of the symbol in the code. + *

+ */ + public void setSystem(UriDt theValue) { + mySystem = theValue; + } + + + /** + * Gets the value(s) for version (Version of the system - if relevant). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 StringDt getVersion() { + if (myVersion == null) { + myVersion = new StringDt(); + } + return myVersion; + } + + /** + * Sets the value(s) for version (Version of the system - if relevant) + * + *

+ * Definition: + * 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 void setVersion(StringDt theValue) { + myVersion = theValue; + } + + /** + * Sets the value(s) for version (Version of the system - if relevant) + * + *

+ * Definition: + * 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 void setVersion( String theString) { + myVersion = new StringDt(theString); + } + + /** + * Gets the value(s) for code (Symbol in syntax defined by the system). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 CodeDt getCode() { + if (myCode == null) { + myCode = new CodeDt(); + } + return myCode; + } + + /** + * Sets the value(s) for code (Symbol in syntax defined by the system) + * + *

+ * Definition: + * 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 void setCode(CodeDt theValue) { + myCode = theValue; + } + + + /** + * Gets the value(s) for display (Representation defined by the system). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A representation of the meaning of the code in the system, following the rules of the system. + *

+ */ + public StringDt getDisplay() { + if (myDisplay == null) { + myDisplay = new StringDt(); + } + return myDisplay; + } + + /** + * Sets the value(s) for display (Representation defined by the system) + * + *

+ * Definition: + * A representation of the meaning of the code in the system, following the rules of the system. + *

+ */ + public void setDisplay(StringDt theValue) { + myDisplay = theValue; + } + + /** + * Sets the value(s) for display (Representation defined by the system) + * + *

+ * Definition: + * A representation of the meaning of the code in the system, following the rules of the system. + *

+ */ + public void setDisplay( String theString) { + myDisplay = new StringDt(theString); + } + + /** + * Gets the value(s) for primary (If this code was chosen directly by the user). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays) + *

+ */ + public BooleanDt getPrimary() { + if (myPrimary == null) { + myPrimary = new BooleanDt(); + } + return myPrimary; + } + + /** + * Sets the value(s) for primary (If this code was chosen directly by the user) + * + *

+ * Definition: + * Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays) + *

+ */ + public void setPrimary(BooleanDt theValue) { + myPrimary = theValue; + } + + + /** + * Gets the value(s) for valueSet (Set this coding was chosen from). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The set of possible coded values this coding was chosen from or constrained by + *

+ */ + public ResourceReference getValueSet() { + if (myValueSet == null) { + myValueSet = new ResourceReference(); + } + return myValueSet; + } + + /** + * Sets the value(s) for valueSet (Set this coding was chosen from) + * + *

+ * Definition: + * The set of possible coded values this coding was chosen from or constrained by + *

+ */ + public void setValueSet(ResourceReference theValue) { + myValueSet = theValue; + } + + + + +} \ No newline at end of file diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/ContactDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/ContactDt.java index 86e1dff7e90..ddbd5d2affe 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/ContactDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/ContactDt.java @@ -17,9 +17,11 @@ package ca.uhn.fhir.model.dstu.composite; import java.util.*; + import ca.uhn.fhir.model.api.*; import ca.uhn.fhir.model.api.annotation.*; import ca.uhn.fhir.model.primitive.*; +import ca.uhn.fhir.model.dstu.valueset.*; /** * HAPI/FHIR Contact Datatype @@ -39,13 +41,13 @@ import ca.uhn.fhir.model.primitive.*; public class ContactDt extends BaseElement implements ICompositeDatatype { @Child(name="system", type=CodeDt.class, order=0, min=0, max=1) - private CodeDt mySystem; + private BoundCodeDt mySystem; @Child(name="value", type=StringDt.class, order=1, min=0, max=1) private StringDt myValue; @Child(name="use", type=CodeDt.class, order=2, min=0, max=1) - private CodeDt myUse; + private BoundCodeDt myUse; @Child(name="period", type=PeriodDt.class, order=3, min=0, max=1) private PeriodDt myPeriod; @@ -60,9 +62,9 @@ public class ContactDt extends BaseElement implements ICompositeDatatype { * Telecommunications form for contact - what communications system is required to make use of the contact *

*/ - public CodeDt getSystem() { + public BoundCodeDt getSystem() { if (mySystem == null) { - mySystem = new CodeDt(); + mySystem = new BoundCodeDt(ContactSystemEnum.VALUESET_BINDER); } return mySystem; } @@ -75,11 +77,23 @@ public class ContactDt extends BaseElement implements ICompositeDatatype { * Telecommunications form for contact - what communications system is required to make use of the contact *

*/ - public void setSystem(CodeDt theValue) { + public void setSystem(BoundCodeDt theValue) { mySystem = theValue; } - - + + /** + * Sets the value(s) for system (phone | fax | email | url) + * + *

+ * Definition: + * Telecommunications form for contact - what communications system is required to make use of the contact + *

+ */ + public void setSystem(ContactSystemEnum theValue) { + getSystem().setValueAsEnum(theValue); + } + + /** * Gets the value(s) for value (The actual contact details). * creating it if it does @@ -108,8 +122,8 @@ public class ContactDt extends BaseElement implements ICompositeDatatype { public void setValue(StringDt theValue) { myValue = theValue; } - - /** + + /** * Sets the value(s) for value (The actual contact details) * *

@@ -131,9 +145,9 @@ public class ContactDt extends BaseElement implements ICompositeDatatype { * Identifies the purpose for the address *

*/ - public CodeDt getUse() { + public BoundCodeDt getUse() { if (myUse == null) { - myUse = new CodeDt(); + myUse = new BoundCodeDt(ContactUseEnum.VALUESET_BINDER); } return myUse; } @@ -146,11 +160,23 @@ public class ContactDt extends BaseElement implements ICompositeDatatype { * Identifies the purpose for the address *

*/ - public void setUse(CodeDt theValue) { + public void setUse(BoundCodeDt theValue) { myUse = theValue; } - - + + /** + * Sets the value(s) for use (home | work | temp | old | mobile - purpose of this address) + * + *

+ * Definition: + * Identifies the purpose for the address + *

+ */ + public void setUse(ContactUseEnum theValue) { + getUse().setValueAsEnum(theValue); + } + + /** * Gets the value(s) for period (Time period when the contact was/is in use). * creating it if it does @@ -179,8 +205,8 @@ public class ContactDt extends BaseElement implements ICompositeDatatype { public void setPeriod(PeriodDt theValue) { myPeriod = theValue; } - - + + } \ No newline at end of file diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/HumanNameDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/HumanNameDt.java index 71596cbbd76..5d5347dd852 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/HumanNameDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/HumanNameDt.java @@ -17,9 +17,11 @@ package ca.uhn.fhir.model.dstu.composite; import java.util.*; + import ca.uhn.fhir.model.api.*; import ca.uhn.fhir.model.api.annotation.*; import ca.uhn.fhir.model.primitive.*; +import ca.uhn.fhir.model.dstu.valueset.*; /** * HAPI/FHIR HumanName Datatype @@ -39,7 +41,7 @@ import ca.uhn.fhir.model.primitive.*; public class HumanNameDt extends BaseElement implements ICompositeDatatype { @Child(name="use", type=CodeDt.class, order=0, min=0, max=1) - private CodeDt myUse; + private BoundCodeDt myUse; @Child(name="text", type=StringDt.class, order=1, min=0, max=1) private StringDt myText; @@ -69,9 +71,9 @@ public class HumanNameDt extends BaseElement implements ICompositeDatatype { * Identifies the purpose for this name *

*/ - public CodeDt getUse() { + public BoundCodeDt getUse() { if (myUse == null) { - myUse = new CodeDt(); + myUse = new BoundCodeDt(NameUseEnum.VALUESET_BINDER); } return myUse; } @@ -84,11 +86,23 @@ public class HumanNameDt extends BaseElement implements ICompositeDatatype { * Identifies the purpose for this name *

*/ - public void setUse(CodeDt theValue) { + public void setUse(BoundCodeDt theValue) { myUse = theValue; } - - + + /** + * Sets the value(s) for use (usual | official | temp | nickname | anonymous | old | maiden) + * + *

+ * Definition: + * Identifies the purpose for this name + *

+ */ + public void setUse(NameUseEnum theValue) { + getUse().setValueAsEnum(theValue); + } + + /** * Gets the value(s) for text (Text representation of the full name). * creating it if it does @@ -117,8 +131,8 @@ public class HumanNameDt extends BaseElement implements ICompositeDatatype { public void setText(StringDt theValue) { myText = theValue; } - - /** + + /** * Sets the value(s) for text (Text representation of the full name) * *

@@ -158,8 +172,8 @@ public class HumanNameDt extends BaseElement implements ICompositeDatatype { public void setFamily(List theValue) { myFamily = theValue; } - - /** + + /** * Sets the value(s) for family (Family name (often called 'Surname')) * *

@@ -202,8 +216,8 @@ public class HumanNameDt extends BaseElement implements ICompositeDatatype { public void setGiven(List theValue) { myGiven = theValue; } - - /** + + /** * Sets the value(s) for given (Given names (not always 'first'). Includes middle names) * *

@@ -246,8 +260,8 @@ public class HumanNameDt extends BaseElement implements ICompositeDatatype { public void setPrefix(List theValue) { myPrefix = theValue; } - - /** + + /** * Sets the value(s) for prefix (Parts that come before the name) * *

@@ -290,8 +304,8 @@ public class HumanNameDt extends BaseElement implements ICompositeDatatype { public void setSuffix(List theValue) { mySuffix = theValue; } - - /** + + /** * Sets the value(s) for suffix (Parts that come after the name) * *

@@ -334,8 +348,8 @@ public class HumanNameDt extends BaseElement implements ICompositeDatatype { public void setPeriod(PeriodDt theValue) { myPeriod = theValue; } - - + + } \ No newline at end of file diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/IdentifierDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/IdentifierDt.java new file mode 100644 index 00000000000..f88a64d5465 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/IdentifierDt.java @@ -0,0 +1,284 @@ + + + + + + + + + + + + + + + + +package ca.uhn.fhir.model.dstu.composite; + +import java.util.*; + +import ca.uhn.fhir.model.api.*; +import ca.uhn.fhir.model.api.annotation.*; +import ca.uhn.fhir.model.primitive.*; +import ca.uhn.fhir.model.dstu.valueset.*; +import ca.uhn.fhir.model.dstu.resource.*; + +/** + * HAPI/FHIR Identifier Datatype + * (An identifier intended for computation) + * + *

+ * Definition: + * A technical identifier - identifies some entity uniquely and unambiguously + *

+ * + *

+ * Requirements: + * Need to be able to identify things with confidence and be sure that the identification is not subject to misinterpretation + *

+ */ +@DatatypeDef(name="Identifier") +public class IdentifierDt extends BaseElement implements ICompositeDatatype { + + @Child(name="use", type=CodeDt.class, order=0, min=0, max=1) + private BoundCodeDt myUse; + + @Child(name="label", type=StringDt.class, order=1, min=0, max=1) + private StringDt myLabel; + + @Child(name="system", type=UriDt.class, order=2, min=0, max=1) + private UriDt mySystem; + + @Child(name="value", type=StringDt.class, order=3, min=0, max=1) + private StringDt myValue; + + @Child(name="period", type=PeriodDt.class, order=4, min=0, max=1) + private PeriodDt myPeriod; + + @Child(name="assigner", order=5, min=0, max=1) + @ChildResource(types= { + Organization.class, + }) + private ResourceReference myAssigner; + + /** + * Gets the value(s) for use (usual | official | temp | secondary (If known) +). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The purpose of this identifier + *

+ */ + public BoundCodeDt getUse() { + if (myUse == null) { + myUse = new BoundCodeDt(IdentifierUseEnum.VALUESET_BINDER); + } + return myUse; + } + + /** + * Sets the value(s) for use (usual | official | temp | secondary (If known) +) + * + *

+ * Definition: + * The purpose of this identifier + *

+ */ + public void setUse(BoundCodeDt theValue) { + myUse = theValue; + } + + /** + * Sets the value(s) for use (usual | official | temp | secondary (If known) +) + * + *

+ * Definition: + * The purpose of this identifier + *

+ */ + public void setUse(IdentifierUseEnum theValue) { + getUse().setValueAsEnum(theValue); + } + + + /** + * Gets the value(s) for label (Description of identifier). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A text string for the identifier that can be displayed to a human so they can recognize the identifier + *

+ */ + public StringDt getLabel() { + if (myLabel == null) { + myLabel = new StringDt(); + } + return myLabel; + } + + /** + * Sets the value(s) for label (Description of identifier) + * + *

+ * Definition: + * A text string for the identifier that can be displayed to a human so they can recognize the identifier + *

+ */ + public void setLabel(StringDt theValue) { + myLabel = theValue; + } + + /** + * Sets the value(s) for label (Description of identifier) + * + *

+ * Definition: + * A text string for the identifier that can be displayed to a human so they can recognize the identifier + *

+ */ + public void setLabel( String theString) { + myLabel = new StringDt(theString); + } + + /** + * Gets the value(s) for system (The namespace for the identifier). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Establishes the namespace in which set of possible id values is unique. + *

+ */ + public UriDt getSystem() { + if (mySystem == null) { + mySystem = new UriDt(); + } + return mySystem; + } + + /** + * Sets the value(s) for system (The namespace for the identifier) + * + *

+ * Definition: + * Establishes the namespace in which set of possible id values is unique. + *

+ */ + public void setSystem(UriDt theValue) { + mySystem = theValue; + } + + + /** + * Gets the value(s) for value (The value that is unique). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The portion of the identifier typically displayed to the user and which is unique within the context of the system. + *

+ */ + public StringDt getValue() { + if (myValue == null) { + myValue = new StringDt(); + } + return myValue; + } + + /** + * Sets the value(s) for value (The value that is unique) + * + *

+ * Definition: + * The portion of the identifier typically displayed to the user and which is unique within the context of the system. + *

+ */ + public void setValue(StringDt theValue) { + myValue = theValue; + } + + /** + * Sets the value(s) for value (The value that is unique) + * + *

+ * Definition: + * The portion of the identifier typically displayed to the user and which is unique within the context of the system. + *

+ */ + public void setValue( String theString) { + myValue = new StringDt(theString); + } + + /** + * Gets the value(s) for period (Time period when id is/was valid for use). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Time period during which identifier is/was valid for use + *

+ */ + public PeriodDt getPeriod() { + if (myPeriod == null) { + myPeriod = new PeriodDt(); + } + return myPeriod; + } + + /** + * Sets the value(s) for period (Time period when id is/was valid for use) + * + *

+ * Definition: + * Time period during which identifier is/was valid for use + *

+ */ + public void setPeriod(PeriodDt theValue) { + myPeriod = theValue; + } + + + /** + * Gets the value(s) for assigner (Organization that issued id (may be just text)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Organization that issued/manages the identifier + *

+ */ + public ResourceReference getAssigner() { + if (myAssigner == null) { + myAssigner = new ResourceReference(); + } + return myAssigner; + } + + /** + * Sets the value(s) for assigner (Organization that issued id (may be just text)) + * + *

+ * Definition: + * Organization that issued/manages the identifier + *

+ */ + public void setAssigner(ResourceReference theValue) { + myAssigner = theValue; + } + + + + +} \ No newline at end of file diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/NarrativeDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/NarrativeDt.java index 919ae3a7871..d633ac9ca57 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/NarrativeDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/NarrativeDt.java @@ -20,6 +20,7 @@ import java.util.*; import ca.uhn.fhir.model.api.*; import ca.uhn.fhir.model.api.annotation.*; import ca.uhn.fhir.model.primitive.*; +import ca.uhn.fhir.model.dstu.valueset.*; /** * HAPI/FHIR Narrative Datatype @@ -39,7 +40,7 @@ import ca.uhn.fhir.model.primitive.*; public class NarrativeDt extends BaseElement implements ICompositeDatatype { @Child(name="status", type=CodeDt.class, order=0, min=1, max=1) - private CodeDt myStatus; + private BoundCodeDt myStatus; @Child(name="div", type=XhtmlDt.class, order=1, min=1, max=1) private XhtmlDt myDiv; @@ -54,9 +55,9 @@ public class NarrativeDt extends BaseElement implements ICompositeDatatype { * 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 CodeDt getStatus() { + public BoundCodeDt getStatus() { if (myStatus == null) { - myStatus = new CodeDt(); + myStatus = new BoundCodeDt(NarrativeStatusEnum.VALUESET_BINDER); } return myStatus; } @@ -69,11 +70,23 @@ public class NarrativeDt extends BaseElement implements ICompositeDatatype { * 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 void setStatus(CodeDt theValue) { + public void setStatus(BoundCodeDt theValue) { myStatus = theValue; } - - + + /** + * Sets the value(s) for status (generated | extensions | additional) + * + *

+ * Definition: + * 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 void setStatus(NarrativeStatusEnum theValue) { + getStatus().setValueAsEnum(theValue); + } + + /** * Gets the value(s) for div (Limited xhtml content). * creating it if it does @@ -102,8 +115,8 @@ public class NarrativeDt extends BaseElement implements ICompositeDatatype { public void setDiv(XhtmlDt theValue) { myDiv = theValue; } - - + + } \ No newline at end of file diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/PeriodDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/PeriodDt.java similarity index 89% rename from hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/PeriodDt.java rename to hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/PeriodDt.java index acb2c7dbc54..b262aa5a7d8 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/PeriodDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/PeriodDt.java @@ -1,10 +1,11 @@ -package ca.uhn.fhir.model.primitive; +package ca.uhn.fhir.model.dstu.composite; import ca.uhn.fhir.model.api.BaseElement; import ca.uhn.fhir.model.api.ICompositeDatatype; import ca.uhn.fhir.model.api.annotation.Child; import ca.uhn.fhir.model.api.annotation.Constraint; import ca.uhn.fhir.model.api.annotation.DatatypeDef; +import ca.uhn.fhir.model.primitive.DateTimeDt; @DatatypeDef(name="Period") public class PeriodDt extends BaseElement implements ICompositeDatatype { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/QuantityDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/QuantityDt.java index 7e152b2f28c..fe39f288306 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/QuantityDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/QuantityDt.java @@ -20,6 +20,7 @@ import java.util.*; import ca.uhn.fhir.model.api.*; import ca.uhn.fhir.model.api.annotation.*; import ca.uhn.fhir.model.primitive.*; +import ca.uhn.fhir.model.dstu.valueset.*; /** * HAPI/FHIR Quantity Datatype @@ -42,7 +43,7 @@ public class QuantityDt extends BaseElement implements ICompositeDatatype { private DecimalDt myValue; @Child(name="comparator", type=CodeDt.class, order=1, min=0, max=1) - private CodeDt myComparator; + private BoundCodeDt myComparator; @Child(name="units", type=StringDt.class, order=2, min=0, max=1) private StringDt myUnits; @@ -81,8 +82,8 @@ public class QuantityDt extends BaseElement implements ICompositeDatatype { public void setValue(DecimalDt theValue) { myValue = theValue; } - - + + /** * Gets the value(s) for comparator (< | <= | >= | > - how to understand the value). * creating it if it does @@ -93,9 +94,9 @@ public class QuantityDt extends BaseElement implements ICompositeDatatype { * 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 CodeDt getComparator() { + public BoundCodeDt getComparator() { if (myComparator == null) { - myComparator = new CodeDt(); + myComparator = new BoundCodeDt(QuantityCompararatorEnum.VALUESET_BINDER); } return myComparator; } @@ -108,11 +109,23 @@ public class QuantityDt extends BaseElement implements ICompositeDatatype { * 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 void setComparator(CodeDt theValue) { + public void setComparator(BoundCodeDt theValue) { myComparator = theValue; } - - + + /** + * Sets the value(s) for comparator (< | <= | >= | > - how to understand the value) + * + *

+ * Definition: + * 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 void setComparator(QuantityCompararatorEnum theValue) { + getComparator().setValueAsEnum(theValue); + } + + /** * Gets the value(s) for units (Unit representation). * creating it if it does @@ -141,8 +154,8 @@ public class QuantityDt extends BaseElement implements ICompositeDatatype { public void setUnits(StringDt theValue) { myUnits = theValue; } - - /** + + /** * Sets the value(s) for units (Unit representation) * *

@@ -182,8 +195,8 @@ public class QuantityDt extends BaseElement implements ICompositeDatatype { public void setSystem(UriDt theValue) { mySystem = theValue; } - - + + /** * Gets the value(s) for code (Coded form of the unit). * creating it if it does @@ -212,8 +225,8 @@ public class QuantityDt extends BaseElement implements ICompositeDatatype { public void setCode(CodeDt theValue) { myCode = theValue; } - - + + } \ No newline at end of file diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/RangeDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/RangeDt.java similarity index 89% rename from hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/RangeDt.java rename to hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/RangeDt.java index 8b6215e94d8..0768cec905c 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/RangeDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/RangeDt.java @@ -1,11 +1,10 @@ -package ca.uhn.fhir.model.primitive; +package ca.uhn.fhir.model.dstu.composite; import ca.uhn.fhir.model.api.BaseElement; import ca.uhn.fhir.model.api.ICompositeDatatype; import ca.uhn.fhir.model.api.annotation.Child; import ca.uhn.fhir.model.api.annotation.Constraint; import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; @DatatypeDef(name="Range") public class RangeDt extends BaseElement implements ICompositeDatatype { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/RatioDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/RatioDt.java similarity index 90% rename from hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/RatioDt.java rename to hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/RatioDt.java index a9fd3210bef..d5ea64edd04 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/RatioDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/RatioDt.java @@ -1,11 +1,10 @@ -package ca.uhn.fhir.model.primitive; +package ca.uhn.fhir.model.dstu.composite; import ca.uhn.fhir.model.api.BaseElement; import ca.uhn.fhir.model.api.ICompositeDatatype; import ca.uhn.fhir.model.api.annotation.Child; import ca.uhn.fhir.model.api.annotation.Constraint; import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.dstu.composite.QuantityDt; @DatatypeDef(name="Ratio") public class RatioDt extends BaseElement implements ICompositeDatatype { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/SampledDataDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/SampledDataDt.java similarity index 91% rename from hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/SampledDataDt.java rename to hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/SampledDataDt.java index 819deb7e847..66e43414650 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/SampledDataDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/composite/SampledDataDt.java @@ -1,11 +1,13 @@ -package ca.uhn.fhir.model.primitive; +package ca.uhn.fhir.model.dstu.composite; import ca.uhn.fhir.model.api.BaseElement; import ca.uhn.fhir.model.api.ICompositeDatatype; 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.model.dstu.composite.QuantityDt; +import ca.uhn.fhir.model.primitive.DecimalDt; +import ca.uhn.fhir.model.primitive.IntegerDt; +import ca.uhn.fhir.model.primitive.StringDt; @DatatypeDef(name="SampledData") public class SampledDataDt extends BaseElement implements ICompositeDatatype { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Device.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Device.java index d3cf1585e24..7fb709a30a6 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Device.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Device.java @@ -21,6 +21,7 @@ import ca.uhn.fhir.model.api.*; import ca.uhn.fhir.model.api.annotation.*; import ca.uhn.fhir.model.primitive.*; import ca.uhn.fhir.model.dstu.composite.*; +import ca.uhn.fhir.model.dstu.valueset.*; /** * HAPI/FHIR Device Resource @@ -37,7 +38,7 @@ import ca.uhn.fhir.model.dstu.composite.*; *

*/ @ResourceDef(name="Device") -public class Device extends BaseElement implements IResource { +public class Device extends BaseResource implements IResource { @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) private List myIdentifier; @@ -115,8 +116,8 @@ public class Device extends BaseElement implements IResource { public void setIdentifier(List theValue) { myIdentifier = theValue; } - - + + /** * Gets the value(s) for type (What kind of device this is). * creating it if it does @@ -145,8 +146,8 @@ public class Device extends BaseElement implements IResource { public void setType(CodeableConceptDt theValue) { myType = theValue; } - - + + /** * Gets the value(s) for manufacturer (Name of device manufacturer). * creating it if it does @@ -175,8 +176,8 @@ public class Device extends BaseElement implements IResource { public void setManufacturer(StringDt theValue) { myManufacturer = theValue; } - - /** + + /** * Sets the value(s) for manufacturer (Name of device manufacturer) * *

@@ -216,8 +217,8 @@ public class Device extends BaseElement implements IResource { public void setModel(StringDt theValue) { myModel = theValue; } - - /** + + /** * Sets the value(s) for model (Model id assigned by the manufacturer) * *

@@ -257,8 +258,8 @@ public class Device extends BaseElement implements IResource { public void setVersion(StringDt theValue) { myVersion = theValue; } - - /** + + /** * Sets the value(s) for version (Version number (i.e. software)) * *

@@ -298,8 +299,8 @@ public class Device extends BaseElement implements IResource { public void setExpiry(DateDt theValue) { myExpiry = theValue; } - - + + /** * Gets the value(s) for udi (FDA Mandated Unique Device Identifier). * creating it if it does @@ -328,8 +329,8 @@ public class Device extends BaseElement implements IResource { public void setUdi(StringDt theValue) { myUdi = theValue; } - - /** + + /** * Sets the value(s) for udi (FDA Mandated Unique Device Identifier) * *

@@ -369,8 +370,8 @@ public class Device extends BaseElement implements IResource { public void setLotNumber(StringDt theValue) { myLotNumber = theValue; } - - /** + + /** * Sets the value(s) for lotNumber (Lot number of manufacture) * *

@@ -410,8 +411,8 @@ public class Device extends BaseElement implements IResource { public void setOwner(ResourceReference theValue) { myOwner = theValue; } - - + + /** * Gets the value(s) for location (Where the resource is found). * creating it if it does @@ -440,8 +441,8 @@ public class Device extends BaseElement implements IResource { public void setLocation(ResourceReference theValue) { myLocation = theValue; } - - + + /** * Gets the value(s) for patient (If the resource is affixed to a person). * creating it if it does @@ -470,8 +471,8 @@ public class Device extends BaseElement implements IResource { public void setPatient(ResourceReference theValue) { myPatient = theValue; } - - + + /** * Gets the value(s) for contact (Details for human/organization for support). * creating it if it does @@ -500,8 +501,8 @@ public class Device extends BaseElement implements IResource { public void setContact(List theValue) { myContact = theValue; } - - + + /** * Gets the value(s) for url (Network address to contact device). * creating it if it does @@ -530,8 +531,8 @@ public class Device extends BaseElement implements IResource { public void setUrl(UriDt theValue) { myUrl = theValue; } - - + + } \ No newline at end of file diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Group.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Group.java index c68e0cd2072..e6a7b51923c 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Group.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Group.java @@ -17,10 +17,12 @@ package ca.uhn.fhir.model.dstu.resource; import java.util.*; + import ca.uhn.fhir.model.api.*; import ca.uhn.fhir.model.api.annotation.*; import ca.uhn.fhir.model.primitive.*; import ca.uhn.fhir.model.dstu.composite.*; +import ca.uhn.fhir.model.dstu.valueset.*; /** * HAPI/FHIR Group Resource @@ -37,13 +39,13 @@ import ca.uhn.fhir.model.dstu.composite.*; *

*/ @ResourceDef(name="Group") -public class Group extends BaseElement implements IResource { +public class Group extends BaseResource implements IResource { @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=1) private IdentifierDt myIdentifier; @Child(name="type", type=CodeDt.class, order=1, min=1, max=1) - private CodeDt myType; + private BoundCodeDt myType; @Child(name="actual", type=BooleanDt.class, order=2, min=1, max=1) private BooleanDt myActual; @@ -98,8 +100,8 @@ public class Group extends BaseElement implements IResource { public void setIdentifier(IdentifierDt theValue) { myIdentifier = theValue; } - - + + /** * Gets the value(s) for type (person | animal | practitioner | device | medication | substance). * creating it if it does @@ -110,9 +112,9 @@ public class Group extends BaseElement implements IResource { * Identifies the broad classification of the kind of resources the group includes *

*/ - public CodeDt getType() { + public BoundCodeDt getType() { if (myType == null) { - myType = new CodeDt(); + myType = new BoundCodeDt(GroupTypeEnum.VALUESET_BINDER); } return myType; } @@ -125,11 +127,23 @@ public class Group extends BaseElement implements IResource { * Identifies the broad classification of the kind of resources the group includes *

*/ - public void setType(CodeDt theValue) { + public void setType(BoundCodeDt theValue) { myType = theValue; } - - + + /** + * Sets the value(s) for type (person | animal | practitioner | device | medication | substance) + * + *

+ * Definition: + * Identifies the broad classification of the kind of resources the group includes + *

+ */ + public void setType(GroupTypeEnum theValue) { + getType().setValueAsEnum(theValue); + } + + /** * Gets the value(s) for actual (Descriptive or actual). * creating it if it does @@ -158,8 +172,8 @@ public class Group extends BaseElement implements IResource { public void setActual(BooleanDt theValue) { myActual = theValue; } - - + + /** * Gets the value(s) for code (Kind of Group members). * creating it if it does @@ -188,8 +202,8 @@ public class Group extends BaseElement implements IResource { public void setCode(CodeableConceptDt theValue) { myCode = theValue; } - - + + /** * Gets the value(s) for name (Label for Group). * creating it if it does @@ -218,8 +232,8 @@ public class Group extends BaseElement implements IResource { public void setName(StringDt theValue) { myName = theValue; } - - /** + + /** * Sets the value(s) for name (Label for Group) * *

@@ -259,8 +273,8 @@ public class Group extends BaseElement implements IResource { public void setQuantity(IntegerDt theValue) { myQuantity = theValue; } - - + + /** * Gets the value(s) for characteristic (Trait of group members). * creating it if it does @@ -289,8 +303,8 @@ public class Group extends BaseElement implements IResource { public void setCharacteristic(List theValue) { myCharacteristic = theValue; } - - + + /** * Gets the value(s) for member (Who is in group). * creating it if it does @@ -316,8 +330,8 @@ public class Group extends BaseElement implements IResource { public void setMember(List theValue) { myMember = theValue; } - - + + /** * Block class for child element: Group.characteristic (Trait of group members) * @@ -371,8 +385,8 @@ public class Group extends BaseElement implements IResource { public void setCode(CodeableConceptDt theValue) { myCode = theValue; } - - + + /** * Gets the value(s) for value[x] (Value held by characteristic). * creating it if it does @@ -398,8 +412,8 @@ public class Group extends BaseElement implements IResource { public void setValue(IDatatype theValue) { myValue = theValue; } - - + + /** * Gets the value(s) for exclude (Group includes or excludes). * creating it if it does @@ -428,8 +442,8 @@ public class Group extends BaseElement implements IResource { public void setExclude(BooleanDt theValue) { myExclude = theValue; } - - + + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Location.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Location.java index 381b38c3276..b2b3842f372 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Location.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Location.java @@ -21,6 +21,7 @@ import ca.uhn.fhir.model.api.*; import ca.uhn.fhir.model.api.annotation.*; import ca.uhn.fhir.model.primitive.*; import ca.uhn.fhir.model.dstu.composite.*; +import ca.uhn.fhir.model.dstu.valueset.*; /** * HAPI/FHIR Location Resource @@ -37,7 +38,7 @@ import ca.uhn.fhir.model.dstu.composite.*; *

*/ @ResourceDef(name="Location") -public class Location extends BaseElement implements IResource { +public class Location extends BaseResource implements IResource { @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=1) private IdentifierDt myIdentifier; @@ -70,7 +71,7 @@ public class Location extends BaseElement implements IResource { private ResourceReference myManagingOrganization; @Child(name="status", type=CodeDt.class, order=9, min=0, max=1) - private CodeDt myStatus; + private BoundCodeDt myStatus; @Child(name="partOf", order=10, min=0, max=1) @ChildResource(types= { @@ -79,7 +80,7 @@ public class Location extends BaseElement implements IResource { private ResourceReference myPartOf; @Child(name="mode", type=CodeDt.class, order=11, min=0, max=1) - private CodeDt myMode; + private BoundCodeDt myMode; /** * Gets the value(s) for identifier (Unique code or number identifying the location to its users). @@ -109,8 +110,8 @@ public class Location extends BaseElement implements IResource { public void setIdentifier(IdentifierDt theValue) { myIdentifier = theValue; } - - + + /** * Gets the value(s) for name (Name of the location as used by humans). * creating it if it does @@ -139,8 +140,8 @@ public class Location extends BaseElement implements IResource { public void setName(StringDt theValue) { myName = theValue; } - - /** + + /** * Sets the value(s) for name (Name of the location as used by humans) * *

@@ -180,8 +181,8 @@ public class Location extends BaseElement implements IResource { public void setDescription(StringDt theValue) { myDescription = theValue; } - - /** + + /** * Sets the value(s) for description (Description of the Location, which helps in finding or referencing the place) * *

@@ -221,8 +222,8 @@ public class Location extends BaseElement implements IResource { public void setType(CodeableConceptDt theValue) { myType = theValue; } - - + + /** * Gets the value(s) for telecom (Contact details of the location). * creating it if it does @@ -251,8 +252,8 @@ public class Location extends BaseElement implements IResource { public void setTelecom(List theValue) { myTelecom = theValue; } - - + + /** * Gets the value(s) for address (Physical location). * creating it if it does @@ -281,8 +282,8 @@ public class Location extends BaseElement implements IResource { public void setAddress(AddressDt theValue) { myAddress = theValue; } - - + + /** * Gets the value(s) for physicalType (Physical form of the location). * creating it if it does @@ -311,8 +312,8 @@ public class Location extends BaseElement implements IResource { public void setPhysicalType(CodeableConceptDt theValue) { myPhysicalType = theValue; } - - + + /** * Gets the value(s) for position (The absolute geographic location ). * creating it if it does @@ -341,8 +342,8 @@ public class Location extends BaseElement implements IResource { public void setPosition(Position theValue) { myPosition = theValue; } - - + + /** * Gets the value(s) for managingOrganization (The organization that is responsible for the provisioning and upkeep of the location). * creating it if it does @@ -371,8 +372,8 @@ public class Location extends BaseElement implements IResource { public void setManagingOrganization(ResourceReference theValue) { myManagingOrganization = theValue; } - - + + /** * Gets the value(s) for status (active | suspended | inactive). * creating it if it does @@ -383,9 +384,9 @@ public class Location extends BaseElement implements IResource { * *

*/ - public CodeDt getStatus() { + public BoundCodeDt getStatus() { if (myStatus == null) { - myStatus = new CodeDt(); + myStatus = new BoundCodeDt(LocationStatusEnum.VALUESET_BINDER); } return myStatus; } @@ -398,11 +399,23 @@ public class Location extends BaseElement implements IResource { * *

*/ - public void setStatus(CodeDt theValue) { + public void setStatus(BoundCodeDt theValue) { myStatus = theValue; } - - + + /** + * Sets the value(s) for status (active | suspended | inactive) + * + *

+ * Definition: + * + *

+ */ + public void setStatus(LocationStatusEnum theValue) { + getStatus().setValueAsEnum(theValue); + } + + /** * Gets the value(s) for partOf (Another Location which this Location is physically part of). * creating it if it does @@ -431,8 +444,8 @@ public class Location extends BaseElement implements IResource { public void setPartOf(ResourceReference theValue) { myPartOf = theValue; } - - + + /** * Gets the value(s) for mode (instance | kind). * creating it if it does @@ -443,9 +456,9 @@ public class Location extends BaseElement implements IResource { * Indicates whether a resource instance represents a specific location or a class of locations *

*/ - public CodeDt getMode() { + public BoundCodeDt getMode() { if (myMode == null) { - myMode = new CodeDt(); + myMode = new BoundCodeDt(LocationModeEnum.VALUESET_BINDER); } return myMode; } @@ -458,11 +471,23 @@ public class Location extends BaseElement implements IResource { * Indicates whether a resource instance represents a specific location or a class of locations *

*/ - public void setMode(CodeDt theValue) { + public void setMode(BoundCodeDt theValue) { myMode = theValue; } - - + + /** + * Sets the value(s) for mode (instance | kind) + * + *

+ * Definition: + * Indicates whether a resource instance represents a specific location or a class of locations + *

+ */ + public void setMode(LocationModeEnum theValue) { + getMode().setValueAsEnum(theValue); + } + + /** * Block class for child element: Location.position (The absolute geographic location ) * @@ -511,8 +536,8 @@ public class Location extends BaseElement implements IResource { public void setLongitude(DecimalDt theValue) { myLongitude = theValue; } - - + + /** * Gets the value(s) for latitude (Latitude as expressed in KML). * creating it if it does @@ -541,8 +566,8 @@ public class Location extends BaseElement implements IResource { public void setLatitude(DecimalDt theValue) { myLatitude = theValue; } - - + + /** * Gets the value(s) for altitude (Altitude as expressed in KML). * creating it if it does @@ -571,8 +596,8 @@ public class Location extends BaseElement implements IResource { public void setAltitude(DecimalDt theValue) { myAltitude = theValue; } - - + + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Medication.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Medication.java index 17685665660..63ef6e28cdf 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Medication.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Medication.java @@ -17,10 +17,12 @@ package ca.uhn.fhir.model.dstu.resource; import java.util.*; + import ca.uhn.fhir.model.api.*; import ca.uhn.fhir.model.api.annotation.*; import ca.uhn.fhir.model.primitive.*; import ca.uhn.fhir.model.dstu.composite.*; +import ca.uhn.fhir.model.dstu.valueset.*; /** * HAPI/FHIR Medication Resource @@ -37,7 +39,7 @@ import ca.uhn.fhir.model.dstu.composite.*; *

*/ @ResourceDef(name="Medication") -public class Medication extends BaseElement implements IResource { +public class Medication extends BaseResource implements IResource { @Child(name="name", type=StringDt.class, order=0, min=0, max=1) private StringDt myName; @@ -55,7 +57,7 @@ public class Medication extends BaseElement implements IResource { private ResourceReference myManufacturer; @Child(name="kind", type=CodeDt.class, order=4, min=0, max=1) - private CodeDt myKind; + private BoundCodeDt myKind; @Child(name="product", order=5, min=0, max=1) private Product myProduct; @@ -91,8 +93,8 @@ public class Medication extends BaseElement implements IResource { public void setName(StringDt theValue) { myName = theValue; } - - /** + + /** * Sets the value(s) for name (Common / Commercial name) * *

@@ -132,8 +134,8 @@ public class Medication extends BaseElement implements IResource { public void setCode(CodeableConceptDt theValue) { myCode = theValue; } - - + + /** * Gets the value(s) for isBrand (True if a brand). * creating it if it does @@ -162,8 +164,8 @@ public class Medication extends BaseElement implements IResource { public void setIsBrand(BooleanDt theValue) { myIsBrand = theValue; } - - + + /** * Gets the value(s) for manufacturer (Manufacturer of the item). * creating it if it does @@ -192,8 +194,8 @@ public class Medication extends BaseElement implements IResource { public void setManufacturer(ResourceReference theValue) { myManufacturer = theValue; } - - + + /** * Gets the value(s) for kind (product | package). * creating it if it does @@ -204,9 +206,9 @@ public class Medication extends BaseElement implements IResource { * Medications are either a single administrable product or a package that contains one or more products. *

*/ - public CodeDt getKind() { + public BoundCodeDt getKind() { if (myKind == null) { - myKind = new CodeDt(); + myKind = new BoundCodeDt(MedicationKindEnum.VALUESET_BINDER); } return myKind; } @@ -219,11 +221,23 @@ public class Medication extends BaseElement implements IResource { * Medications are either a single administrable product or a package that contains one or more products. *

*/ - public void setKind(CodeDt theValue) { + public void setKind(BoundCodeDt theValue) { myKind = theValue; } - - + + /** + * Sets the value(s) for kind (product | package) + * + *

+ * Definition: + * Medications are either a single administrable product or a package that contains one or more products. + *

+ */ + public void setKind(MedicationKindEnum theValue) { + getKind().setValueAsEnum(theValue); + } + + /** * Gets the value(s) for product (Administrable medication details). * creating it if it does @@ -252,8 +266,8 @@ public class Medication extends BaseElement implements IResource { public void setProduct(Product theValue) { myProduct = theValue; } - - + + /** * Gets the value(s) for package (Details about packaged medications). * creating it if it does @@ -282,8 +296,8 @@ public class Medication extends BaseElement implements IResource { public void setPackage(CodeDt theValue) { myPackage = theValue; } - - + + /** * Block class for child element: Medication.product (Administrable medication details) * @@ -329,8 +343,8 @@ public class Medication extends BaseElement implements IResource { public void setForm(CodeableConceptDt theValue) { myForm = theValue; } - - + + /** * Gets the value(s) for ingredient (Active or inactive ingredient). * creating it if it does @@ -359,8 +373,8 @@ public class Medication extends BaseElement implements IResource { public void setIngredient(List theValue) { myIngredient = theValue; } - - + + } @@ -410,8 +424,8 @@ public class Medication extends BaseElement implements IResource { public void setItem(ResourceReference theValue) { myItem = theValue; } - - + + /** * Gets the value(s) for amount (How much ingredient in product). * creating it if it does @@ -440,8 +454,8 @@ public class Medication extends BaseElement implements IResource { public void setAmount(RatioDt theValue) { myAmount = theValue; } - - + + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Observation.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Observation.java index 29316fca681..2e4b6e9f15b 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Observation.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Observation.java @@ -17,10 +17,12 @@ package ca.uhn.fhir.model.dstu.resource; import java.util.*; + import ca.uhn.fhir.model.api.*; import ca.uhn.fhir.model.api.annotation.*; import ca.uhn.fhir.model.primitive.*; import ca.uhn.fhir.model.dstu.composite.*; +import ca.uhn.fhir.model.dstu.valueset.*; /** * HAPI/FHIR Observation Resource @@ -37,7 +39,7 @@ import ca.uhn.fhir.model.dstu.composite.*; *

*/ @ResourceDef(name="Observation") -public class Observation extends BaseElement implements IResource { +public class Observation extends BaseResource implements IResource { @Child(name="name", type=CodeableConceptDt.class, order=0, min=1, max=1) private CodeableConceptDt myName; @@ -69,10 +71,10 @@ public class Observation extends BaseElement implements IResource { private InstantDt myIssued; @Child(name="status", type=CodeDt.class, order=6, min=1, max=1) - private CodeDt myStatus; + private BoundCodeDt myStatus; @Child(name="reliability", type=CodeDt.class, order=7, min=1, max=1) - private CodeDt myReliability; + private BoundCodeDt myReliability; @Child(name="bodySite", type=CodeableConceptDt.class, order=8, min=0, max=1) private CodeableConceptDt myBodySite; @@ -140,8 +142,8 @@ public class Observation extends BaseElement implements IResource { public void setName(CodeableConceptDt theValue) { myName = theValue; } - - + + /** * Gets the value(s) for value[x] (Actual result). * creating it if it does @@ -167,8 +169,8 @@ public class Observation extends BaseElement implements IResource { public void setValue(IDatatype theValue) { myValue = theValue; } - - + + /** * Gets the value(s) for interpretation (High, low, normal, etc.). * creating it if it does @@ -197,8 +199,8 @@ public class Observation extends BaseElement implements IResource { public void setInterpretation(CodeableConceptDt theValue) { myInterpretation = theValue; } - - + + /** * Gets the value(s) for comments (Comments about result). * creating it if it does @@ -227,8 +229,8 @@ public class Observation extends BaseElement implements IResource { public void setComments(StringDt theValue) { myComments = theValue; } - - /** + + /** * Sets the value(s) for comments (Comments about result) * *

@@ -265,8 +267,8 @@ public class Observation extends BaseElement implements IResource { public void setApplies(IDatatype theValue) { myApplies = theValue; } - - + + /** * Gets the value(s) for issued (Date/Time this was made available). * creating it if it does @@ -295,8 +297,8 @@ public class Observation extends BaseElement implements IResource { public void setIssued(InstantDt theValue) { myIssued = theValue; } - - + + /** * Gets the value(s) for status (registered | preliminary | final | amended +). * creating it if it does @@ -307,9 +309,9 @@ public class Observation extends BaseElement implements IResource { * The status of the result value *

*/ - public CodeDt getStatus() { + public BoundCodeDt getStatus() { if (myStatus == null) { - myStatus = new CodeDt(); + myStatus = new BoundCodeDt(ObservationStatusEnum.VALUESET_BINDER); } return myStatus; } @@ -322,11 +324,23 @@ public class Observation extends BaseElement implements IResource { * The status of the result value *

*/ - public void setStatus(CodeDt theValue) { + public void setStatus(BoundCodeDt theValue) { myStatus = theValue; } - - + + /** + * Sets the value(s) for status (registered | preliminary | final | amended +) + * + *

+ * Definition: + * The status of the result value + *

+ */ + public void setStatus(ObservationStatusEnum theValue) { + getStatus().setValueAsEnum(theValue); + } + + /** * Gets the value(s) for reliability (ok | ongoing | early | questionable | calibrating | error + ). * creating it if it does @@ -337,9 +351,9 @@ public class Observation extends BaseElement implements IResource { * An estimate of the degree to which quality issues have impacted on the value reported *

*/ - public CodeDt getReliability() { + public BoundCodeDt getReliability() { if (myReliability == null) { - myReliability = new CodeDt(); + myReliability = new BoundCodeDt(ObservationReliabilityEnum.VALUESET_BINDER); } return myReliability; } @@ -352,11 +366,23 @@ public class Observation extends BaseElement implements IResource { * An estimate of the degree to which quality issues have impacted on the value reported *

*/ - public void setReliability(CodeDt theValue) { + public void setReliability(BoundCodeDt theValue) { myReliability = theValue; } - - + + /** + * Sets the value(s) for reliability (ok | ongoing | early | questionable | calibrating | error + ) + * + *

+ * Definition: + * An estimate of the degree to which quality issues have impacted on the value reported + *

+ */ + public void setReliability(ObservationReliabilityEnum theValue) { + getReliability().setValueAsEnum(theValue); + } + + /** * Gets the value(s) for bodySite (Observed body part). * creating it if it does @@ -385,8 +411,8 @@ public class Observation extends BaseElement implements IResource { public void setBodySite(CodeableConceptDt theValue) { myBodySite = theValue; } - - + + /** * Gets the value(s) for method (How it was done). * creating it if it does @@ -415,8 +441,8 @@ public class Observation extends BaseElement implements IResource { public void setMethod(CodeableConceptDt theValue) { myMethod = theValue; } - - + + /** * Gets the value(s) for identifier (Unique Id for this particular observation). * creating it if it does @@ -445,8 +471,8 @@ public class Observation extends BaseElement implements IResource { public void setIdentifier(IdentifierDt theValue) { myIdentifier = theValue; } - - + + /** * Gets the value(s) for subject (Who and/or what this is about). * creating it if it does @@ -472,8 +498,8 @@ public class Observation extends BaseElement implements IResource { public void setSubject(ResourceReference theValue) { mySubject = theValue; } - - + + /** * Gets the value(s) for specimen (Specimen used for this observation). * creating it if it does @@ -502,8 +528,8 @@ public class Observation extends BaseElement implements IResource { public void setSpecimen(ResourceReference theValue) { mySpecimen = theValue; } - - + + /** * Gets the value(s) for performer (Who did the observation). * creating it if it does @@ -529,8 +555,8 @@ public class Observation extends BaseElement implements IResource { public void setPerformer(List theValue) { myPerformer = theValue; } - - + + /** * Gets the value(s) for referenceRange (Provides guide for interpretation). * creating it if it does @@ -559,8 +585,8 @@ public class Observation extends BaseElement implements IResource { public void setReferenceRange(List theValue) { myReferenceRange = theValue; } - - + + /** * Gets the value(s) for related (Observations related to this observation). * creating it if it does @@ -589,8 +615,8 @@ public class Observation extends BaseElement implements IResource { public void setRelated(List theValue) { myRelated = theValue; } - - + + /** * Block class for child element: Observation.referenceRange (Provides guide for interpretation) * @@ -642,8 +668,8 @@ public class Observation extends BaseElement implements IResource { public void setLow(QuantityDt theValue) { myLow = theValue; } - - + + /** * Gets the value(s) for high (High Range, if relevant). * creating it if it does @@ -672,8 +698,8 @@ public class Observation extends BaseElement implements IResource { public void setHigh(QuantityDt theValue) { myHigh = theValue; } - - + + /** * Gets the value(s) for meaning (Indicates the meaning/use of this range of this range). * creating it if it does @@ -702,8 +728,8 @@ public class Observation extends BaseElement implements IResource { public void setMeaning(CodeableConceptDt theValue) { myMeaning = theValue; } - - + + /** * Gets the value(s) for age (Applicable age range, if relevant). * creating it if it does @@ -732,8 +758,8 @@ public class Observation extends BaseElement implements IResource { public void setAge(RangeDt theValue) { myAge = theValue; } - - + + } @@ -750,7 +776,7 @@ public class Observation extends BaseElement implements IResource { public static class Related extends BaseElement implements IResourceBlock { @Child(name="type", type=CodeDt.class, order=0, min=0, max=1) - private CodeDt myType; + private BoundCodeDt myType; @Child(name="target", order=1, min=1, max=1) @ChildResource(types= { @@ -768,9 +794,9 @@ public class Observation extends BaseElement implements IResource { * A code specifying the kind of relationship that exists with the target observation *

*/ - public CodeDt getType() { + public BoundCodeDt getType() { if (myType == null) { - myType = new CodeDt(); + myType = new BoundCodeDt(ObservationRelationshipTypeEnum.VALUESET_BINDER); } return myType; } @@ -783,11 +809,23 @@ public class Observation extends BaseElement implements IResource { * A code specifying the kind of relationship that exists with the target observation *

*/ - public void setType(CodeDt theValue) { + public void setType(BoundCodeDt theValue) { myType = theValue; } - - + + /** + * Sets the value(s) for type (has-component | has-member | derived-from | sequel-to | replaces | qualified-by | interfered-by) + * + *

+ * Definition: + * A code specifying the kind of relationship that exists with the target observation + *

+ */ + public void setType(ObservationRelationshipTypeEnum theValue) { + getType().setValueAsEnum(theValue); + } + + /** * Gets the value(s) for target (Observation that is related to this one). * creating it if it does @@ -816,8 +854,8 @@ public class Observation extends BaseElement implements IResource { public void setTarget(ResourceReference theValue) { myTarget = theValue; } - - + + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Organization.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Organization.java index 33c4116dd77..ba568754679 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Organization.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Organization.java @@ -21,6 +21,7 @@ import ca.uhn.fhir.model.api.*; import ca.uhn.fhir.model.api.annotation.*; import ca.uhn.fhir.model.primitive.*; import ca.uhn.fhir.model.dstu.composite.*; +import ca.uhn.fhir.model.dstu.valueset.*; /** * HAPI/FHIR Organization Resource @@ -37,7 +38,7 @@ import ca.uhn.fhir.model.dstu.composite.*; *

*/ @ResourceDef(name="Organization") -public class Organization extends BaseElement implements IResource { +public class Organization extends BaseResource implements IResource { @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) private List myIdentifier; @@ -100,8 +101,8 @@ public class Organization extends BaseElement implements IResource { public void setIdentifier(List theValue) { myIdentifier = theValue; } - - + + /** * Gets the value(s) for name (Name used for the organization). * creating it if it does @@ -130,8 +131,8 @@ public class Organization extends BaseElement implements IResource { public void setName(StringDt theValue) { myName = theValue; } - - /** + + /** * Sets the value(s) for name (Name used for the organization) * *

@@ -171,8 +172,8 @@ public class Organization extends BaseElement implements IResource { public void setType(CodeableConceptDt theValue) { myType = theValue; } - - + + /** * Gets the value(s) for telecom (A contact detail for the organization). * creating it if it does @@ -201,8 +202,8 @@ public class Organization extends BaseElement implements IResource { public void setTelecom(List theValue) { myTelecom = theValue; } - - + + /** * Gets the value(s) for address (An address for the organization). * creating it if it does @@ -231,8 +232,8 @@ public class Organization extends BaseElement implements IResource { public void setAddress(List theValue) { myAddress = theValue; } - - + + /** * Gets the value(s) for partOf (The organization of which this organization forms a part). * creating it if it does @@ -261,8 +262,8 @@ public class Organization extends BaseElement implements IResource { public void setPartOf(ResourceReference theValue) { myPartOf = theValue; } - - + + /** * Gets the value(s) for contact (Contact for the organization for a certain purpose). * creating it if it does @@ -291,8 +292,8 @@ public class Organization extends BaseElement implements IResource { public void setContact(List theValue) { myContact = theValue; } - - + + /** * Gets the value(s) for location (Location(s) the organization uses to provide services). * creating it if it does @@ -321,8 +322,8 @@ public class Organization extends BaseElement implements IResource { public void setLocation(List theValue) { myLocation = theValue; } - - + + /** * Gets the value(s) for active (Whether the organization's record is still in active use). * creating it if it does @@ -351,8 +352,8 @@ public class Organization extends BaseElement implements IResource { public void setActive(BooleanDt theValue) { myActive = theValue; } - - + + /** * Block class for child element: Organization.contact (Contact for the organization for a certain purpose) * @@ -407,8 +408,8 @@ public class Organization extends BaseElement implements IResource { public void setPurpose(CodeableConceptDt theValue) { myPurpose = theValue; } - - + + /** * Gets the value(s) for name (A name associated with the contact). * creating it if it does @@ -437,8 +438,8 @@ public class Organization extends BaseElement implements IResource { public void setName(HumanNameDt theValue) { myName = theValue; } - - + + /** * Gets the value(s) for telecom (Contact details (telephone, email, etc) for a contact). * creating it if it does @@ -467,8 +468,8 @@ public class Organization extends BaseElement implements IResource { public void setTelecom(List theValue) { myTelecom = theValue; } - - + + /** * Gets the value(s) for address (Visiting or postal addresses for the contact). * creating it if it does @@ -497,8 +498,8 @@ public class Organization extends BaseElement implements IResource { public void setAddress(AddressDt theValue) { myAddress = theValue; } - - + + /** * Gets the value(s) for gender (Gender for administrative purposes). * creating it if it does @@ -527,8 +528,8 @@ public class Organization extends BaseElement implements IResource { public void setGender(CodeableConceptDt theValue) { myGender = theValue; } - - + + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Patient.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Patient.java index 0a31d9e4935..b59ceb37b9a 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Patient.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Patient.java @@ -17,10 +17,12 @@ package ca.uhn.fhir.model.dstu.resource; import java.util.*; + import ca.uhn.fhir.model.api.*; import ca.uhn.fhir.model.api.annotation.*; import ca.uhn.fhir.model.primitive.*; import ca.uhn.fhir.model.dstu.composite.*; +import ca.uhn.fhir.model.dstu.valueset.*; /** * HAPI/FHIR Patient Resource @@ -37,7 +39,7 @@ import ca.uhn.fhir.model.dstu.composite.*; *

*/ @ResourceDef(name="Patient") -public class Patient extends BaseElement implements IResource { +public class Patient extends BaseResource implements IResource { @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) private List myIdentifier; @@ -131,8 +133,8 @@ public class Patient extends BaseElement implements IResource { public void setIdentifier(List theValue) { myIdentifier = theValue; } - - + + /** * Gets the value(s) for name (A name associated with the patient). * creating it if it does @@ -161,8 +163,8 @@ public class Patient extends BaseElement implements IResource { public void setName(List theValue) { myName = theValue; } - - + + /** * Gets the value(s) for telecom (A contact detail for the individual). * creating it if it does @@ -191,8 +193,8 @@ public class Patient extends BaseElement implements IResource { public void setTelecom(List theValue) { myTelecom = theValue; } - - + + /** * Gets the value(s) for gender (Gender for administrative purposes). * creating it if it does @@ -221,8 +223,8 @@ public class Patient extends BaseElement implements IResource { public void setGender(CodeableConceptDt theValue) { myGender = theValue; } - - + + /** * Gets the value(s) for birthDate (The date and time of birth for the individual). * creating it if it does @@ -251,8 +253,8 @@ public class Patient extends BaseElement implements IResource { public void setBirthDate(DateTimeDt theValue) { myBirthDate = theValue; } - - /** + + /** * Sets the value(s) for birthDate (The date and time of birth for the individual) * *

@@ -289,8 +291,8 @@ public class Patient extends BaseElement implements IResource { public void setDeceased(IDatatype theValue) { myDeceased = theValue; } - - + + /** * Gets the value(s) for address (Addresses for the individual). * creating it if it does @@ -319,8 +321,8 @@ public class Patient extends BaseElement implements IResource { public void setAddress(List theValue) { myAddress = theValue; } - - + + /** * Gets the value(s) for maritalStatus (Marital (civil) status of a person). * creating it if it does @@ -349,8 +351,8 @@ public class Patient extends BaseElement implements IResource { public void setMaritalStatus(CodeableConceptDt theValue) { myMaritalStatus = theValue; } - - + + /** * Gets the value(s) for multipleBirth[x] (Whether patient is part of a multiple birth). * creating it if it does @@ -376,8 +378,8 @@ public class Patient extends BaseElement implements IResource { public void setMultipleBirth(IDatatype theValue) { myMultipleBirth = theValue; } - - + + /** * Gets the value(s) for photo (Image of the person). * creating it if it does @@ -406,8 +408,8 @@ public class Patient extends BaseElement implements IResource { public void setPhoto(List theValue) { myPhoto = theValue; } - - + + /** * Gets the value(s) for contact (A contact party (e.g. guardian, partner, friend) for the patient). * creating it if it does @@ -436,8 +438,8 @@ public class Patient extends BaseElement implements IResource { public void setContact(List theValue) { myContact = theValue; } - - + + /** * Gets the value(s) for animal (If this patient is an animal (non-human)). * creating it if it does @@ -466,8 +468,8 @@ public class Patient extends BaseElement implements IResource { public void setAnimal(Animal theValue) { myAnimal = theValue; } - - + + /** * Gets the value(s) for communication (Languages which may be used to communicate with the patient about his or her health). * creating it if it does @@ -496,8 +498,8 @@ public class Patient extends BaseElement implements IResource { public void setCommunication(List theValue) { myCommunication = theValue; } - - + + /** * Gets the value(s) for careProvider (Patient's nominated care provider). * creating it if it does @@ -523,8 +525,8 @@ public class Patient extends BaseElement implements IResource { public void setCareProvider(List theValue) { myCareProvider = theValue; } - - + + /** * Gets the value(s) for managingOrganization (Organization that is the custodian of the patient record). * creating it if it does @@ -553,8 +555,8 @@ public class Patient extends BaseElement implements IResource { public void setManagingOrganization(ResourceReference theValue) { myManagingOrganization = theValue; } - - + + /** * Gets the value(s) for link (Link to another patient resource that concerns the same actual person). * creating it if it does @@ -583,8 +585,8 @@ public class Patient extends BaseElement implements IResource { public void setLink(List theValue) { myLink = theValue; } - - + + /** * Gets the value(s) for active (Whether this patient's record is in active use). * creating it if it does @@ -613,8 +615,8 @@ public class Patient extends BaseElement implements IResource { public void setActive(BooleanDt theValue) { myActive = theValue; } - - + + /** * Block class for child element: Patient.contact (A contact party (e.g. guardian, partner, friend) for the patient) * @@ -675,8 +677,8 @@ public class Patient extends BaseElement implements IResource { public void setRelationship(List theValue) { myRelationship = theValue; } - - + + /** * Gets the value(s) for name (A name associated with the person). * creating it if it does @@ -705,8 +707,8 @@ public class Patient extends BaseElement implements IResource { public void setName(HumanNameDt theValue) { myName = theValue; } - - + + /** * Gets the value(s) for telecom (A contact detail for the person). * creating it if it does @@ -735,8 +737,8 @@ public class Patient extends BaseElement implements IResource { public void setTelecom(List theValue) { myTelecom = theValue; } - - + + /** * Gets the value(s) for address (Address for the contact person). * creating it if it does @@ -765,8 +767,8 @@ public class Patient extends BaseElement implements IResource { public void setAddress(AddressDt theValue) { myAddress = theValue; } - - + + /** * Gets the value(s) for gender (Gender for administrative purposes). * creating it if it does @@ -795,8 +797,8 @@ public class Patient extends BaseElement implements IResource { public void setGender(CodeableConceptDt theValue) { myGender = theValue; } - - + + /** * Gets the value(s) for organization (Organization that is associated with the contact). * creating it if it does @@ -825,8 +827,8 @@ public class Patient extends BaseElement implements IResource { public void setOrganization(ResourceReference theValue) { myOrganization = theValue; } - - + + } @@ -879,8 +881,8 @@ public class Patient extends BaseElement implements IResource { public void setSpecies(CodeableConceptDt theValue) { mySpecies = theValue; } - - + + /** * Gets the value(s) for breed (E.g. Poodle, Angus). * creating it if it does @@ -909,8 +911,8 @@ public class Patient extends BaseElement implements IResource { public void setBreed(CodeableConceptDt theValue) { myBreed = theValue; } - - + + /** * Gets the value(s) for genderStatus (E.g. Neutered, Intact). * creating it if it does @@ -939,8 +941,8 @@ public class Patient extends BaseElement implements IResource { public void setGenderStatus(CodeableConceptDt theValue) { myGenderStatus = theValue; } - - + + } @@ -963,7 +965,7 @@ public class Patient extends BaseElement implements IResource { private ResourceReference myOther; @Child(name="type", type=CodeDt.class, order=1, min=1, max=1) - private CodeDt myType; + private BoundCodeDt myType; /** * Gets the value(s) for other (The other patient resource that the link refers to). @@ -993,8 +995,8 @@ public class Patient extends BaseElement implements IResource { public void setOther(ResourceReference theValue) { myOther = theValue; } - - + + /** * Gets the value(s) for type (replace | refer | seealso - type of link). * creating it if it does @@ -1005,9 +1007,9 @@ public class Patient extends BaseElement implements IResource { * The type of link between this patient resource and another patient resource. *

*/ - public CodeDt getType() { + public BoundCodeDt getType() { if (myType == null) { - myType = new CodeDt(); + myType = new BoundCodeDt(LinkTypeEnum.VALUESET_BINDER); } return myType; } @@ -1020,11 +1022,23 @@ public class Patient extends BaseElement implements IResource { * The type of link between this patient resource and another patient resource. *

*/ - public void setType(CodeDt theValue) { + public void setType(BoundCodeDt theValue) { myType = theValue; } - - + + /** + * Sets the value(s) for type (replace | refer | seealso - type of link) + * + *

+ * Definition: + * The type of link between this patient resource and another patient resource. + *

+ */ + public void setType(LinkTypeEnum theValue) { + getType().setValueAsEnum(theValue); + } + + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Practitioner.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Practitioner.java index 78e9c38a775..e8e5b6cf813 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Practitioner.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Practitioner.java @@ -17,10 +17,12 @@ package ca.uhn.fhir.model.dstu.resource; import java.util.*; + import ca.uhn.fhir.model.api.*; import ca.uhn.fhir.model.api.annotation.*; import ca.uhn.fhir.model.primitive.*; import ca.uhn.fhir.model.dstu.composite.*; +import ca.uhn.fhir.model.dstu.valueset.*; /** * HAPI/FHIR Practitioner Resource @@ -37,7 +39,7 @@ import ca.uhn.fhir.model.dstu.composite.*; *

*/ @ResourceDef(name="Practitioner") -public class Practitioner extends BaseElement implements IResource { +public class Practitioner extends BaseResource implements IResource { @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) private List myIdentifier; @@ -115,8 +117,8 @@ public class Practitioner extends BaseElement implements IResource { public void setIdentifier(List theValue) { myIdentifier = theValue; } - - + + /** * Gets the value(s) for name (A name associated with the person). * creating it if it does @@ -145,8 +147,8 @@ public class Practitioner extends BaseElement implements IResource { public void setName(HumanNameDt theValue) { myName = theValue; } - - + + /** * Gets the value(s) for telecom (A contact detail for the practitioner). * creating it if it does @@ -175,8 +177,8 @@ public class Practitioner extends BaseElement implements IResource { public void setTelecom(List theValue) { myTelecom = theValue; } - - + + /** * Gets the value(s) for address (Where practitioner can be found/visited). * creating it if it does @@ -205,8 +207,8 @@ public class Practitioner extends BaseElement implements IResource { public void setAddress(AddressDt theValue) { myAddress = theValue; } - - + + /** * Gets the value(s) for gender (Gender for administrative purposes). * creating it if it does @@ -235,8 +237,8 @@ public class Practitioner extends BaseElement implements IResource { public void setGender(CodeableConceptDt theValue) { myGender = theValue; } - - + + /** * Gets the value(s) for birthDate (The date and time of birth for the practitioner). * creating it if it does @@ -265,8 +267,8 @@ public class Practitioner extends BaseElement implements IResource { public void setBirthDate(DateTimeDt theValue) { myBirthDate = theValue; } - - /** + + /** * Sets the value(s) for birthDate (The date and time of birth for the practitioner) * *

@@ -306,8 +308,8 @@ public class Practitioner extends BaseElement implements IResource { public void setPhoto(List theValue) { myPhoto = theValue; } - - + + /** * Gets the value(s) for organization (The represented organization). * creating it if it does @@ -336,8 +338,8 @@ public class Practitioner extends BaseElement implements IResource { public void setOrganization(ResourceReference theValue) { myOrganization = theValue; } - - + + /** * Gets the value(s) for role (Roles which this practitioner may perform). * creating it if it does @@ -366,8 +368,8 @@ public class Practitioner extends BaseElement implements IResource { public void setRole(List theValue) { myRole = theValue; } - - + + /** * Gets the value(s) for specialty (Specific specialty of the practitioner). * creating it if it does @@ -396,8 +398,8 @@ public class Practitioner extends BaseElement implements IResource { public void setSpecialty(List theValue) { mySpecialty = theValue; } - - + + /** * Gets the value(s) for period (The period during which the practitioner is authorized to perform in these role(s)). * creating it if it does @@ -426,8 +428,8 @@ public class Practitioner extends BaseElement implements IResource { public void setPeriod(PeriodDt theValue) { myPeriod = theValue; } - - + + /** * Gets the value(s) for location (The location(s) at which this practitioner provides care). * creating it if it does @@ -456,8 +458,8 @@ public class Practitioner extends BaseElement implements IResource { public void setLocation(List theValue) { myLocation = theValue; } - - + + /** * Gets the value(s) for qualification (Qualifications obtained by training and certification). * creating it if it does @@ -486,8 +488,8 @@ public class Practitioner extends BaseElement implements IResource { public void setQualification(List theValue) { myQualification = theValue; } - - + + /** * Gets the value(s) for communication (A language the practitioner is able to use in patient communication). * creating it if it does @@ -516,8 +518,8 @@ public class Practitioner extends BaseElement implements IResource { public void setCommunication(List theValue) { myCommunication = theValue; } - - + + /** * Block class for child element: Practitioner.qualification (Qualifications obtained by training and certification) * @@ -569,8 +571,8 @@ public class Practitioner extends BaseElement implements IResource { public void setCode(CodeableConceptDt theValue) { myCode = theValue; } - - + + /** * Gets the value(s) for period (Period during which the qualification is valid). * creating it if it does @@ -599,8 +601,8 @@ public class Practitioner extends BaseElement implements IResource { public void setPeriod(PeriodDt theValue) { myPeriod = theValue; } - - + + /** * Gets the value(s) for issuer (Organization that regulates and issues the qualification). * creating it if it does @@ -629,8 +631,8 @@ public class Practitioner extends BaseElement implements IResource { public void setIssuer(ResourceReference theValue) { myIssuer = theValue; } - - + + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Profile.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Profile.java new file mode 100644 index 00000000000..1c13c42b822 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Profile.java @@ -0,0 +1,3468 @@ + + + + + + + + + + + + + + + + +package ca.uhn.fhir.model.dstu.resource; + +import java.util.*; +import ca.uhn.fhir.model.api.*; +import ca.uhn.fhir.model.api.annotation.*; +import ca.uhn.fhir.model.primitive.*; +import ca.uhn.fhir.model.dstu.composite.*; +import ca.uhn.fhir.model.dstu.valueset.*; + +/** + * HAPI/FHIR Profile Resource + * (Resource Profile) + * + *

+ * Definition: + * A Resource Profile - a statement of use of one or more FHIR Resources. It may include constraints on Resources and Data Types, Terminology Binding Statements and Extension Definitions + *

+ * + *

+ * Requirements: + * + *

+ */ +@ResourceDef(name="Profile") +public class Profile extends BaseResource implements IResource { + + @Child(name="identifier", type=StringDt.class, order=0, min=0, max=1) + private StringDt myIdentifier; + + @Child(name="version", type=StringDt.class, order=1, min=0, max=1) + private StringDt myVersion; + + @Child(name="name", type=StringDt.class, order=2, min=1, max=1) + private StringDt myName; + + @Child(name="publisher", type=StringDt.class, order=3, min=0, max=1) + private StringDt myPublisher; + + @Child(name="telecom", type=ContactDt.class, order=4, min=0, max=Child.MAX_UNLIMITED) + private List myTelecom; + + @Child(name="description", type=StringDt.class, order=5, min=0, max=1) + private StringDt myDescription; + + @Child(name="code", type=CodingDt.class, order=6, min=0, max=Child.MAX_UNLIMITED) + private List myCode; + + @Child(name="status", type=CodeDt.class, order=7, min=1, max=1) + private BoundCodeDt myStatus; + + @Child(name="experimental", type=BooleanDt.class, order=8, min=0, max=1) + private BooleanDt myExperimental; + + @Child(name="date", type=DateTimeDt.class, order=9, min=0, max=1) + private DateTimeDt myDate; + + @Child(name="requirements", type=StringDt.class, order=10, min=0, max=1) + private StringDt myRequirements; + + @Child(name="fhirVersion", type=IdDt.class, order=11, min=0, max=1) + private IdDt myFhirVersion; + + @Child(name="mapping", order=12, min=0, max=Child.MAX_UNLIMITED) + private List myMapping; + + @Child(name="structure", order=13, min=0, max=Child.MAX_UNLIMITED) + private List myStructure; + + @Child(name="extensionDefn", order=14, min=0, max=Child.MAX_UNLIMITED) + private List myExtensionDefn; + + @Child(name="query", order=15, min=0, max=Child.MAX_UNLIMITED) + private List myQuery; + + /** + * Gets the value(s) for identifier (Logical id to reference this profile). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The identifier that is used to identify this profile when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI) + *

+ */ + public StringDt getIdentifier() { + if (myIdentifier == null) { + myIdentifier = new StringDt(); + } + return myIdentifier; + } + + /** + * Sets the value(s) for identifier (Logical id to reference this profile) + * + *

+ * Definition: + * The identifier that is used to identify this profile when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI) + *

+ */ + public void setIdentifier(StringDt theValue) { + myIdentifier = theValue; + } + + /** + * Sets the value(s) for identifier (Logical id to reference this profile) + * + *

+ * Definition: + * The identifier that is used to identify this profile when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI) + *

+ */ + public void setIdentifier( String theString) { + myIdentifier = new StringDt(theString); + } + + /** + * Gets the value(s) for version (Logical id for this version of the profile). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 StringDt getVersion() { + if (myVersion == null) { + myVersion = new StringDt(); + } + return myVersion; + } + + /** + * Sets the value(s) for version (Logical id for this version of the profile) + * + *

+ * Definition: + * 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 void setVersion(StringDt theValue) { + myVersion = theValue; + } + + /** + * Sets the value(s) for version (Logical id for this version of the profile) + * + *

+ * Definition: + * 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 void setVersion( String theString) { + myVersion = new StringDt(theString); + } + + /** + * Gets the value(s) for name (Informal name for this profile). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A free text natural language name identifying the Profile + *

+ */ + public StringDt getName() { + if (myName == null) { + myName = new StringDt(); + } + return myName; + } + + /** + * Sets the value(s) for name (Informal name for this profile) + * + *

+ * Definition: + * A free text natural language name identifying the Profile + *

+ */ + public void setName(StringDt theValue) { + myName = theValue; + } + + /** + * Sets the value(s) for name (Informal name for this profile) + * + *

+ * Definition: + * A free text natural language name identifying the Profile + *

+ */ + public void setName( String theString) { + myName = new StringDt(theString); + } + + /** + * Gets the value(s) for publisher (Name of the publisher (Organization or individual)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Details of the individual or organization who accepts responsibility for publishing the profile + *

+ */ + public StringDt getPublisher() { + if (myPublisher == null) { + myPublisher = new StringDt(); + } + return myPublisher; + } + + /** + * Sets the value(s) for publisher (Name of the publisher (Organization or individual)) + * + *

+ * Definition: + * Details of the individual or organization who accepts responsibility for publishing the profile + *

+ */ + public void setPublisher(StringDt theValue) { + myPublisher = theValue; + } + + /** + * Sets the value(s) for publisher (Name of the publisher (Organization or individual)) + * + *

+ * Definition: + * Details of the individual or organization who accepts responsibility for publishing the profile + *

+ */ + public void setPublisher( String theString) { + myPublisher = new StringDt(theString); + } + + /** + * Gets the value(s) for telecom (Contact information of the publisher). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Contact details to assist a user in finding and communicating with the publisher + *

+ */ + public List getTelecom() { + if (myTelecom == null) { + myTelecom = new ArrayList(); + } + return myTelecom; + } + + /** + * Sets the value(s) for telecom (Contact information of the publisher) + * + *

+ * Definition: + * Contact details to assist a user in finding and communicating with the publisher + *

+ */ + public void setTelecom(List theValue) { + myTelecom = theValue; + } + + + /** + * Gets the value(s) for description (Natural language description of the profile). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A free text natural language description of the profile and its use + *

+ */ + public StringDt getDescription() { + if (myDescription == null) { + myDescription = new StringDt(); + } + return myDescription; + } + + /** + * Sets the value(s) for description (Natural language description of the profile) + * + *

+ * Definition: + * A free text natural language description of the profile and its use + *

+ */ + public void setDescription(StringDt theValue) { + myDescription = theValue; + } + + /** + * Sets the value(s) for description (Natural language description of the profile) + * + *

+ * Definition: + * A free text natural language description of the profile and its use + *

+ */ + public void setDescription( String theString) { + myDescription = new StringDt(theString); + } + + /** + * Gets the value(s) for code (Assist with indexing and finding). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A set of terms from external terminologies that may be used to assist with indexing and searching of templates. + *

+ */ + public List getCode() { + if (myCode == null) { + myCode = new ArrayList(); + } + return myCode; + } + + /** + * Sets the value(s) for code (Assist with indexing and finding) + * + *

+ * Definition: + * A set of terms from external terminologies that may be used to assist with indexing and searching of templates. + *

+ */ + public void setCode(List theValue) { + myCode = theValue; + } + + + /** + * Gets the value(s) for status (draft | active | retired). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The status of the profile + *

+ */ + public BoundCodeDt getStatus() { + if (myStatus == null) { + myStatus = new BoundCodeDt(ResourceProfileStatusEnum.VALUESET_BINDER); + } + return myStatus; + } + + /** + * Sets the value(s) for status (draft | active | retired) + * + *

+ * Definition: + * The status of the profile + *

+ */ + public void setStatus(BoundCodeDt theValue) { + myStatus = theValue; + } + + /** + * Sets the value(s) for status (draft | active | retired) + * + *

+ * Definition: + * The status of the profile + *

+ */ + public void setStatus(ResourceProfileStatusEnum theValue) { + getStatus().setValueAsEnum(theValue); + } + + + /** + * Gets the value(s) for experimental (If for testing purposes, not real usage). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage + *

+ */ + public BooleanDt getExperimental() { + if (myExperimental == null) { + myExperimental = new BooleanDt(); + } + return myExperimental; + } + + /** + * Sets the value(s) for experimental (If for testing purposes, not real usage) + * + *

+ * Definition: + * This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage + *

+ */ + public void setExperimental(BooleanDt theValue) { + myExperimental = theValue; + } + + + /** + * Gets the value(s) for date (Date for this version of the profile). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The date that this version of the profile was published + *

+ */ + public DateTimeDt getDate() { + if (myDate == null) { + myDate = new DateTimeDt(); + } + return myDate; + } + + /** + * Sets the value(s) for date (Date for this version of the profile) + * + *

+ * Definition: + * The date that this version of the profile was published + *

+ */ + public void setDate(DateTimeDt theValue) { + myDate = theValue; + } + + /** + * Sets the value(s) for date (Date for this version of the profile) + * + *

+ * Definition: + * The date that this version of the profile was published + *

+ */ + public void setDateWithSecondsPrecision( Date theDate) { + myDate = new DateTimeDt(theDate); + } + + /** + * Gets the value(s) for requirements (Scope and Usage this profile is for). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The Scope and Usage that this profile was created to meet + *

+ */ + public StringDt getRequirements() { + if (myRequirements == null) { + myRequirements = new StringDt(); + } + return myRequirements; + } + + /** + * Sets the value(s) for requirements (Scope and Usage this profile is for) + * + *

+ * Definition: + * The Scope and Usage that this profile was created to meet + *

+ */ + public void setRequirements(StringDt theValue) { + myRequirements = theValue; + } + + /** + * Sets the value(s) for requirements (Scope and Usage this profile is for) + * + *

+ * Definition: + * The Scope and Usage that this profile was created to meet + *

+ */ + public void setRequirements( String theString) { + myRequirements = new StringDt(theString); + } + + /** + * Gets the value(s) for fhirVersion (FHIR Version this profile targets). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The version of the FHIR specification on which this profile is based + *

+ */ + public IdDt getFhirVersion() { + if (myFhirVersion == null) { + myFhirVersion = new IdDt(); + } + return myFhirVersion; + } + + /** + * Sets the value(s) for fhirVersion (FHIR Version this profile targets) + * + *

+ * Definition: + * The version of the FHIR specification on which this profile is based + *

+ */ + public void setFhirVersion(IdDt theValue) { + myFhirVersion = theValue; + } + + /** + * Sets the value(s) for fhirVersion (FHIR Version this profile targets) + * + *

+ * Definition: + * The version of the FHIR specification on which this profile is based + *

+ */ + public void setFhirVersion( String theId) { + myFhirVersion = new IdDt(theId); + } + + /** + * Gets the value(s) for mapping (External specification that the content is mapped to). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * An external specification that the content is mapped to + *

+ */ + public List getMapping() { + if (myMapping == null) { + myMapping = new ArrayList(); + } + return myMapping; + } + + /** + * Sets the value(s) for mapping (External specification that the content is mapped to) + * + *

+ * Definition: + * An external specification that the content is mapped to + *

+ */ + public void setMapping(List theValue) { + myMapping = theValue; + } + + + /** + * Gets the value(s) for structure (A constraint on a resource or a data type). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A constraint statement about what contents a resource or data type may have + *

+ */ + public List getStructure() { + if (myStructure == null) { + myStructure = new ArrayList(); + } + return myStructure; + } + + /** + * Sets the value(s) for structure (A constraint on a resource or a data type) + * + *

+ * Definition: + * A constraint statement about what contents a resource or data type may have + *

+ */ + public void setStructure(List theValue) { + myStructure = theValue; + } + + + /** + * Gets the value(s) for extensionDefn (Definition of an extension). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * An extension defined as part of the profile + *

+ */ + public List getExtensionDefn() { + if (myExtensionDefn == null) { + myExtensionDefn = new ArrayList(); + } + return myExtensionDefn; + } + + /** + * Sets the value(s) for extensionDefn (Definition of an extension) + * + *

+ * Definition: + * An extension defined as part of the profile + *

+ */ + public void setExtensionDefn(List theValue) { + myExtensionDefn = theValue; + } + + + /** + * Gets the value(s) for query (Definition of a named query). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Definition of a named query and its parameters and their meaning + *

+ */ + public List getQuery() { + if (myQuery == null) { + myQuery = new ArrayList(); + } + return myQuery; + } + + /** + * Sets the value(s) for query (Definition of a named query) + * + *

+ * Definition: + * Definition of a named query and its parameters and their meaning + *

+ */ + public void setQuery(List theValue) { + myQuery = theValue; + } + + + /** + * Block class for child element: Profile.mapping (External specification that the content is mapped to) + * + *

+ * Definition: + * An external specification that the content is mapped to + *

+ */ + @Block(name="Profile.mapping") + public static class Mapping extends BaseElement implements IResourceBlock { + + @Child(name="identity", type=IdDt.class, order=0, min=1, max=1) + private IdDt myIdentity; + + @Child(name="uri", type=UriDt.class, order=1, min=0, max=1) + private UriDt myUri; + + @Child(name="name", type=StringDt.class, order=2, min=0, max=1) + private StringDt myName; + + @Child(name="comments", type=StringDt.class, order=3, min=0, max=1) + private StringDt myComments; + + /** + * Gets the value(s) for identity (Internal id when this mapping is used). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * An Internal id that is used to identify this mapping set when specific mappings are made + *

+ */ + public IdDt getIdentity() { + if (myIdentity == null) { + myIdentity = new IdDt(); + } + return myIdentity; + } + + /** + * Sets the value(s) for identity (Internal id when this mapping is used) + * + *

+ * Definition: + * An Internal id that is used to identify this mapping set when specific mappings are made + *

+ */ + public void setIdentity(IdDt theValue) { + myIdentity = theValue; + } + + /** + * Sets the value(s) for identity (Internal id when this mapping is used) + * + *

+ * Definition: + * An Internal id that is used to identify this mapping set when specific mappings are made + *

+ */ + public void setIdentity( String theId) { + myIdentity = new IdDt(theId); + } + + /** + * Gets the value(s) for uri (Identifies what this mapping refers to). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A URI that identifies the specification that this mapping is expressed to + *

+ */ + public UriDt getUri() { + if (myUri == null) { + myUri = new UriDt(); + } + return myUri; + } + + /** + * Sets the value(s) for uri (Identifies what this mapping refers to) + * + *

+ * Definition: + * A URI that identifies the specification that this mapping is expressed to + *

+ */ + public void setUri(UriDt theValue) { + myUri = theValue; + } + + + /** + * Gets the value(s) for name (Names what this mapping refers to). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A name for the specification that is being mapped to + *

+ */ + public StringDt getName() { + if (myName == null) { + myName = new StringDt(); + } + return myName; + } + + /** + * Sets the value(s) for name (Names what this mapping refers to) + * + *

+ * Definition: + * A name for the specification that is being mapped to + *

+ */ + public void setName(StringDt theValue) { + myName = theValue; + } + + /** + * Sets the value(s) for name (Names what this mapping refers to) + * + *

+ * Definition: + * A name for the specification that is being mapped to + *

+ */ + public void setName( String theString) { + myName = new StringDt(theString); + } + + /** + * Gets the value(s) for comments (Versions, Issues, Scope limitations etc). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage + *

+ */ + public StringDt getComments() { + if (myComments == null) { + myComments = new StringDt(); + } + return myComments; + } + + /** + * Sets the value(s) for comments (Versions, Issues, Scope limitations etc) + * + *

+ * Definition: + * Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage + *

+ */ + public void setComments(StringDt theValue) { + myComments = theValue; + } + + /** + * Sets the value(s) for comments (Versions, Issues, Scope limitations etc) + * + *

+ * Definition: + * Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage + *

+ */ + public void setComments( String theString) { + myComments = new StringDt(theString); + } + + + } + + + /** + * Block class for child element: Profile.structure (A constraint on a resource or a data type) + * + *

+ * Definition: + * A constraint statement about what contents a resource or data type may have + *

+ */ + @Block(name="Profile.structure") + public static class Structure extends BaseElement implements IResourceBlock { + + @Child(name="type", type=CodeDt.class, order=0, min=1, max=1) + private BoundCodeDt myType; + + @Child(name="name", type=StringDt.class, order=1, min=0, max=1) + private StringDt myName; + + @Child(name="publish", type=BooleanDt.class, order=2, min=0, max=1) + private BooleanDt myPublish; + + @Child(name="purpose", type=StringDt.class, order=3, min=0, max=1) + private StringDt myPurpose; + + @Child(name="element", order=4, min=0, max=Child.MAX_UNLIMITED) + private List myElement; + + @Child(name="searchParam", order=5, min=0, max=Child.MAX_UNLIMITED) + private List mySearchParam; + + /** + * Gets the value(s) for type (The Resource or Data Type being described). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The Resource or Data type being described + *

+ */ + public BoundCodeDt getType() { + if (myType == null) { + myType = new BoundCodeDt(FHIRDefinedTypeEnum.VALUESET_BINDER); + } + return myType; + } + + /** + * Sets the value(s) for type (The Resource or Data Type being described) + * + *

+ * Definition: + * The Resource or Data type being described + *

+ */ + public void setType(BoundCodeDt theValue) { + myType = theValue; + } + + /** + * Sets the value(s) for type (The Resource or Data Type being described) + * + *

+ * Definition: + * The Resource or Data type being described + *

+ */ + public void setType(FHIRDefinedTypeEnum theValue) { + getType().setValueAsEnum(theValue); + } + + + /** + * Gets the value(s) for name (Name for this particular structure (reference target)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The name of this resource constraint statement (to refer to it from other resource constraints - from Profile.structure.element.definition.type.profile) + *

+ */ + public StringDt getName() { + if (myName == null) { + myName = new StringDt(); + } + return myName; + } + + /** + * Sets the value(s) for name (Name for this particular structure (reference target)) + * + *

+ * Definition: + * The name of this resource constraint statement (to refer to it from other resource constraints - from Profile.structure.element.definition.type.profile) + *

+ */ + public void setName(StringDt theValue) { + myName = theValue; + } + + /** + * Sets the value(s) for name (Name for this particular structure (reference target)) + * + *

+ * Definition: + * The name of this resource constraint statement (to refer to it from other resource constraints - from Profile.structure.element.definition.type.profile) + *

+ */ + public void setName( String theString) { + myName = new StringDt(theString); + } + + /** + * Gets the value(s) for publish (This definition is published (i.e. for validation)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * This definition of a profile on a structure is published as a formal statement. Some structural definitions might be defined purely for internal use within the profile, and not intended to be used outside that context + *

+ */ + public BooleanDt getPublish() { + if (myPublish == null) { + myPublish = new BooleanDt(); + } + return myPublish; + } + + /** + * Sets the value(s) for publish (This definition is published (i.e. for validation)) + * + *

+ * Definition: + * This definition of a profile on a structure is published as a formal statement. Some structural definitions might be defined purely for internal use within the profile, and not intended to be used outside that context + *

+ */ + public void setPublish(BooleanDt theValue) { + myPublish = theValue; + } + + + /** + * Gets the value(s) for purpose (Human summary: why describe this resource?). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Human summary: why describe this resource? + *

+ */ + public StringDt getPurpose() { + if (myPurpose == null) { + myPurpose = new StringDt(); + } + return myPurpose; + } + + /** + * Sets the value(s) for purpose (Human summary: why describe this resource?) + * + *

+ * Definition: + * Human summary: why describe this resource? + *

+ */ + public void setPurpose(StringDt theValue) { + myPurpose = theValue; + } + + /** + * Sets the value(s) for purpose (Human summary: why describe this resource?) + * + *

+ * Definition: + * Human summary: why describe this resource? + *

+ */ + public void setPurpose( String theString) { + myPurpose = new StringDt(theString); + } + + /** + * Gets the value(s) for element (Definition of elements in the resource (if no profile)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Captures constraints on each element within the resource + *

+ */ + public List getElement() { + if (myElement == null) { + myElement = new ArrayList(); + } + return myElement; + } + + /** + * Sets the value(s) for element (Definition of elements in the resource (if no profile)) + * + *

+ * Definition: + * Captures constraints on each element within the resource + *

+ */ + public void setElement(List theValue) { + myElement = theValue; + } + + + /** + * Gets the value(s) for searchParam (Search params defined). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Additional search parameters for implementations to support and/or make use of + *

+ */ + public List getSearchParam() { + if (mySearchParam == null) { + mySearchParam = new ArrayList(); + } + return mySearchParam; + } + + /** + * Sets the value(s) for searchParam (Search params defined) + * + *

+ * Definition: + * Additional search parameters for implementations to support and/or make use of + *

+ */ + public void setSearchParam(List theValue) { + mySearchParam = theValue; + } + + + + } + + /** + * Block class for child element: Profile.structure.element (Definition of elements in the resource (if no profile)) + * + *

+ * Definition: + * Captures constraints on each element within the resource + *

+ */ + @Block(name="Profile.structure.element") + public static class StructureElement extends BaseElement implements IResourceBlock { + + @Child(name="path", type=StringDt.class, order=0, min=1, max=1) + private StringDt myPath; + + @Child(name="representation", type=CodeDt.class, order=1, min=0, max=Child.MAX_UNLIMITED) + private List> myRepresentation; + + @Child(name="name", type=StringDt.class, order=2, min=0, max=1) + private StringDt myName; + + @Child(name="slicing", order=3, min=0, max=1) + private StructureElementSlicing mySlicing; + + @Child(name="definition", order=4, min=0, max=1) + private StructureElementDefinition myDefinition; + + /** + * Gets the value(s) for path (The path of the element (see the formal definitions)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource + *

+ */ + public StringDt getPath() { + if (myPath == null) { + myPath = new StringDt(); + } + return myPath; + } + + /** + * Sets the value(s) for path (The path of the element (see the formal definitions)) + * + *

+ * Definition: + * The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource + *

+ */ + public void setPath(StringDt theValue) { + myPath = theValue; + } + + /** + * Sets the value(s) for path (The path of the element (see the formal definitions)) + * + *

+ * Definition: + * The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource + *

+ */ + public void setPath( String theString) { + myPath = new StringDt(theString); + } + + /** + * Gets the value(s) for representation (How this element is represented in instances). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Codes that define how this element is represented in instances, when the deviation varies from the normal case + *

+ */ + public List> getRepresentation() { + if (myRepresentation == null) { + myRepresentation = new ArrayList>(); + } + return myRepresentation; + } + + /** + * Sets the value(s) for representation (How this element is represented in instances) + * + *

+ * Definition: + * Codes that define how this element is represented in instances, when the deviation varies from the normal case + *

+ */ + public void setRepresentation(List> theValue) { + myRepresentation = theValue; + } + + /** + * Add a value for representation (How this element is represented in instances) + * + *

+ * Definition: + * Codes that define how this element is represented in instances, when the deviation varies from the normal case + *

+ */ + public void addRepresentation(PropertyRepresentationEnum theValue) { + getRepresentation().add(new BoundCodeDt(PropertyRepresentationEnum.VALUESET_BINDER, theValue)); + } + + /** + * Sets the value(s), and clears any existing value(s) for representation (How this element is represented in instances) + * + *

+ * Definition: + * Codes that define how this element is represented in instances, when the deviation varies from the normal case + *

+ */ + public void setRepresentation(PropertyRepresentationEnum theValue) { + getRepresentation().clear(); + addRepresentation(theValue); + } + + + /** + * Gets the value(s) for name (Name for this particular element definition (reference target)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The name of this element definition (to refer to it from other element definitions using Profile.structure.element.definition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element + *

+ */ + public StringDt getName() { + if (myName == null) { + myName = new StringDt(); + } + return myName; + } + + /** + * Sets the value(s) for name (Name for this particular element definition (reference target)) + * + *

+ * Definition: + * The name of this element definition (to refer to it from other element definitions using Profile.structure.element.definition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element + *

+ */ + public void setName(StringDt theValue) { + myName = theValue; + } + + /** + * Sets the value(s) for name (Name for this particular element definition (reference target)) + * + *

+ * Definition: + * The name of this element definition (to refer to it from other element definitions using Profile.structure.element.definition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element + *

+ */ + public void setName( String theString) { + myName = new StringDt(theString); + } + + /** + * Gets the value(s) for slicing (This element is sliced - slices follow). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). 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 StructureElementSlicing getSlicing() { + if (mySlicing == null) { + mySlicing = new StructureElementSlicing(); + } + return mySlicing; + } + + /** + * Sets the value(s) for slicing (This element is sliced - slices follow) + * + *

+ * Definition: + * Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). 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 void setSlicing(StructureElementSlicing theValue) { + mySlicing = theValue; + } + + + /** + * Gets the value(s) for definition (More specific definition of the element ). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Definition of the content of the element to provide a more specific definition than that contained for the element in the base resource + *

+ */ + public StructureElementDefinition getDefinition() { + if (myDefinition == null) { + myDefinition = new StructureElementDefinition(); + } + return myDefinition; + } + + /** + * Sets the value(s) for definition (More specific definition of the element ) + * + *

+ * Definition: + * Definition of the content of the element to provide a more specific definition than that contained for the element in the base resource + *

+ */ + public void setDefinition(StructureElementDefinition theValue) { + myDefinition = theValue; + } + + + + } + + /** + * Block class for child element: Profile.structure.element.slicing (This element is sliced - slices follow) + * + *

+ * Definition: + * Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). 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) + *

+ */ + @Block(name="Profile.structure.element.slicing") + public static class StructureElementSlicing extends BaseElement implements IResourceBlock { + + @Child(name="discriminator", type=IdDt.class, order=0, min=1, max=1) + private IdDt myDiscriminator; + + @Child(name="ordered", type=BooleanDt.class, order=1, min=1, max=1) + private BooleanDt myOrdered; + + @Child(name="rules", type=CodeDt.class, order=2, min=1, max=1) + private BoundCodeDt myRules; + + /** + * Gets the value(s) for discriminator (Element that used to distinguish the slices). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Designates which child element is used to discriminate between the slices when processing an instance. The value of the child element in the instance SHALL completely distinguish which slice the element in the resource matches based on the allowed values for that element in each of the slices + *

+ */ + public IdDt getDiscriminator() { + if (myDiscriminator == null) { + myDiscriminator = new IdDt(); + } + return myDiscriminator; + } + + /** + * Sets the value(s) for discriminator (Element that used to distinguish the slices) + * + *

+ * Definition: + * Designates which child element is used to discriminate between the slices when processing an instance. The value of the child element in the instance SHALL completely distinguish which slice the element in the resource matches based on the allowed values for that element in each of the slices + *

+ */ + public void setDiscriminator(IdDt theValue) { + myDiscriminator = theValue; + } + + /** + * Sets the value(s) for discriminator (Element that used to distinguish the slices) + * + *

+ * Definition: + * Designates which child element is used to discriminate between the slices when processing an instance. The value of the child element in the instance SHALL completely distinguish which slice the element in the resource matches based on the allowed values for that element in each of the slices + *

+ */ + public void setDiscriminator( String theId) { + myDiscriminator = new IdDt(theId); + } + + /** + * Gets the value(s) for ordered (If elements must be in same order as slices). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * If the matching elements have to occur in the same order as defined in the profile + *

+ */ + public BooleanDt getOrdered() { + if (myOrdered == null) { + myOrdered = new BooleanDt(); + } + return myOrdered; + } + + /** + * Sets the value(s) for ordered (If elements must be in same order as slices) + * + *

+ * Definition: + * If the matching elements have to occur in the same order as defined in the profile + *

+ */ + public void setOrdered(BooleanDt theValue) { + myOrdered = theValue; + } + + + /** + * Gets the value(s) for rules (closed | open | openAtEnd). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 BoundCodeDt getRules() { + if (myRules == null) { + myRules = new BoundCodeDt(SlicingRulesEnum.VALUESET_BINDER); + } + return myRules; + } + + /** + * Sets the value(s) for rules (closed | open | openAtEnd) + * + *

+ * Definition: + * 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 void setRules(BoundCodeDt theValue) { + myRules = theValue; + } + + /** + * Sets the value(s) for rules (closed | open | openAtEnd) + * + *

+ * Definition: + * 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 void setRules(SlicingRulesEnum theValue) { + getRules().setValueAsEnum(theValue); + } + + + + } + + + /** + * Block class for child element: Profile.structure.element.definition (More specific definition of the element ) + * + *

+ * Definition: + * Definition of the content of the element to provide a more specific definition than that contained for the element in the base resource + *

+ */ + @Block(name="Profile.structure.element.definition") + public static class StructureElementDefinition extends BaseElement implements IResourceBlock { + + @Child(name="short", type=StringDt.class, order=0, min=1, max=1) + private StringDt myShort; + + @Child(name="formal", type=StringDt.class, order=1, min=1, max=1) + private StringDt myFormal; + + @Child(name="comments", type=StringDt.class, order=2, min=0, max=1) + private StringDt myComments; + + @Child(name="requirements", type=StringDt.class, order=3, min=0, max=1) + private StringDt myRequirements; + + @Child(name="synonym", type=StringDt.class, order=4, min=0, max=Child.MAX_UNLIMITED) + private List mySynonym; + + @Child(name="min", type=IntegerDt.class, order=5, min=1, max=1) + private IntegerDt myMin; + + @Child(name="max", type=StringDt.class, order=6, min=1, max=1) + private StringDt myMax; + + @Child(name="type", order=7, min=0, max=Child.MAX_UNLIMITED) + private List myType; + + @Child(name="nameReference", type=StringDt.class, order=8, min=0, max=1) + private StringDt myNameReference; + + @Child(name="value", type=IDatatype.class, order=9, min=0, max=1) + private IDatatype myValue; + + @Child(name="example", type=IDatatype.class, order=10, min=0, max=1) + private IDatatype myExample; + + @Child(name="maxLength", type=IntegerDt.class, order=11, min=0, max=1) + private IntegerDt myMaxLength; + + @Child(name="condition", type=IdDt.class, order=12, min=0, max=Child.MAX_UNLIMITED) + private List myCondition; + + @Child(name="constraint", order=13, min=0, max=Child.MAX_UNLIMITED) + private List myConstraint; + + @Child(name="mustSupport", type=BooleanDt.class, order=14, min=0, max=1) + private BooleanDt myMustSupport; + + @Child(name="isModifier", type=BooleanDt.class, order=15, min=1, max=1) + private BooleanDt myIsModifier; + + @Child(name="binding", order=16, min=0, max=1) + private StructureElementDefinitionBinding myBinding; + + @Child(name="mapping", order=17, min=0, max=Child.MAX_UNLIMITED) + private List myMapping; + + /** + * Gets the value(s) for short (Concise definition for xml presentation). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification) + *

+ */ + public StringDt getShort() { + if (myShort == null) { + myShort = new StringDt(); + } + return myShort; + } + + /** + * Sets the value(s) for short (Concise definition for xml presentation) + * + *

+ * Definition: + * A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification) + *

+ */ + public void setShort(StringDt theValue) { + myShort = theValue; + } + + /** + * Sets the value(s) for short (Concise definition for xml presentation) + * + *

+ * Definition: + * A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification) + *

+ */ + public void setShort( String theString) { + myShort = new StringDt(theString); + } + + /** + * Gets the value(s) for formal (Full formal definition in human language). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 StringDt getFormal() { + if (myFormal == null) { + myFormal = new StringDt(); + } + return myFormal; + } + + /** + * Sets the value(s) for formal (Full formal definition in human language) + * + *

+ * Definition: + * 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 void setFormal(StringDt theValue) { + myFormal = theValue; + } + + /** + * Sets the value(s) for formal (Full formal definition in human language) + * + *

+ * Definition: + * 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 void setFormal( String theString) { + myFormal = new StringDt(theString); + } + + /** + * Gets the value(s) for comments (Comments about the use of this element). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc. + *

+ */ + public StringDt getComments() { + if (myComments == null) { + myComments = new StringDt(); + } + return myComments; + } + + /** + * Sets the value(s) for comments (Comments about the use of this element) + * + *

+ * Definition: + * Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc. + *

+ */ + public void setComments(StringDt theValue) { + myComments = theValue; + } + + /** + * Sets the value(s) for comments (Comments about the use of this element) + * + *

+ * Definition: + * Comments about the use of the element, including notes about how to use the data properly, exceptions to proper use, etc. + *

+ */ + public void setComments( String theString) { + myComments = new StringDt(theString); + } + + /** + * Gets the value(s) for requirements (Why is this needed?). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Explains why this element is needed and why it's been constrained as it has + *

+ */ + public StringDt getRequirements() { + if (myRequirements == null) { + myRequirements = new StringDt(); + } + return myRequirements; + } + + /** + * Sets the value(s) for requirements (Why is this needed?) + * + *

+ * Definition: + * Explains why this element is needed and why it's been constrained as it has + *

+ */ + public void setRequirements(StringDt theValue) { + myRequirements = theValue; + } + + /** + * Sets the value(s) for requirements (Why is this needed?) + * + *

+ * Definition: + * Explains why this element is needed and why it's been constrained as it has + *

+ */ + public void setRequirements( String theString) { + myRequirements = new StringDt(theString); + } + + /** + * Gets the value(s) for synonym (Other names). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Identifies additional names by which this element might also be known + *

+ */ + public List getSynonym() { + if (mySynonym == null) { + mySynonym = new ArrayList(); + } + return mySynonym; + } + + /** + * Sets the value(s) for synonym (Other names) + * + *

+ * Definition: + * Identifies additional names by which this element might also be known + *

+ */ + public void setSynonym(List theValue) { + mySynonym = theValue; + } + + /** + * Sets the value(s) for synonym (Other names) + * + *

+ * Definition: + * Identifies additional names by which this element might also be known + *

+ */ + public void addSynonym( String theString) { + if (mySynonym == null) { + mySynonym = new ArrayList(); + } + mySynonym.add(new StringDt(theString)); + } + + /** + * Gets the value(s) for min (Minimum Cardinality). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The minimum number of times this element SHALL appear in the instance + *

+ */ + public IntegerDt getMin() { + if (myMin == null) { + myMin = new IntegerDt(); + } + return myMin; + } + + /** + * Sets the value(s) for min (Minimum Cardinality) + * + *

+ * Definition: + * The minimum number of times this element SHALL appear in the instance + *

+ */ + public void setMin(IntegerDt theValue) { + myMin = theValue; + } + + + /** + * Gets the value(s) for max (Maximum Cardinality (a number or *)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The maximum number of times this element is permitted to appear in the instance + *

+ */ + public StringDt getMax() { + if (myMax == null) { + myMax = new StringDt(); + } + return myMax; + } + + /** + * Sets the value(s) for max (Maximum Cardinality (a number or *)) + * + *

+ * Definition: + * The maximum number of times this element is permitted to appear in the instance + *

+ */ + public void setMax(StringDt theValue) { + myMax = theValue; + } + + /** + * Sets the value(s) for max (Maximum Cardinality (a number or *)) + * + *

+ * Definition: + * The maximum number of times this element is permitted to appear in the instance + *

+ */ + public void setMax( String theString) { + myMax = new StringDt(theString); + } + + /** + * Gets the value(s) for type (Data type and Profile for this element). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The data type or resource that the value of this element is permitted to be + *

+ */ + public List getType() { + if (myType == null) { + myType = new ArrayList(); + } + return myType; + } + + /** + * Sets the value(s) for type (Data type and Profile for this element) + * + *

+ * Definition: + * The data type or resource that the value of this element is permitted to be + *

+ */ + public void setType(List theValue) { + myType = theValue; + } + + + /** + * Gets the value(s) for nameReference (To another element constraint (by element.name)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element + *

+ */ + public StringDt getNameReference() { + if (myNameReference == null) { + myNameReference = new StringDt(); + } + return myNameReference; + } + + /** + * Sets the value(s) for nameReference (To another element constraint (by element.name)) + * + *

+ * Definition: + * Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element + *

+ */ + public void setNameReference(StringDt theValue) { + myNameReference = theValue; + } + + /** + * Sets the value(s) for nameReference (To another element constraint (by element.name)) + * + *

+ * Definition: + * Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element + *

+ */ + public void setNameReference( String theString) { + myNameReference = new StringDt(theString); + } + + /** + * Gets the value(s) for value[x] (Fixed value: [as defined for a primitive type]). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Specifies a primitive value that SHALL hold for this element in the instance + *

+ */ + public IDatatype getValue() { + return myValue; + } + + /** + * Sets the value(s) for value[x] (Fixed value: [as defined for a primitive type]) + * + *

+ * Definition: + * Specifies a primitive value that SHALL hold for this element in the instance + *

+ */ + public void setValue(IDatatype theValue) { + myValue = theValue; + } + + + /** + * Gets the value(s) for example[x] (Example value: [as defined for type]). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * An example value for this element + *

+ */ + public IDatatype getExample() { + return myExample; + } + + /** + * Sets the value(s) for example[x] (Example value: [as defined for type]) + * + *

+ * Definition: + * An example value for this element + *

+ */ + public void setExample(IDatatype theValue) { + myExample = theValue; + } + + + /** + * Gets the value(s) for maxLength (Length for strings). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Indicates the shortest length that SHALL be supported by conformant instances without truncation + *

+ */ + public IntegerDt getMaxLength() { + if (myMaxLength == null) { + myMaxLength = new IntegerDt(); + } + return myMaxLength; + } + + /** + * Sets the value(s) for maxLength (Length for strings) + * + *

+ * Definition: + * Indicates the shortest length that SHALL be supported by conformant instances without truncation + *

+ */ + public void setMaxLength(IntegerDt theValue) { + myMaxLength = theValue; + } + + + /** + * Gets the value(s) for condition (Reference to invariant about presence). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A reference to an invariant that may make additional statements about the cardinality or value in the instance + *

+ */ + public List getCondition() { + if (myCondition == null) { + myCondition = new ArrayList(); + } + return myCondition; + } + + /** + * Sets the value(s) for condition (Reference to invariant about presence) + * + *

+ * Definition: + * A reference to an invariant that may make additional statements about the cardinality or value in the instance + *

+ */ + public void setCondition(List theValue) { + myCondition = theValue; + } + + /** + * Sets the value(s) for condition (Reference to invariant about presence) + * + *

+ * Definition: + * A reference to an invariant that may make additional statements about the cardinality or value in the instance + *

+ */ + public void addCondition( String theId) { + if (myCondition == null) { + myCondition = new ArrayList(); + } + myCondition.add(new IdDt(theId)); + } + + /** + * Gets the value(s) for constraint (Condition that must evaluate to true). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance + *

+ */ + public List getConstraint() { + if (myConstraint == null) { + myConstraint = new ArrayList(); + } + return myConstraint; + } + + /** + * Sets the value(s) for constraint (Condition that must evaluate to true) + * + *

+ * Definition: + * Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance + *

+ */ + public void setConstraint(List theValue) { + myConstraint = theValue; + } + + + /** + * Gets the value(s) for mustSupport (If the element must supported). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported + *

+ */ + public BooleanDt getMustSupport() { + if (myMustSupport == null) { + myMustSupport = new BooleanDt(); + } + return myMustSupport; + } + + /** + * Sets the value(s) for mustSupport (If the element must supported) + * + *

+ * Definition: + * If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported + *

+ */ + public void setMustSupport(BooleanDt theValue) { + myMustSupport = theValue; + } + + + /** + * Gets the value(s) for isModifier (If this modifies the meaning of other elements). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * 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 BooleanDt getIsModifier() { + if (myIsModifier == null) { + myIsModifier = new BooleanDt(); + } + return myIsModifier; + } + + /** + * Sets the value(s) for isModifier (If this modifies the meaning of other elements) + * + *

+ * Definition: + * 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 void setIsModifier(BooleanDt theValue) { + myIsModifier = theValue; + } + + + /** + * Gets the value(s) for binding (ValueSet details if this is coded). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Binds to a value set if this element is coded (code, Coding, CodeableConcept) + *

+ */ + public StructureElementDefinitionBinding getBinding() { + if (myBinding == null) { + myBinding = new StructureElementDefinitionBinding(); + } + return myBinding; + } + + /** + * Sets the value(s) for binding (ValueSet details if this is coded) + * + *

+ * Definition: + * Binds to a value set if this element is coded (code, Coding, CodeableConcept) + *

+ */ + public void setBinding(StructureElementDefinitionBinding theValue) { + myBinding = theValue; + } + + + /** + * Gets the value(s) for mapping (Map element to another set of definitions). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Identifies a concept from an external specification that roughly corresponds to this element + *

+ */ + public List getMapping() { + if (myMapping == null) { + myMapping = new ArrayList(); + } + return myMapping; + } + + /** + * Sets the value(s) for mapping (Map element to another set of definitions) + * + *

+ * Definition: + * Identifies a concept from an external specification that roughly corresponds to this element + *

+ */ + public void setMapping(List theValue) { + myMapping = theValue; + } + + + + } + + /** + * Block class for child element: Profile.structure.element.definition.type (Data type and Profile for this element) + * + *

+ * Definition: + * The data type or resource that the value of this element is permitted to be + *

+ */ + @Block(name="Profile.structure.element.definition.type") + public static class StructureElementDefinitionType extends BaseElement implements IResourceBlock { + + @Child(name="code", type=CodeDt.class, order=0, min=1, max=1) + private BoundCodeDt myCode; + + @Child(name="profile", type=UriDt.class, order=1, min=0, max=1) + private UriDt myProfile; + + @Child(name="aggregation", type=CodeDt.class, order=2, min=0, max=Child.MAX_UNLIMITED) + private List> myAggregation; + + /** + * Gets the value(s) for code (Name of Data type or Resource). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * + *

+ */ + public BoundCodeDt getCode() { + if (myCode == null) { + myCode = new BoundCodeDt(DataTypeEnum.VALUESET_BINDER); + } + return myCode; + } + + /** + * Sets the value(s) for code (Name of Data type or Resource) + * + *

+ * Definition: + * + *

+ */ + public void setCode(BoundCodeDt theValue) { + myCode = theValue; + } + + /** + * Sets the value(s) for code (Name of Data type or Resource) + * + *

+ * Definition: + * + *

+ */ + public void setCode(DataTypeEnum theValue) { + getCode().setValueAsEnum(theValue); + } + + + /** + * Gets the value(s) for profile (Profile.structure to apply). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Identifies a profile 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 + *

+ */ + public UriDt getProfile() { + if (myProfile == null) { + myProfile = new UriDt(); + } + return myProfile; + } + + /** + * Sets the value(s) for profile (Profile.structure to apply) + * + *

+ * Definition: + * Identifies a profile 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 + *

+ */ + public void setProfile(UriDt theValue) { + myProfile = theValue; + } + + + /** + * Gets the value(s) for aggregation (contained | referenced | bundled - how aggregated). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * If the type is a reference to another resource, how the resource is or can be aggreated - 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 (myAggregation == null) { + myAggregation = new ArrayList>(); + } + return myAggregation; + } + + /** + * Sets the value(s) for aggregation (contained | referenced | bundled - how aggregated) + * + *

+ * Definition: + * If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle + *

+ */ + public void setAggregation(List> theValue) { + myAggregation = theValue; + } + + /** + * Add a value for aggregation (contained | referenced | bundled - how aggregated) + * + *

+ * Definition: + * If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle + *

+ */ + public void addAggregation(AggregationModeEnum theValue) { + getAggregation().add(new BoundCodeDt(AggregationModeEnum.VALUESET_BINDER, theValue)); + } + + /** + * Sets the value(s), and clears any existing value(s) for aggregation (contained | referenced | bundled - how aggregated) + * + *

+ * Definition: + * If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle + *

+ */ + public void setAggregation(AggregationModeEnum theValue) { + getAggregation().clear(); + addAggregation(theValue); + } + + + + } + + + /** + * Block class for child element: Profile.structure.element.definition.constraint (Condition that must evaluate to true) + * + *

+ * Definition: + * Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance + *

+ */ + @Block(name="Profile.structure.element.definition.constraint") + public static class StructureElementDefinitionConstraint extends BaseElement implements IResourceBlock { + + @Child(name="key", type=IdDt.class, order=0, min=1, max=1) + private IdDt myKey; + + @Child(name="name", type=StringDt.class, order=1, min=0, max=1) + private StringDt myName; + + @Child(name="severity", type=CodeDt.class, order=2, min=1, max=1) + private BoundCodeDt mySeverity; + + @Child(name="human", type=StringDt.class, order=3, min=1, max=1) + private StringDt myHuman; + + @Child(name="xpath", type=StringDt.class, order=4, min=1, max=1) + private StringDt myXpath; + + /** + * Gets the value(s) for key (Target of 'condition' reference above). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality + *

+ */ + public IdDt getKey() { + if (myKey == null) { + myKey = new IdDt(); + } + return myKey; + } + + /** + * Sets the value(s) for key (Target of 'condition' reference above) + * + *

+ * Definition: + * Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality + *

+ */ + public void setKey(IdDt theValue) { + myKey = theValue; + } + + /** + * Sets the value(s) for key (Target of 'condition' reference above) + * + *

+ * Definition: + * Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality + *

+ */ + public void setKey( String theId) { + myKey = new IdDt(theId); + } + + /** + * Gets the value(s) for name (Short human label). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Used to label the constraint in OCL or in short displays incapable of displaying the full human description + *

+ */ + public StringDt getName() { + if (myName == null) { + myName = new StringDt(); + } + return myName; + } + + /** + * Sets the value(s) for name (Short human label) + * + *

+ * Definition: + * Used to label the constraint in OCL or in short displays incapable of displaying the full human description + *

+ */ + public void setName(StringDt theValue) { + myName = theValue; + } + + /** + * Sets the value(s) for name (Short human label) + * + *

+ * Definition: + * Used to label the constraint in OCL or in short displays incapable of displaying the full human description + *

+ */ + public void setName( String theString) { + myName = new StringDt(theString); + } + + /** + * Gets the value(s) for severity (error | warning). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Identifies the impact constraint violation has on the conformance of the instance + *

+ */ + public BoundCodeDt getSeverity() { + if (mySeverity == null) { + mySeverity = new BoundCodeDt(ConstraintSeverityEnum.VALUESET_BINDER); + } + return mySeverity; + } + + /** + * Sets the value(s) for severity (error | warning) + * + *

+ * Definition: + * Identifies the impact constraint violation has on the conformance of the instance + *

+ */ + public void setSeverity(BoundCodeDt theValue) { + mySeverity = theValue; + } + + /** + * Sets the value(s) for severity (error | warning) + * + *

+ * Definition: + * Identifies the impact constraint violation has on the conformance of the instance + *

+ */ + public void setSeverity(ConstraintSeverityEnum theValue) { + getSeverity().setValueAsEnum(theValue); + } + + + /** + * Gets the value(s) for human (Human description of constraint). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Text that can be used to describe the constraint in messages identifying that the constraint has been violated + *

+ */ + public StringDt getHuman() { + if (myHuman == null) { + myHuman = new StringDt(); + } + return myHuman; + } + + /** + * Sets the value(s) for human (Human description of constraint) + * + *

+ * Definition: + * Text that can be used to describe the constraint in messages identifying that the constraint has been violated + *

+ */ + public void setHuman(StringDt theValue) { + myHuman = theValue; + } + + /** + * Sets the value(s) for human (Human description of constraint) + * + *

+ * Definition: + * Text that can be used to describe the constraint in messages identifying that the constraint has been violated + *

+ */ + public void setHuman( String theString) { + myHuman = new StringDt(theString); + } + + /** + * Gets the value(s) for xpath (XPath expression of constraint). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * XPath expression of constraint + *

+ */ + public StringDt getXpath() { + if (myXpath == null) { + myXpath = new StringDt(); + } + return myXpath; + } + + /** + * Sets the value(s) for xpath (XPath expression of constraint) + * + *

+ * Definition: + * XPath expression of constraint + *

+ */ + public void setXpath(StringDt theValue) { + myXpath = theValue; + } + + /** + * Sets the value(s) for xpath (XPath expression of constraint) + * + *

+ * Definition: + * XPath expression of constraint + *

+ */ + public void setXpath( String theString) { + myXpath = new StringDt(theString); + } + + + } + + + /** + * Block class for child element: Profile.structure.element.definition.binding (ValueSet details if this is coded) + * + *

+ * Definition: + * Binds to a value set if this element is coded (code, Coding, CodeableConcept) + *

+ */ + @Block(name="Profile.structure.element.definition.binding") + public static class StructureElementDefinitionBinding extends BaseElement implements IResourceBlock { + + @Child(name="name", type=StringDt.class, order=0, min=1, max=1) + private StringDt myName; + + @Child(name="isExtensible", type=BooleanDt.class, order=1, min=1, max=1) + private BooleanDt myIsExtensible; + + @Child(name="conformance", type=CodeDt.class, order=2, min=0, max=1) + private BoundCodeDt myConformance; + + @Child(name="description", type=StringDt.class, order=3, min=0, max=1) + private StringDt myDescription; + + @Child(name="reference", order=4, min=0, max=1, choice=@Choice(types= { + UriDt.class, + ValueSet.class, + })) + private IDatatype myReference; + + /** + * Gets the value(s) for name (Descriptive Name). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A descriptive name for this - can be useful for generating implementation artifacts + *

+ */ + public StringDt getName() { + if (myName == null) { + myName = new StringDt(); + } + return myName; + } + + /** + * Sets the value(s) for name (Descriptive Name) + * + *

+ * Definition: + * A descriptive name for this - can be useful for generating implementation artifacts + *

+ */ + public void setName(StringDt theValue) { + myName = theValue; + } + + /** + * Sets the value(s) for name (Descriptive Name) + * + *

+ * Definition: + * A descriptive name for this - can be useful for generating implementation artifacts + *

+ */ + public void setName( String theString) { + myName = new StringDt(theString); + } + + /** + * Gets the value(s) for isExtensible (Can additional codes be used?). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone + *

+ */ + public BooleanDt getIsExtensible() { + if (myIsExtensible == null) { + myIsExtensible = new BooleanDt(); + } + return myIsExtensible; + } + + /** + * Sets the value(s) for isExtensible (Can additional codes be used?) + * + *

+ * Definition: + * If true, then conformant systems may use additional codes or (where the data type permits) text alone to convey concepts not covered by the set of codes identified in the binding. If false, then conformant systems are constrained to the provided codes alone + *

+ */ + public void setIsExtensible(BooleanDt theValue) { + myIsExtensible = theValue; + } + + + /** + * Gets the value(s) for conformance (required | preferred | example). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Indicates the degree of conformance expectations associated with this binding + *

+ */ + public BoundCodeDt getConformance() { + if (myConformance == null) { + myConformance = new BoundCodeDt(BindingConformanceEnum.VALUESET_BINDER); + } + return myConformance; + } + + /** + * Sets the value(s) for conformance (required | preferred | example) + * + *

+ * Definition: + * Indicates the degree of conformance expectations associated with this binding + *

+ */ + public void setConformance(BoundCodeDt theValue) { + myConformance = theValue; + } + + /** + * Sets the value(s) for conformance (required | preferred | example) + * + *

+ * Definition: + * Indicates the degree of conformance expectations associated with this binding + *

+ */ + public void setConformance(BindingConformanceEnum theValue) { + getConformance().setValueAsEnum(theValue); + } + + + /** + * Gets the value(s) for description (Human explanation of the value set). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Describes the intended use of this particular set of codes + *

+ */ + public StringDt getDescription() { + if (myDescription == null) { + myDescription = new StringDt(); + } + return myDescription; + } + + /** + * Sets the value(s) for description (Human explanation of the value set) + * + *

+ * Definition: + * Describes the intended use of this particular set of codes + *

+ */ + public void setDescription(StringDt theValue) { + myDescription = theValue; + } + + /** + * Sets the value(s) for description (Human explanation of the value set) + * + *

+ * Definition: + * Describes the intended use of this particular set of codes + *

+ */ + public void setDescription( String theString) { + myDescription = new StringDt(theString); + } + + /** + * Gets the value(s) for reference[x] (Source of value set). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Points to the value set or external definition that identifies the set of codes to be used + *

+ */ + public IDatatype getReference() { + return myReference; + } + + /** + * Sets the value(s) for reference[x] (Source of value set) + * + *

+ * Definition: + * Points to the value set or external definition that identifies the set of codes to be used + *

+ */ + public void setReference(IDatatype theValue) { + myReference = theValue; + } + + + + } + + + /** + * Block class for child element: Profile.structure.element.definition.mapping (Map element to another set of definitions) + * + *

+ * Definition: + * Identifies a concept from an external specification that roughly corresponds to this element + *

+ */ + @Block(name="Profile.structure.element.definition.mapping") + public static class StructureElementDefinitionMapping extends BaseElement implements IResourceBlock { + + @Child(name="identity", type=IdDt.class, order=0, min=1, max=1) + private IdDt myIdentity; + + @Child(name="map", type=StringDt.class, order=1, min=1, max=1) + private StringDt myMap; + + /** + * Gets the value(s) for identity (Reference to mapping declaration). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * An internal reference to the definition of a mapping + *

+ */ + public IdDt getIdentity() { + if (myIdentity == null) { + myIdentity = new IdDt(); + } + return myIdentity; + } + + /** + * Sets the value(s) for identity (Reference to mapping declaration) + * + *

+ * Definition: + * An internal reference to the definition of a mapping + *

+ */ + public void setIdentity(IdDt theValue) { + myIdentity = theValue; + } + + /** + * Sets the value(s) for identity (Reference to mapping declaration) + * + *

+ * Definition: + * An internal reference to the definition of a mapping + *

+ */ + public void setIdentity( String theId) { + myIdentity = new IdDt(theId); + } + + /** + * Gets the value(s) for map (Details of the mapping). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Expresses what part of the target specification corresponds to this element + *

+ */ + public StringDt getMap() { + if (myMap == null) { + myMap = new StringDt(); + } + return myMap; + } + + /** + * Sets the value(s) for map (Details of the mapping) + * + *

+ * Definition: + * Expresses what part of the target specification corresponds to this element + *

+ */ + public void setMap(StringDt theValue) { + myMap = theValue; + } + + /** + * Sets the value(s) for map (Details of the mapping) + * + *

+ * Definition: + * Expresses what part of the target specification corresponds to this element + *

+ */ + public void setMap( String theString) { + myMap = new StringDt(theString); + } + + + } + + + + + /** + * Block class for child element: Profile.structure.searchParam (Search params defined) + * + *

+ * Definition: + * Additional search parameters for implementations to support and/or make use of + *

+ */ + @Block(name="Profile.structure.searchParam") + public static class StructureSearchParam extends BaseElement implements IResourceBlock { + + @Child(name="name", type=StringDt.class, order=0, min=1, max=1) + private StringDt myName; + + @Child(name="type", type=CodeDt.class, order=1, min=1, max=1) + private BoundCodeDt myType; + + @Child(name="documentation", type=StringDt.class, order=2, min=1, max=1) + private StringDt myDocumentation; + + @Child(name="xpath", type=StringDt.class, order=3, min=0, max=1) + private StringDt myXpath; + + @Child(name="target", type=CodeDt.class, order=4, min=0, max=Child.MAX_UNLIMITED) + private List> myTarget; + + /** + * Gets the value(s) for name (Name of search parameter). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The name of the standard or custom search parameter + *

+ */ + public StringDt getName() { + if (myName == null) { + myName = new StringDt(); + } + return myName; + } + + /** + * Sets the value(s) for name (Name of search parameter) + * + *

+ * Definition: + * The name of the standard or custom search parameter + *

+ */ + public void setName(StringDt theValue) { + myName = theValue; + } + + /** + * Sets the value(s) for name (Name of search parameter) + * + *

+ * Definition: + * The name of the standard or custom search parameter + *

+ */ + public void setName( String theString) { + myName = new StringDt(theString); + } + + /** + * Gets the value(s) for type (number | date | string | token | reference | composite | quantity). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The type of value a search parameter refers to, and how the content is interpreted + *

+ */ + public BoundCodeDt getType() { + if (myType == null) { + myType = new BoundCodeDt(SearchParamTypeEnum.VALUESET_BINDER); + } + return myType; + } + + /** + * Sets the value(s) for type (number | date | string | token | reference | composite | quantity) + * + *

+ * Definition: + * The type of value a search parameter refers to, and how the content is interpreted + *

+ */ + public void setType(BoundCodeDt theValue) { + myType = theValue; + } + + /** + * Sets the value(s) for type (number | date | string | token | reference | composite | quantity) + * + *

+ * Definition: + * The type of value a search parameter refers to, and how the content is interpreted + *

+ */ + public void setType(SearchParamTypeEnum theValue) { + getType().setValueAsEnum(theValue); + } + + + /** + * Gets the value(s) for documentation (Contents and meaning of search parameter). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A specification for search parameters. For standard parameters, provides additional information on how the parameter is used in this solution. For custom parameters, provides a description of what the parameter does + *

+ */ + public StringDt getDocumentation() { + if (myDocumentation == null) { + myDocumentation = new StringDt(); + } + return myDocumentation; + } + + /** + * Sets the value(s) for documentation (Contents and meaning of search parameter) + * + *

+ * Definition: + * A specification for search parameters. For standard parameters, provides additional information on how the parameter is used in this solution. For custom parameters, provides a description of what the parameter does + *

+ */ + public void setDocumentation(StringDt theValue) { + myDocumentation = theValue; + } + + /** + * Sets the value(s) for documentation (Contents and meaning of search parameter) + * + *

+ * Definition: + * A specification for search parameters. For standard parameters, provides additional information on how the parameter is used in this solution. For custom parameters, provides a description of what the parameter does + *

+ */ + public void setDocumentation( String theString) { + myDocumentation = new StringDt(theString); + } + + /** + * Gets the value(s) for xpath (XPath that extracts the parameter set). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * An XPath expression that returns a set of elements for the search parameter + *

+ */ + public StringDt getXpath() { + if (myXpath == null) { + myXpath = new StringDt(); + } + return myXpath; + } + + /** + * Sets the value(s) for xpath (XPath that extracts the parameter set) + * + *

+ * Definition: + * An XPath expression that returns a set of elements for the search parameter + *

+ */ + public void setXpath(StringDt theValue) { + myXpath = theValue; + } + + /** + * Sets the value(s) for xpath (XPath that extracts the parameter set) + * + *

+ * Definition: + * An XPath expression that returns a set of elements for the search parameter + *

+ */ + public void setXpath( String theString) { + myXpath = new StringDt(theString); + } + + /** + * Gets the value(s) for target (Types of resource (if a resource reference)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Types of resource (if a resource is referenced) + *

+ */ + public List> getTarget() { + if (myTarget == null) { + myTarget = new ArrayList>(); + } + return myTarget; + } + + /** + * Sets the value(s) for target (Types of resource (if a resource reference)) + * + *

+ * Definition: + * Types of resource (if a resource is referenced) + *

+ */ + public void setTarget(List> theValue) { + myTarget = theValue; + } + + /** + * Add a value for target (Types of resource (if a resource reference)) + * + *

+ * Definition: + * Types of resource (if a resource is referenced) + *

+ */ + public void addTarget(ResourceTypeEnum theValue) { + getTarget().add(new BoundCodeDt(ResourceTypeEnum.VALUESET_BINDER, theValue)); + } + + /** + * Sets the value(s), and clears any existing value(s) for target (Types of resource (if a resource reference)) + * + *

+ * Definition: + * Types of resource (if a resource is referenced) + *

+ */ + public void setTarget(ResourceTypeEnum theValue) { + getTarget().clear(); + addTarget(theValue); + } + + + + } + + + + /** + * Block class for child element: Profile.extensionDefn (Definition of an extension) + * + *

+ * Definition: + * An extension defined as part of the profile + *

+ */ + @Block(name="Profile.extensionDefn") + public static class ExtensionDefn extends BaseElement implements IResourceBlock { + + @Child(name="code", type=CodeDt.class, order=0, min=1, max=1) + private CodeDt myCode; + + @Child(name="display", type=StringDt.class, order=1, min=0, max=1) + private StringDt myDisplay; + + @Child(name="contextType", type=CodeDt.class, order=2, min=1, max=1) + private BoundCodeDt myContextType; + + @Child(name="context", type=StringDt.class, order=3, min=1, max=Child.MAX_UNLIMITED) + private List myContext; + + @Child(name="definition", type=StructureElementDefinition.class, order=4, min=1, max=1) + private StructureElementDefinition myDefinition; + + /** + * Gets the value(s) for code (Identifies the extension in this profile). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A unique code (within the profile) used to identify the extension + *

+ */ + public CodeDt getCode() { + if (myCode == null) { + myCode = new CodeDt(); + } + return myCode; + } + + /** + * Sets the value(s) for code (Identifies the extension in this profile) + * + *

+ * Definition: + * A unique code (within the profile) used to identify the extension + *

+ */ + public void setCode(CodeDt theValue) { + myCode = theValue; + } + + + /** + * Gets the value(s) for display (Use this name when displaying the value). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Defined so that applications can use this name when displaying the value of the extension to the user + *

+ */ + public StringDt getDisplay() { + if (myDisplay == null) { + myDisplay = new StringDt(); + } + return myDisplay; + } + + /** + * Sets the value(s) for display (Use this name when displaying the value) + * + *

+ * Definition: + * Defined so that applications can use this name when displaying the value of the extension to the user + *

+ */ + public void setDisplay(StringDt theValue) { + myDisplay = theValue; + } + + /** + * Sets the value(s) for display (Use this name when displaying the value) + * + *

+ * Definition: + * Defined so that applications can use this name when displaying the value of the extension to the user + *

+ */ + public void setDisplay( String theString) { + myDisplay = new StringDt(theString); + } + + /** + * Gets the value(s) for contextType (resource | datatype | mapping | extension). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Identifies the type of context to which the extension applies + *

+ */ + public BoundCodeDt getContextType() { + if (myContextType == null) { + myContextType = new BoundCodeDt(ExtensionContextEnum.VALUESET_BINDER); + } + return myContextType; + } + + /** + * Sets the value(s) for contextType (resource | datatype | mapping | extension) + * + *

+ * Definition: + * Identifies the type of context to which the extension applies + *

+ */ + public void setContextType(BoundCodeDt theValue) { + myContextType = theValue; + } + + /** + * Sets the value(s) for contextType (resource | datatype | mapping | extension) + * + *

+ * Definition: + * Identifies the type of context to which the extension applies + *

+ */ + public void setContextType(ExtensionContextEnum theValue) { + getContextType().setValueAsEnum(theValue); + } + + + /** + * Gets the value(s) for context (Where the extension can be used in instances). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Identifies the types of resource or data type elements to which the extension can be applied + *

+ */ + public List getContext() { + if (myContext == null) { + myContext = new ArrayList(); + } + return myContext; + } + + /** + * Sets the value(s) for context (Where the extension can be used in instances) + * + *

+ * Definition: + * Identifies the types of resource or data type elements to which the extension can be applied + *

+ */ + public void setContext(List theValue) { + myContext = theValue; + } + + /** + * Sets the value(s) for context (Where the extension can be used in instances) + * + *

+ * Definition: + * Identifies the types of resource or data type elements to which the extension can be applied + *

+ */ + public void addContext( String theString) { + if (myContext == null) { + myContext = new ArrayList(); + } + myContext.add(new StringDt(theString)); + } + + /** + * Gets the value(s) for definition (Definition of the extension and its content). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Definition of the extension and its content + *

+ */ + public StructureElementDefinition getDefinition() { + if (myDefinition == null) { + myDefinition = new StructureElementDefinition(); + } + return myDefinition; + } + + /** + * Sets the value(s) for definition (Definition of the extension and its content) + * + *

+ * Definition: + * Definition of the extension and its content + *

+ */ + public void setDefinition(StructureElementDefinition theValue) { + myDefinition = theValue; + } + + + + } + + + /** + * Block class for child element: Profile.query (Definition of a named query) + * + *

+ * Definition: + * Definition of a named query and its parameters and their meaning + *

+ */ + @Block(name="Profile.query") + public static class Query extends BaseElement implements IResourceBlock { + + @Child(name="name", type=StringDt.class, order=0, min=1, max=1) + private StringDt myName; + + @Child(name="documentation", type=StringDt.class, order=1, min=1, max=1) + private StringDt myDocumentation; + + @Child(name="parameter", type=StructureSearchParam.class, order=2, min=0, max=Child.MAX_UNLIMITED) + private List myParameter; + + /** + * Gets the value(s) for name (Special named queries (_query=)). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * The name of a query, which is used in the URI from Conformance statements declaring use of the query. Typically this will also be the name for the _query parameter when the query is called, though in some cases it may be aliased by a server to avoid collisions + *

+ */ + public StringDt getName() { + if (myName == null) { + myName = new StringDt(); + } + return myName; + } + + /** + * Sets the value(s) for name (Special named queries (_query=)) + * + *

+ * Definition: + * The name of a query, which is used in the URI from Conformance statements declaring use of the query. Typically this will also be the name for the _query parameter when the query is called, though in some cases it may be aliased by a server to avoid collisions + *

+ */ + public void setName(StringDt theValue) { + myName = theValue; + } + + /** + * Sets the value(s) for name (Special named queries (_query=)) + * + *

+ * Definition: + * The name of a query, which is used in the URI from Conformance statements declaring use of the query. Typically this will also be the name for the _query parameter when the query is called, though in some cases it may be aliased by a server to avoid collisions + *

+ */ + public void setName( String theString) { + myName = new StringDt(theString); + } + + /** + * Gets the value(s) for documentation (Describes the named query). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * Description of the query - the functionality it offers, and considerations about how it functions and to use it + *

+ */ + public StringDt getDocumentation() { + if (myDocumentation == null) { + myDocumentation = new StringDt(); + } + return myDocumentation; + } + + /** + * Sets the value(s) for documentation (Describes the named query) + * + *

+ * Definition: + * Description of the query - the functionality it offers, and considerations about how it functions and to use it + *

+ */ + public void setDocumentation(StringDt theValue) { + myDocumentation = theValue; + } + + /** + * Sets the value(s) for documentation (Describes the named query) + * + *

+ * Definition: + * Description of the query - the functionality it offers, and considerations about how it functions and to use it + *

+ */ + public void setDocumentation( String theString) { + myDocumentation = new StringDt(theString); + } + + /** + * Gets the value(s) for parameter (Parameter for the named query). + * creating it if it does + * not exist. Will not return null. + * + *

+ * Definition: + * A parameter of a named query + *

+ */ + public List getParameter() { + if (myParameter == null) { + myParameter = new ArrayList(); + } + return myParameter; + } + + /** + * Sets the value(s) for parameter (Parameter for the named query) + * + *

+ * Definition: + * A parameter of a named query + *

+ */ + public void setParameter(List theValue) { + myParameter = theValue; + } + + + + } + + + + +} \ No newline at end of file diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Specimen.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Specimen.java index 5837a2c4564..79168a0e1b8 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Specimen.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Specimen.java @@ -17,10 +17,12 @@ package ca.uhn.fhir.model.dstu.resource; import java.util.*; + import ca.uhn.fhir.model.api.*; import ca.uhn.fhir.model.api.annotation.*; import ca.uhn.fhir.model.primitive.*; import ca.uhn.fhir.model.dstu.composite.*; +import ca.uhn.fhir.model.dstu.valueset.*; /** * HAPI/FHIR Specimen Resource @@ -37,7 +39,7 @@ import ca.uhn.fhir.model.dstu.composite.*; *

*/ @ResourceDef(name="Specimen") -public class Specimen extends BaseElement implements IResource { +public class Specimen extends BaseResource implements IResource { @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=Child.MAX_UNLIMITED) private List myIdentifier; @@ -100,8 +102,8 @@ public class Specimen extends BaseElement implements IResource { public void setIdentifier(List theValue) { myIdentifier = theValue; } - - + + /** * Gets the value(s) for type (Kind of material that forms the specimen). * creating it if it does @@ -130,8 +132,8 @@ public class Specimen extends BaseElement implements IResource { public void setType(CodeableConceptDt theValue) { myType = theValue; } - - + + /** * Gets the value(s) for source (Parent of specimen). * creating it if it does @@ -160,8 +162,8 @@ public class Specimen extends BaseElement implements IResource { public void setSource(List theValue) { mySource = theValue; } - - + + /** * Gets the value(s) for subject (Where the specimen came from. This may be the patient(s) or from the environment or a device). * creating it if it does @@ -187,8 +189,8 @@ public class Specimen extends BaseElement implements IResource { public void setSubject(ResourceReference theValue) { mySubject = theValue; } - - + + /** * Gets the value(s) for accessionIdentifier (Identifier assigned by the lab). * creating it if it does @@ -217,8 +219,8 @@ public class Specimen extends BaseElement implements IResource { public void setAccessionIdentifier(IdentifierDt theValue) { myAccessionIdentifier = theValue; } - - + + /** * Gets the value(s) for receivedTime (The time when specimen was received for processing). * creating it if it does @@ -247,8 +249,8 @@ public class Specimen extends BaseElement implements IResource { public void setReceivedTime(DateTimeDt theValue) { myReceivedTime = theValue; } - - /** + + /** * Sets the value(s) for receivedTime (The time when specimen was received for processing) * *

@@ -288,8 +290,8 @@ public class Specimen extends BaseElement implements IResource { public void setCollection(Collection theValue) { myCollection = theValue; } - - + + /** * Gets the value(s) for treatment (Treatment and processing step details). * creating it if it does @@ -318,8 +320,8 @@ public class Specimen extends BaseElement implements IResource { public void setTreatment(List theValue) { myTreatment = theValue; } - - + + /** * Gets the value(s) for container (Direct container of specimen (tube/slide, etc)). * creating it if it does @@ -348,8 +350,8 @@ public class Specimen extends BaseElement implements IResource { public void setContainer(List theValue) { myContainer = theValue; } - - + + /** * Block class for child element: Specimen.source (Parent of specimen) * @@ -362,7 +364,7 @@ public class Specimen extends BaseElement implements IResource { public static class Source extends BaseElement implements IResourceBlock { @Child(name="relationship", type=CodeDt.class, order=0, min=1, max=1) - private CodeDt myRelationship; + private BoundCodeDt myRelationship; @Child(name="target", order=1, min=0, max=Child.MAX_UNLIMITED) @ChildResource(types= { @@ -380,9 +382,9 @@ public class Specimen extends BaseElement implements IResource { * Whether this relationship is to a parent or to a child *

*/ - public CodeDt getRelationship() { + public BoundCodeDt getRelationship() { if (myRelationship == null) { - myRelationship = new CodeDt(); + myRelationship = new BoundCodeDt(HierarchicalRelationshipTypeEnum.VALUESET_BINDER); } return myRelationship; } @@ -395,11 +397,23 @@ public class Specimen extends BaseElement implements IResource { * Whether this relationship is to a parent or to a child *

*/ - public void setRelationship(CodeDt theValue) { + public void setRelationship(BoundCodeDt theValue) { myRelationship = theValue; } - - + + /** + * Sets the value(s) for relationship (parent | child) + * + *

+ * Definition: + * Whether this relationship is to a parent or to a child + *

+ */ + public void setRelationship(HierarchicalRelationshipTypeEnum theValue) { + getRelationship().setValueAsEnum(theValue); + } + + /** * Gets the value(s) for target (The subject of the relationship). * creating it if it does @@ -428,8 +442,8 @@ public class Specimen extends BaseElement implements IResource { public void setTarget(List theValue) { myTarget = theValue; } - - + + } @@ -497,8 +511,8 @@ public class Specimen extends BaseElement implements IResource { public void setCollector(ResourceReference theValue) { myCollector = theValue; } - - + + /** * Gets the value(s) for comment (Collector comments). * creating it if it does @@ -527,8 +541,8 @@ public class Specimen extends BaseElement implements IResource { public void setComment(List theValue) { myComment = theValue; } - - /** + + /** * Sets the value(s) for comment (Collector comments) * *

@@ -568,8 +582,8 @@ public class Specimen extends BaseElement implements IResource { public void setCollected(IDatatype theValue) { myCollected = theValue; } - - + + /** * Gets the value(s) for quantity (The quantity of specimen collected). * creating it if it does @@ -598,8 +612,8 @@ public class Specimen extends BaseElement implements IResource { public void setQuantity(QuantityDt theValue) { myQuantity = theValue; } - - + + /** * Gets the value(s) for method (Technique used to perform collection). * creating it if it does @@ -628,8 +642,8 @@ public class Specimen extends BaseElement implements IResource { public void setMethod(CodeableConceptDt theValue) { myMethod = theValue; } - - + + /** * Gets the value(s) for sourceSite (Anatomical collection site). * creating it if it does @@ -658,8 +672,8 @@ public class Specimen extends BaseElement implements IResource { public void setSourceSite(CodeableConceptDt theValue) { mySourceSite = theValue; } - - + + } @@ -715,8 +729,8 @@ public class Specimen extends BaseElement implements IResource { public void setDescription(StringDt theValue) { myDescription = theValue; } - - /** + + /** * Sets the value(s) for description (Textual description of procedure) * *

@@ -756,8 +770,8 @@ public class Specimen extends BaseElement implements IResource { public void setProcedure(CodeableConceptDt theValue) { myProcedure = theValue; } - - + + /** * Gets the value(s) for additive (Material used in the processing step). * creating it if it does @@ -786,8 +800,8 @@ public class Specimen extends BaseElement implements IResource { public void setAdditive(List theValue) { myAdditive = theValue; } - - + + } @@ -852,8 +866,8 @@ public class Specimen extends BaseElement implements IResource { public void setIdentifier(List theValue) { myIdentifier = theValue; } - - + + /** * Gets the value(s) for description (Textual description of the container). * creating it if it does @@ -882,8 +896,8 @@ public class Specimen extends BaseElement implements IResource { public void setDescription(StringDt theValue) { myDescription = theValue; } - - /** + + /** * Sets the value(s) for description (Textual description of the container) * *

@@ -923,8 +937,8 @@ public class Specimen extends BaseElement implements IResource { public void setType(CodeableConceptDt theValue) { myType = theValue; } - - + + /** * Gets the value(s) for capacity (Container volume or size). * creating it if it does @@ -953,8 +967,8 @@ public class Specimen extends BaseElement implements IResource { public void setCapacity(QuantityDt theValue) { myCapacity = theValue; } - - + + /** * Gets the value(s) for specimenQuantity (Quantity of specimen within container). * creating it if it does @@ -983,8 +997,8 @@ public class Specimen extends BaseElement implements IResource { public void setSpecimenQuantity(QuantityDt theValue) { mySpecimenQuantity = theValue; } - - + + /** * Gets the value(s) for additive (Additive associated with container ). * creating it if it does @@ -1013,8 +1027,8 @@ public class Specimen extends BaseElement implements IResource { public void setAdditive(ResourceReference theValue) { myAdditive = theValue; } - - + + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Substance.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Substance.java index 3f8a04ef2af..813fe9eb984 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Substance.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Substance.java @@ -17,10 +17,12 @@ package ca.uhn.fhir.model.dstu.resource; import java.util.*; + import ca.uhn.fhir.model.api.*; import ca.uhn.fhir.model.api.annotation.*; import ca.uhn.fhir.model.primitive.*; import ca.uhn.fhir.model.dstu.composite.*; +import ca.uhn.fhir.model.dstu.valueset.*; /** * HAPI/FHIR Substance Resource @@ -37,7 +39,7 @@ import ca.uhn.fhir.model.dstu.composite.*; *

*/ @ResourceDef(name="Substance") -public class Substance extends BaseElement implements IResource { +public class Substance extends BaseResource implements IResource { @Child(name="type", type=CodeableConceptDt.class, order=0, min=1, max=1) private CodeableConceptDt myType; @@ -79,8 +81,8 @@ public class Substance extends BaseElement implements IResource { public void setType(CodeableConceptDt theValue) { myType = theValue; } - - + + /** * Gets the value(s) for description (Textual description of the substance, comments). * creating it if it does @@ -109,8 +111,8 @@ public class Substance extends BaseElement implements IResource { public void setDescription(StringDt theValue) { myDescription = theValue; } - - /** + + /** * Sets the value(s) for description (Textual description of the substance, comments) * *

@@ -150,8 +152,8 @@ public class Substance extends BaseElement implements IResource { public void setInstance(Instance theValue) { myInstance = theValue; } - - + + /** * Gets the value(s) for ingredient (Composition information about the substance). * creating it if it does @@ -180,8 +182,8 @@ public class Substance extends BaseElement implements IResource { public void setIngredient(List theValue) { myIngredient = theValue; } - - + + /** * Block class for child element: Substance.instance (If this describes a specific package/container of the substance) * @@ -230,8 +232,8 @@ public class Substance extends BaseElement implements IResource { public void setIdentifier(IdentifierDt theValue) { myIdentifier = theValue; } - - + + /** * Gets the value(s) for expiry (When no longer valid to use). * creating it if it does @@ -260,8 +262,8 @@ public class Substance extends BaseElement implements IResource { public void setExpiry(DateTimeDt theValue) { myExpiry = theValue; } - - /** + + /** * Sets the value(s) for expiry (When no longer valid to use) * *

@@ -301,8 +303,8 @@ public class Substance extends BaseElement implements IResource { public void setQuantity(QuantityDt theValue) { myQuantity = theValue; } - - + + } @@ -355,8 +357,8 @@ public class Substance extends BaseElement implements IResource { public void setQuantity(RatioDt theValue) { myQuantity = theValue; } - - + + /** * Gets the value(s) for substance (A component of the substance). * creating it if it does @@ -385,8 +387,8 @@ public class Substance extends BaseElement implements IResource { public void setSubstance(ResourceReference theValue) { mySubstance = theValue; } - - + + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ValueSet.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ValueSet.java index 7e07e87bf2f..3b65ca14f96 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ValueSet.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ValueSet.java @@ -21,6 +21,7 @@ import ca.uhn.fhir.model.api.*; import ca.uhn.fhir.model.api.annotation.*; import ca.uhn.fhir.model.primitive.*; import ca.uhn.fhir.model.dstu.composite.*; +import ca.uhn.fhir.model.dstu.valueset.*; /** * HAPI/FHIR ValueSet Resource @@ -61,7 +62,7 @@ public class ValueSet extends BaseResource implements IResource { private StringDt myCopyright; @Child(name="status", type=CodeDt.class, order=7, min=1, max=1) - private CodeDt myStatus; + private BoundCodeDt myStatus; @Child(name="experimental", type=BooleanDt.class, order=8, min=0, max=1) private BooleanDt myExperimental; @@ -109,8 +110,8 @@ public class ValueSet extends BaseResource implements IResource { public void setIdentifier(StringDt theValue) { myIdentifier = theValue; } - - /** + + /** * Sets the value(s) for identifier (Logical id to reference this value set) * *

@@ -150,8 +151,8 @@ public class ValueSet extends BaseResource implements IResource { public void setVersion(StringDt theValue) { myVersion = theValue; } - - /** + + /** * Sets the value(s) for version (Logical id for this version of the value set) * *

@@ -191,8 +192,8 @@ public class ValueSet extends BaseResource implements IResource { public void setName(StringDt theValue) { myName = theValue; } - - /** + + /** * Sets the value(s) for name (Informal name for this value set) * *

@@ -232,8 +233,8 @@ public class ValueSet extends BaseResource implements IResource { public void setPublisher(StringDt theValue) { myPublisher = theValue; } - - /** + + /** * Sets the value(s) for publisher (Name of the publisher (Organization or individual)) * *

@@ -273,8 +274,8 @@ public class ValueSet extends BaseResource implements IResource { public void setTelecom(List theValue) { myTelecom = theValue; } - - + + /** * Gets the value(s) for description (Human language description of the value set). * creating it if it does @@ -303,8 +304,8 @@ public class ValueSet extends BaseResource implements IResource { public void setDescription(StringDt theValue) { myDescription = theValue; } - - /** + + /** * Sets the value(s) for description (Human language description of the value set) * *

@@ -344,8 +345,8 @@ public class ValueSet extends BaseResource implements IResource { public void setCopyright(StringDt theValue) { myCopyright = theValue; } - - /** + + /** * Sets the value(s) for copyright (About the value set or its content) * *

@@ -368,9 +369,9 @@ public class ValueSet extends BaseResource implements IResource { * The status of the value set *

*/ - public CodeDt getStatus() { + public BoundCodeDt getStatus() { if (myStatus == null) { - myStatus = new CodeDt(); + myStatus = new BoundCodeDt(ValueSetStatusEnum.VALUESET_BINDER); } return myStatus; } @@ -384,11 +385,24 @@ public class ValueSet extends BaseResource implements IResource { * The status of the value set *

*/ - public void setStatus(CodeDt theValue) { + public void setStatus(BoundCodeDt theValue) { myStatus = theValue; } - - + + /** + * Sets the value(s) for status (draft | active | retired +) + * + *

+ * Definition: + * The status of the value set + *

+ */ + public void setStatus(ValueSetStatusEnum theValue) { + getStatus().setValueAsEnum(theValue); + } + + /** * Gets the value(s) for experimental (If for testing purposes, not real usage). * creating it if it does @@ -417,8 +431,8 @@ public class ValueSet extends BaseResource implements IResource { public void setExperimental(BooleanDt theValue) { myExperimental = theValue; } - - + + /** * Gets the value(s) for extensible (Whether this is intended to be used with an extensible binding). * creating it if it does @@ -447,8 +461,8 @@ public class ValueSet extends BaseResource implements IResource { public void setExtensible(BooleanDt theValue) { myExtensible = theValue; } - - + + /** * Gets the value(s) for date (Date for given status). * creating it if it does @@ -477,8 +491,8 @@ public class ValueSet extends BaseResource implements IResource { public void setDate(DateTimeDt theValue) { myDate = theValue; } - - /** + + /** * Sets the value(s) for date (Date for given status) * *

@@ -518,8 +532,8 @@ public class ValueSet extends BaseResource implements IResource { public void setDefine(Define theValue) { myDefine = theValue; } - - + + /** * Gets the value(s) for compose (When value set includes codes from elsewhere). * creating it if it does @@ -548,8 +562,8 @@ public class ValueSet extends BaseResource implements IResource { public void setCompose(Compose theValue) { myCompose = theValue; } - - + + /** * Gets the value(s) for expansion (When value set is an expansion). * creating it if it does @@ -578,8 +592,8 @@ public class ValueSet extends BaseResource implements IResource { public void setExpansion(Expansion theValue) { myExpansion = theValue; } - - + + /** * Block class for child element: ValueSet.define (When value set defines its own codes) * @@ -631,8 +645,8 @@ public class ValueSet extends BaseResource implements IResource { public void setSystem(UriDt theValue) { mySystem = theValue; } - - + + /** * Gets the value(s) for version (Version of this system). * creating it if it does @@ -661,8 +675,8 @@ public class ValueSet extends BaseResource implements IResource { public void setVersion(StringDt theValue) { myVersion = theValue; } - - /** + + /** * Sets the value(s) for version (Version of this system) * *

@@ -702,8 +716,8 @@ public class ValueSet extends BaseResource implements IResource { public void setCaseSensitive(BooleanDt theValue) { myCaseSensitive = theValue; } - - + + /** * Gets the value(s) for concept (Concepts in the code system). * creating it if it does @@ -732,8 +746,8 @@ public class ValueSet extends BaseResource implements IResource { public void setConcept(List theValue) { myConcept = theValue; } - - + + } @@ -791,8 +805,8 @@ public class ValueSet extends BaseResource implements IResource { public void setCode(CodeDt theValue) { myCode = theValue; } - - + + /** * Gets the value(s) for abstract (If this code is not for use as a real concept). * creating it if it does @@ -821,8 +835,8 @@ public class ValueSet extends BaseResource implements IResource { public void setAbstract(BooleanDt theValue) { myAbstract = theValue; } - - + + /** * Gets the value(s) for display (Text to Display to the user). * creating it if it does @@ -851,8 +865,8 @@ public class ValueSet extends BaseResource implements IResource { public void setDisplay(StringDt theValue) { myDisplay = theValue; } - - /** + + /** * Sets the value(s) for display (Text to Display to the user) * *

@@ -892,8 +906,8 @@ public class ValueSet extends BaseResource implements IResource { public void setDefinition(StringDt theValue) { myDefinition = theValue; } - - /** + + /** * Sets the value(s) for definition (Formal Definition) * *

@@ -933,8 +947,8 @@ public class ValueSet extends BaseResource implements IResource { public void setConcept(List theValue) { myConcept = theValue; } - - + + } @@ -988,8 +1002,8 @@ public class ValueSet extends BaseResource implements IResource { public void setImport(List theValue) { myImport = theValue; } - - + + /** * Gets the value(s) for include (Include one or more codes from a code system). * creating it if it does @@ -1018,8 +1032,8 @@ public class ValueSet extends BaseResource implements IResource { public void setInclude(List theValue) { myInclude = theValue; } - - + + /** * Gets the value(s) for exclude (Explicitly exclude codes). * creating it if it does @@ -1048,8 +1062,8 @@ public class ValueSet extends BaseResource implements IResource { public void setExclude(List theValue) { myExclude = theValue; } - - + + } @@ -1104,8 +1118,8 @@ public class ValueSet extends BaseResource implements IResource { public void setSystem(UriDt theValue) { mySystem = theValue; } - - + + /** * Gets the value(s) for version (Specific version of the code system referred to). * creating it if it does @@ -1134,8 +1148,8 @@ public class ValueSet extends BaseResource implements IResource { public void setVersion(StringDt theValue) { myVersion = theValue; } - - /** + + /** * Sets the value(s) for version (Specific version of the code system referred to) * *

@@ -1175,8 +1189,8 @@ public class ValueSet extends BaseResource implements IResource { public void setCode(List theValue) { myCode = theValue; } - - + + /** * Gets the value(s) for filter (Select codes/concepts by their properties (including relationships)). * creating it if it does @@ -1205,8 +1219,8 @@ public class ValueSet extends BaseResource implements IResource { public void setFilter(List theValue) { myFilter = theValue; } - - + + } @@ -1225,7 +1239,7 @@ public class ValueSet extends BaseResource implements IResource { private CodeDt myProperty; @Child(name="op", type=CodeDt.class, order=1, min=1, max=1) - private CodeDt myOp; + private BoundCodeDt myOp; @Child(name="value", type=CodeDt.class, order=2, min=1, max=1) private CodeDt myValue; @@ -1258,8 +1272,8 @@ public class ValueSet extends BaseResource implements IResource { public void setProperty(CodeDt theValue) { myProperty = theValue; } - - + + /** * Gets the value(s) for op (= | is-a | is-not-a | regex | in | not in). * creating it if it does @@ -1270,9 +1284,9 @@ public class ValueSet extends BaseResource implements IResource { * The kind of operation to perform as a part of the filter criteria *

*/ - public CodeDt getOp() { + public BoundCodeDt getOp() { if (myOp == null) { - myOp = new CodeDt(); + myOp = new BoundCodeDt(FilterOperatorEnum.VALUESET_BINDER); } return myOp; } @@ -1285,11 +1299,23 @@ public class ValueSet extends BaseResource implements IResource { * The kind of operation to perform as a part of the filter criteria *

*/ - public void setOp(CodeDt theValue) { + public void setOp(BoundCodeDt theValue) { myOp = theValue; } - - + + /** + * Sets the value(s) for op (= | is-a | is-not-a | regex | in | not in) + * + *

+ * Definition: + * The kind of operation to perform as a part of the filter criteria + *

+ */ + public void setOp(FilterOperatorEnum theValue) { + getOp().setValueAsEnum(theValue); + } + + /** * Gets the value(s) for value (Code from the system, or regex criteria). * creating it if it does @@ -1318,8 +1344,8 @@ public class ValueSet extends BaseResource implements IResource { public void setValue(CodeDt theValue) { myValue = theValue; } - - + + } @@ -1374,8 +1400,8 @@ public class ValueSet extends BaseResource implements IResource { public void setIdentifier(IdentifierDt theValue) { myIdentifier = theValue; } - - + + /** * Gets the value(s) for timestamp (Time valueset expansion happened). * creating it if it does @@ -1404,8 +1430,8 @@ public class ValueSet extends BaseResource implements IResource { public void setTimestamp(InstantDt theValue) { myTimestamp = theValue; } - - + + /** * Gets the value(s) for contains (Codes in the value set). * creating it if it does @@ -1434,8 +1460,8 @@ public class ValueSet extends BaseResource implements IResource { public void setContains(List theValue) { myContains = theValue; } - - + + } @@ -1490,8 +1516,8 @@ public class ValueSet extends BaseResource implements IResource { public void setSystem(UriDt theValue) { mySystem = theValue; } - - + + /** * Gets the value(s) for code (Code - if blank, this is not a choosable code). * creating it if it does @@ -1520,8 +1546,8 @@ public class ValueSet extends BaseResource implements IResource { public void setCode(CodeDt theValue) { myCode = theValue; } - - + + /** * Gets the value(s) for display (User display for the concept). * creating it if it does @@ -1550,8 +1576,8 @@ public class ValueSet extends BaseResource implements IResource { public void setDisplay(StringDt theValue) { myDisplay = theValue; } - - /** + + /** * Sets the value(s) for display (User display for the concept) * *

@@ -1591,8 +1617,8 @@ public class ValueSet extends BaseResource implements IResource { public void setContains(List theValue) { myContains = theValue; } - - + + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AddressUseEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AddressUseEnum.java new file mode 100644 index 00000000000..aac4fdcf65d --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AddressUseEnum.java @@ -0,0 +1,103 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum AddressUseEnum { + + /** + * home + * + * + * A communication address at a home. + */ + HOME("home"), + + /** + * work + * + * + * An office address. First choice for business related contacts during business hours. + */ + WORK("work"), + + /** + * temp + * + * + * A temporary address. The period can provide more detailed information. + */ + TEMP("temp"), + + /** + * old + * + * + * This address is no longer in use (or was never correct, but retained for records). + */ + OLD("old"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/address-use + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/address-use"; + + /** + * Name for this Value Set: + * AddressUse + */ + public static final String VALUESET_NAME = "AddressUse"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (AddressUseEnum next : AddressUseEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public AddressUseEnum forCode(String theCode) { + AddressUseEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(AddressUseEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public AddressUseEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + AddressUseEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AggregationModeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AggregationModeEnum.java new file mode 100644 index 00000000000..6f9543b2bef --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AggregationModeEnum.java @@ -0,0 +1,87 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum AggregationModeEnum { + + /** + * contained + * + * + * The reference is a local reference to a contained resource. + */ + CONTAINED("contained"), + + /** + * referenced + * + * + * The reference to to a resource that has to be resolved externally to the resource that includes the reference. + */ + REFERENCED("referenced"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/resource-aggregation-mode + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/resource-aggregation-mode"; + + /** + * Name for this Value Set: + * AggregationMode + */ + public static final String VALUESET_NAME = "AggregationMode"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (AggregationModeEnum next : AggregationModeEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public AggregationModeEnum forCode(String theCode) { + AggregationModeEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(AggregationModeEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public AggregationModeEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + AggregationModeEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AnimalSpeciesEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AnimalSpeciesEnum.java new file mode 100644 index 00000000000..addd67ad168 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/AnimalSpeciesEnum.java @@ -0,0 +1,95 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum AnimalSpeciesEnum { + + /** + * canislf + * Dog + * + * Canis lupus familiaris + */ + CANISLF("canislf"), + + /** + * ovisa + * Sheep + * + * Ovis aries + */ + OVISA("ovisa"), + + /** + * serinuscd + * Domestic Canary + * + * Serinus canaria domestica + */ + SERINUSCD("serinuscd"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/animal-species + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/animal-species"; + + /** + * Name for this Value Set: + * AnimalSpecies + */ + public static final String VALUESET_NAME = "AnimalSpecies"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (AnimalSpeciesEnum next : AnimalSpeciesEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public AnimalSpeciesEnum forCode(String theCode) { + AnimalSpeciesEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(AnimalSpeciesEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public AnimalSpeciesEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + AnimalSpeciesEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/BindingConformanceEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/BindingConformanceEnum.java new file mode 100644 index 00000000000..a96175aa3b5 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/BindingConformanceEnum.java @@ -0,0 +1,95 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum BindingConformanceEnum { + + /** + * required + * + * + * Only codes in the specified set are allowed. If the binding is extensible, other codes may be used for concepts not covered by the bound set of codes. + */ + REQUIRED("required"), + + /** + * preferred + * + * + * For greater interoperability, implementers are strongly encouraged to use the bound set of codes, however alternate codes may be used in derived profiles and implementations if necessary without being considered non-conformant. + */ + PREFERRED("preferred"), + + /** + * example + * + * + * The codes in the set are an example to illustrate the meaning of the field. There is no particular preference for its use nor any assertion that the provided values are sufficient to meet implementation needs. + */ + EXAMPLE("example"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/binding-conformance + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/binding-conformance"; + + /** + * Name for this Value Set: + * BindingConformance + */ + public static final String VALUESET_NAME = "BindingConformance"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (BindingConformanceEnum next : BindingConformanceEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public BindingConformanceEnum forCode(String theCode) { + BindingConformanceEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(BindingConformanceEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public BindingConformanceEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + BindingConformanceEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ConstraintSeverityEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ConstraintSeverityEnum.java new file mode 100644 index 00000000000..81120e2e67d --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ConstraintSeverityEnum.java @@ -0,0 +1,87 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum ConstraintSeverityEnum { + + /** + * error + * + * + * If the constraint is violated, the resource is not conformant. + */ + ERROR("error"), + + /** + * warning + * + * + * If the constraint is violated, the resource is conformant, but it is not necessarily following best practice. + */ + WARNING("warning"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/constraint-severity + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/constraint-severity"; + + /** + * Name for this Value Set: + * ConstraintSeverity + */ + public static final String VALUESET_NAME = "ConstraintSeverity"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (ConstraintSeverityEnum next : ConstraintSeverityEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public ConstraintSeverityEnum forCode(String theCode) { + ConstraintSeverityEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(ConstraintSeverityEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public ConstraintSeverityEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + ConstraintSeverityEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ContactSystemEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ContactSystemEnum.java new file mode 100644 index 00000000000..25b5eebc451 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ContactSystemEnum.java @@ -0,0 +1,103 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum ContactSystemEnum { + + /** + * phone + * + * + * 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("phone"), + + /** + * fax + * + * + * The value is a fax machine. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required. + */ + FAX("fax"), + + /** + * email + * + * + * The value is an email address. + */ + EMAIL("email"), + + /** + * url + * + * + * The value is a url. This is intended for various personal contacts including blogs, Twitter, Facebook, etc. Do not use for email addresses. + */ + URL("url"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/contact-system + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/contact-system"; + + /** + * Name for this Value Set: + * ContactSystem + */ + public static final String VALUESET_NAME = "ContactSystem"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (ContactSystemEnum next : ContactSystemEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public ContactSystemEnum forCode(String theCode) { + ContactSystemEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(ContactSystemEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public ContactSystemEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + ContactSystemEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ContactUseEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ContactUseEnum.java new file mode 100644 index 00000000000..6675c3a4390 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ContactUseEnum.java @@ -0,0 +1,111 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum ContactUseEnum { + + /** + * home + * + * + * A communication contact 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("home"), + + /** + * work + * + * + * An office contact. First choice for business related contacts during business hours. + */ + WORK("work"), + + /** + * temp + * + * + * A temporary contact. The period can provide more detailed information. + */ + TEMP("temp"), + + /** + * old + * + * + * This contact is no longer in use (or was never correct, but retained for records). + */ + OLD("old"), + + /** + * mobile + * + * + * 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("mobile"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/contact-use + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/contact-use"; + + /** + * Name for this Value Set: + * ContactUse + */ + public static final String VALUESET_NAME = "ContactUse"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (ContactUseEnum next : ContactUseEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public ContactUseEnum forCode(String theCode) { + ContactUseEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(ContactUseEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public ContactUseEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + ContactUseEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/DataTypeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/DataTypeEnum.java new file mode 100644 index 00000000000..9a41f37897b --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/DataTypeEnum.java @@ -0,0 +1,343 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum DataTypeEnum { + + /** + * Address + * + * + * There is a variety of postal address formats defined around the world. This format defines a superset that is the basis for all addresses around the world. + */ + ADDRESS("Address"), + + /** + * Age + * + * + * 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. + */ + AGE("Age"), + + /** + * Attachment + * + * + * For referring to data content defined in other formats. + */ + ATTACHMENT("Attachment"), + + /** + * CodeableConcept + * + * + * A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text. + */ + CODEABLECONCEPT("CodeableConcept"), + + /** + * Coding + * + * + * A reference to a code defined by a terminology system. + */ + CODING("Coding"), + + /** + * Contact + * + * + * All kinds of technology mediated contact details for a person or organization, including telephone, email, etc. + */ + CONTACT("Contact"), + + /** + * Count + * + * + * There SHALL be a code with a value of "1" if there is a value and it SHALL be an expression of length. If system is present, it SHALL be UCUM. If present, the value SHALL a whole number. + */ + COUNT("Count"), + + /** + * Distance + * + * + * There SHALL be a code if there is a value and it SHALL be an expression of length. If system is present, it SHALL be UCUM. + */ + DISTANCE("Distance"), + + /** + * Duration + * + * + * 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. + */ + DURATION("Duration"), + + /** + * Extension + * + * + * Optional Extensions Element - found in all resources. + */ + EXTENSION("Extension"), + + /** + * HumanName + * + * + * A human's name with the ability to identify parts and usage. + */ + HUMANNAME("HumanName"), + + /** + * Identifier + * + * + * A technical identifier - identifies some entity uniquely and unambiguously. + */ + IDENTIFIER("Identifier"), + + /** + * Money + * + * + * 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:std:iso:4217" - currency). + */ + MONEY("Money"), + + /** + * Narrative + * + * + * A human-readable formatted text, including images. + */ + NARRATIVE("Narrative"), + + /** + * Period + * + * + * A time period defined by a start and end date and optionally time. + */ + PERIOD("Period"), + + /** + * Quantity + * + * + * 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("Quantity"), + + /** + * Range + * + * + * A set of ordered Quantities defined by a low and high limit. + */ + RANGE("Range"), + + /** + * Ratio + * + * + * A relationship of two Quantity values - expressed as a numerator and a denominator. + */ + RATIO("Ratio"), + + /** + * ResourceReference + * + * + * A reference from one resource to another. + */ + RESOURCEREFERENCE("ResourceReference"), + + /** + * SampledData + * + * + * A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data. + */ + SAMPLEDDATA("SampledData"), + + /** + * Schedule + * + * + * Specifies an event that may occur multiple times. Schedules are used for to reord when things are expected or requested to occur. + */ + SCHEDULE("Schedule"), + + /** + * base64Binary + * + * + * A stream of bytes + */ + BASE64BINARY("base64Binary"), + + /** + * boolean + * + * + * Value of "true" or "false" + */ + BOOLEAN("boolean"), + + /** + * code + * + * + * 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("code"), + + /** + * date + * + * + * 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("date"), + + /** + * dateTime + * + * + * 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 may be provided but may also be ignored. Dates SHALL be valid dates. + */ + DATETIME("dateTime"), + + /** + * decimal + * + * + * A rational number with implicit precision + */ + DECIMAL("decimal"), + + /** + * id + * + * + * A whole number in the range 0 to 2^64-1, optionally represented in hex, a uuid, an oid or any other combination of lower-case letters a-z, numerals, "-" and ".", with a length limit of 36 characters + */ + ID("id"), + + /** + * instant + * + * + * An instant in time - known at least to the second + */ + INSTANT("instant"), + + /** + * integer + * + * + * A whole number + */ + INTEGER("integer"), + + /** + * oid + * + * + * An oid represented as a URI + */ + OID("oid"), + + /** + * string + * + * + * A sequence of Unicode characters + */ + STRING("string"), + + /** + * uri + * + * + * String of characters used to identify a name or a resource + */ + URI("uri"), + + /** + * uuid + * + * + * A UUID, represented as a URI + */ + UUID("uuid"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/data-types + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/data-types"; + + /** + * Name for this Value Set: + * DataType + */ + public static final String VALUESET_NAME = "DataType"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (DataTypeEnum next : DataTypeEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public DataTypeEnum forCode(String theCode) { + DataTypeEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(DataTypeEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public DataTypeEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + DataTypeEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ExtensionContextEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ExtensionContextEnum.java new file mode 100644 index 00000000000..7bd988408c6 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ExtensionContextEnum.java @@ -0,0 +1,103 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum ExtensionContextEnum { + + /** + * resource + * + * + * The context is all elements matching a particular resource element path. + */ + RESOURCE("resource"), + + /** + * datatype + * + * + * 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("datatype"), + + /** + * mapping + * + * + * The context is all nodes whose mapping to a specified reference model corresponds to a particular mapping structure. The context identifies the mapping target. The mapping should clearly identify where such an extension could be used. + */ + MAPPING("mapping"), + + /** + * extension + * + * + * The context is a particular extension from a particular profile. Expressed as uri#name, where uri identifies the profile and #name identifies the extension code. + */ + EXTENSION("extension"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/extension-context + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/extension-context"; + + /** + * Name for this Value Set: + * ExtensionContext + */ + public static final String VALUESET_NAME = "ExtensionContext"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (ExtensionContextEnum next : ExtensionContextEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public ExtensionContextEnum forCode(String theCode) { + ExtensionContextEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(ExtensionContextEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public ExtensionContextEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + ExtensionContextEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/FHIRDefinedTypeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/FHIRDefinedTypeEnum.java new file mode 100644 index 00000000000..2ec3ade09c2 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/FHIRDefinedTypeEnum.java @@ -0,0 +1,727 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum FHIRDefinedTypeEnum { + + /** + * Address + * + * + * There is a variety of postal address formats defined around the world. This format defines a superset that is the basis for all addresses around the world. + */ + ADDRESS("Address"), + + /** + * Age + * + * + * 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. + */ + AGE("Age"), + + /** + * Attachment + * + * + * For referring to data content defined in other formats. + */ + ATTACHMENT("Attachment"), + + /** + * CodeableConcept + * + * + * A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text. + */ + CODEABLECONCEPT("CodeableConcept"), + + /** + * Coding + * + * + * A reference to a code defined by a terminology system. + */ + CODING("Coding"), + + /** + * Contact + * + * + * All kinds of technology mediated contact details for a person or organization, including telephone, email, etc. + */ + CONTACT("Contact"), + + /** + * Count + * + * + * There SHALL be a code with a value of "1" if there is a value and it SHALL be an expression of length. If system is present, it SHALL be UCUM. If present, the value SHALL a whole number. + */ + COUNT("Count"), + + /** + * Distance + * + * + * There SHALL be a code if there is a value and it SHALL be an expression of length. If system is present, it SHALL be UCUM. + */ + DISTANCE("Distance"), + + /** + * Duration + * + * + * 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. + */ + DURATION("Duration"), + + /** + * Extension + * + * + * Optional Extensions Element - found in all resources. + */ + EXTENSION("Extension"), + + /** + * HumanName + * + * + * A human's name with the ability to identify parts and usage. + */ + HUMANNAME("HumanName"), + + /** + * Identifier + * + * + * A technical identifier - identifies some entity uniquely and unambiguously. + */ + IDENTIFIER("Identifier"), + + /** + * Money + * + * + * 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:std:iso:4217" - currency). + */ + MONEY("Money"), + + /** + * Narrative + * + * + * A human-readable formatted text, including images. + */ + NARRATIVE("Narrative"), + + /** + * Period + * + * + * A time period defined by a start and end date and optionally time. + */ + PERIOD("Period"), + + /** + * Quantity + * + * + * 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("Quantity"), + + /** + * Range + * + * + * A set of ordered Quantities defined by a low and high limit. + */ + RANGE("Range"), + + /** + * Ratio + * + * + * A relationship of two Quantity values - expressed as a numerator and a denominator. + */ + RATIO("Ratio"), + + /** + * ResourceReference + * + * + * A reference from one resource to another. + */ + RESOURCEREFERENCE("ResourceReference"), + + /** + * SampledData + * + * + * A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data. + */ + SAMPLEDDATA("SampledData"), + + /** + * Schedule + * + * + * Specifies an event that may occur multiple times. Schedules are used for to reord when things are expected or requested to occur. + */ + SCHEDULE("Schedule"), + + /** + * base64Binary + * + * + * A stream of bytes + */ + BASE64BINARY("base64Binary"), + + /** + * boolean + * + * + * Value of "true" or "false" + */ + BOOLEAN("boolean"), + + /** + * code + * + * + * 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("code"), + + /** + * date + * + * + * 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("date"), + + /** + * dateTime + * + * + * 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 may be provided but may also be ignored. Dates SHALL be valid dates. + */ + DATETIME("dateTime"), + + /** + * decimal + * + * + * A rational number with implicit precision + */ + DECIMAL("decimal"), + + /** + * id + * + * + * A whole number in the range 0 to 2^64-1, optionally represented in hex, a uuid, an oid or any other combination of lower-case letters a-z, numerals, "-" and ".", with a length limit of 36 characters + */ + ID("id"), + + /** + * instant + * + * + * An instant in time - known at least to the second + */ + INSTANT("instant"), + + /** + * integer + * + * + * A whole number + */ + INTEGER("integer"), + + /** + * oid + * + * + * An oid represented as a URI + */ + OID("oid"), + + /** + * string + * + * + * A sequence of Unicode characters + */ + STRING("string"), + + /** + * uri + * + * + * String of characters used to identify a name or a resource + */ + URI("uri"), + + /** + * uuid + * + * + * A UUID, represented as a URI + */ + UUID("uuid"), + + /** + * AdverseReaction + * + * + * Records an unexpected reaction suspected to be related to the exposure of the reaction subject to a substance. + */ + ADVERSEREACTION("AdverseReaction"), + + /** + * Alert + * + * + * Prospective warnings of potential issues when providing care to the patient. + */ + ALERT("Alert"), + + /** + * AllergyIntolerance + * + * + * Indicates the patient has a susceptibility to an adverse reaction upon exposure to a specified substance. + */ + ALLERGYINTOLERANCE("AllergyIntolerance"), + + /** + * CarePlan + * + * + * Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions. + */ + CAREPLAN("CarePlan"), + + /** + * Composition + * + * + * 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. + */ + COMPOSITION("Composition"), + + /** + * ConceptMap + * + * + * A statement of relationships from one set of concepts to one or more other concept systems. + */ + CONCEPTMAP("ConceptMap"), + + /** + * Condition + * + * + * 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("Condition"), + + /** + * Conformance + * + * + * A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation. + */ + CONFORMANCE("Conformance"), + + /** + * Device + * + * + * This resource identifies an instance of a manufactured thing that is used in the provision of healthcare without being substantially changed through that activity. The device may be a machine, an insert, a computer, an application, etc. This includes durable (reusable) medical equipment as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health. + */ + DEVICE("Device"), + + /** + * DeviceObservationReport + * + * + * Describes the data produced by a device at a point in time. + */ + DEVICEOBSERVATIONREPORT("DeviceObservationReport"), + + /** + * DiagnosticOrder + * + * + * A request for a diagnostic investigation service to be performed. + */ + DIAGNOSTICORDER("DiagnosticOrder"), + + /** + * DiagnosticReport + * + * + * 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 interpretation, and formatted representation of diagnostic reports. + */ + DIAGNOSTICREPORT("DiagnosticReport"), + + /** + * DocumentManifest + * + * + * A manifest that defines a set of documents. + */ + DOCUMENTMANIFEST("DocumentManifest"), + + /** + * DocumentReference + * + * + * A reference to a document. + */ + DOCUMENTREFERENCE("DocumentReference"), + + /** + * Encounter + * + * + * 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("Encounter"), + + /** + * FamilyHistory + * + * + * Significant health events and conditions for people related to the subject relevant in the context of care for the subject. + */ + FAMILYHISTORY("FamilyHistory"), + + /** + * Group + * + * + * 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("Group"), + + /** + * ImagingStudy + * + * + * Manifest of a set of images produced in study. The set of images may include every image in the study, or it may be an incomplete sample, such as a list of key images. + */ + IMAGINGSTUDY("ImagingStudy"), + + /** + * Immunization + * + * + * Immunization event information. + */ + IMMUNIZATION("Immunization"), + + /** + * ImmunizationRecommendation + * + * + * A patient's point-of-time immunization status and recommendation with optional supporting justification. + */ + IMMUNIZATIONRECOMMENDATION("ImmunizationRecommendation"), + + /** + * List + * + * + * A set of information summarized from a list of other resources. + */ + LIST("List"), + + /** + * Location + * + * + * Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained or accommodated. + */ + LOCATION("Location"), + + /** + * Media + * + * + * A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference. + */ + MEDIA("Media"), + + /** + * Medication + * + * + * Primarily used for identification and definition of Medication, but also covers ingredients and packaging. + */ + MEDICATION("Medication"), + + /** + * MedicationAdministration + * + * + * Describes the event of a patient being given a dose of 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("MedicationAdministration"), + + /** + * MedicationDispense + * + * + * Dispensing a medication to a named patient. This includes a description of the supply provided and the instructions for administering the medication. + */ + MEDICATIONDISPENSE("MedicationDispense"), + + /** + * MedicationPrescription + * + * + * An order for both supply of the medication and the instructions for administration of the medicine to a patient. + */ + MEDICATIONPRESCRIPTION("MedicationPrescription"), + + /** + * MedicationStatement + * + * + * A record of medication being taken by a patient, or that the medication has been given to a patient where the record is the result of a report from the patient or another clinician. + */ + MEDICATIONSTATEMENT("MedicationStatement"), + + /** + * MessageHeader + * + * + * The header for a message exchange that is either requesting or responding to an action. The resource(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("MessageHeader"), + + /** + * Observation + * + * + * Measurements and simple assertions made about a patient, device or other subject. + */ + OBSERVATION("Observation"), + + /** + * OperationOutcome + * + * + * A collection of error, warning or information messages that result from a system action. + */ + OPERATIONOUTCOME("OperationOutcome"), + + /** + * Order + * + * + * A request to perform an action. + */ + ORDER("Order"), + + /** + * OrderResponse + * + * + * A response to an order. + */ + ORDERRESPONSE("OrderResponse"), + + /** + * Organization + * + * + * A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc. + */ + ORGANIZATION("Organization"), + + /** + * Other + * + * + * Other is a conformant for handling resource concepts not yet defined for FHIR or outside HL7's scope of interest. + */ + OTHER("Other"), + + /** + * Patient + * + * + * Demographics and other administrative information about a person or animal receiving care or other health-related services. + */ + PATIENT("Patient"), + + /** + * Practitioner + * + * + * A person who is directly or indirectly involved in the provisioning of healthcare. + */ + PRACTITIONER("Practitioner"), + + /** + * Procedure + * + * + * An action that is performed on a patient. This can be a physical 'thing' like an operation, or less invasive like counseling or hypnotherapy. + */ + PROCEDURE("Procedure"), + + /** + * Profile + * + * + * A Resource Profile - a statement of use of one or more FHIR Resources. It may include constraints on Resources and Data Types, Terminology Binding Statements and Extension Definitions. + */ + PROFILE("Profile"), + + /** + * Provenance + * + * + * Provenance information that describes the activity that led to the creation of a set of resources. This information can be used to help determine their reliability or trace where the information in them came from. The focus of the provenance resource is record keeping, audit and traceability, and not explicit statements of clinical significance. + */ + PROVENANCE("Provenance"), + + /** + * Query + * + * + * A description of a query with a set of parameters. + */ + QUERY("Query"), + + /** + * Questionnaire + * + * + * A structured set of questions and their answers. The Questionnaire may contain questions, answers or both. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. + */ + QUESTIONNAIRE("Questionnaire"), + + /** + * RelatedPerson + * + * + * 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("RelatedPerson"), + + /** + * SecurityEvent + * + * + * 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. + */ + SECURITYEVENT("SecurityEvent"), + + /** + * Specimen + * + * + * Sample for analysis. + */ + SPECIMEN("Specimen"), + + /** + * Substance + * + * + * A homogeneous material with a definite composition. + */ + SUBSTANCE("Substance"), + + /** + * Supply + * + * + * A supply - a request for something, and provision of what is supplied. + */ + SUPPLY("Supply"), + + /** + * ValueSet + * + * + * A value set specifies a set of codes drawn from one or more code systems. + */ + VALUESET("ValueSet"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/defined-types + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/defined-types"; + + /** + * Name for this Value Set: + * FHIRDefinedType + */ + public static final String VALUESET_NAME = "FHIRDefinedType"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (FHIRDefinedTypeEnum next : FHIRDefinedTypeEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public FHIRDefinedTypeEnum forCode(String theCode) { + FHIRDefinedTypeEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(FHIRDefinedTypeEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public FHIRDefinedTypeEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + FHIRDefinedTypeEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/FilterOperatorEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/FilterOperatorEnum.java new file mode 100644 index 00000000000..00fa9778962 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/FilterOperatorEnum.java @@ -0,0 +1,119 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum FilterOperatorEnum { + + /** + * = + * + * + * The property value has the concept specified by the value. + */ + EQUALS("="), + + /** + * is-a + * + * + * The property value has a concept that has an is-a relationship with the value. + */ + IS_A("is-a"), + + /** + * is-not-a + * + * + * The property value has a concept that does not have an is-a relationship with the value. + */ + IS_NOT_A("is-not-a"), + + /** + * regex + * + * + * The property value representation matches the regex specified in the value. + */ + REGEX("regex"), + + /** + * in + * + * + * The property value is in the set of codes or concepts identified by the value. + */ + IN("in"), + + /** + * not in + * + * + * The property value is not in the set of codes or concepts identified by the value. + */ + NOT_IN("not in"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/filter-operator + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/filter-operator"; + + /** + * Name for this Value Set: + * FilterOperator + */ + public static final String VALUESET_NAME = "FilterOperator"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (FilterOperatorEnum next : FilterOperatorEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public FilterOperatorEnum forCode(String theCode) { + FilterOperatorEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(FilterOperatorEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public FilterOperatorEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + FilterOperatorEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/GroupTypeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/GroupTypeEnum.java new file mode 100644 index 00000000000..d09e84573f3 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/GroupTypeEnum.java @@ -0,0 +1,119 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum GroupTypeEnum { + + /** + * person + * + * + * Group contains "person" Patient resources. + */ + PERSON("person"), + + /** + * animal + * + * + * Group contains "animal" Patient resources. + */ + ANIMAL("animal"), + + /** + * practitioner + * + * + * Group contains healthcare practitioner resources. + */ + PRACTITIONER("practitioner"), + + /** + * device + * + * + * Group contains Device resources. + */ + DEVICE("device"), + + /** + * medication + * + * + * Group contains Medication resources. + */ + MEDICATION("medication"), + + /** + * substance + * + * + * Group contains Substance resources. + */ + SUBSTANCE("substance"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/group-type + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/group-type"; + + /** + * Name for this Value Set: + * GroupType + */ + public static final String VALUESET_NAME = "GroupType"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (GroupTypeEnum next : GroupTypeEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public GroupTypeEnum forCode(String theCode) { + GroupTypeEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(GroupTypeEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public GroupTypeEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + GroupTypeEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/HierarchicalRelationshipTypeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/HierarchicalRelationshipTypeEnum.java new file mode 100644 index 00000000000..b2b6b5ae9b8 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/HierarchicalRelationshipTypeEnum.java @@ -0,0 +1,87 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum HierarchicalRelationshipTypeEnum { + + /** + * parent + * Parent + * + * The target resource is the parent of the focal specimen resource. + */ + PARENT("parent"), + + /** + * child + * Child + * + * The target resource is the child of the focal specimen resource. + */ + CHILD("child"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/hierarchical-relationship-type + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/hierarchical-relationship-type"; + + /** + * Name for this Value Set: + * HierarchicalRelationshipType + */ + public static final String VALUESET_NAME = "HierarchicalRelationshipType"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (HierarchicalRelationshipTypeEnum next : HierarchicalRelationshipTypeEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public HierarchicalRelationshipTypeEnum forCode(String theCode) { + HierarchicalRelationshipTypeEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(HierarchicalRelationshipTypeEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public HierarchicalRelationshipTypeEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + HierarchicalRelationshipTypeEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/IdentifierUseEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/IdentifierUseEnum.java new file mode 100644 index 00000000000..9f783273918 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/IdentifierUseEnum.java @@ -0,0 +1,103 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum IdentifierUseEnum { + + /** + * usual + * + * + * the identifier recommended for display and use in real-world interactions. + */ + USUAL("usual"), + + /** + * official + * + * + * the identifier considered to be most trusted for the identification of this item. + */ + OFFICIAL("official"), + + /** + * temp + * + * + * A temporary identifier. + */ + TEMP("temp"), + + /** + * secondary + * + * + * 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("secondary"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/identifier-use + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/identifier-use"; + + /** + * Name for this Value Set: + * IdentifierUse + */ + public static final String VALUESET_NAME = "IdentifierUse"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (IdentifierUseEnum next : IdentifierUseEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public IdentifierUseEnum forCode(String theCode) { + IdentifierUseEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(IdentifierUseEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public IdentifierUseEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + IdentifierUseEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LinkTypeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LinkTypeEnum.java new file mode 100644 index 00000000000..c44daebddfe --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LinkTypeEnum.java @@ -0,0 +1,95 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum LinkTypeEnum { + + /** + * replace + * + * + * The patient resource containing this link must no longer be used. The link points forward to another patient resource that must be used in lieu of the patient resource that contains the link. + */ + REPLACE("replace"), + + /** + * refer + * + * + * 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("refer"), + + /** + * seealso + * + * + * 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("seealso"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/link-type + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/link-type"; + + /** + * Name for this Value Set: + * LinkType + */ + public static final String VALUESET_NAME = "LinkType"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (LinkTypeEnum next : LinkTypeEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public LinkTypeEnum forCode(String theCode) { + LinkTypeEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(LinkTypeEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public LinkTypeEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + LinkTypeEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LocationModeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LocationModeEnum.java new file mode 100644 index 00000000000..536c2ba307d --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LocationModeEnum.java @@ -0,0 +1,87 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum LocationModeEnum { + + /** + * instance + * + * + * The Location resource represents a specific instance of a Location. + */ + INSTANCE("instance"), + + /** + * kind + * + * + * The Location represents a class of Locations. + */ + KIND("kind"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/location-mode + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/location-mode"; + + /** + * Name for this Value Set: + * LocationMode + */ + public static final String VALUESET_NAME = "LocationMode"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (LocationModeEnum next : LocationModeEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public LocationModeEnum forCode(String theCode) { + LocationModeEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(LocationModeEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public LocationModeEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + LocationModeEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LocationStatusEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LocationStatusEnum.java new file mode 100644 index 00000000000..1c4ec949a0d --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LocationStatusEnum.java @@ -0,0 +1,95 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum LocationStatusEnum { + + /** + * active + * + * + * The location is operational. + */ + ACTIVE("active"), + + /** + * suspended + * + * + * The location is temporarily closed. + */ + SUSPENDED("suspended"), + + /** + * inactive + * + * + * The location is no longer used. + */ + INACTIVE("inactive"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/location-status + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/location-status"; + + /** + * Name for this Value Set: + * LocationStatus + */ + public static final String VALUESET_NAME = "LocationStatus"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (LocationStatusEnum next : LocationStatusEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public LocationStatusEnum forCode(String theCode) { + LocationStatusEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(LocationStatusEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public LocationStatusEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + LocationStatusEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LocationTypeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LocationTypeEnum.java new file mode 100644 index 00000000000..922e2fc8ea3 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/LocationTypeEnum.java @@ -0,0 +1,135 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum LocationTypeEnum { + + /** + * bu + * Building + * + * + */ + BU("bu"), + + /** + * wi + * Wing + * + * + */ + WI("wi"), + + /** + * co + * Corridor + * + * + */ + CO("co"), + + /** + * ro + * Room + * + * + */ + RO("ro"), + + /** + * ve + * Vehicle + * + * + */ + VE("ve"), + + /** + * ho + * House + * + * + */ + HO("ho"), + + /** + * ca + * Cabinet + * + * + */ + CA("ca"), + + /** + * rd + * Road + * + * + */ + RD("rd"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/location-physical-type + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/location-physical-type"; + + /** + * Name for this Value Set: + * LocationType + */ + public static final String VALUESET_NAME = "LocationType"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (LocationTypeEnum next : LocationTypeEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public LocationTypeEnum forCode(String theCode) { + LocationTypeEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(LocationTypeEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public LocationTypeEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + LocationTypeEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/MedicationKindEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/MedicationKindEnum.java new file mode 100644 index 00000000000..7ee1745dd6c --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/MedicationKindEnum.java @@ -0,0 +1,87 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum MedicationKindEnum { + + /** + * product + * + * + * The medication is a product. + */ + PRODUCT("product"), + + /** + * package + * + * + * The medication is a package - a contained group of one of more products. + */ + PACKAGE("package"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/medication-kind + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/medication-kind"; + + /** + * Name for this Value Set: + * MedicationKind + */ + public static final String VALUESET_NAME = "MedicationKind"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (MedicationKindEnum next : MedicationKindEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public MedicationKindEnum forCode(String theCode) { + MedicationKindEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(MedicationKindEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public MedicationKindEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + MedicationKindEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/NameUseEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/NameUseEnum.java new file mode 100644 index 00000000000..5ebb1f862a2 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/NameUseEnum.java @@ -0,0 +1,127 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum NameUseEnum { + + /** + * usual + * + * + * Known as/conventional/the one you normally use. + */ + USUAL("usual"), + + /** + * official + * + * + * The formal name as registered in an official (government) registry, but which name might not be commonly used. May be called "legal name". + */ + OFFICIAL("official"), + + /** + * temp + * + * + * 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("temp"), + + /** + * nickname + * + * + * A name that is used to address the person in an informal manner, but is not part of their formal or usual name. + */ + NICKNAME("nickname"), + + /** + * anonymous + * + * + * Anonymous assigned name, alias, or pseudonym (used to protect a person's identity for privacy reasons). + */ + ANONYMOUS("anonymous"), + + /** + * old + * + * + * This name is no longer in use (or was never correct, but retained for records). + */ + OLD("old"), + + /** + * maiden + * + * + * 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("maiden"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/name-use + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/name-use"; + + /** + * Name for this Value Set: + * NameUse + */ + public static final String VALUESET_NAME = "NameUse"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (NameUseEnum next : NameUseEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public NameUseEnum forCode(String theCode) { + NameUseEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(NameUseEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public NameUseEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + NameUseEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/NarrativeStatusEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/NarrativeStatusEnum.java new file mode 100644 index 00000000000..e1fd07695d8 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/NarrativeStatusEnum.java @@ -0,0 +1,103 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum NarrativeStatusEnum { + + /** + * generated + * + * + * The contents of the narrative are entirely generated from the structured data in the resource. + */ + GENERATED("generated"), + + /** + * extensions + * + * + * The contents of the narrative are entirely generated from the structured data in the resource and some of the content is generated from extensions. + */ + EXTENSIONS("extensions"), + + /** + * additional + * + * + * The contents of the narrative contain additional information not found in the structured data. + */ + ADDITIONAL("additional"), + + /** + * empty + * + * + * the contents of the narrative are some equivalent of "No human-readable text provided for this resource". + */ + EMPTY("empty"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/narrative-status + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/narrative-status"; + + /** + * Name for this Value Set: + * NarrativeStatus + */ + public static final String VALUESET_NAME = "NarrativeStatus"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (NarrativeStatusEnum next : NarrativeStatusEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public NarrativeStatusEnum forCode(String theCode) { + NarrativeStatusEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(NarrativeStatusEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public NarrativeStatusEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + NarrativeStatusEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ObservationRelationshipTypeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ObservationRelationshipTypeEnum.java new file mode 100644 index 00000000000..9d781b17635 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ObservationRelationshipTypeEnum.java @@ -0,0 +1,127 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum ObservationRelationshipTypeEnum { + + /** + * has-component + * + * + * The target observation is a component of this observation (e.g. Systolic and Diastolic Blood Pressure). + */ + HAS_COMPONENT("has-component"), + + /** + * has-member + * + * + * 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. + */ + HAS_MEMBER("has-member"), + + /** + * derived-from + * + * + * The target observation is part of the information from which this observation value is derived (e.g. calculated anion gap, Apgar score). + */ + DERIVED_FROM("derived-from"), + + /** + * sequel-to + * + * + * This observation follows the target observation (e.g. timed tests such as Glucose Tolerance Test). + */ + SEQUEL_TO("sequel-to"), + + /** + * replaces + * + * + * This observation replaces a previous observation (i.e. a revised value). The target observation is now obsolete. + */ + REPLACES("replaces"), + + /** + * qualified-by + * + * + * The value of the target observation qualifies (refines) the semantics of the source observation (e.g. a lipaemia measure target from a plasma measure). + */ + QUALIFIED_BY("qualified-by"), + + /** + * interfered-by + * + * + * The value of the target observation interferes (degardes 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). + */ + INTERFERED_BY("interfered-by"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/observation-relationshiptypes + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/observation-relationshiptypes"; + + /** + * Name for this Value Set: + * ObservationRelationshipType + */ + public static final String VALUESET_NAME = "ObservationRelationshipType"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (ObservationRelationshipTypeEnum next : ObservationRelationshipTypeEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public ObservationRelationshipTypeEnum forCode(String theCode) { + ObservationRelationshipTypeEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(ObservationRelationshipTypeEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public ObservationRelationshipTypeEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + ObservationRelationshipTypeEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ObservationReliabilityEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ObservationReliabilityEnum.java new file mode 100644 index 00000000000..2394f3d8537 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ObservationReliabilityEnum.java @@ -0,0 +1,127 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum ObservationReliabilityEnum { + + /** + * ok + * + * + * The result has no reliability concerns. + */ + OK("ok"), + + /** + * ongoing + * + * + * An early estimate of value; measurement is still occurring. + */ + ONGOING("ongoing"), + + /** + * early + * + * + * An early estimate of value; processing is still occurring. + */ + EARLY("early"), + + /** + * questionable + * + * + * The observation value should be treated with care. + */ + QUESTIONABLE("questionable"), + + /** + * calibrating + * + * + * The result has been generated while calibration is occurring. + */ + CALIBRATING("calibrating"), + + /** + * error + * + * + * The observation could not be completed because of an error. + */ + ERROR("error"), + + /** + * unknown + * + * + * No observation value was available. + */ + UNKNOWN("unknown"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/observation-reliability + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/observation-reliability"; + + /** + * Name for this Value Set: + * ObservationReliability + */ + public static final String VALUESET_NAME = "ObservationReliability"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (ObservationReliabilityEnum next : ObservationReliabilityEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public ObservationReliabilityEnum forCode(String theCode) { + ObservationReliabilityEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(ObservationReliabilityEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public ObservationReliabilityEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + ObservationReliabilityEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ObservationStatusEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ObservationStatusEnum.java new file mode 100644 index 00000000000..01abdf51d69 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ObservationStatusEnum.java @@ -0,0 +1,119 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum ObservationStatusEnum { + + /** + * registered + * + * + * The existence of the observation is registered, but there is no result yet available. + */ + REGISTERED("registered"), + + /** + * preliminary + * + * + * This is an initial or interim observation: data may be incomplete or unverified. + */ + PRELIMINARY("preliminary"), + + /** + * final + * + * + * The observation is complete and verified by an authorized person. + */ + FINAL("final"), + + /** + * amended + * + * + * The observation has been modified subsequent to being Final, and is complete and verified by an authorized person. + */ + AMENDED("amended"), + + /** + * cancelled + * + * + * The observation is unavailable because the measurement was not started or not completed (also sometimes called "aborted"). + */ + CANCELLED("cancelled"), + + /** + * entered in error + * + * + * The observation has been withdrawn following previous Final release. + */ + ENTERED_IN_ERROR("entered in error"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/observation-status + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/observation-status"; + + /** + * Name for this Value Set: + * ObservationStatus + */ + public static final String VALUESET_NAME = "ObservationStatus"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (ObservationStatusEnum next : ObservationStatusEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public ObservationStatusEnum forCode(String theCode) { + ObservationStatusEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(ObservationStatusEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public ObservationStatusEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + ObservationStatusEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/OrganizationTypeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/OrganizationTypeEnum.java new file mode 100644 index 00000000000..5582303d055 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/OrganizationTypeEnum.java @@ -0,0 +1,143 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum OrganizationTypeEnum { + + /** + * prov + * Healthcare Provider + * + * + */ + PROV("prov"), + + /** + * dept + * Hospital Department + * + * + */ + DEPT("dept"), + + /** + * icu + * Intensive Care Unit + * + * + */ + ICU("icu"), + + /** + * team + * Organizational team + * + * + */ + TEAM("team"), + + /** + * fed + * Federal Government + * + * + */ + FED("fed"), + + /** + * ins + * Insurance Company + * + * + */ + INS("ins"), + + /** + * edu + * Educational Institute + * + * + */ + EDU("edu"), + + /** + * reli + * Religious Institution + * + * + */ + RELI("reli"), + + /** + * pharm + * Pharmacy + * + * + */ + PHARM("pharm"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/organization-type + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/organization-type"; + + /** + * Name for this Value Set: + * OrganizationType + */ + public static final String VALUESET_NAME = "OrganizationType"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (OrganizationTypeEnum next : OrganizationTypeEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public OrganizationTypeEnum forCode(String theCode) { + OrganizationTypeEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(OrganizationTypeEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public OrganizationTypeEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + OrganizationTypeEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/PractitionerRoleEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/PractitionerRoleEnum.java new file mode 100644 index 00000000000..96907e0e411 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/PractitionerRoleEnum.java @@ -0,0 +1,119 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum PractitionerRoleEnum { + + /** + * doctor + * + * + * + */ + DOCTOR("doctor"), + + /** + * nurse + * + * + * + */ + NURSE("nurse"), + + /** + * pharmacist + * + * + * + */ + PHARMACIST("pharmacist"), + + /** + * researcher + * + * + * + */ + RESEARCHER("researcher"), + + /** + * teacher + * Teacher/educator + * + * + */ + TEACHER("teacher"), + + /** + * ict + * ICT professional + * + * + */ + ICT("ict"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/practitioner-role + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/practitioner-role"; + + /** + * Name for this Value Set: + * PractitionerRole + */ + public static final String VALUESET_NAME = "PractitionerRole"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (PractitionerRoleEnum next : PractitionerRoleEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public PractitionerRoleEnum forCode(String theCode) { + PractitionerRoleEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(PractitionerRoleEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public PractitionerRoleEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + PractitionerRoleEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/PractitionerSpecialtyEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/PractitionerSpecialtyEnum.java new file mode 100644 index 00000000000..83eb580894e --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/PractitionerSpecialtyEnum.java @@ -0,0 +1,111 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum PractitionerSpecialtyEnum { + + /** + * cardio + * Cardiologist + * + * + */ + CARDIO("cardio"), + + /** + * dent + * Dentist + * + * + */ + DENT("dent"), + + /** + * dietary + * Dietary consultant + * + * + */ + DIETARY("dietary"), + + /** + * midw + * Midwife + * + * + */ + MIDW("midw"), + + /** + * sysarch + * Systems architect + * + * + */ + SYSARCH("sysarch"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/practitioner-specialty + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/practitioner-specialty"; + + /** + * Name for this Value Set: + * PractitionerSpecialty + */ + public static final String VALUESET_NAME = "PractitionerSpecialty"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (PractitionerSpecialtyEnum next : PractitionerSpecialtyEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public PractitionerSpecialtyEnum forCode(String theCode) { + PractitionerSpecialtyEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(PractitionerSpecialtyEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public PractitionerSpecialtyEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + PractitionerSpecialtyEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/PropertyRepresentationEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/PropertyRepresentationEnum.java new file mode 100644 index 00000000000..2588f6f0bbd --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/PropertyRepresentationEnum.java @@ -0,0 +1,79 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum PropertyRepresentationEnum { + + /** + * xmlAttr + * + * + * In XML, this property is represented as an attribute not an element. + */ + XMLATTR("xmlAttr"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/property-representation + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/property-representation"; + + /** + * Name for this Value Set: + * PropertyRepresentation + */ + public static final String VALUESET_NAME = "PropertyRepresentation"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (PropertyRepresentationEnum next : PropertyRepresentationEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public PropertyRepresentationEnum forCode(String theCode) { + PropertyRepresentationEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(PropertyRepresentationEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public PropertyRepresentationEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + PropertyRepresentationEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/QuantityCompararatorEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/QuantityCompararatorEnum.java new file mode 100644 index 00000000000..cea041a8218 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/QuantityCompararatorEnum.java @@ -0,0 +1,103 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum QuantityCompararatorEnum { + + /** + * < + * + * + * The actual value is less than the given value. + */ + LESSTHAN("<"), + + /** + * <= + * + * + * The actual value is less than or equal to the given value. + */ + LESSTHAN_OR_EQUALS("<="), + + /** + * >= + * + * + * The actual value is greater than or equal to the given value. + */ + GREATERTHAN_OR_EQUALS(">="), + + /** + * > + * + * + * The actual value is greater than the given value. + */ + GREATERTHAN(">"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/quantity-comparator + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/quantity-comparator"; + + /** + * Name for this Value Set: + * QuantityCompararator + */ + public static final String VALUESET_NAME = "QuantityCompararator"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (QuantityCompararatorEnum next : QuantityCompararatorEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public QuantityCompararatorEnum forCode(String theCode) { + QuantityCompararatorEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(QuantityCompararatorEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public QuantityCompararatorEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + QuantityCompararatorEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ResourceProfileStatusEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ResourceProfileStatusEnum.java new file mode 100644 index 00000000000..13ea900feb7 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ResourceProfileStatusEnum.java @@ -0,0 +1,95 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum ResourceProfileStatusEnum { + + /** + * draft + * + * + * This profile is still under development. + */ + DRAFT("draft"), + + /** + * active + * + * + * This profile is ready for normal use. + */ + ACTIVE("active"), + + /** + * retired + * + * + * This profile has been deprecated, withdrawn or superseded and should no longer be used. + */ + RETIRED("retired"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/resource-profile-status + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/resource-profile-status"; + + /** + * Name for this Value Set: + * ResourceProfileStatus + */ + public static final String VALUESET_NAME = "ResourceProfileStatus"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (ResourceProfileStatusEnum next : ResourceProfileStatusEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public ResourceProfileStatusEnum forCode(String theCode) { + ResourceProfileStatusEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(ResourceProfileStatusEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public ResourceProfileStatusEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + ResourceProfileStatusEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ResourceTypeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ResourceTypeEnum.java new file mode 100644 index 00000000000..a6fbc2414bc --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ResourceTypeEnum.java @@ -0,0 +1,455 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum ResourceTypeEnum { + + /** + * AdverseReaction + * + * + * Records an unexpected reaction suspected to be related to the exposure of the reaction subject to a substance. + */ + ADVERSEREACTION("AdverseReaction"), + + /** + * Alert + * + * + * Prospective warnings of potential issues when providing care to the patient. + */ + ALERT("Alert"), + + /** + * AllergyIntolerance + * + * + * Indicates the patient has a susceptibility to an adverse reaction upon exposure to a specified substance. + */ + ALLERGYINTOLERANCE("AllergyIntolerance"), + + /** + * CarePlan + * + * + * Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions. + */ + CAREPLAN("CarePlan"), + + /** + * Composition + * + * + * 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. + */ + COMPOSITION("Composition"), + + /** + * ConceptMap + * + * + * A statement of relationships from one set of concepts to one or more other concept systems. + */ + CONCEPTMAP("ConceptMap"), + + /** + * Condition + * + * + * 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("Condition"), + + /** + * Conformance + * + * + * A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation. + */ + CONFORMANCE("Conformance"), + + /** + * Device + * + * + * This resource identifies an instance of a manufactured thing that is used in the provision of healthcare without being substantially changed through that activity. The device may be a machine, an insert, a computer, an application, etc. This includes durable (reusable) medical equipment as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health. + */ + DEVICE("Device"), + + /** + * DeviceObservationReport + * + * + * Describes the data produced by a device at a point in time. + */ + DEVICEOBSERVATIONREPORT("DeviceObservationReport"), + + /** + * DiagnosticOrder + * + * + * A request for a diagnostic investigation service to be performed. + */ + DIAGNOSTICORDER("DiagnosticOrder"), + + /** + * DiagnosticReport + * + * + * 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 interpretation, and formatted representation of diagnostic reports. + */ + DIAGNOSTICREPORT("DiagnosticReport"), + + /** + * DocumentManifest + * + * + * A manifest that defines a set of documents. + */ + DOCUMENTMANIFEST("DocumentManifest"), + + /** + * DocumentReference + * + * + * A reference to a document. + */ + DOCUMENTREFERENCE("DocumentReference"), + + /** + * Encounter + * + * + * 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("Encounter"), + + /** + * FamilyHistory + * + * + * Significant health events and conditions for people related to the subject relevant in the context of care for the subject. + */ + FAMILYHISTORY("FamilyHistory"), + + /** + * Group + * + * + * 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("Group"), + + /** + * ImagingStudy + * + * + * Manifest of a set of images produced in study. The set of images may include every image in the study, or it may be an incomplete sample, such as a list of key images. + */ + IMAGINGSTUDY("ImagingStudy"), + + /** + * Immunization + * + * + * Immunization event information. + */ + IMMUNIZATION("Immunization"), + + /** + * ImmunizationRecommendation + * + * + * A patient's point-of-time immunization status and recommendation with optional supporting justification. + */ + IMMUNIZATIONRECOMMENDATION("ImmunizationRecommendation"), + + /** + * List + * + * + * A set of information summarized from a list of other resources. + */ + LIST("List"), + + /** + * Location + * + * + * Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained or accommodated. + */ + LOCATION("Location"), + + /** + * Media + * + * + * A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference. + */ + MEDIA("Media"), + + /** + * Medication + * + * + * Primarily used for identification and definition of Medication, but also covers ingredients and packaging. + */ + MEDICATION("Medication"), + + /** + * MedicationAdministration + * + * + * Describes the event of a patient being given a dose of 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("MedicationAdministration"), + + /** + * MedicationDispense + * + * + * Dispensing a medication to a named patient. This includes a description of the supply provided and the instructions for administering the medication. + */ + MEDICATIONDISPENSE("MedicationDispense"), + + /** + * MedicationPrescription + * + * + * An order for both supply of the medication and the instructions for administration of the medicine to a patient. + */ + MEDICATIONPRESCRIPTION("MedicationPrescription"), + + /** + * MedicationStatement + * + * + * A record of medication being taken by a patient, or that the medication has been given to a patient where the record is the result of a report from the patient or another clinician. + */ + MEDICATIONSTATEMENT("MedicationStatement"), + + /** + * MessageHeader + * + * + * The header for a message exchange that is either requesting or responding to an action. The resource(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("MessageHeader"), + + /** + * Observation + * + * + * Measurements and simple assertions made about a patient, device or other subject. + */ + OBSERVATION("Observation"), + + /** + * OperationOutcome + * + * + * A collection of error, warning or information messages that result from a system action. + */ + OPERATIONOUTCOME("OperationOutcome"), + + /** + * Order + * + * + * A request to perform an action. + */ + ORDER("Order"), + + /** + * OrderResponse + * + * + * A response to an order. + */ + ORDERRESPONSE("OrderResponse"), + + /** + * Organization + * + * + * A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc. + */ + ORGANIZATION("Organization"), + + /** + * Other + * + * + * Other is a conformant for handling resource concepts not yet defined for FHIR or outside HL7's scope of interest. + */ + OTHER("Other"), + + /** + * Patient + * + * + * Demographics and other administrative information about a person or animal receiving care or other health-related services. + */ + PATIENT("Patient"), + + /** + * Practitioner + * + * + * A person who is directly or indirectly involved in the provisioning of healthcare. + */ + PRACTITIONER("Practitioner"), + + /** + * Procedure + * + * + * An action that is performed on a patient. This can be a physical 'thing' like an operation, or less invasive like counseling or hypnotherapy. + */ + PROCEDURE("Procedure"), + + /** + * Profile + * + * + * A Resource Profile - a statement of use of one or more FHIR Resources. It may include constraints on Resources and Data Types, Terminology Binding Statements and Extension Definitions. + */ + PROFILE("Profile"), + + /** + * Provenance + * + * + * Provenance information that describes the activity that led to the creation of a set of resources. This information can be used to help determine their reliability or trace where the information in them came from. The focus of the provenance resource is record keeping, audit and traceability, and not explicit statements of clinical significance. + */ + PROVENANCE("Provenance"), + + /** + * Query + * + * + * A description of a query with a set of parameters. + */ + QUERY("Query"), + + /** + * Questionnaire + * + * + * A structured set of questions and their answers. The Questionnaire may contain questions, answers or both. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. + */ + QUESTIONNAIRE("Questionnaire"), + + /** + * RelatedPerson + * + * + * 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("RelatedPerson"), + + /** + * SecurityEvent + * + * + * 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. + */ + SECURITYEVENT("SecurityEvent"), + + /** + * Specimen + * + * + * Sample for analysis. + */ + SPECIMEN("Specimen"), + + /** + * Substance + * + * + * A homogeneous material with a definite composition. + */ + SUBSTANCE("Substance"), + + /** + * Supply + * + * + * A supply - a request for something, and provision of what is supplied. + */ + SUPPLY("Supply"), + + /** + * ValueSet + * + * + * A value set specifies a set of codes drawn from one or more code systems. + */ + VALUESET("ValueSet"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/resource-types + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/resource-types"; + + /** + * Name for this Value Set: + * ResourceType + */ + public static final String VALUESET_NAME = "ResourceType"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (ResourceTypeEnum next : ResourceTypeEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public ResourceTypeEnum forCode(String theCode) { + ResourceTypeEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(ResourceTypeEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public ResourceTypeEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + ResourceTypeEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SearchParamTypeEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SearchParamTypeEnum.java new file mode 100644 index 00000000000..4a99ac3b5ed --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SearchParamTypeEnum.java @@ -0,0 +1,127 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum SearchParamTypeEnum { + + /** + * number + * + * + * Search parameter SHALL be a number (a whole number, or a decimal). + */ + NUMBER("number"), + + /** + * date + * + * + * Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported. + */ + DATE("date"), + + /** + * string + * + * + * 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("string"), + + /** + * token + * + * + * 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("token"), + + /** + * reference + * + * + * A reference to another resource. + */ + REFERENCE("reference"), + + /** + * composite + * + * + * A composite search parameter that combines a search on two values together. + */ + COMPOSITE("composite"), + + /** + * quantity + * + * + * A search parameter that searches on a quantity. + */ + QUANTITY("quantity"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/search-param-type + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/search-param-type"; + + /** + * Name for this Value Set: + * SearchParamType + */ + public static final String VALUESET_NAME = "SearchParamType"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (SearchParamTypeEnum next : SearchParamTypeEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public SearchParamTypeEnum forCode(String theCode) { + SearchParamTypeEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(SearchParamTypeEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public SearchParamTypeEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + SearchParamTypeEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SlicingRulesEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SlicingRulesEnum.java new file mode 100644 index 00000000000..8d543f9a508 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SlicingRulesEnum.java @@ -0,0 +1,95 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum SlicingRulesEnum { + + /** + * closed + * + * + * No additional content is allowed other than that described by the slices in this profile. + */ + CLOSED("closed"), + + /** + * open + * + * + * Additional content is allowed anywhere in the list. + */ + OPEN("open"), + + /** + * openAtEnd + * + * + * Additional content is allowed, but only at the end of the list. + */ + OPENATEND("openAtEnd"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/resource-slicing-rules + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/resource-slicing-rules"; + + /** + * Name for this Value Set: + * SlicingRules + */ + public static final String VALUESET_NAME = "SlicingRules"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (SlicingRulesEnum next : SlicingRulesEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public SlicingRulesEnum forCode(String theCode) { + SlicingRulesEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(SlicingRulesEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public SlicingRulesEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + SlicingRulesEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SpecimenCollectionMethodEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SpecimenCollectionMethodEnum.java new file mode 100644 index 00000000000..fdf61ebd523 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SpecimenCollectionMethodEnum.java @@ -0,0 +1,71 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum SpecimenCollectionMethodEnum { + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/specimen-collection-method + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/specimen-collection-method"; + + /** + * Name for this Value Set: + * SpecimenCollectionMethod + */ + public static final String VALUESET_NAME = "SpecimenCollectionMethod"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (SpecimenCollectionMethodEnum next : SpecimenCollectionMethodEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public SpecimenCollectionMethodEnum forCode(String theCode) { + SpecimenCollectionMethodEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(SpecimenCollectionMethodEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public SpecimenCollectionMethodEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + SpecimenCollectionMethodEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SpecimenTreatmentProcedureEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SpecimenTreatmentProcedureEnum.java new file mode 100644 index 00000000000..4f7e2591059 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/SpecimenTreatmentProcedureEnum.java @@ -0,0 +1,71 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum SpecimenTreatmentProcedureEnum { + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/specimen-treatment-procedure + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/specimen-treatment-procedure"; + + /** + * Name for this Value Set: + * SpecimenTreatmentProcedure + */ + public static final String VALUESET_NAME = "SpecimenTreatmentProcedure"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (SpecimenTreatmentProcedureEnum next : SpecimenTreatmentProcedureEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public SpecimenTreatmentProcedureEnum forCode(String theCode) { + SpecimenTreatmentProcedureEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(SpecimenTreatmentProcedureEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public SpecimenTreatmentProcedureEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + SpecimenTreatmentProcedureEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ValueSetStatusEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ValueSetStatusEnum.java new file mode 100644 index 00000000000..9885a4c8db8 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/valueset/ValueSetStatusEnum.java @@ -0,0 +1,95 @@ + +package ca.uhn.fhir.model.dstu.valueset; + +import ca.uhn.fhir.model.api.*; +import java.util.HashMap; +import java.util.Map; + +public enum ValueSetStatusEnum { + + /** + * draft + * + * + * This valueset is still under development. + */ + DRAFT("draft"), + + /** + * active + * + * + * This valueset is ready for normal use. + */ + ACTIVE("active"), + + /** + * retired + * + * + * This valueset has been withdrawn or superceded and should no longer be used. + */ + RETIRED("retired"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/valueset-status + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/valueset-status"; + + /** + * Name for this Value Set: + * ValueSetStatus + */ + public static final String VALUESET_NAME = "ValueSetStatus"; + + private static Map CODE_TO_ENUM = new HashMap(); + private String myCode; + + static { + for (ValueSetStatusEnum next : ValueSetStatusEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the enumerated value associated with this code + */ + public ValueSetStatusEnum forCode(String theCode) { + ValueSetStatusEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(ValueSetStatusEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public ValueSetStatusEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + }; + + /** + * Constructor + */ + ValueSetStatusEnum(String theCode) { + myCode = theCode; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/CodeableConceptDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/CodeableConceptDt.java deleted file mode 100644 index af86178ba03..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/CodeableConceptDt.java +++ /dev/null @@ -1,37 +0,0 @@ -package ca.uhn.fhir.model.primitive; - -import java.util.List; - -import ca.uhn.fhir.model.api.BaseElement; -import ca.uhn.fhir.model.api.ICompositeDatatype; -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; - -@DatatypeDef(name="CodeableConcept") -public class CodeableConceptDt extends BaseElement implements ICodedDatatype, ICompositeDatatype { - - @Child(name="coding", order=0, min=0, max=Child.MAX_UNLIMITED) - private List myCoding; - - @Child(name="text",order=1) - private StringDt myText; - - public List getCoding() { - return myCoding; - } - - public void setCoding(List theCoding) { - myCoding = theCoding; - } - - public StringDt getText() { - return myText; - } - - public void setText(StringDt theText) { - myText = theText; - } - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/CodingDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/CodingDt.java deleted file mode 100644 index 59888d7bf79..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/CodingDt.java +++ /dev/null @@ -1,84 +0,0 @@ -package ca.uhn.fhir.model.primitive; - -import ca.uhn.fhir.model.api.BaseElement; -import ca.uhn.fhir.model.api.ICompositeDatatype; -import ca.uhn.fhir.model.api.ResourceReference; -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.ChildResource; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.dstu.resource.ValueSet; - - -@DatatypeDef(name="Coding") -public class CodingDt extends BaseElement implements ICompositeDatatype { - - @Child(name="system", order=0) - private UriDt mySystem; - - @Child(name="version", order=1) - private StringDt myVersion; - - @Child(name="code", order=2) - private CodeDt myCode; - - @Child(name="display", order=3) - private StringDt myDisplay; - - @Child(name="primary", order=4) - private BooleanDt myPrimary; - - @Child(name="assigner", order=5) - @ChildResource(types= {ValueSet.class}) - private ResourceReference myAssigner; - - public UriDt getSystem() { - return mySystem; - } - - public void setSystem(UriDt theSystem) { - mySystem = theSystem; - } - - public StringDt getVersion() { - return myVersion; - } - - public void setVersion(StringDt theVersion) { - myVersion = theVersion; - } - - public CodeDt getCode() { - return myCode; - } - - public void setCode(CodeDt theCode) { - myCode = theCode; - } - - public StringDt getDisplay() { - return myDisplay; - } - - public void setDisplay(StringDt theDisplay) { - myDisplay = theDisplay; - } - - public BooleanDt getPrimary() { - return myPrimary; - } - - public void setPrimary(BooleanDt thePrimary) { - myPrimary = thePrimary; - } - - public ResourceReference getAssigner() { - return myAssigner; - } - - public void setAssigner(ResourceReference theAssigner) { - myAssigner = theAssigner; - } - - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/IdentifierDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/IdentifierDt.java deleted file mode 100644 index 57878c02c46..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/IdentifierDt.java +++ /dev/null @@ -1,85 +0,0 @@ -package ca.uhn.fhir.model.primitive; - -import ca.uhn.fhir.model.api.BaseElement; -import ca.uhn.fhir.model.api.CodeableConceptElement; -import ca.uhn.fhir.model.api.ICompositeDatatype; -import ca.uhn.fhir.model.api.ResourceReference; -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.ChildResource; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.dstu.resource.Organization; -import ca.uhn.fhir.model.enm.IdentifierUseEnum; - -@DatatypeDef(name="identifier") -public class IdentifierDt extends BaseElement implements ICompositeDatatype { - - @Child(name="use", order=0) - @CodeableConceptElement(type=IdentifierUseEnum.class) - private CodeDt myUse; - - @Child(name="label", order=1) - private StringDt myLabel; - - @Child(name="system", order=2) - private UriDt mySystem; - - @Child(name="value", order=3) - private StringDt myValue; - - @Child(name="period", order=4) - private PeriodDt myPeriod; - - @Child(name="assigner", order=5) - @ChildResource(types= {Organization.class}) - private ResourceReference myAssigner; - - public CodeDt getUse() { - return myUse; - } - - public void setUse(CodeDt theUse) { - myUse = theUse; - } - - public StringDt getLabel() { - return myLabel; - } - - public void setLabel(StringDt theLabel) { - myLabel = theLabel; - } - - public UriDt getSystem() { - return mySystem; - } - - public void setSystem(UriDt theSystem) { - mySystem = theSystem; - } - - public StringDt getValue() { - return myValue; - } - - public void setValue(StringDt theValue) { - myValue = theValue; - } - - public PeriodDt getPeriod() { - return myPeriod; - } - - public void setPeriod(PeriodDt thePeriod) { - myPeriod = thePeriod; - } - - public ResourceReference getAssigner() { - return myAssigner; - } - - public void setAssigner(ResourceReference theAssigner) { - myAssigner = theAssigner; - } - - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/StringDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/StringDt.java index b02e8fd72d7..05f8b56e018 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/StringDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/StringDt.java @@ -1,5 +1,7 @@ package ca.uhn.fhir.model.primitive; +import org.apache.commons.lang3.StringUtils; + import ca.uhn.fhir.model.api.BaseElement; import ca.uhn.fhir.model.api.IPrimitiveDatatype; import ca.uhn.fhir.model.api.annotation.DatatypeDef; @@ -31,6 +33,10 @@ public class StringDt extends BaseElement implements IPrimitiveDatatype return myValue; } + public String getValueNotNull() { + return StringUtils.defaultString(myValue); + } + @Override public String getValueAsString() { return myValue; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/ParserState.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/ParserState.java index 2e02809add3..9289e962a1b 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/ParserState.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/ParserState.java @@ -298,7 +298,7 @@ class ParserState { push(new AtomPrimitiveState(myInstance.getId())); } else if ("link".equals(theLocalPart)) { push(new AtomLinkState(myInstance)); - } else if ("totalresults".equals(theLocalPart) && verifyNamespace(XmlParser.OPENSEARCH_NS, theNamespaceURI)) { + } else if ("totalResults".equals(theLocalPart) && verifyNamespace(XmlParser.OPENSEARCH_NS, theNamespaceURI)) { push(new AtomPrimitiveState(myInstance.getTotalResults())); } else if ("updated".equals(theLocalPart)) { push(new AtomPrimitiveState(myInstance.getUpdated())); diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/context/ModelScannerTest.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/context/ModelScannerTest.java index b79703ef4e4..70316b34d05 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/context/ModelScannerTest.java +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/context/ModelScannerTest.java @@ -35,7 +35,7 @@ public class ModelScannerTest { assertNotNull(valueDate); childExt = ext.getChildExtensionForUrl("http://bar/1/2"); assertNotNull(childExt); - childExt = childExt.getChildExtensionForUrl("http://baz/1/2/1"); + childExt = childExt.getChildExtensionForUrl("http://bar/1/2/1"); assertNotNull(childExt); valueDate = childExt.getChildByName("valueDate"); assertNotNull(valueDate); diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/context/ResourceWithExtensionsA.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/context/ResourceWithExtensionsA.java index eb1aa8d9426..519d18df7eb 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/context/ResourceWithExtensionsA.java +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/context/ResourceWithExtensionsA.java @@ -8,8 +8,8 @@ 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.model.dstu.composite.IdentifierDt; import ca.uhn.fhir.model.primitive.DateDt; -import ca.uhn.fhir.model.primitive.IdentifierDt; import ca.uhn.fhir.model.primitive.StringDt; @ResourceDef(name = "ResourceWithExtensionsA") diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/XmlParserTest.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/XmlParserTest.java index 2bd8ec97d82..584deac2df6 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/XmlParserTest.java +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/XmlParserTest.java @@ -1,6 +1,7 @@ package ca.uhn.fhir.parser; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import java.io.IOException; import java.io.StringReader; @@ -135,6 +136,7 @@ public class XmlParserTest { " \n" + " \n" + " \n" + ""; //@formatter:on diff --git a/hapi-tinder-plugin/.classpath b/hapi-tinder-plugin/.classpath index 1de7b03a990..5e23d6cfdb4 100644 --- a/hapi-tinder-plugin/.classpath +++ b/hapi-tinder-plugin/.classpath @@ -1,260 +1,78 @@ - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - + + + + + + + + + - + - - - - + - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + diff --git a/hapi-tinder-plugin/.project b/hapi-tinder-plugin/.project index d21cbe187e6..a5a3ad1e7e2 100644 --- a/hapi-tinder-plugin/.project +++ b/hapi-tinder-plugin/.project @@ -1,17 +1,14 @@ - hapi-tinder-plugin - NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - + hapi-tinder-plugin + NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. + + + + org.eclipse.jdt.core.javabuilder + + + + org.eclipse.jdt.core.javanature + + \ No newline at end of file diff --git a/hapi-tinder-plugin/.settings/org.eclipse.jdt.core.prefs b/hapi-tinder-plugin/.settings/org.eclipse.jdt.core.prefs index 7341ab1683c..9b5ebfa5836 100644 --- a/hapi-tinder-plugin/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-tinder-plugin/.settings/org.eclipse.jdt.core.prefs @@ -1,11 +1,12 @@ +#Mon Mar 03 15:01:12 EST 2014 +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.debug.lineNumber=generate eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.source=1.6 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 diff --git a/hapi-tinder-plugin/pom.xml b/hapi-tinder-plugin/pom.xml index 8a1104ba039..70eb6548b3f 100644 --- a/hapi-tinder-plugin/pom.xml +++ b/hapi-tinder-plugin/pom.xml @@ -1,4 +1,5 @@ - + 4.0.0 @@ -10,21 +11,16 @@ ca.uhn.hapi.fhir hapi-tinder-plugin - - jar + maven-plugin + - HAPI FHIR-Starter Maven Plugin + HAPI Tinder Plugin - org.apache.poi - poi - 3.10-FINAL - - - org.apache.poi - poi-ooxml - 3.10-FINAL + ca.uhn.hapi.fhir + hapi-fhir-base + 1.0-SNAPSHOT @@ -45,7 +41,12 @@ commons-lang3 3.2.1 - + + commons-io + commons-io + 2.4 + + org.slf4j @@ -77,44 +78,19 @@ org.apache.maven maven-project - 2.0.11 - - - org.apache.maven - maven-core - ${maven_version} - - - org.slf4j - slf4j-nop - - - org.slf4j - jcl-over-slf4j - - + 2.2.1 org.apache.maven maven-plugin-api - ${maven_version} + 3.2.1 - org.apache.maven - maven-settings - ${maven_version} + org.apache.maven.plugin-tools + maven-plugin-annotations + 3.2 + provided - - org.apache.maven - maven-artifact - ${maven_version} - - - org.apache.maven - maven-model - ${maven_version} - - @@ -122,9 +98,13 @@ - + + diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/BaseStructureParser.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/BaseStructureParser.java index 09692890077..15cb1dd573b 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/BaseStructureParser.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/BaseStructureParser.java @@ -14,6 +14,7 @@ import java.util.List; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.maven.plugin.MojoFailureException; import org.apache.velocity.VelocityContext; import org.apache.velocity.app.VelocityEngine; import org.w3c.dom.Element; @@ -30,11 +31,10 @@ import ca.uhn.fhir.tinder.model.SimpleSetter.Parameter; public abstract class BaseStructureParser { private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(BaseStructureParser.class); - private String myDirectory; private ArrayList myExtensions; private List myResources = new ArrayList(); - public void bindValueSets(ValueSetParser theVsp) { + public void bindValueSets(ValueSetGenerator theVsp) { for (Resource next : myResources) { bindValueSets(next, theVsp); } @@ -44,11 +44,8 @@ public abstract class BaseStructureParser { myResources.add(theResource); } - public String getDirectory() { - return myDirectory; - } - private void bindValueSets(BaseElement theResource, ValueSetParser theVsp) { + private void bindValueSets(BaseElement theResource, ValueSetGenerator theVsp) { if (isNotBlank(theResource.getBinding())) { String bindingClass = theVsp.getClassForValueSetIdAndMarkAsNeeded(theResource.getBinding()); if (bindingClass!= null) { @@ -108,38 +105,39 @@ public abstract class BaseStructureParser { throw new IllegalArgumentException(theBase.getCanonicalName() + " has @" + SimpleSetter.class.getCanonicalName() + " constructor with no/invalid parameter annotation"); } - public void setDirectory(String theDirectory) { - myDirectory = theDirectory; - } public void setExtensions(ArrayList theExts) { myExtensions = theExts; } - public void writeAll(String theOutputDirectory) throws IOException { - File targetDir = new File(theOutputDirectory); - if (!targetDir.exists()) { - targetDir.mkdirs(); + public void writeAll(File theOutputDirectory, String thePackageBase) throws MojoFailureException { + if (!theOutputDirectory.exists()) { + theOutputDirectory.mkdirs(); } - if (!targetDir.isDirectory()) { - throw new IOException(theOutputDirectory + " is not a directory"); + if (!theOutputDirectory.isDirectory()) { + throw new MojoFailureException(theOutputDirectory + " is not a directory"); } for (Resource next : myResources) { File f = new File(theOutputDirectory, next.getName() + getFilenameSuffix() + ".java"); - write(next, f); + try { + write(next, f, thePackageBase); + } catch (IOException e) { + throw new MojoFailureException("Failed to write structure", e); + } } } protected abstract String getFilenameSuffix(); - private void write(Resource theResource, File theFile) throws IOException { + private void write(Resource theResource, File theFile, String thePackageBase) throws IOException { FileWriter w = new FileWriter(theFile, false); ourLog.info("Writing file: {}", theFile.getAbsolutePath()); VelocityContext ctx = new VelocityContext(); + ctx.put("packageBase", thePackageBase); ctx.put("className", theResource.getName()); ctx.put("shortName", defaultString(theResource.getShortName())); ctx.put("definition", defaultString(theResource.getDefinition())); @@ -153,7 +151,7 @@ public abstract class BaseStructureParser { v.setProperty("cp.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); v.setProperty("runtime.references.strict", Boolean.TRUE); - InputStream templateIs = ResourceSpreadsheetParser.class.getResourceAsStream(getTemplate()); + InputStream templateIs = ResourceGeneratorUsingSpreadsheet.class.getResourceAsStream(getTemplate()); InputStreamReader templateReader = new InputStreamReader(templateIs); v.evaluate(ctx, w, "", templateReader); diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/BaseStructureSpreadsheetParser.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/BaseStructureSpreadsheetParser.java index f6bd054fcb6..da3dee504c1 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/BaseStructureSpreadsheetParser.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/BaseStructureSpreadsheetParser.java @@ -1,7 +1,7 @@ package ca.uhn.fhir.tinder; -import java.io.File; -import java.io.FileInputStream; +import java.io.InputStream; +import java.util.Collection; import java.util.HashMap; import java.util.Map; @@ -30,88 +30,78 @@ public abstract class BaseStructureSpreadsheetParser extends BaseStructureParser private int myColV2Mapping; public void parse() throws Exception { - File baseDir = new File(getDirectory()); - if (baseDir.exists() == false || baseDir.isDirectory() == false) { - throw new Exception(getDirectory() + " does not exist or is not a directory"); - } - for (File nextFile : baseDir.listFiles()) { - if (isSpreadsheet(nextFile.getAbsolutePath())) { - ourLog.info("Scanning file: {}", nextFile.getAbsolutePath()); + for (InputStream nextInputStream : getInputStreams()) { + + Document file = XMLUtils.parse(nextInputStream, false); + Element dataElementsSheet = (Element) file.getElementsByTagName("Worksheet").item(0); + NodeList tableList = dataElementsSheet.getElementsByTagName("Table"); + Element table = (Element) tableList.item(0); - File resourceSpreadsheetFile = nextFile; - if (resourceSpreadsheetFile.exists() == false) { - throw new Exception(resourceSpreadsheetFile.getAbsolutePath() + " does not exist"); + NodeList rows = table.getElementsByTagName("Row"); + + Element defRow = (Element) rows.item(0); + parseFirstRow(defRow); + + Element resourceRow = (Element) rows.item(1); + Resource resource = new Resource(); + addResource(resource); + + parseBasicElements(resourceRow, resource); + + Map elements = new HashMap(); + elements.put(resource.getElementName(), resource); + + // Map blockFullNameToShortName = new + // HashMap(); + + for (int i = 2; i < rows.getLength(); i++) { + Element nextRow = (Element) rows.item(i); + String name = cellValue(nextRow, 0); + if (name == null || name.startsWith("!")) { + continue; } - Document file = XMLUtils.parse(new FileInputStream(resourceSpreadsheetFile), false); - Element dataElementsSheet = (Element) file.getElementsByTagName("Worksheet").item(0); - NodeList tableList = dataElementsSheet.getElementsByTagName("Table"); - Element table = (Element) tableList.item(0); + String type = cellValue(nextRow, myColType); - NodeList rows = table.getElementsByTagName("Row"); + Child elem; + if (StringUtils.isBlank(type) || type.startsWith("=")) { + elem = new ResourceBlock(); + } else if (type.startsWith("@")) { + // type = type.substring(type.lastIndexOf('.')+1); + elem = new ResourceBlockCopy(); + } else if (type.equals("*")) { + elem = new AnyChild(); + } else { + elem = new Child(); + } - Element defRow = (Element) rows.item(0); - parseFirstRow(defRow); + parseBasicElements(nextRow, elem); - Element resourceRow = (Element) rows.item(1); - Resource resource = new Resource(); - addResource(resource); - - parseBasicElements(resourceRow, resource); - - Map elements = new HashMap(); - elements.put(resource.getElementName(), resource); - - // Map blockFullNameToShortName = new - // HashMap(); - - for (int i = 2; i < rows.getLength(); i++) { - Element nextRow = (Element) rows.item(i); - String name = cellValue(nextRow, 0); - if (name == null || name.startsWith("!")) { - continue; - } - - String type = cellValue(nextRow, myColType); - - Child elem; - if (StringUtils.isBlank(type) || type.startsWith("=")) { - elem = new ResourceBlock(); - } else if (type.startsWith("@")) { - // type = type.substring(type.lastIndexOf('.')+1); - elem = new ResourceBlockCopy(); - } else if (type.equals("*")) { - elem = new AnyChild(); - } else { - elem = new Child(); - } - - parseBasicElements(nextRow, elem); - - elements.put(elem.getName(), elem); - BaseElement parent = elements.get(elem.getElementParentName()); - if (parent == null) { - throw new Exception("Can't find element " + elem.getElementParentName() + " - Valid values are: " + elements.keySet()); - } - parent.addChild(elem); - - /* - * Find simple setters - */ - if (elem instanceof Child) { - scanForSimpleSetters(elem); - } + elements.put(elem.getName(), elem); + BaseElement parent = elements.get(elem.getElementParentName()); + if (parent == null) { + throw new Exception("Can't find element " + elem.getElementParentName() + " - Valid values are: " + elements.keySet()); + } + parent.addChild(elem); + /* + * Find simple setters + */ + if (elem instanceof Child) { + scanForSimpleSetters(elem); } } + } - ourLog.info("Parsed {} resources", getResources().size()); + ourLog.info("Parsed {} spreadsheet structures", getResources().size()); } + protected abstract Collection getInputStreams(); + private void parseFirstRow(Element theDefRow) { for (int i = 0; i < 20; i++) { String nextName = cellValue(theDefRow, i); @@ -143,7 +133,7 @@ public abstract class BaseStructureSpreadsheetParser extends BaseStructureParser String name = cellValue(theRowXml, myColName); theTarget.setName(name); - theTarget.setElementName(name); + theTarget.setElementNameAndDeriveParentElementName(name); String cardValue = cellValue(theRowXml, myColCard); if (cardValue != null && cardValue.contains("..")) { diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/DatatypeGeneratorUsingSpreadsheet.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/DatatypeGeneratorUsingSpreadsheet.java new file mode 100644 index 00000000000..0fe1058498d --- /dev/null +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/DatatypeGeneratorUsingSpreadsheet.java @@ -0,0 +1,45 @@ +package ca.uhn.fhir.tinder; + +import java.io.File; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collection; + +public class DatatypeGeneratorUsingSpreadsheet extends BaseStructureSpreadsheetParser { + + @Override + protected String getTemplate() { + return "/vm/dt_composite.vm"; + } + + @Override + protected String getFilenameSuffix() { + return "Dt"; + } + + @Override + protected Collection getInputStreams() { + ArrayList retVal = new ArrayList(); + + retVal.add(getClass().getResourceAsStream("/dt/address.xml")); + retVal.add(getClass().getResourceAsStream("/dt/coding.xml")); + retVal.add(getClass().getResourceAsStream("/dt/humanname.xml")); + retVal.add(getClass().getResourceAsStream("/dt/period.xml")); + retVal.add(getClass().getResourceAsStream("/dt/ratio.xml")); + retVal.add(getClass().getResourceAsStream("/dt/schedule.xml")); + retVal.add(getClass().getResourceAsStream("/dt/attachment.xml")); + retVal.add(getClass().getResourceAsStream("/dt/contact.xml")); + retVal.add(getClass().getResourceAsStream("/dt/identifier.xml")); + retVal.add(getClass().getResourceAsStream("/dt/quantity.xml")); + retVal.add(getClass().getResourceAsStream("/dt/resourcereference.xml")); + retVal.add(getClass().getResourceAsStream("/dt/codeableconcept.xml")); +// retVal.add(getClass().getResourceAsStream("/dt/extension.xml")); +// retVal.add(getClass().getResourceAsStream("/dt/narrative.xml")); + retVal.add(getClass().getResourceAsStream("/dt/range.xml")); + retVal.add(getClass().getResourceAsStream("/dt/sampleddata.xml")); + + return retVal; + } + + +} diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/DatatypeSpreadsheetParser.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/DatatypeSpreadsheetParser.java deleted file mode 100644 index 142614d3b75..00000000000 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/DatatypeSpreadsheetParser.java +++ /dev/null @@ -1,51 +0,0 @@ -package ca.uhn.fhir.tinder; - - -public class DatatypeSpreadsheetParser extends BaseStructureSpreadsheetParser { - - @Override - protected String getTemplate() { - return "/dt_composite.vm"; - } - - @Override - protected String getFilenameSuffix() { - return "Dt"; - } - - -// @Override -// protected void parseBasicElements(Element theRowXml, BaseElement theTarget) { -// String name = cellValue(theRowXml, 0); -// theTarget.setName(name); -// -// int lastDot = name.lastIndexOf('.'); -// if (lastDot == -1) { -// theTarget.setElementName(name); -// } else { -// String elementName = name.substring(lastDot + 1); -// String elementParentName = name.substring(0, lastDot); -// theTarget.setElementName(elementName); -// theTarget.setElementParentName(elementParentName); -// } -// -// String cardValue = cellValue(theRowXml, 1); -// if (cardValue != null && cardValue.contains("..")) { -// String[] split = cardValue.split("\\.\\."); -// theTarget.setCardMin(split[0]); -// theTarget.setCardMax(split[1]); -// } -// -// -// String type = cellValue(theRowXml, 4); -// theTarget.setTypeFromString(type); -// -// theTarget.setBinding(cellValue(theRowXml, 5)); -// theTarget.setShortName(cellValue(theRowXml, 6)); -// theTarget.setDefinition(cellValue(theRowXml, 7)); -// theTarget.setRequirement(cellValue(theRowXml, 6)); -// theTarget.setV2Mapping(cellValue(theRowXml, 13)); -// } - - -} diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/ProfileParser.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/ProfileParser.java index be885204d14..7fd56d7fb95 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/ProfileParser.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/ProfileParser.java @@ -1,20 +1,24 @@ package ca.uhn.fhir.tinder; -import static org.apache.commons.lang.StringUtils.*; +import static org.apache.commons.lang.StringUtils.capitalize; +import static org.apache.commons.lang.StringUtils.isBlank; -import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.HashMap; +import java.util.List; import java.util.Map; +import java.util.TreeMap; +import java.util.TreeSet; import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; -import org.apache.poi.xslf.model.geom.AddSubtractExpression; +import org.apache.maven.plugin.MojoFailureException; import ca.uhn.fhir.context.ConfigurationException; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.model.api.Bundle; +import ca.uhn.fhir.model.api.BundleEntry; import ca.uhn.fhir.model.dstu.resource.Profile; import ca.uhn.fhir.model.dstu.resource.Profile.ExtensionDefn; import ca.uhn.fhir.model.dstu.resource.Profile.Structure; @@ -22,39 +26,41 @@ import ca.uhn.fhir.model.dstu.resource.Profile.StructureElement; import ca.uhn.fhir.model.dstu.resource.Profile.StructureElementDefinition; import ca.uhn.fhir.model.dstu.resource.Profile.StructureElementDefinitionType; import ca.uhn.fhir.model.dstu.valueset.DataTypeEnum; +import ca.uhn.fhir.parser.DataFormatException; import ca.uhn.fhir.parser.XmlParser; -import ca.uhn.fhir.tinder.model.AnyChild; import ca.uhn.fhir.tinder.model.BaseElement; import ca.uhn.fhir.tinder.model.Child; import ca.uhn.fhir.tinder.model.Resource; import ca.uhn.fhir.tinder.model.ResourceBlock; -import ca.uhn.fhir.tinder.model.ResourceBlockCopy; import ca.uhn.fhir.tinder.model.Slicing; public class ProfileParser extends BaseStructureParser { private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ProfileParser.class); + + public static void main(String[] args) throws Exception { - FhirContext fhirContext = new FhirContext(Profile.class); - XmlParser parser = fhirContext.newXmlParser(); - - String file = IOUtils.toString(new FileReader("src/test/resources/prof/organization.xml")); - Profile text = (Profile) parser.parseResource(file); - - ValueSetParser vsp = new ValueSetParser(); - vsp.setDirectory("src/test/resources/vs/"); - vsp.parse(); - - ProfileParser p = new ProfileParser(); - p.parseSingleProfile(text); - p.bindValueSets(vsp); - p.writeAll("target/generated/valuesets/ca/uhn/fhir/model/dstu/resource"); - +// FhirContext fhirContext = new FhirContext(Profile.class); +// XmlParser parser = fhirContext.newXmlParser(); +// +// String file = IOUtils.toString(new FileReader("src/test/resources/prof/organization.xml")); +// Profile text = (Profile) parser.parseResource(file); +// +// ValueSetGenerator vsp = new ValueSetGenerator(); +// vsp.setDirectory("src/test/resources/vs/"); +// vsp.parse(); +// +// ProfileParser p = new ProfileParser(); +// p.parseSingleProfile(text, "http://fhir.connectinggta.ca/static/Profile/organization.xml"); +// p.bindValueSets(vsp); +// p.writeAll("target/generated/valuesets/ca/uhn/fhir/model/dstu/resource"); +// +// vsp.writeMarkedValueSets("target/generated/valuesets/ca/uhn/fhir/model/dstu/valueset"); } - public void parseSingleProfile(Profile theProfile) throws Exception { + public void parseSingleProfile(Profile theProfile, String theUrlTOThisProfile) throws Exception { for (Structure nextStructure : theProfile.getStructure()) { int elemIdx = 0; @@ -78,7 +84,7 @@ public class ProfileParser extends BaseStructureParser { } elem.setName(next.getPath().getValue()); - elem.setElementName(next.getPath().getValue()); + elem.setElementNameAndDeriveParentElementName(next.getPath().getValue()); boolean allResourceReferences = next.getDefinition().getType().size() > 0; for (StructureElementDefinitionType nextType : next.getDefinition().getType()) { @@ -123,6 +129,12 @@ public class ProfileParser extends BaseStructureParser { if (next.getDefinition().getType().size() != 1 || next.getDefinition().getType().get(0).getCode().getValueAsEnum() != DataTypeEnum.EXTENSION) { throw new ConfigurationException("Extension slices must have a single type with a code of 'Extension'"); } + String name = next.getName().getValue(); + if (StringUtils.isBlank(name)) { + throw new ConfigurationException("Extension slices must have a 'name' defined, none found at path: " + next.getPath()); + } + elem.setName(name); + elem.setElementName(name); String profile = next.getDefinition().getType().get(0).getProfile().getValueAsString(); if (isBlank(profile)) { throw new ConfigurationException("Extension slice for " + next.getPath().getValue() + " has no profile specified in its type"); @@ -134,6 +146,8 @@ public class ProfileParser extends BaseStructureParser { } ourLog.info("Element at path {} is using extension {}", next.getPath(), profile); definition = extension.getDefinition(); + String extensionUrl = theUrlTOThisProfile + profile; + elem.setExtensionUrl(extensionUrl); } else { // TODO: implement this throw new ConfigurationException("Extensions specified outside of the given profile are not yet supported"); @@ -207,7 +221,32 @@ public class ProfileParser extends BaseStructureParser { @Override protected String getTemplate() { - return "/resource.vm"; + return "/vm/resource.vm"; + } + + public void parseBaseResources(List theBaseResourceNames) throws MojoFailureException { + for (int i = 0; i < theBaseResourceNames.size(); i++) { + theBaseResourceNames.set(i, theBaseResourceNames.get(i).toLowerCase()); + } + + FhirContext fhirContext = new FhirContext(Profile.class); + try { + + Bundle bundle = fhirContext.newXmlParser().parseBundle(IOUtils.toString(getClass().getResourceAsStream("/prof/allprofiles.xml"))); + TreeSet allProfiles = new TreeSet(); + for (BundleEntry nextResource : bundle.getEntries() ) { + Profile nextProfile = (Profile) nextResource.getResource(); + allProfiles.add(nextProfile.getName().getValue()); + if (theBaseResourceNames.contains(nextProfile.getName().getValue().toLowerCase())){ + parseSingleProfile(nextProfile, bundle.getLinkBase().getValueNotNull()); + } + } + + ourLog.info("Base profiles found: {}", allProfiles); + + } catch (Exception e) { + throw new MojoFailureException("Failed to load base resources", e); + } } } diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/ResourceSpreadsheetParser.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/ResourceGeneratorUsingSpreadsheet.java similarity index 82% rename from hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/ResourceSpreadsheetParser.java rename to hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/ResourceGeneratorUsingSpreadsheet.java index 5efe850e91f..d80b8621460 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/ResourceSpreadsheetParser.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/ResourceGeneratorUsingSpreadsheet.java @@ -1,13 +1,22 @@ package ca.uhn.fhir.tinder; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import org.apache.maven.plugin.MojoFailureException; -public class ResourceSpreadsheetParser extends BaseStructureSpreadsheetParser { +public class ResourceGeneratorUsingSpreadsheet extends BaseStructureSpreadsheetParser { + + + private ArrayList myInputStreams; @Override protected String getTemplate() { - return "/resource.vm"; + return "/vm/resource.vm"; } @Override @@ -121,4 +130,21 @@ public class ResourceSpreadsheetParser extends BaseStructureSpreadsheetParser { } + @Override + protected Collection getInputStreams() { + return myInputStreams; + } + + public void setBaseResourceNames(List theBaseResourceNames) throws MojoFailureException { + myInputStreams = new ArrayList(); + + for (String next : theBaseResourceNames) { + InputStream nextRes = getClass().getResourceAsStream("/res/" + next + "-spreadsheet.xml"); + myInputStreams.add(nextRes); + if (nextRes == null) { + throw new MojoFailureException("Unknown base resource name: " + next); + } + } + } + } \ No newline at end of file diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/TinderMojo.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/TinderMojo.java index 02cdbe27108..e6a62641f65 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/TinderMojo.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/TinderMojo.java @@ -1,32 +1,118 @@ package ca.uhn.fhir.tinder; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.List; -public class TinderMojo { +import org.apache.commons.lang3.StringUtils; +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugins.annotations.Component; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.project.MavenProject; - public static void main(String[] args) throws Exception { +@Mojo(name = "generate", defaultPhase = LifecyclePhase.GENERATE_SOURCES) +public class TinderMojo extends AbstractMojo { + + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(TinderMojo.class); + + @Parameter(alias = "package", required = true) + private String myPackage; + + @Parameter(alias = "targetDirectory", required = true, defaultValue = "${project.build.directory}/generated-sources/tinder") + private String myTargetDirectory; + + @Parameter(property = "generate.valueSetResourceXmlDirectory", required = false) + private String myValueSetResourceXmlDirectory; + + @Parameter(alias = "baseResourceNames", required = true) + private List myBaseResourceNames; + + @Component + private MavenProject myProject; + + @Override + public void execute() throws MojoExecutionException, MojoFailureException { + if (StringUtils.isBlank(myPackage)) { + throw new MojoFailureException("Package not specified"); + } + if (myPackage.contains("..") || myPackage.endsWith(".")) { + throw new MojoFailureException("Invalid package specified"); + } - ValueSetParser vsp = new ValueSetParser(); - vsp.setDirectory("src/test/resources/vs/"); - vsp.parse(); + ourLog.info("Beginning HAPI-FHIR Tinder Code Generation..."); - DatatypeSpreadsheetParser dtp = new DatatypeSpreadsheetParser(); - dtp.setDirectory("src/test/resources/dt"); - dtp.parse(); + ourLog.info(" * Output Package: " + myPackage); + File directoryBase = new File(new File(myTargetDirectory), myPackage.replace('.', File.separatorChar)); + directoryBase.mkdirs(); + ourLog.info(" * Output Directory: " + directoryBase.getAbsolutePath()); + + ValueSetGenerator vsp = new ValueSetGenerator(); + vsp.setDirectory(myValueSetResourceXmlDirectory); + try { + vsp.parse(); + } catch (Exception e) { + throw new MojoFailureException("Failed to load valuesets", e); + } + + ourLog.info("Loading Datatypes..."); + + DatatypeGeneratorUsingSpreadsheet dtp = new DatatypeGeneratorUsingSpreadsheet(); + try { + dtp.parse(); + } catch (Exception e) { + throw new MojoFailureException("Failed to load datatypes", e); + } dtp.bindValueSets(vsp); - - String dtOutputDir = "target/generated/valuesets/ca/uhn/fhir/model/dstu/composite"; - dtp.writeAll(dtOutputDir); - - ResourceSpreadsheetParser rp = new ResourceSpreadsheetParser(); - rp.setDirectory("src/test/resources/res"); - rp.parse(); - rp.bindValueSets(vsp); - String rpOutputDir = "target/generated/valuesets/ca/uhn/fhir/model/dstu/resource"; - rp.writeAll(rpOutputDir); + ourLog.info("Loading Resources..."); + ResourceGeneratorUsingSpreadsheet rp = new ResourceGeneratorUsingSpreadsheet(); + try { + rp.setBaseResourceNames(myBaseResourceNames); + rp.parse(); + } catch (Exception e) { + throw new MojoFailureException("Failed to load resources", e); + } + rp.bindValueSets(vsp); - String vsOutputDir = "target/generated/valuesets/ca/uhn/fhir/model/dstu/valueset"; - vsp.writeMarkedValueSets(vsOutputDir); + ourLog.info("Writing Resources..."); + rp.writeAll(new File(directoryBase, "resource"), myPackage); + + ourLog.info("Writing Composite Datatypes..."); + dtp.writeAll(new File(directoryBase, "composite"), myPackage); + + ourLog.info("Writing ValueSet Enums..."); + vsp.writeMarkedValueSets(new File(directoryBase, "valueset"), myPackage); + + myProject.addCompileSourceRoot(myTargetDirectory); } + public static void main(String[] args) throws Exception { + +// ValueSetGenerator vsp = new ValueSetGenerator(); +// vsp.setDirectory("src/test/resources/vs/"); +// vsp.parse(); +// +// DatatypeGeneratorUsingSpreadsheet dtp = new DatatypeGeneratorUsingSpreadsheet(); +// dtp.parse(); +// dtp.bindValueSets(vsp); +// +// String dtOutputDir = "target/generated/valuesets/ca/uhn/fhir/model/dstu/composite"; +// dtp.writeAll(dtOutputDir); +// +// ResourceGeneratorUsingSpreadsheet rp = new ResourceGeneratorUsingSpreadsheet(); +// rp.parse(); +// rp.bindValueSets(vsp); +// +// String rpOutputDir = "target/generated/valuesets/ca/uhn/fhir/model/dstu/resource"; +// rp.writeAll(rpOutputDir); +// +// String vsOutputDir = "target/generated/valuesets/ca/uhn/fhir/model/dstu/valueset"; +// vsp.writeMarkedValueSets(vsOutputDir); + } + } diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/ValueSetParser.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/ValueSetGenerator.java similarity index 53% rename from hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/ValueSetParser.java rename to hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/ValueSetGenerator.java index 784007c16c0..69e7a1d164d 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/ValueSetParser.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/ValueSetGenerator.java @@ -4,6 +4,7 @@ import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; +import java.io.FilenameFilter; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; @@ -14,8 +15,10 @@ import java.util.Map; import java.util.Set; import org.apache.commons.io.IOUtils; +import org.apache.commons.io.filefilter.WildcardFileFilter; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.text.WordUtils; +import org.apache.maven.plugin.MojoFailureException; import org.apache.velocity.VelocityContext; import org.apache.velocity.app.VelocityEngine; @@ -24,16 +27,19 @@ import ca.uhn.fhir.model.api.Bundle; import ca.uhn.fhir.model.api.BundleEntry; import ca.uhn.fhir.model.dstu.resource.ValueSet; import ca.uhn.fhir.model.dstu.resource.ValueSet.DefineConcept; +import ca.uhn.fhir.parser.XmlParser; import ca.uhn.fhir.tinder.model.ValueSetTm; import ca.uhn.fhir.tinder.model.ValueSetTm.Code; -public class ValueSetParser { +public class ValueSetGenerator { - private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ValueSetParser.class); + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ValueSetGenerator.class); private String myDirectory; private Set myMarkedValueSets = new HashSet(); private Map myValueSets = new HashMap(); + private int myValueSetCount; + private int myConceptCount; public String getClassForValueSetIdAndMarkAsNeeded(String theId) { ValueSetTm vs = myValueSets.get(theId); @@ -46,57 +52,66 @@ public class ValueSetParser { } public void parse() throws FileNotFoundException, IOException { - String string = IOUtils.toString(new FileReader(myDirectory + "valuesets.xml")); - Bundle bundle = new FhirContext(ValueSet.class).newXmlParser().parseBundle(string); + XmlParser newXmlParser = new FhirContext(ValueSet.class).newXmlParser(); - int vsCount = 0; - int conceptCount = 0; + ourLog.info("Parsing built-in ValueSets"); + String vs = IOUtils.toString(ValueSetGenerator.class.getResourceAsStream("/vs/all-valuesets-bundle.xml")); + Bundle bundle = newXmlParser.parseBundle(vs); for (BundleEntry next : bundle.getEntries()) { ValueSet nextVs = (ValueSet) next.getResource(); - conceptCount += nextVs.getDefine().getConcept().size(); - ourLog.info("Parsing ValueSetTm #{} - {} - {} concepts total", vsCount++, nextVs.getName().getValue(), conceptCount); - // output.addConcept(next.getCode().getValue(), - // next.getDisplay().getValue(), next.getDefinition()); - - ValueSetTm vs = new ValueSetTm(); - - vs.setName(nextVs.getName().getValue()); - vs.setDescription(nextVs.getDescription().getValue()); - vs.setId(nextVs.getIdentifier().getValue()); - vs.setClassName(toClassName(nextVs.getName().getValue())); - - for (DefineConcept nextConcept : nextVs.getDefine().getConcept()) { - String nextCodeValue = nextConcept.getCode().getValue(); - String nextCodeDisplay = StringUtils.defaultString(nextConcept.getDisplay().getValue()); - String nextCodeDefinition = StringUtils.defaultString(nextConcept.getDefinition().getValue()); - - vs.getCodes().add(new Code(nextCodeValue, nextCodeDisplay, nextCodeDefinition)); - } - - if (myValueSets.containsKey(vs.getName())) { - ourLog.warn("Duplicate Name: " + vs.getName()); - continue; - } - myValueSets.put(vs.getName(), vs); - - // if (vsCount > 5) { - // break; - // } + parseValueSet(nextVs); } + if (myDirectory != null) { + File[] files = new File(myDirectory).listFiles((FilenameFilter) new WildcardFileFilter("*.xml")); + for (File file : files) { + ourLog.info("Parsing ValueSet file: {}" + file.getName()); + vs = IOUtils.toString(new FileReader(file)); + ValueSet nextVs = (ValueSet) newXmlParser.parseResource(vs); + parseValueSet(nextVs); + } + } + + } + + private void parseValueSet(ValueSet nextVs) { + myConceptCount += nextVs.getDefine().getConcept().size(); + ourLog.info("Parsing ValueSetTm #{} - {} - {} concepts total", myValueSetCount++, nextVs.getName().getValue(), myConceptCount); + // output.addConcept(next.getCode().getValue(), + // next.getDisplay().getValue(), next.getDefinition()); + + ValueSetTm vs = new ValueSetTm(); + + vs.setName(nextVs.getName().getValue()); + vs.setDescription(nextVs.getDescription().getValue()); + vs.setId(nextVs.getIdentifier().getValue()); + vs.setClassName(toClassName(nextVs.getName().getValue())); + + for (DefineConcept nextConcept : nextVs.getDefine().getConcept()) { + String nextCodeValue = nextConcept.getCode().getValue(); + String nextCodeDisplay = StringUtils.defaultString(nextConcept.getDisplay().getValue()); + String nextCodeDefinition = StringUtils.defaultString(nextConcept.getDefinition().getValue()); + + vs.getCodes().add(new Code(nextCodeValue, nextCodeDisplay, nextCodeDefinition)); + } + + if (myValueSets.containsKey(vs.getName())) { + ourLog.warn("Duplicate Name: " + vs.getName()); + } else { + myValueSets.put(vs.getName(), vs); + } } public void setDirectory(String theString) { myDirectory = theString; } - public void write(Collection theValueSets, String theOutputDirectory) throws IOException { + public void write(Collection theValueSets, File theOutputDirectory, String thePackageBase) throws IOException { for (ValueSetTm nextValueSetTm : theValueSets) { - write(nextValueSetTm, theOutputDirectory); + write(nextValueSetTm, theOutputDirectory, thePackageBase); } } - private String toClassName(String theValue) { StringBuilder b = new StringBuilder(); for (String next : theValue.split("\\s+")) { @@ -116,7 +131,7 @@ public class ValueSetParser { } b.append(next); } - + b.append("Enum"); return b.toString(); } @@ -125,12 +140,11 @@ public class ValueSetParser { // myValueSetName = theString; // } - private void write(ValueSetTm theValueSetTm, String theOutputDirectory) throws IOException { - File targetDir = new File(theOutputDirectory); - if (!targetDir.exists()) { - targetDir.mkdirs(); + private void write(ValueSetTm theValueSetTm, File theOutputDirectory, String thePackageBase) throws IOException { + if (!theOutputDirectory.exists()) { + theOutputDirectory.mkdirs(); } - if (!targetDir.isDirectory()) { + if (!theOutputDirectory.isDirectory()) { throw new IOException(theOutputDirectory + " is not a directory"); } @@ -141,13 +155,14 @@ public class ValueSetParser { VelocityContext ctx = new VelocityContext(); ctx.put("valueSet", theValueSetTm); + ctx.put("packageBase", thePackageBase); VelocityEngine v = new VelocityEngine(); v.setProperty("resource.loader", "cp"); v.setProperty("cp.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); v.setProperty("runtime.references.strict", Boolean.TRUE); - InputStream templateIs = ResourceSpreadsheetParser.class.getResourceAsStream("/valueset.vm"); + InputStream templateIs = ResourceGeneratorUsingSpreadsheet.class.getResourceAsStream("/vm/valueset.vm"); InputStreamReader templateReader = new InputStreamReader(templateIs); v.evaluate(ctx, w, "", templateReader); @@ -162,8 +177,12 @@ public class ValueSetParser { } - public void writeMarkedValueSets(String theOutputDirectory) throws IOException { - write(myMarkedValueSets, theOutputDirectory); + public void writeMarkedValueSets(File theOutputDirectory, String thePackageBase) throws MojoFailureException { + try { + write(myMarkedValueSets, theOutputDirectory, thePackageBase); + } catch (IOException e) { + throw new MojoFailureException("Failed to write valueset", e); + } } } diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/BaseElement.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/BaseElement.java index 1dd5c2b430d..39360d487b9 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/BaseElement.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/BaseElement.java @@ -27,6 +27,7 @@ public abstract class BaseElement { private String myShortName; private List myType; private String myV2Mapping; + private String myExtensionUrl; public void addChild(Child theElem) { if (myChildren == null) { @@ -150,6 +151,10 @@ public abstract class BaseElement { } public void setElementName(String theName) { + myElementName = theName; + } + + public void setElementNameAndDeriveParentElementName(String theName) { int lastDot = theName.lastIndexOf('.'); if (lastDot == -1) { myElementName = (theName); @@ -217,4 +222,16 @@ public abstract class BaseElement { myV2Mapping = theV2Mapping; } + public void setExtensionUrl(String theExtensionUrl) { + myExtensionUrl = theExtensionUrl; + } + + public boolean isHasExtensionUrl() { + return StringUtils.isNotBlank(myExtensionUrl); + } + + public String getExtensionUrl() { + return myExtensionUrl; + } + } diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/Extension.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/Extension.java index 2294035356e..0876b800d9a 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/Extension.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/Extension.java @@ -71,8 +71,8 @@ public class Extension extends Child { } @Override - public void setElementName(String theName) { - super.setElementName(theName); + public void setElementNameAndDeriveParentElementName(String theName) { + super.setElementNameAndDeriveParentElementName(theName); if (getName() == null) { super.setName(theName); } @@ -82,7 +82,7 @@ public class Extension extends Child { public void setName(String theName) { super.setName(theName); if (getElementName() == null) { - super.setElementName(theName); + super.setElementNameAndDeriveParentElementName(theName); } } diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/ValueSetTm.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/ValueSetTm.java index c1bac6b94d5..382c5cd95d1 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/ValueSetTm.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/ValueSetTm.java @@ -3,6 +3,7 @@ package ca.uhn.fhir.tinder.model; import java.util.ArrayList; import java.util.List; +import org.apache.commons.validator.ISBNValidator; import org.codehaus.plexus.util.StringUtils; public class ValueSetTm { @@ -99,7 +100,11 @@ public class ValueSetTm { } public String getCodeEnumValue() { - String retVal = myCode.toUpperCase().replace(' ', '_').replace('-', '_').replace('/', '_').replace('.', '_'); + String retVal = myDisplay; + if (StringUtils.isBlank(retVal)) { + retVal = myCode; + } + retVal = retVal.toUpperCase().replace(' ', '_').replace('-', '_').replace('/', '_').replace('.', '_').replace(':', '_').replace("'", ""); if ("=".equals(retVal)) { retVal = "EQUALS"; } @@ -131,6 +136,14 @@ public class ValueSetTm { return myDisplay; } + public boolean isHasDefinition() { + return StringUtils.isNotBlank(myDefinition); + } + + public boolean isHasDisplay() { + return StringUtils.isNotBlank(myDisplay); + } + } } diff --git a/hapi-tinder-plugin/src/test/resources/dt/address.xml b/hapi-tinder-plugin/src/main/resources/dt/address.xml similarity index 100% rename from hapi-tinder-plugin/src/test/resources/dt/address.xml rename to hapi-tinder-plugin/src/main/resources/dt/address.xml diff --git a/hapi-tinder-plugin/src/main/resources/dt/attachment.xml b/hapi-tinder-plugin/src/main/resources/dt/attachment.xml new file mode 100644 index 00000000000..9f250bbea81 --- /dev/null +++ b/hapi-tinder-plugin/src/main/resources/dt/attachment.xml @@ -0,0 +1,342 @@ + + + + + Grahame + Grahame + 2012-03-19T11:25:39Z + 2013-08-12T11:30:54Z + 14.00 + + + + + + 9810 + 26235 + 1740 + 2310 + False + False + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Element + Card. + Inv. + Is Modifier + Type + Binding + Short Name + Definition + Example + Requirements + Comments + RIM Mapping + v2 Mapping + To Do + Committee Notes + + + Attachment + + + + Type + Content in a format defined elsewhere + For referring to data content defined in other formats. + Many models need to include data defined in other specifications that is complex and opaque to the healthcare model. This includes documents, media recordings, structured data, etc. + ED + ED/RP + + + Attachment.contentType + 1..1 + code + MimeType + Mime type of the content, with charset etc. + 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 + text/plain; charset=UTF-8, image/png + Processors of the data need to be able to know how to interpret the data + ./mediaType, ./charset + ED.2+ED.3/RP.2+RP.3. Note conversion may be needed if old style values are being used + + + Attachment.language + 0..1 + code + Language + Human language of the content (BCP-47) + The human language of the content. The value can be any valid value according to BCP 47 + en-AU + Users need to be able to choose between the languages in a set of attachments + ./language + + + Attachment.data + 0..1 + base64Binary + Data inline, base64ed + The actual data of the attachment - a sequence of bytes. In XML, represented using base64 + The data needs to able to be transmitted inline + The base64-encoded data SHALL be expressed in the same character set as the base resource XML or JSON + ./data + ED.5 + + + Attachment.url + 0..1 + uri + Uri where the data can be found + An alternative location where the data can be accessed + http://www.acme.com/logo-small.png + The data needs to be transmitted by reference + If both data and url are provided, the url SHALL point to the same content as the data contains. Urls may be relative references or may reference transient locations such as a wrapping envelope using cid: though this has ramifications for using signatures. Relative URLs are interpreted relative to the service url, like a resource reference, rather than relative to the resource itself. If a URL is provided, it SHALL resolve to actual data. + ./reference/literal + RP.1+RP.2 - if they refer to a URL (see v2.6) + + + Attachment.size + 0..1 + integer + Number of bytes of content (if url provided) + The number of bytes of data that make up this attachment. + + Representing the size allows applications to determine whether they should fetch the content automatically in advance, or refuse to fetch it at all + The number of bytes is redundant if the data is provided as a base64binary, but is useful if the data is provided as a url reference + N/A (needs data type R3 proposal) + + + Attachment.hash + 0..1 + base64Binary + Hash of the data (sha-1, base64ed ) + The calculated hash of the data using SHA-1. Represented using base64 + Included so that applications can verify that the contents of a location have not changed and so that a signature of the content can implicitly sign the content of an image without having to include the data in the instance or reference the url in the signature + .integrityCheck[parent::ED/integrityCheckAlgorithm="SHA-1"] + + + !Attachment.lang + 0..1 + code + Language + ISO 639-3 language code + The language that the attachment is in + eng (English), esp (Spanish) + May need to be able to pick the right language to render for a particular person from a list of attachments in different languages + note that the v3 lang is ISO 639-2 and this is ISO 639-3 + ./language + + + Attachment.title + 0..1 + string + Label to display in place of the data + A label or set of text to display in place of the data + "Official Corporate Logo" + Applications need a label to display to a human user in place of the actual data if the data cannot be rendered or perceived by the viewer. + ./title/data + +
+ + +

+