diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IResource.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IResource.java index c26fdee679a..a998e82ce11 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IResource.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IResource.java @@ -25,6 +25,7 @@ import java.util.Map; import ca.uhn.fhir.model.dstu.composite.ContainedDt; import ca.uhn.fhir.model.dstu.composite.NarrativeDt; import ca.uhn.fhir.model.dstu.resource.Patient; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.CodeDt; import ca.uhn.fhir.model.primitive.IdDt; @@ -112,5 +113,11 @@ public interface IResource extends ICompositeElement { * The map must not be null */ void setResourceMetadata(Map, Object> theMap); - + + /** + * Returns a ResourceTypeEnum representing the type of this Resource + * @return the ResourceType of this Resource + */ + ResourceTypeEnum getResourceType(); + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AdverseReaction.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AdverseReaction.java index b3583a7fbb5..d9cdc21a7a4 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AdverseReaction.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AdverseReaction.java @@ -59,6 +59,7 @@ import ca.uhn.fhir.model.dstu.valueset.CausalityExpectationEnum; import ca.uhn.fhir.model.dstu.valueset.ExposureTypeEnum; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; import ca.uhn.fhir.model.dstu.valueset.ReactionSeverityEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.CodeDt; @@ -975,6 +976,12 @@ public class AdverseReaction extends BaseResource implements IResource { } + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.ADVERSEREACTION; + } + + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Alert.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Alert.java index 22fa576dda6..92442d182f5 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Alert.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Alert.java @@ -52,6 +52,7 @@ import ca.uhn.fhir.model.dstu.composite.IdentifierDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.AlertStatusEnum; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.CodeDt; import ca.uhn.fhir.model.primitive.StringDt; @@ -440,6 +441,11 @@ public class Alert extends BaseResource implements IResource { return this; } + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.ALERT; + } + diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AllergyIntolerance.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AllergyIntolerance.java index af7d4a83ca9..839ee1b24bb 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AllergyIntolerance.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AllergyIntolerance.java @@ -53,6 +53,7 @@ import ca.uhn.fhir.model.dstu.composite.IdentifierDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.CriticalityEnum; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.dstu.valueset.SensitivityStatusEnum; import ca.uhn.fhir.model.dstu.valueset.SensitivityTypeEnum; import ca.uhn.fhir.model.primitive.BoundCodeDt; @@ -782,6 +783,11 @@ public class AllergyIntolerance extends BaseResource implements IResource { getSensitivityTest().add(newType); return newType; } + + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.ALLERGYINTOLERANCE; + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Appointment.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Appointment.java index fc96dbf6bf9..54a9e5df31e 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Appointment.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Appointment.java @@ -58,6 +58,7 @@ import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.composite.ScheduleDt; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; import ca.uhn.fhir.model.dstu.valueset.ParticipantTypeEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; import ca.uhn.fhir.model.primitive.CodeDt; import ca.uhn.fhir.model.primitive.DateTimeDt; @@ -1350,6 +1351,12 @@ public class Appointment extends BaseResource implements IResource { } + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.APPOINTMENT; + } + + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AppointmentResponse.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AppointmentResponse.java index b946d191cb6..b41abeb3685 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AppointmentResponse.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AppointmentResponse.java @@ -55,6 +55,7 @@ import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.composite.ScheduleDt; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; import ca.uhn.fhir.model.dstu.valueset.ParticipantTypeEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; import ca.uhn.fhir.model.primitive.CodeDt; import ca.uhn.fhir.model.primitive.DateTimeDt; @@ -888,6 +889,11 @@ public class AppointmentResponse extends BaseResource implements IResource { return this; } + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.APPOINTMENTRESPONSE; + } + diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Availability.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Availability.java index 5ec3dc3b750..ebd14768b59 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Availability.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Availability.java @@ -54,6 +54,7 @@ import ca.uhn.fhir.model.dstu.composite.IdentifierDt; import ca.uhn.fhir.model.dstu.composite.PeriodDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.DateTimeDt; import ca.uhn.fhir.model.primitive.StringDt; import ca.uhn.fhir.rest.gclient.ReferenceClientParam; @@ -514,6 +515,11 @@ public class Availability extends BaseResource implements IResource { return this; } + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.AVAILABILITY; + } + diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Binary.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Binary.java index d999566db98..9db57a06806 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Binary.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Binary.java @@ -29,6 +29,7 @@ import ca.uhn.fhir.model.api.BaseResource; import ca.uhn.fhir.model.api.IElement; import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.Base64BinaryDt; @ResourceDef(name = "Binary", profile = "http://hl7.org/fhir/profiles/Binary", id = "binary") @@ -91,4 +92,9 @@ public class Binary extends BaseResource implements IResource { myContentType = theContentType; } + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.BINARY; + } + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/CarePlan.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/CarePlan.java index 267dbaff32f..3e8df912626 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/CarePlan.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/CarePlan.java @@ -65,6 +65,7 @@ import ca.uhn.fhir.model.dstu.valueset.CarePlanGoalStatusEnum; import ca.uhn.fhir.model.dstu.valueset.CarePlanStatusEnum; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.CodeDt; @@ -2152,6 +2153,11 @@ public class CarePlan extends BaseResource implements IResource { } + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.CAREPLAN; + } + diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Claim.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Claim.java index c10a2de0974..523f6dee407 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Claim.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Claim.java @@ -59,6 +59,7 @@ import ca.uhn.fhir.model.dstu.composite.IdentifierDt; import ca.uhn.fhir.model.dstu.composite.PeriodDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.DateDt; import ca.uhn.fhir.model.primitive.DecimalDt; import ca.uhn.fhir.model.primitive.IntegerDt; @@ -2027,6 +2028,11 @@ public class Claim extends BaseResource implements IResource { } + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.CLAIM; + } + diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Composition.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Composition.java index 194be2b3843..c5f2e13d960 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Composition.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Composition.java @@ -60,6 +60,7 @@ import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.CompositionAttestationModeEnum; import ca.uhn.fhir.model.dstu.valueset.CompositionStatusEnum; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.CodeDt; import ca.uhn.fhir.model.primitive.DateTimeDt; @@ -1694,6 +1695,12 @@ public class Composition extends BaseResource implements IResource { } + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.COMPOSITION; + } + + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ConceptMap.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ConceptMap.java index 78d7b84e1c1..32f4a99b611 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ConceptMap.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ConceptMap.java @@ -56,6 +56,7 @@ import ca.uhn.fhir.model.dstu.composite.ContactDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.ConceptMapEquivalenceEnum; import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.dstu.valueset.ValueSetStatusEnum; import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.BoundCodeDt; @@ -1825,6 +1826,12 @@ public class ConceptMap extends BaseResource implements IResource { } + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.CONCEPTMAP; + } + + diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Condition.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Condition.java index f97e2e988e0..f44f1804541 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Condition.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Condition.java @@ -60,6 +60,7 @@ import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.ConditionRelationshipTypeEnum; import ca.uhn.fhir.model.dstu.valueset.ConditionStatusEnum; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.CodeDt; @@ -1773,6 +1774,12 @@ public class Condition extends BaseResource implements IResource { } + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.CONDITION; + } + + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Conformance.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Conformance.java index 2ff435af243..06453f05bd8 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Conformance.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Conformance.java @@ -4880,5 +4880,12 @@ public class Conformance extends BaseResource implements IResource { + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.CONFORMANCE; + } + + + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Coverage.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Coverage.java index 3247218e4ac..aa01e70f3eb 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Coverage.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Coverage.java @@ -59,6 +59,7 @@ import ca.uhn.fhir.model.dstu.composite.IdentifierDt; import ca.uhn.fhir.model.dstu.composite.PeriodDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.DateDt; import ca.uhn.fhir.model.primitive.IntegerDt; import ca.uhn.fhir.rest.gclient.ReferenceClientParam; @@ -972,6 +973,12 @@ public class Coverage extends BaseResource implements IResource { } + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.COVERAGE; + } + + } 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 0d4d8e050e6..2fa824cf137 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 @@ -55,6 +55,7 @@ import ca.uhn.fhir.model.dstu.composite.IdentifierDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.DateDt; import ca.uhn.fhir.model.primitive.StringDt; import ca.uhn.fhir.model.primitive.UriDt; @@ -1014,6 +1015,11 @@ public class Device extends BaseResource implements IResource { return this; } + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.DEVICE; + } + diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DeviceObservationReport.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DeviceObservationReport.java index c684abe000b..f3a619a1d98 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DeviceObservationReport.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DeviceObservationReport.java @@ -56,6 +56,7 @@ import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; import ca.uhn.fhir.model.dstu.composite.IdentifierDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.InstantDt; import ca.uhn.fhir.rest.gclient.ReferenceClientParam; import ca.uhn.fhir.rest.gclient.TokenClientParam; @@ -816,6 +817,11 @@ public class DeviceObservationReport extends BaseResource implements IResource { } + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.DEVICEOBSERVATIONREPORT; + } + diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticOrder.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticOrder.java index 7542556caf7..446f27ae23f 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticOrder.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticOrder.java @@ -58,6 +58,7 @@ import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderPriorityEnum; import ca.uhn.fhir.model.dstu.valueset.DiagnosticOrderStatusEnum; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.CodeDt; import ca.uhn.fhir.model.primitive.DateTimeDt; @@ -1530,6 +1531,12 @@ public class DiagnosticOrder extends BaseResource implements IResource { } + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.DIAGNOSTICORDER; + } + + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticReport.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticReport.java index 213ab9bf89e..be8b5103274 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticReport.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticReport.java @@ -60,6 +60,7 @@ import ca.uhn.fhir.model.dstu.composite.PeriodDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.DiagnosticReportStatusEnum; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.CodeDt; import ca.uhn.fhir.model.primitive.DateTimeDt; @@ -1357,6 +1358,11 @@ public class DiagnosticReport extends BaseResource implements IResource { } + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.DIAGNOSTICREPORT; + } + diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DocumentManifest.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DocumentManifest.java index b4fb4903a32..4d2b457a7de 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DocumentManifest.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DocumentManifest.java @@ -54,6 +54,7 @@ import ca.uhn.fhir.model.dstu.composite.IdentifierDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.DocumentReferenceStatusEnum; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.CodeDt; import ca.uhn.fhir.model.primitive.DateTimeDt; @@ -1067,6 +1068,11 @@ public class DocumentManifest extends BaseResource implements IResource { getContent().add(newType); return newType; } + + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.DOCUMENTMANIFEST; + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DocumentReference.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DocumentReference.java index 1280ccb7c3a..93c67228bca 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DocumentReference.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DocumentReference.java @@ -59,6 +59,7 @@ import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.DocumentReferenceStatusEnum; import ca.uhn.fhir.model.dstu.valueset.DocumentRelationshipTypeEnum; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.CodeDt; import ca.uhn.fhir.model.primitive.DateTimeDt; @@ -2478,5 +2479,12 @@ public class DocumentReference extends BaseResource implements IResource { + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.DOCUMENTREFERENCE; + } + + + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Encounter.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Encounter.java index a9a1a219fea..bcf6d962096 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Encounter.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Encounter.java @@ -62,6 +62,7 @@ import ca.uhn.fhir.model.dstu.valueset.EncounterStateEnum; import ca.uhn.fhir.model.dstu.valueset.EncounterTypeEnum; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; import ca.uhn.fhir.model.dstu.valueset.ParticipantTypeEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; @@ -2085,5 +2086,12 @@ public class Encounter extends BaseResource implements IResource { + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.ENCOUNTER; + } + + + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/FamilyHistory.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/FamilyHistory.java index 6ae8e650076..549ef6b8579 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/FamilyHistory.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/FamilyHistory.java @@ -58,6 +58,7 @@ import ca.uhn.fhir.model.dstu.composite.PeriodDt; import ca.uhn.fhir.model.dstu.composite.RangeDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.DateDt; import ca.uhn.fhir.model.primitive.StringDt; @@ -878,6 +879,11 @@ public class FamilyHistory extends BaseResource implements IResource { } + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.FAMILYHISTORY; + } + diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GVFMeta.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GVFMeta.java index d2e88ecb018..e5fb205f115 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GVFMeta.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GVFMeta.java @@ -54,6 +54,7 @@ import ca.uhn.fhir.model.api.annotation.ResourceDef; import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; import ca.uhn.fhir.model.dstu.composite.AttachmentDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.CodeDt; import ca.uhn.fhir.model.primitive.DateDt; import ca.uhn.fhir.model.primitive.IntegerDt; @@ -1549,6 +1550,12 @@ public class GVFMeta extends BaseResource implements IResource { } + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.GVFMETA; + } + + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GVFVariant.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GVFVariant.java index 5d90f43e474..fc368327b03 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GVFVariant.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GVFVariant.java @@ -52,6 +52,7 @@ import ca.uhn.fhir.model.api.annotation.ResourceDef; import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; import ca.uhn.fhir.model.dstu.composite.AttachmentDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.CodeDt; import ca.uhn.fhir.model.primitive.DecimalDt; import ca.uhn.fhir.model.primitive.IntegerDt; @@ -3194,6 +3195,12 @@ public class GVFVariant extends BaseResource implements IResource { } + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.GVFVARIANT; + } + + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GeneExpression.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GeneExpression.java index b8f9a6055c1..3931f872ec1 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GeneExpression.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GeneExpression.java @@ -51,6 +51,7 @@ import ca.uhn.fhir.model.api.annotation.Description; import ca.uhn.fhir.model.api.annotation.ResourceDef; import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.DecimalDt; import ca.uhn.fhir.model.primitive.IntegerDt; import ca.uhn.fhir.model.primitive.StringDt; @@ -1052,6 +1053,11 @@ public class GeneExpression extends BaseResource implements IResource { } + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.GENEEXPRESSION; + } + diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GeneticAnalysis.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GeneticAnalysis.java index 621fa7135b9..4cc6ada866c 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GeneticAnalysis.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GeneticAnalysis.java @@ -54,6 +54,7 @@ import ca.uhn.fhir.model.api.annotation.ResourceDef; import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; import ca.uhn.fhir.model.dstu.composite.CodingDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.DateDt; import ca.uhn.fhir.model.primitive.IntegerDt; import ca.uhn.fhir.model.primitive.StringDt; @@ -1422,5 +1423,12 @@ public class GeneticAnalysis extends BaseResource implements IResource { + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.GENETICANALYSIS; + } + + + } 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 1d8e599d85d..e4b1cc89389 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 @@ -58,6 +58,7 @@ import ca.uhn.fhir.model.dstu.composite.RangeDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.GroupTypeEnum; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.CodeDt; @@ -873,6 +874,11 @@ public class Group extends BaseResource implements IResource { } + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.GROUP; + } + diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ImagingStudy.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ImagingStudy.java index 260a5f26c21..e5b4399bbec 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ImagingStudy.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ImagingStudy.java @@ -59,6 +59,7 @@ import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; import ca.uhn.fhir.model.dstu.valueset.ImagingModalityEnum; import ca.uhn.fhir.model.dstu.valueset.InstanceAvailabilityEnum; import ca.uhn.fhir.model.dstu.valueset.ModalityEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.CodeDt; import ca.uhn.fhir.model.primitive.DateTimeDt; @@ -2182,6 +2183,11 @@ public class ImagingStudy extends BaseResource implements IResource { } + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.IMAGINGSTUDY; + } + diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Immunization.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Immunization.java index 0abf3367386..be5fc2508a1 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Immunization.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Immunization.java @@ -60,6 +60,7 @@ import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; import ca.uhn.fhir.model.dstu.valueset.ImmunizationReasonCodesEnum; import ca.uhn.fhir.model.dstu.valueset.ImmunizationRouteCodesEnum; import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; import ca.uhn.fhir.model.primitive.DateDt; @@ -2208,6 +2209,9 @@ public class Immunization extends BaseResource implements IResource { } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.IMMUNIZATION; + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ImmunizationRecommendation.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ImmunizationRecommendation.java index 69db89d2d24..ee572d2bbe8 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ImmunizationRecommendation.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ImmunizationRecommendation.java @@ -58,6 +58,7 @@ import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; import ca.uhn.fhir.model.dstu.valueset.ImmunizationRecommendationDateCriterionCodesEnum; import ca.uhn.fhir.model.dstu.valueset.ImmunizationRecommendationStatusCodesEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; import ca.uhn.fhir.model.primitive.DateTimeDt; import ca.uhn.fhir.model.primitive.IntegerDt; @@ -1316,7 +1317,10 @@ public class ImmunizationRecommendation extends BaseResource implements IResourc } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.IMMUNIZATIONRECOMMENDATION; + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ListResource.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ListResource.java index af520332ec5..ce8ce90495e 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ListResource.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ListResource.java @@ -57,6 +57,7 @@ import ca.uhn.fhir.model.dstu.composite.IdentifierDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; import ca.uhn.fhir.model.dstu.valueset.ListModeEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.CodeDt; @@ -982,6 +983,12 @@ public class ListResource extends BaseResource implements IResource { } + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.LIST; + } + + } 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 1641976d8b5..180f965a287 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 @@ -60,6 +60,7 @@ import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; import ca.uhn.fhir.model.dstu.valueset.LocationModeEnum; import ca.uhn.fhir.model.dstu.valueset.LocationStatusEnum; import ca.uhn.fhir.model.dstu.valueset.LocationTypeEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; import ca.uhn.fhir.model.primitive.CodeDt; @@ -1150,6 +1151,12 @@ public class Location extends BaseResource implements IResource { } + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.LOCATION; + } + + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Media.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Media.java index 5d204d022e1..45f753e11f7 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Media.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Media.java @@ -55,6 +55,7 @@ import ca.uhn.fhir.model.dstu.composite.IdentifierDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; import ca.uhn.fhir.model.dstu.valueset.MediaTypeEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.CodeDt; import ca.uhn.fhir.model.primitive.DateTimeDt; @@ -923,7 +924,10 @@ public class Media extends BaseResource implements IResource { return this; } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.MEDIA; + } } 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 d0c596caacf..351d8c3f641 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 @@ -54,6 +54,7 @@ import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; import ca.uhn.fhir.model.dstu.composite.RatioDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.MedicationKindEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.CodeDt; @@ -815,7 +816,10 @@ public class Medication extends BaseResource implements IResource { } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.MEDICATION; + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationAdministration.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationAdministration.java index d30786c2278..83f273a91a8 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationAdministration.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationAdministration.java @@ -60,6 +60,7 @@ import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; import ca.uhn.fhir.model.dstu.valueset.MedicationAdministrationStatusEnum; import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.CodeDt; @@ -1350,7 +1351,10 @@ public class MedicationAdministration extends BaseResource implements IResource } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.MEDICATIONADMINISTRATION; + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationDispense.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationDispense.java index b36cd036582..e24fe1f5cf1 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationDispense.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationDispense.java @@ -63,6 +63,7 @@ import ca.uhn.fhir.model.dstu.composite.ScheduleDt; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; import ca.uhn.fhir.model.dstu.valueset.MedicationDispenseStatusEnum; import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.CodeDt; @@ -1968,7 +1969,10 @@ public class MedicationDispense extends BaseResource implements IResource { } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.MEDICATIONDISPENSE; + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationPrescription.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationPrescription.java index 73f9ab52588..1b626382403 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationPrescription.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationPrescription.java @@ -64,6 +64,7 @@ import ca.uhn.fhir.model.dstu.composite.ScheduleDt; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; import ca.uhn.fhir.model.dstu.valueset.MedicationPrescriptionStatusEnum; import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.CodeDt; @@ -75,8 +76,7 @@ import ca.uhn.fhir.rest.gclient.ReferenceClientParam; import ca.uhn.fhir.rest.gclient.TokenClientParam; -/** - * HAPI/FHIR MedicationPrescription Resource +/** * HAPI/FHIR MedicationPrescription Resource * (Prescription of medication to for patient) * *

@@ -1709,7 +1709,10 @@ public class MedicationPrescription extends BaseResource implements IResource { } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.MEDICATIONPRESCRIPTION; + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationStatement.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationStatement.java index 5e6641b2ac8..7a4f0d57e47 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationStatement.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationStatement.java @@ -60,6 +60,7 @@ import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.composite.ScheduleDt; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.rest.gclient.DateClientParam; import ca.uhn.fhir.rest.gclient.ReferenceClientParam; @@ -1086,6 +1087,9 @@ public class MedicationStatement extends BaseResource implements IResource { } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.MEDICATIONSTATEMENT; + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MessageHeader.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MessageHeader.java index f8c68214c12..8c7990d9661 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MessageHeader.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MessageHeader.java @@ -55,6 +55,7 @@ import ca.uhn.fhir.model.dstu.composite.CodingDt; import ca.uhn.fhir.model.dstu.composite.ContactDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.dstu.valueset.ResponseTypeEnum; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.CodeDt; @@ -1268,7 +1269,10 @@ public class MessageHeader extends BaseResource implements IResource { } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.MESSAGEHEADER; + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Microarray.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Microarray.java index 1d99def65fc..d8c646c9235 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Microarray.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Microarray.java @@ -54,6 +54,7 @@ import ca.uhn.fhir.model.api.annotation.ResourceDef; import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.DateDt; import ca.uhn.fhir.model.primitive.DecimalDt; @@ -1485,7 +1486,10 @@ public class Microarray extends BaseResource implements IResource { } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.MICROARRAY; + } 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 73a9e5b11ee..af02d73f704 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 @@ -68,6 +68,7 @@ import ca.uhn.fhir.model.dstu.valueset.ObservationRelationshipTypeEnum; import ca.uhn.fhir.model.dstu.valueset.ObservationReliabilityEnum; import ca.uhn.fhir.model.dstu.valueset.ObservationStatusEnum; import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; import ca.uhn.fhir.model.primitive.CodeDt; @@ -1750,7 +1751,10 @@ public class Observation extends BaseResource implements IResource { } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.OBSERVATION; + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/OperationOutcome.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/OperationOutcome.java index 7ca704f5aeb..1e5c1360778 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/OperationOutcome.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/OperationOutcome.java @@ -50,6 +50,7 @@ import ca.uhn.fhir.model.api.annotation.Description; import ca.uhn.fhir.model.api.annotation.ResourceDef; import ca.uhn.fhir.model.dstu.composite.CodingDt; import ca.uhn.fhir.model.dstu.valueset.IssueSeverityEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.CodeDt; import ca.uhn.fhir.model.primitive.StringDt; @@ -407,7 +408,10 @@ public class OperationOutcome extends BaseResource implements IResource { } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.OPERATIONOUTCOME; + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Order.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Order.java index 93413f13bf7..aa331973d1e 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Order.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Order.java @@ -58,6 +58,7 @@ import ca.uhn.fhir.model.dstu.composite.IdentifierDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.composite.ScheduleDt; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.DateTimeDt; import ca.uhn.fhir.rest.gclient.DateClientParam; import ca.uhn.fhir.rest.gclient.ReferenceClientParam; @@ -847,7 +848,10 @@ public class Order extends BaseResource implements IResource { } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.ORDER; + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/OrderResponse.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/OrderResponse.java index 0fa13d912d9..9994a5a5f2f 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/OrderResponse.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/OrderResponse.java @@ -55,6 +55,7 @@ import ca.uhn.fhir.model.dstu.composite.IdentifierDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; import ca.uhn.fhir.model.dstu.valueset.OrderOutcomeStatusEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.CodeDt; import ca.uhn.fhir.model.primitive.DateTimeDt; @@ -656,7 +657,11 @@ public class OrderResponse extends BaseResource implements IResource { getFulfillment().add(newType); return newType; } - + + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.ORDERRESPONSE; + } } 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 0cb7102589a..4c6510e3443 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 @@ -60,6 +60,7 @@ import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; import ca.uhn.fhir.model.dstu.valueset.OrganizationTypeEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; import ca.uhn.fhir.model.primitive.StringDt; @@ -1112,7 +1113,10 @@ public class Organization extends BaseResource implements IResource { } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.ORGANIZATION; + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Other.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Other.java index d52f6372067..d3abef98d84 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Other.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Other.java @@ -53,6 +53,7 @@ import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; import ca.uhn.fhir.model.dstu.composite.IdentifierDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.DateDt; import ca.uhn.fhir.rest.gclient.DateClientParam; import ca.uhn.fhir.rest.gclient.ReferenceClientParam; @@ -445,7 +446,10 @@ public class Other extends BaseResource implements IResource { return this; } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.OTHER; + } } 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 749fd1dcf40..429b0b88268 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 @@ -66,6 +66,7 @@ import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; import ca.uhn.fhir.model.dstu.valueset.LinkTypeEnum; import ca.uhn.fhir.model.dstu.valueset.MaritalStatusCodesEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; @@ -2096,7 +2097,10 @@ public class Patient extends BaseResource implements IResource { } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.PATIENT; + } } 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 1a809268ab3..879ea016de4 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 @@ -65,6 +65,7 @@ import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; import ca.uhn.fhir.model.dstu.valueset.PractitionerRoleEnum; import ca.uhn.fhir.model.dstu.valueset.PractitionerSpecialtyEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; import ca.uhn.fhir.model.primitive.DateTimeDt; import ca.uhn.fhir.rest.gclient.ReferenceClientParam; @@ -1367,7 +1368,10 @@ public class Practitioner extends BaseResource implements IResource { } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.PRACTITIONER; + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Procedure.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Procedure.java index 85868e468fc..b42d8874a68 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Procedure.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Procedure.java @@ -56,6 +56,7 @@ import ca.uhn.fhir.model.dstu.composite.PeriodDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; import ca.uhn.fhir.model.dstu.valueset.ProcedureRelationshipTypeEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.CodeDt; import ca.uhn.fhir.model.primitive.StringDt; @@ -1183,7 +1184,10 @@ public class Procedure extends BaseResource implements IResource { } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.PROCEDURE; + } } 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 index 170b3de1b01..c6994d90216 100644 --- 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 @@ -36,7 +36,6 @@ package ca.uhn.fhir.model.dstu.resource; * #L% */ - import java.util.Date; import java.util.List; @@ -5133,6 +5132,9 @@ public class Profile extends BaseResource implements IResource { } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.PROFILE; + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Provenance.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Provenance.java index c467247aaea..d14df23b4e1 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Provenance.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Provenance.java @@ -57,6 +57,7 @@ import ca.uhn.fhir.model.dstu.composite.CodingDt; import ca.uhn.fhir.model.dstu.composite.PeriodDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.ProvenanceEntityRoleEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.CodeDt; import ca.uhn.fhir.model.primitive.InstantDt; @@ -1199,7 +1200,10 @@ public class Provenance extends BaseResource implements IResource { } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.PROVENANCE; + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Query.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Query.java index 01e41b02419..ebb125116e2 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Query.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Query.java @@ -52,6 +52,7 @@ import ca.uhn.fhir.model.api.annotation.ResourceDef; import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.QueryOutcomeEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.CodeDt; import ca.uhn.fhir.model.primitive.IntegerDt; @@ -858,6 +859,9 @@ public class Query extends BaseResource implements IResource { } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.QUERY; + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Questionnaire.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Questionnaire.java index 667f08dc289..844f8cffc0d 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Questionnaire.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Questionnaire.java @@ -61,6 +61,7 @@ import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; import ca.uhn.fhir.model.dstu.valueset.QuestionnaireGroupNameEnum; import ca.uhn.fhir.model.dstu.valueset.QuestionnaireNameEnum; import ca.uhn.fhir.model.dstu.valueset.QuestionnaireStatusEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; @@ -1499,7 +1500,10 @@ public class Questionnaire extends BaseResource implements IResource { } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.QUESTIONNAIRE; + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/RelatedPerson.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/RelatedPerson.java index b72577e5d60..3af5266af85 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/RelatedPerson.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/RelatedPerson.java @@ -58,6 +58,7 @@ import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; import ca.uhn.fhir.model.dstu.valueset.PatientRelationshipTypeEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; import ca.uhn.fhir.rest.gclient.ReferenceClientParam; import ca.uhn.fhir.rest.gclient.StringClientParam; @@ -742,6 +743,8 @@ public class RelatedPerson extends BaseResource implements IResource { return getPhoto().get(0); } - - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.RELATEDPERSON; + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Remittance.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Remittance.java index c167fd52eab..37cbba80cdc 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Remittance.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Remittance.java @@ -52,6 +52,7 @@ import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; import ca.uhn.fhir.model.dstu.composite.IdentifierDt; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.DecimalDt; import ca.uhn.fhir.model.primitive.IntegerDt; import ca.uhn.fhir.rest.gclient.TokenClientParam; @@ -533,7 +534,10 @@ public class Remittance extends BaseResource implements IResource { } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.REMITTANCE; + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SecurityEvent.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SecurityEvent.java index c295fc902e5..5696da5cf06 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SecurityEvent.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SecurityEvent.java @@ -57,6 +57,7 @@ import ca.uhn.fhir.model.dstu.composite.CodingDt; import ca.uhn.fhir.model.dstu.composite.IdentifierDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.dstu.valueset.SecurityEventActionEnum; import ca.uhn.fhir.model.dstu.valueset.SecurityEventObjectLifecycleEnum; import ca.uhn.fhir.model.dstu.valueset.SecurityEventObjectRoleEnum; @@ -2407,6 +2408,9 @@ public class SecurityEvent extends BaseResource implements IResource { - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.SECURITYEVENT; + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SequencingAnalysis.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SequencingAnalysis.java index df47230fdf8..12561bbcb32 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SequencingAnalysis.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SequencingAnalysis.java @@ -54,6 +54,7 @@ import ca.uhn.fhir.model.api.annotation.ResourceDef; import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; import ca.uhn.fhir.model.dstu.composite.AttachmentDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.CodeDt; import ca.uhn.fhir.model.primitive.DateDt; import ca.uhn.fhir.model.primitive.StringDt; @@ -656,7 +657,10 @@ public class SequencingAnalysis extends BaseResource implements IResource { } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.SEQUENCINGANALYSIS; + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SequencingLab.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SequencingLab.java index d22719b8f29..9d09a72175d 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SequencingLab.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SequencingLab.java @@ -55,6 +55,7 @@ import ca.uhn.fhir.model.api.annotation.SearchParamDefinition; import ca.uhn.fhir.model.dstu.composite.AttachmentDt; import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.CodeDt; import ca.uhn.fhir.model.primitive.DateDt; import ca.uhn.fhir.model.primitive.StringDt; @@ -974,6 +975,9 @@ public class SequencingLab extends BaseResource implements IResource { } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.SEQUENCINGLAB; + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Slot.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Slot.java index d8b738c24a3..62a9c9dc24f 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Slot.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Slot.java @@ -53,6 +53,7 @@ import ca.uhn.fhir.model.dstu.composite.CodeableConceptDt; import ca.uhn.fhir.model.dstu.composite.IdentifierDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.CodeDt; import ca.uhn.fhir.model.primitive.DateTimeDt; import ca.uhn.fhir.model.primitive.InstantDt; @@ -699,7 +700,10 @@ public class Slot extends BaseResource implements IResource { return this; } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.SLOT; + } } 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 dce33742a7f..c72fc53d542 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 @@ -61,6 +61,7 @@ import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.HierarchicalRelationshipTypeEnum; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.dstu.valueset.SpecimenCollectionMethodEnum; import ca.uhn.fhir.model.dstu.valueset.SpecimenTreatmentProcedureEnum; import ca.uhn.fhir.model.primitive.BoundCodeDt; @@ -1868,7 +1869,10 @@ public class Specimen extends BaseResource implements IResource { } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.SPECIMEN; + } } 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 f816152f445..10112647f5f 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 @@ -59,6 +59,7 @@ import ca.uhn.fhir.model.dstu.composite.RatioDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.dstu.valueset.SubstanceTypeEnum; import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt; import ca.uhn.fhir.model.primitive.DateTimeDt; @@ -794,7 +795,10 @@ public class Substance extends BaseResource implements IResource { } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.SUBSTANCE; + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Supply.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Supply.java index 20ece25f013..1522d8e4e5f 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Supply.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Supply.java @@ -57,6 +57,7 @@ import ca.uhn.fhir.model.dstu.composite.QuantityDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.dstu.valueset.SupplyDispenseStatusEnum; import ca.uhn.fhir.model.dstu.valueset.SupplyItemTypeEnum; import ca.uhn.fhir.model.dstu.valueset.SupplyStatusEnum; @@ -1126,6 +1127,9 @@ public class Supply extends BaseResource implements IResource { } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.SUPPLY; + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Test.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Test.java index 1302b654641..396b1c5c59b 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Test.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Test.java @@ -47,6 +47,7 @@ import ca.uhn.fhir.model.api.TemporalPrecisionEnum; import ca.uhn.fhir.model.api.annotation.Child; import ca.uhn.fhir.model.api.annotation.Description; import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.Base64BinaryDt; import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.DecimalDt; @@ -1428,6 +1429,9 @@ public class Test extends BaseResource implements IResource { } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.TEST; + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/User.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/User.java index 95cb7940a4d..c2a84b205f5 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/User.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/User.java @@ -51,6 +51,7 @@ import ca.uhn.fhir.model.dstu.composite.ContactDt; import ca.uhn.fhir.model.dstu.composite.HumanNameDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.primitive.CodeDt; import ca.uhn.fhir.model.primitive.IntegerDt; import ca.uhn.fhir.model.primitive.StringDt; @@ -654,6 +655,9 @@ public class User extends BaseResource implements IResource { return newType; } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.USER; + } } 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 eb69bea10a0..597b2de883c 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 @@ -56,6 +56,7 @@ import ca.uhn.fhir.model.dstu.composite.IdentifierDt; import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum; import ca.uhn.fhir.model.dstu.valueset.FilterOperatorEnum; import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; +import ca.uhn.fhir.model.dstu.valueset.ResourceTypeEnum; import ca.uhn.fhir.model.dstu.valueset.ValueSetStatusEnum; import ca.uhn.fhir.model.primitive.BooleanDt; import ca.uhn.fhir.model.primitive.BoundCodeDt; @@ -2767,7 +2768,10 @@ public class ValueSet extends BaseResource implements IResource { } - + @Override + public ResourceTypeEnum getResourceType() { + return ResourceTypeEnum.VALUESET; + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/interceptor/AuditingInterceptor.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/interceptor/AuditingInterceptor.java index d28e84d77ee..7753145b527 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/interceptor/AuditingInterceptor.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/interceptor/AuditingInterceptor.java @@ -27,6 +27,7 @@ import ca.uhn.fhir.rest.server.Constants; import ca.uhn.fhir.rest.server.audit.IResourceAuditor; import ca.uhn.fhir.rest.server.exceptions.AuthenticationException; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; +import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.store.IAuditDataStore; public class AuditingInterceptor extends InterceptorAdapter { @@ -34,6 +35,15 @@ public class AuditingInterceptor extends InterceptorAdapter { private IAuditDataStore myDataStore; private Map>> myAuditableResources = new HashMap>>(); + private boolean myClientParamsOptional = false; + + public AuditingInterceptor() { + myClientParamsOptional = false; + } + + public AuditingInterceptor(boolean theClientParamsOptional){ + myClientParamsOptional = theClientParamsOptional; + } @Override public boolean outgoingResponse(RequestDetails theRequestDetails, Bundle theResponseObject, HttpServletRequest theServletRequest, HttpServletResponse theServletResponse) @@ -42,6 +52,10 @@ public class AuditingInterceptor extends InterceptorAdapter { log.info("Auditing bundle: " + theResponseObject + " from request " + theRequestDetails); SecurityEvent auditEvent = new SecurityEvent(); + //get user info from request if available + boolean hasUserInfo = addParticipantToEvent(theServletRequest, auditEvent); + if(!hasUserInfo) return true; //no user to audit - throws exception if client params are required + SecurityEventObjectLifecycleEnum lifecycle = mapResourceTypeToSecurityLifecycle(theRequestDetails.getResourceOperationType()); boolean hasAuditableEntry = false; byte[] query = getQueryFromRequestDetails(theRequestDetails); @@ -51,7 +65,7 @@ public class AuditingInterceptor extends InterceptorAdapter { if(hasAuditableEntryInResource) hasAuditableEntry = true; } if(!hasAuditableEntry) return true; //no PHI to audit - addParticipantToEvent(theServletRequest, auditEvent); + store(auditEvent); return true; }catch(Exception e){ @@ -105,9 +119,8 @@ public class AuditingInterceptor extends InterceptorAdapter { * @throws InstantiationException */ protected boolean addResourceObjectToEvent(SecurityEvent auditEvent, IResource resource, SecurityEventObjectLifecycleEnum lifecycle, byte[] query) throws InstantiationException, IllegalAccessException { - //TODO: get resource name from IResource -- James will put this in the model - //reference ResourceTypeEnum - ResourceTypeEnum resourceType = null; //resource.getResourceType(); + + ResourceTypeEnum resourceType = resource.getResourceType(); if(myAuditableResources.containsKey(resourceType)){ @SuppressWarnings("unchecked") IResourceAuditor auditableResource = (IResourceAuditor) myAuditableResources.get(resourceType).newInstance(); @@ -129,13 +142,16 @@ public class AuditingInterceptor extends InterceptorAdapter { return false; //not something we care to audit } - private void addParticipantToEvent(HttpServletRequest theServletRequest, SecurityEvent auditEvent) { + private boolean addParticipantToEvent(HttpServletRequest theServletRequest, SecurityEvent auditEvent) throws InvalidRequestException, NotImplementedException { if(theServletRequest.getHeader(Constants.HEADER_AUTHORIZATION) != null && theServletRequest.getHeader(Constants.HEADER_AUTHORIZATION).startsWith("OAuth")){ //TODO: get user info from token throw new NotImplementedException("OAuth user auditing not yet implemented."); }else { //no auth or basic auth or anything else, use HTTP headers for user info String userId = theServletRequest.getHeader(UserInfoInterceptor.HEADER_USER_ID); - if(userId == null) userId = "anonymous"; //TODO: throw new InvalidParameterException(UserInfoInterceptor.HEADER_USER_ID + " must be specified as an HTTP header to access PHI."); + if(userId == null){ + if(myClientParamsOptional) return false; //no auditing + else throw new InvalidRequestException(UserInfoInterceptor.HEADER_USER_ID + " must be specified as an HTTP header to access PHI."); + } String userName = theServletRequest.getHeader(UserInfoInterceptor.HEADER_USER_NAME); if(userName == null) userName = "Anonymous"; String userIp = theServletRequest.getRemoteAddr(); @@ -145,6 +161,7 @@ public class AuditingInterceptor extends InterceptorAdapter { ParticipantNetwork network = participant.getNetwork(); network.setType(SecurityEventParticipantNetworkTypeEnum.IP_ADDRESS); network.setIdentifier(userIp); + return true; }