added resource type to IResource so all resource subclasses must declare what type they are (to facilitate auditing of resources)

This commit is contained in:
lmds1 2014-10-15 15:22:42 -04:00
parent 6049df0bfa
commit fdd9939d16
67 changed files with 405 additions and 46 deletions

View File

@ -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<ResourceMetadataKeyEnum<?>, Object> theMap);
/**
* Returns a ResourceTypeEnum representing the type of this Resource
* @return the ResourceType of this Resource
*/
ResourceTypeEnum getResourceType();
}

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -4880,5 +4880,12 @@ public class Conformance extends BaseResource implements IResource {
@Override
public ResourceTypeEnum getResourceType() {
return ResourceTypeEnum.CONFORMANCE;
}
}

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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 <b>MedicationPrescription</b> Resource
/** * HAPI/FHIR <b>MedicationPrescription</b> Resource
* (Prescription of medication to for patient)
*
* <p>
@ -1709,7 +1709,10 @@ public class MedicationPrescription extends BaseResource implements IResource {
}
@Override
public ResourceTypeEnum getResourceType() {
return ResourceTypeEnum.MEDICATIONPRESCRIPTION;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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<ResourceTypeEnum, Class<? extends IResourceAuditor<? extends IResource>>> myAuditableResources = new HashMap<ResourceTypeEnum, Class<? extends IResourceAuditor<? extends IResource>>>();
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<IResource> auditableResource = (IResourceAuditor<IResource>) 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;
}