diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeResourceDefinition.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeResourceDefinition.java index c524e96c7ee..d7ddbaa6d70 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeResourceDefinition.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/RuntimeResourceDefinition.java @@ -107,7 +107,11 @@ public class RuntimeResourceDefinition extends BaseRuntimeElementCompositeDefini } if (!UrlUtil.isValid(profile)) { - String profileWithUrl = theServerBase + "/Profile/" + profile; + String resourceName = "/StructureDefinition/"; + if (myContext.getVersion().getVersion() == FhirVersionEnum.DSTU1) { + resourceName = "/Profile/"; + } + String profileWithUrl = theServerBase + resourceName + profile; if (UrlUtil.isValid(profileWithUrl)) { return profileWithUrl; } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/interceptor/ResponseValidatingInterceptor.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/interceptor/ResponseValidatingInterceptor.java index 6fc48753f1b..b142bc6ed3e 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/interceptor/ResponseValidatingInterceptor.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/interceptor/ResponseValidatingInterceptor.java @@ -1,49 +1,21 @@ package ca.uhn.fhir.rest.server.interceptor; -import java.nio.charset.Charset; - -/* - * #%L - * HAPI FHIR - Core Library - * %% - * Copyright (C) 2014 - 2015 University Health Network - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * #L% - */ - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import java.util.HashSet; +import java.util.Set; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBaseResource; -import ca.uhn.fhir.model.api.Bundle; -import ca.uhn.fhir.model.api.TagList; +import ca.uhn.fhir.rest.api.RestOperationTypeEnum; import ca.uhn.fhir.rest.method.RequestDetails; -import ca.uhn.fhir.rest.param.ResourceParameter; -import ca.uhn.fhir.rest.server.EncodingEnum; -import ca.uhn.fhir.rest.server.RestfulServerUtils; -import ca.uhn.fhir.rest.server.exceptions.AuthenticationException; import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException; import ca.uhn.fhir.validation.FhirValidator; import ca.uhn.fhir.validation.ResultSeverityEnum; import ca.uhn.fhir.validation.ValidationResult; /** - * This interceptor intercepts each outgoing response and if it contains a FHIR resource, validates that resource. The - * interceptor may be configured to run any validator modules, and will then add headers to the response or fail the - * request with an {@link UnprocessableEntityException HTTP 422 Unprocessable Entity}. + * This interceptor intercepts each outgoing response and if it contains a FHIR resource, validates that resource. The interceptor may be configured to run any validator modules, and will then add + * headers to the response or fail the request with an {@link UnprocessableEntityException HTTP 422 Unprocessable Entity}. */ public class ResponseValidatingInterceptor extends BaseValidatingInterceptor { @@ -54,12 +26,42 @@ public class ResponseValidatingInterceptor extends BaseValidatingInterceptor myExcludeOperationTypes; + + /** + * Do not validate the following operations. A common use for this is to exclude {@link RestOperationTypeEnum#METADATA} so that this operation will execute as quickly as possible. + */ + public void addExcludeOperationType(RestOperationTypeEnum theOperationType) { + Validate.notNull(theOperationType, "theOperationType must not be null"); + if (myExcludeOperationTypes == null) { + myExcludeOperationTypes = new HashSet(); + } + myExcludeOperationTypes.add(theOperationType); + } + + @Override + ValidationResult doValidate(FhirValidator theValidator, IBaseResource theRequest) { + return theValidator.validateWithResult(theRequest); + } + @Override public boolean outgoingResponse(RequestDetails theRequestDetails, IBaseResource theResponseObject) { + RestOperationTypeEnum operationType = theRequestDetails.getRestOperationType(); + if (operationType != null && myExcludeOperationTypes != null && myExcludeOperationTypes.contains(operationType)) { + ourLog.trace("Operation type {} is excluded from validation", operationType); + return true; + } + validate(theResponseObject, theRequestDetails); + return true; } + @Override + String provideDefaultResponseHeaderName() { + return DEFAULT_RESPONSE_HEADER_NAME; + } + /** * Sets the name of the response header to add validation failures to * @@ -71,14 +73,4 @@ public class ResponseValidatingInterceptor extends BaseValidatingInterceptor - home_dev , DSTU2 , UHN/HAPI Server (DSTU2 FHIR) , http://fhirtest.uhn.ca/baseDstu2 - home_21 , DSTU2 , UHN/HAPI Server (DSTU2.1 FHIR) , http://fhirtest.uhn.ca/baseDstu2.1 - home , DSTU1 , UHN/HAPI Server (DSTU1 FHIR) , http://fhirtest.uhn.ca/baseDstu1 - hidev , DSTU2 , Health Intersections (DSTU2 FHIR) , http://fhir-dev.healthintersections.com.au/open - hi , DSTU1 , Health Intersections (DSTU1 FHIR) , http://fhir.healthintersections.com.au/open - furored2 , DSTU2 , Spark - Furore (DSTU2 FHIR) , http://spark-dstu2.furore.com/fhir - furore , DSTU1 , Spark - Furore (DSTU1 FHIR) , http://spark.furore.com/fhir - sof , DSTU2 , SQL on FHIR - HealthConnex (DSTU2 FHIR) , http://sqlonfhir.azurewebsites.net/fhir + home_dev , DSTU2 , UHN/HAPI Server (DSTU2 FHIR) , http://fhirtest.uhn.ca/baseDstu2 + home_21 , DSTU2_1 , UHN/HAPI Server (DSTU2.1 FHIR) , http://fhirtest.uhn.ca/baseDstu2.1 + home , DSTU1 , UHN/HAPI Server (DSTU1 FHIR) , http://fhirtest.uhn.ca/baseDstu1 + hidev , DSTU2 , Health Intersections (DSTU2 FHIR) , http://fhir-dev.healthintersections.com.au/open + hi , DSTU1 , Health Intersections (DSTU1 FHIR) , http://fhir.healthintersections.com.au/open + furored2 , DSTU2 , Spark - Furore (DSTU2 FHIR) , http://spark-dstu2.furore.com/fhir + furore , DSTU1 , Spark - Furore (DSTU1 FHIR) , http://spark.furore.com/fhir + sof , DSTU2 , SQL on FHIR - HealthConnex (DSTU2 FHIR) , http://sqlonfhir.azurewebsites.net/fhir @@ -3678,6 +3678,37 @@ + + + + Identifies the name, action type, time, and disposition of the audited event. + + + + + A person, a hardware device or software process. + + + + + Application systems and processes. + + + + + Specific instances of data or objects that have been accessed. + + + + + + + + + A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. + + + @@ -3694,7 +3725,7 @@ Indicator for type of action performed during the event that generated the audit. - + The time when the event occurred on the source. @@ -3714,26 +3745,11 @@ The purposeOfUse (reason) that was used during the event being recorded. - - - A person, a hardware device or software process. - - - - - Application systems and processes. - - - - - Specific instances of data or objects that have been accessed. - - - + A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. @@ -3747,7 +3763,7 @@ - Direct reference to a resource that identifies the agent. + Direct reference to a resource that identifies the participant. @@ -3757,7 +3773,7 @@ - Alternative agent Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g. single sign-on), if available. + Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g. single sign-on), if available. @@ -3792,7 +3808,7 @@ - The reason (purpose of use), specific to this agent, that was used during the event being recorded. + The reason (purpose of use), specific to this participant, that was used during the event being recorded. @@ -3846,7 +3862,7 @@ - + A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. @@ -3855,12 +3871,12 @@ - Identifies a specific instance of the entity. The reference should always be version specific. + Identifies a specific instance of the participant object. The reference should always be version specific. - Identifies a specific instance of the entity. The reference should always be version specific. + Identifies a specific instance of the participant object. The reference should always be version specific. @@ -3870,37 +3886,37 @@ - Code representing the role the entity played in the event being audited. + Code representing the functional application role of Participant Object being audited. - Identifier for the data life-cycle stage for the entity. + Identifier for the data life-cycle stage for the participant object. - Denotes security labels for the identified entity. + Denotes security labels for the identified object. - A name of the entity in the audit event. + An instance-specific descriptor of the Participant Object ID audited, such as a person's name. - Text that describes the entity in more detail. + Text that describes the object in more detail. - The query parameters for a query-type entities. + The actual query for a query-type participant object. - Additional Information about the entity. + Additional Information about the Object. @@ -21596,12 +21612,12 @@ Specifically if 'boolean' datatype is selected, then the following logic applies The instant of time at which the activity was recorded. - + The reason that the activity was taking place. - + An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities. @@ -21616,7 +21632,7 @@ Specifically if 'boolean' datatype is selected, then the following logic applies Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc. - + An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, an organization, software, or other entities that may be ascribed responsibility. diff --git a/hapi-tinder-plugin/src/main/resources/dt/dstu21/backboneelement.xml b/hapi-tinder-plugin/src/main/resources/dt/dstu21/backboneelement.xml index aa5ca0db6ad..c1d74d571ba 100644 --- a/hapi-tinder-plugin/src/main/resources/dt/dstu21/backboneelement.xml +++ b/hapi-tinder-plugin/src/main/resources/dt/dstu21/backboneelement.xml @@ -1,9075 +1,4292 @@ - + - - - Grahame - Grahame - 2012-03-19T11:12:07Z - 2014-11-17T05:30:16Z - 14.00 - - - - - - - Invariants - Invariants - - 2580 - 9870 - 5520 - 6075 - 1 - - False - False - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FHIR Resource-authoring Spreadsheet - - - - - This spreadsheet is used to support the definition of resources or data types (structures). A complete set of instructions on the various tabs, columns and rules associated with populating this spreadsheet can be found here: - - - - - http://wiki.hl7.org?title=FHIR_Spreadsheet_Authoring - - -
- - -
-