Add CapabilityStatement customizer (#2387)

* Add CapabilityStatement customizer

* Fix javadocs
This commit is contained in:
James Agnew 2021-02-15 14:58:34 -05:00 committed by GitHub
parent 98b4141b1b
commit 65ac0e80fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
54 changed files with 302 additions and 110 deletions

View File

@ -8,7 +8,7 @@ assignees: ''
---
NOTE: Before filing a ticket, please see the following URL:
https://github.com/jamesagnew/hapi-fhir/wiki/Getting-Help
https://github.com/hapifhir/hapi-fhir/wiki/Getting-Help
**Describe the bug**
A clear and concise description of what the bug is.

View File

@ -1,5 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Getting Help / Community
url: https://github.com/jamesagnew/hapi-fhir/wiki/Getting-Help
url: https://github.com/hapifhir/hapi-fhir/wiki/Getting-Help
about: Please click here to learn about where to ask questions about HAPI FHIR

View File

@ -8,7 +8,7 @@ assignees: ''
---
NOTE: Before filing a ticket, please see the following URL:
https://github.com/jamesagnew/hapi-fhir/wiki/Getting-Help
https://github.com/hapifhir/hapi-fhir/wiki/Getting-Help
**Describe the issue**
A clear and concise description of what the feature request is. Please include details about what problem you are ultimately trying to solve (i.e. what are you building with HAPI FHIR) and how this feature would help.

View File

@ -32,7 +32,7 @@ Please see [Smile CDR][Link-SmileCDR] for information on commercial support.
[Link-AzurePipelinesSnapshot]: https://dev.azure.com/hapifhir/HAPI%20FHIR/_build?definitionId=3
[Link-MavenCentral]: http://search.maven.org/#search|ga|1|ca.uhn.hapi.fhir
[Link-CodeCov]: https://codecov.io/gh/hapifhir/hapi-fhir
[Link-wiki]: https://github.com/jamesagnew/hapi-fhir/wiki/Getting-Help
[Link-wiki]: https://github.com/hapifhir/hapi-fhir/wiki/Getting-Help
[Link-SmileCDR]: https://smilecdr.com
[Link-License]: https://hapifhir.io/hapi-fhir/license.html

View File

@ -31,7 +31,7 @@
<p>
The architecture in use here is shown in the image on the right. This server is built
from a number of modules of the
<a href="https://github.com/jamesagnew/hapi-fhir/">HAPI FHIR</a>
<a href="https://github.com/hapifhir/hapi-fhir/">HAPI FHIR</a>
project, which is a 100% open-source (Apache 2.0 Licensed) Java based
implementation of the FHIR specification.
</p>

View File

@ -7,7 +7,7 @@
<a href="http://uhn.ca">University Health Network</a>. This server
(and the testing application you are currently using to access it)
is entirely built using
<a href="https://github.com/jamesagnew/hapi-fhir">HAPI-FHIR</a>,
<a href="https://github.com/hapifhir/hapi-fhir">HAPI-FHIR</a>,
a 100% open-source Java implementation of the
<a href="http://hl7.org/implement/standards/fhir/">FHIR specification</a>.
</p>

View File

@ -31,7 +31,7 @@
<p>
The architecture in use here is shown in the image on the right. This server is built
from a number of modules of the
<a href="https://github.com/jamesagnew/hapi-fhir/">HAPI FHIR</a>
<a href="https://github.com/hapifhir/hapi-fhir/">HAPI FHIR</a>
project, which is a 100% open-source (Apache 2.0 Licensed) Java based
implementation of the FHIR specification.
</p>

View File

@ -7,7 +7,7 @@
<a href="http://uhn.ca">University Health Network</a>. This server
(and the testing application you are currently using to access it)
is entirely built using
<a href="https://github.com/jamesagnew/hapi-fhir">HAPI-FHIR</a>,
<a href="https://github.com/hapifhir/hapi-fhir">HAPI-FHIR</a>,
a 100% open-source Java implementation of the
<a href="http://hl7.org/implement/standards/fhir/">FHIR specification</a>.
</p>

View File

@ -27,7 +27,7 @@ import ca.uhn.fhir.jpa.search.LuceneSearchMappingFactory;
* you can use it as a config if you want to support DSTU3
* instead of DSTU2 in your server.
*
* See https://github.com/jamesagnew/hapi-fhir/issues/278
* See https://github.com/hapifhir/hapi-fhir/issues/278
*/
@Configuration
@EnableTransactionManagement()

View File

@ -31,7 +31,7 @@
<p>
The architecture in use here is shown in the image on the right. This server is built
from a number of modules of the
<a href="https://github.com/jamesagnew/hapi-fhir/">HAPI FHIR</a>
<a href="https://github.com/hapifhir/hapi-fhir/">HAPI FHIR</a>
project, which is a 100% open-source (Apache 2.0 Licensed) Java based
implementation of the FHIR specification.
</p>

View File

@ -7,7 +7,7 @@
<a href="http://uhn.ca">University Health Network</a>. This server
(and the testing application you are currently using to access it)
is entirely built using
<a href="https://github.com/jamesagnew/hapi-fhir">HAPI-FHIR</a>,
<a href="https://github.com/hapifhir/hapi-fhir">HAPI-FHIR</a>,
a 100% open-source Java implementation of the
<a href="http://hl7.org/implement/standards/fhir/">FHIR specification</a>.
</p>

View File

@ -121,6 +121,15 @@ public enum Pointcut implements IPointcut {
* must be of type <code>IBaseConformance</code>, so it is the responsibility of the interceptor hook method
* code to cast to the appropriate version.
* </li>
* <li>
* ca.uhn.fhir.rest.api.server.RequestDetails - A bean containing details about the request that is about to
* be processed
* </li>
* <li>
* ca.uhn.fhir.rest.server.servlet.ServletRequestDetails - A bean containing details about the request that
* is about to be processed. This parameter is identical to the RequestDetails parameter above but will only
* be populated when operating in a RestfulServer implementation. It is provided as a convenience.
* </li>
* </ul>
* </p>
* Hook methods may an instance of a new <code>CapabilityStatement</code> resource which will replace the
@ -129,7 +138,9 @@ public enum Pointcut implements IPointcut {
* for your hook method to return <code>void</code> or <code>null</code>.
*/
SERVER_CAPABILITY_STATEMENT_GENERATED(IBaseConformance.class,
"org.hl7.fhir.instance.model.api.IBaseConformance"
"org.hl7.fhir.instance.model.api.IBaseConformance",
"ca.uhn.fhir.rest.api.server.RequestDetails",
"ca.uhn.fhir.rest.server.servlet.ServletRequestDetails"
),
/**

View File

@ -39,7 +39,7 @@ import java.util.*;
* <p>
* <b>See:</b> A complete list of available exceptions is in the <a href="./package-summary.html">package summary</a>.
* If an exception doesn't exist for a condition you want to represent, let us know by filing an
* <a href="https://github.com/jamesagnew/hapi-fhir/issues">issue in our tracker</a>. You may also
* <a href="https://github.com/hapifhir/hapi-fhir/issues">issue in our tracker</a>. You may also
* use {@link UnclassifiedServerFailureException} to represent any error code you want.
* </p>
*/

View File

@ -43,9 +43,15 @@ public class ClasspathUtil {
private static final Logger ourLog = LoggerFactory.getLogger(ClasspathUtil.class);
/**
* Non instantiable
*/
private ClasspathUtil() {
// nothing
}
public static String loadResource(String theClasspath) {
Function<InputStream, InputStream> streamTransform = t -> t;
return loadResource(theClasspath, streamTransform);
return loadResource(theClasspath, Function.identity());
}
/**
@ -55,7 +61,12 @@ public class ClasspathUtil {
public static InputStream loadResourceAsStream(String theClasspath) {
InputStream retVal = ClasspathUtil.class.getResourceAsStream(theClasspath);
if (retVal == null) {
throw new InternalErrorException("Unable to find classpath resource: " + theClasspath);
if (!theClasspath.startsWith("/")) {
retVal = ClasspathUtil.class.getResourceAsStream("/" + theClasspath);
}
if (retVal == null) {
throw new InternalErrorException("Unable to find classpath resource: " + theClasspath);
}
}
return retVal;
}
@ -65,17 +76,9 @@ public class ClasspathUtil {
*/
@Nonnull
public static String loadResource(String theClasspath, Function<InputStream, InputStream> theStreamTransform) {
InputStream stream = ClasspathUtil.class.getResourceAsStream(theClasspath);
try {
if (stream == null) {
throw new IOException("Unable to find classpath resource: " + theClasspath);
}
try {
InputStream newStream = theStreamTransform.apply(stream);
return IOUtils.toString(newStream, Charsets.UTF_8);
} finally {
stream.close();
}
try (InputStream stream = loadResourceAsStream(theClasspath)) {
InputStream newStream = theStreamTransform.apply(stream);
return IOUtils.toString(newStream, Charsets.UTF_8);
} catch (IOException e) {
throw new InternalErrorException(e);
}

View File

@ -1721,7 +1721,7 @@ public class XmlUtil {
* These two properties disable external entity processing, which can
* be a security vulnerability.
*
* See https://github.com/jamesagnew/hapi-fhir/issues/339
* See https://github.com/hapifhir/hapi-fhir/issues/339
* https://www.owasp.org/index.php/XML_External_Entity_%28XXE%29_Processing
*/
inputFactory.setProperty(XMLInputFactory.SUPPORT_DTD, false); // This disables DTDs entirely for that factory

View File

@ -88,7 +88,7 @@ public class SchemaBaseValidator implements IValidatorModule {
try {
/*
* See https://github.com/jamesagnew/hapi-fhir/issues/339
* See https://github.com/hapifhir/hapi-fhir/issues/339
* https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Processing
*/
validator.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, "");
@ -128,7 +128,7 @@ public class SchemaBaseValidator implements IValidatorModule {
try {
try {
/*
* See https://github.com/jamesagnew/hapi-fhir/issues/339
* See https://github.com/hapifhir/hapi-fhir/issues/339
* https://www.owasp.org/index.php/XML_External_Entity_(XXE)_Processing
*/
schemaFactory.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, "");

View File

@ -47,7 +47,7 @@ import java.util.Properties;
* you can use it as a config if you want to support DSTU3
* instead of DSTU2 in your server.
* <p>
* See https://github.com/jamesagnew/hapi-fhir/issues/278
* See https://github.com/hapifhir/hapi-fhir/issues/278
*/
@Configuration
@EnableTransactionManagement()

View File

@ -45,7 +45,7 @@ import java.util.Properties;
* you can use it as a config if you want to support DSTU3
* instead of DSTU2 in your server.
* <p>
* See https://github.com/jamesagnew/hapi-fhir/issues/278
* See https://github.com/hapifhir/hapi-fhir/issues/278
*/
@Configuration
@EnableTransactionManagement()

View File

@ -31,7 +31,7 @@
<p>
The architecture in use here is shown in the image on the right. This server is built
from a number of modules of the
<a href="https://github.com/jamesagnew/hapi-fhir/">HAPI FHIR</a>
<a href="https://github.com/hapifhir/hapi-fhir/">HAPI FHIR</a>
project, which is a 100% open-source (Apache 2.0 Licensed) Java based
implementation of the FHIR specification.
</p>

View File

@ -26,6 +26,8 @@ import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import ca.uhn.fhir.rest.server.interceptor.*;
import ca.uhn.fhir.validation.ResultSeverityEnum;
import org.hl7.fhir.common.hapi.validation.validator.FhirInstanceValidator;
import org.hl7.fhir.r4.model.CapabilityStatement;
import org.hl7.fhir.r4.model.Enumerations;
import org.springframework.web.cors.CorsConfiguration;
import javax.servlet.ServletException;
@ -139,6 +141,36 @@ public class ServletExamples {
}
// END SNIPPET: fhirPathInterceptor
// START SNIPPET: staticCapabilityStatementInterceptor
@WebServlet(urlPatterns = { "/fhir/*" }, displayName = "FHIR Server")
public class RestfulServerWithStaticCapabilityStatement extends RestfulServer {
@Override
protected void initialize() throws ServletException {
// ... define your resource providers here ...
// Create the interceptor
StaticCapabilityStatementInterceptor interceptor = new StaticCapabilityStatementInterceptor();
// There are two ways of supplying a CapabilityStatement to the
// interceptor. You can use a static resource found on the classpath
interceptor.setCapabilityStatementResource("/classpath/to/capabilitystatement.json");
// ..or you can simply create one in code (in which case you do not
// need to call setCapabilityStatementResource(..))
CapabilityStatement cs = new CapabilityStatement();
cs.setFhirVersion(Enumerations.FHIRVersion._4_0_1);
cs.getSoftware().setName("My Acme Server");
// Now register the interceptor
registerInterceptor(interceptor);
}
}
// END SNIPPET: staticCapabilityStatementInterceptor
// START SNIPPET: responseHighlighterInterceptor
@WebServlet(urlPatterns = { "/fhir/*" }, displayName = "FHIR Server")
public class RestfulServerWithResponseHighlighter extends RestfulServer {

View File

@ -91,11 +91,11 @@
- item:
issue: "743"
type: "add"
title: "Add support for Spring Boot for initializing a number of parts of the library, as well as several examples. See the <a href=\"https://github.com/jamesagnew/hapi-fhir/tree/master/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples\">Spring Boot samples</a> for examples of how this works. Thanks to Mathieu Ouellet for the contribution!"
title: "Add support for Spring Boot for initializing a number of parts of the library, as well as several examples. See the <a href=\"https://github.com/hapifhir/hapi-fhir/tree/master/hapi-fhir-spring-boot/hapi-fhir-spring-boot-samples\">Spring Boot samples</a> for examples of how this works. Thanks to Mathieu Ouellet for the contribution!"
- item:
issue: "747"
type: "add"
title: "JPA server now has lucene index support moved to separate classes from the entity classes in order to facilitate support for ElasticSearch. Thanks to Jiang Liang for the pull request! Note that any existing JPA projects will need to add an additional property in their Spring config called <code>hibernate.search.model_mapping</code>. See <a href=\"https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-jpaserver-example/src/main/java/ca/uhn/fhir/jpa/demo/FhirServerConfig.java#L84\">this line</a> in the example project."
title: "JPA server now has lucene index support moved to separate classes from the entity classes in order to facilitate support for ElasticSearch. Thanks to Jiang Liang for the pull request! Note that any existing JPA projects will need to add an additional property in their Spring config called <code>hibernate.search.model_mapping</code>. See <a href=\"https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-jpaserver-example/src/main/java/ca/uhn/fhir/jpa/demo/FhirServerConfig.java#L84\">this line</a> in the example project."
- item:
issue: "755"
type: "add"

View File

@ -10,7 +10,7 @@
title: "Changed subscription processing, if the subscription criteria are straightforward (i.e. no chained references, qualifiers or prefixes) then attempt to match the incoming resource against the criteria in-memory. If the subscription criteria can't be matched in-memory, then the server falls back to the original subscription matching process of querying the database. The in-memory matcher can be disabled by setting isEnableInMemorySubscriptionMatching to \"false\" in DaoConfig (by default it is true). If isEnableInMemorySubscriptionMatching is \"false\", then all subscription matching will query the database as before."
- item:
type: "change"
title: "Removed BaseSubscriptionInterceptor and all its subclasses (RestHook, EMail, WebSocket). These are replaced by two new interceptors: SubscriptionActivatingInterceptor that is responsible for activating subscriptions and SubscriptionMatchingInterceptor that is responsible for matching incoming resources against activated subscriptions. Call DaoConfig.addSupportedSubscriptionType(type) to configure which subscription types are supported in your environment. If you are processing subscriptions on a separate server and only want to activate subscriptions on this server, you should set DaoConfig.setSubscriptionMatchingEnabled to false. The helper method SubscriptionInterceptorLoader.registerInterceptors() will check if any subscription types are supported, and if so then load active subscriptions into the SubscriptionRegistry and register the subscription activating interceptor. This method also registers the subscription matching interceptor (that matches incoming resources and sends matches to subscription channels) only if DaoConfig.isSubscriptionMatchingEnabled is true. See https://github.com/jamesagnew/hapi-fhir/wiki/Proposed-Subscription-Design-Change for more details."
title: "Removed BaseSubscriptionInterceptor and all its subclasses (RestHook, EMail, WebSocket). These are replaced by two new interceptors: SubscriptionActivatingInterceptor that is responsible for activating subscriptions and SubscriptionMatchingInterceptor that is responsible for matching incoming resources against activated subscriptions. Call DaoConfig.addSupportedSubscriptionType(type) to configure which subscription types are supported in your environment. If you are processing subscriptions on a separate server and only want to activate subscriptions on this server, you should set DaoConfig.setSubscriptionMatchingEnabled to false. The helper method SubscriptionInterceptorLoader.registerInterceptors() will check if any subscription types are supported, and if so then load active subscriptions into the SubscriptionRegistry and register the subscription activating interceptor. This method also registers the subscription matching interceptor (that matches incoming resources and sends matches to subscription channels) only if DaoConfig.isSubscriptionMatchingEnabled is true. See https://github.com/hapifhir/hapi-fhir/wiki/Proposed-Subscription-Design-Change for more details."
- item:
type: "change"
title: "Added support for matching subscriptions in a separate server from the REST Server. To do this, run the SubscriptionActivatingInterceptor on the REST server and the SubscriptionMatchingInterceptor in the standalone server. Classes required to support running a standalone subscription server are in the ca.uhn.fhir.jpa.subscription.module.standalone package. These classes are excluded by default from the JPA ApplicationContext (that package is explicitly filtered out in the BaseConfig.java @ComponentScan)."

View File

@ -4,7 +4,7 @@
title: "The version of a few dependencies have been bumped to the latest versions (dependent HAPI modules listed in brackets): <ul> <li>Commons Codec (Core): 1.11 -&gt; 1.12</li> <li>Apache HTTPClient (Client): 4.5.3 -&gt; 4.5.9</li> <li>Apache HTTPCore (Client>: 4.4.6 -&gt; 4.4.11</li> <li>Spring (JPA): 5.1.6.RELEASE -&gt; 5.1.8.RELEASE</li> <li>Spring-Data (JPA): 2.1.6.RELEASE -&gt; 2.1.8.RELEASE</li> <li>JANSI (CLI): 1.17.1 -&gt; 1.18</li> <li>json-patch (JPA): 1.10 -&gt; 1.15 (see changelog entry about this change)</li> <li>Jackson-Databind (JPA): 2.9.9 -&gt; 2.9.9.1 (due to a Jackson vulnerability CVE-2019-12384)</li> <li>commons-collections4 (Server/JPA): 4.1 -&gt; 4.3</li> <li>commons-dbcp2 (JPA): 2.5.0 -&gt; 2.6.0</li> <li>commons-lang3 (Core): 3.8.1 -&gt; 3.9</li> <li>commons-text (Core): 1.6 -&gt; 1.7</li> <li>Guava (JPA): 27.1-jre -&gt; 28.0-jre</li> </ul>"
- item:
type: "change"
title: "<b>Breaking Change</b>: The HL7.org DSTU2 structures (and <i>ONLY</i> the HL7.org DSTU2 structures) have been moved to a new package. Where they were previously found in <code>org.hl7.fhir.instance.model</code> they are now found in <code>org.hl7.fhir.dstu2.model</code>. This was done in order to complete the harmonization between the <a href=\"https://github.com/jamesagnew/hapi-fhir\">HAPI FHIR</a> GitHub repository and the <a href=\"https://github.com/hapifhir/org.hl7.fhir.core/\">org.hl7.fhir.core</a> GitHub repository. This is the kind of change we don't make lightly, as we do know that it will be annoying for users of the existing library. It is a change however that will allow us to apply validator fixes much more quickly, and will greatly reduce the amount of effort required to keep up with R5 changes as they come out, so we're hoping it is worth it. Note that no classes are removed, they have only been moved, so it should be fairly straightforward to migrate existing code with an IDE."
title: "<b>Breaking Change</b>: The HL7.org DSTU2 structures (and <i>ONLY</i> the HL7.org DSTU2 structures) have been moved to a new package. Where they were previously found in <code>org.hl7.fhir.instance.model</code> they are now found in <code>org.hl7.fhir.dstu2.model</code>. This was done in order to complete the harmonization between the <a href=\"https://github.com/hapifhir/hapi-fhir\">HAPI FHIR</a> GitHub repository and the <a href=\"https://github.com/hapifhir/org.hl7.fhir.core/\">org.hl7.fhir.core</a> GitHub repository. This is the kind of change we don't make lightly, as we do know that it will be annoying for users of the existing library. It is a change however that will allow us to apply validator fixes much more quickly, and will greatly reduce the amount of effort required to keep up with R5 changes as they come out, so we're hoping it is worth it. Note that no classes are removed, they have only been moved, so it should be fairly straightforward to migrate existing code with an IDE."
- item:
type: "change"
title: "<b>Breaking Change</b>: The <code>IPagingProvider</code> interface has been modified so that the <code>retrieveResultList</code> method now takes one additional parameter of type <code>RequestDetails</code>. If you have created a custom implementation of this interface, you can add this parameter and ignore it if needed. The use of the method has not changed, so this should be an easy fix to existing code."

View File

@ -4,7 +4,7 @@
### Where can I ask questions or get help?
Please see [this page](https://github.com/jamesagnew/hapi-fhir/wiki/Getting-Help) in the HAPI FHIR Wiki for information on getting help.
Please see [this page](https://github.com/hapifhir/hapi-fhir/wiki/Getting-Help) in the HAPI FHIR Wiki for information on getting help.
# Using HAPI FHIR

View File

@ -4,11 +4,11 @@ This page contains useful information about how to get started in developing HAP
# Understanding the HAPI FHIR Codebase
The HAPI FHIR [Codebase](https://github.com/jamesagnew/hapi-fhir) has a number of subprojects. You will typically need to interact with several of them in order to develop HAPI, but you generally don't need all of them.
The HAPI FHIR [Codebase](https://github.com/hapifhir/hapi-fhir) has a number of subprojects. You will typically need to interact with several of them in order to develop HAPI, but you generally don't need all of them.
The following is a list of key subprojects you might open in your IDE:
* [hapi-fhir-base](https://github.com/jamesagnew/hapi-fhir/tree/master/hapi-fhir-base): This is the core library, containing the parsers, client/server frameworks, and many other features. Note that this module does not contain any model classes (e.g. the Patient model class) as these are found in "structures" projects below.
* [hapi-fhir-base](https://github.com/hapifhir/hapi-fhir/tree/master/hapi-fhir-base): This is the core library, containing the parsers, client/server frameworks, and many other features. Note that this module does not contain any model classes (e.g. the Patient model class) as these are found in "structures" projects below.
* hapi-fhir-structures-[version]: There are several structures projects (e.g. `hapi-fhir-structures-r4`), each of which contains model classes for a specific version of FHIR. Generally speaking you don't need to edit these projects directly, as most (but not all) of their code is generated.
* hapi-fhir-jpaserver-base: This module contains the JPA server.

View File

@ -9,7 +9,7 @@ This page describes some client interceptors that are shipped with HAPI FHIR out
The LoggingInterceptor logs details about each request and/or response that is performed using the client. All logging is performed using SLF4j.
* [LoggingInterceptor JavaDoc](/apidocs/hapi-fhir-client/ca/uhn/fhir/rest/client/interceptor/LoggingInterceptor.html)
* [LoggingInterceptor Source](https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/interceptor/LoggingInterceptor.java)
* [LoggingInterceptor Source](https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/interceptor/LoggingInterceptor.java)
LoggingInterceptor is highly configurable in terms of its output. It can be configured to log simple details about requests, or detailed output including payload bodies and header contents. The following example shows how to enable LoggingInterceptor.
@ -22,7 +22,7 @@ LoggingInterceptor is highly configurable in terms of its output. It can be conf
The BasicAuthInterceptor adds an `Authorization` header containing an HTTP Basic Auth (username+password) token in every outgoing request.
* [BasicAuthInterceptor JavaDoc](/apidocs/hapi-fhir-client/ca/uhn/fhir/rest/client/interceptor/BasicAuthInterceptor.html)
* [BasicAuthInterceptor Source](https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/interceptor/BasicAuthInterceptor.java)
* [BasicAuthInterceptor Source](https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/interceptor/BasicAuthInterceptor.java)
The following example shows how to configure your client to use a specific username and password in every request.
@ -35,7 +35,7 @@ The following example shows how to configure your client to use a specific usern
The BearerTokenAuthInterceptor can be used to add an `Authorization` header containing a bearer token (typically used for OIDC/OAuth2/SMART security flows) to every outgoing request.
* [BearerTokenAuthInterceptor JavaDoc](/apidocs/hapi-fhir-client/ca/uhn/fhir/rest/client/interceptor/BearerTokenAuthInterceptor.html)
* [BearerTokenAuthInterceptor Source](https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/interceptor/BearerTokenAuthInterceptor.java)
* [BearerTokenAuthInterceptor Source](https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/interceptor/BearerTokenAuthInterceptor.java)
The following example shows how to configure your client to inject a bearer token authorization header into every request.
@ -48,7 +48,7 @@ The following example shows how to configure your client to inject a bearer toke
The AdditionlRequestHeadersInterceptor can be used to add arbitrary headers to each request created by the client.
* [AdditionalRequestHeadersInterceptor JavaDoc](/apidocs/hapi-fhir-client/ca/uhn/fhir/rest/client/interceptor/AdditionalRequestHeadersInterceptor.html)
* [AdditionalRequestHeadersInterceptor Source](https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/interceptor/AdditionalRequestHeadersInterceptor.java)
* [AdditionalRequestHeadersInterceptor Source](https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/interceptor/AdditionalRequestHeadersInterceptor.java)
The following example shows how to configure your client to inject a bearer token authorization header into every request.
@ -67,7 +67,7 @@ Note that headers can also be added to individual [Generic Client](/docs/client/
The CookieInterceptor can be used to add an HTTP Cookie header to each request created by the client.
* [CookieInterceptor JavaDoc](/apidocs/hapi-fhir-client/ca/uhn/fhir/rest/client/interceptor/CookieInterceptor.html)
* [CookieInterceptor Source](https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/interceptor/CookieInterceptor.java)
* [CookieInterceptor Source](https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/interceptor/CookieInterceptor.java)
The following example shows how to configure your client to inject a bearer token authorization header into every request.
@ -80,7 +80,7 @@ The following example shows how to configure your client to inject a bearer toke
When communicating with a server that supports [URL Base Multitenancy](/docs/server_plain/multitenancy.html#url-base-multitenancy), an extra element needs to be added to the request path. This can be done by simply appending the path to the base URL supplied to the client, but it can also be dynamically appended using this interceptor.
* [UrlTenantSelectionInterceptor JavaDoc](/apidocs/hapi-fhir-client/ca/uhn/fhir/rest/client/interceptor/UrlTenantSelectionInterceptor.html)
* [UrlTenantSelectionInterceptor Source](https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/interceptor/UrlTenantSelectionInterceptor.java)
* [UrlTenantSelectionInterceptor Source](https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/interceptor/UrlTenantSelectionInterceptor.java)
```java
{{snippet:classpath:/ca/uhn/hapi/fhir/docs/ClientExamples.java|tenantId}}
@ -91,7 +91,7 @@ When communicating with a server that supports [URL Base Multitenancy](/docs/ser
The GZipContentInterceptor compresses outgoing contents. With this interceptor, if the client is transmitting resources to the server (e.g. for a create, update, transaction, etc.) the content will be GZipped before transmission to the server.
* [GZipContentInterceptor JavaDoc](/apidocs/hapi-fhir-client/ca/uhn/fhir/rest/client/apache/GZipContentInterceptor.html)
* [GZipContentInterceptor Source](https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/apache/GZipContentInterceptor.java)
* [GZipContentInterceptor Source](https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-client/src/main/java/ca/uhn/fhir/rest/client/apache/GZipContentInterceptor.java)
The following example shows how to enable the GZipContentInterceptor.

View File

@ -9,7 +9,7 @@ This page describes some server interceptors that are shipped with HAPI FHIR out
The LoggingInterceptor can be used to generate a new log line (via SLF4j) for each incoming request. LoggingInterceptor provides a flexible message format that can be used to provide a customized level detail about each incoming request.
* [LoggingInterceptor JavaDoc](/apidocs/hapi-fhir-server/ca/uhn/fhir/rest/server/interceptor/LoggingInterceptor.html)
* [LoggingInterceptor Source](https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/LoggingInterceptor.java)
* [LoggingInterceptor Source](https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/LoggingInterceptor.java)
The following example shows how to register a logging interceptor within a FHIR RESTful server.
@ -31,7 +31,7 @@ This interceptor will then produce output similar to the following:
If the JPA server has [partitioning](/docs/server_jpa_partitioning/partitioning.html) enabled, the RequestTenantPartitionInterceptor can be used in combination with a [Tenant Identification Strategy](/docs/server_plain/multitenancy.html) in order to achieve a multitenant solution. See [JPA Server Partitioning](/docs/server_jpa_partitioning/partitioning.html) for more information on partitioning.
* [RequestTenantPartitionInterceptor JavaDoc](/apidocs/hapi-fhir-server/ca/uhn/fhir/rest/server/interceptor/partition/RequestTenantPartitionInterceptor.html)
* [RequestTenantPartitionInterceptor Source](https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/partition/RequestTenantPartitionInterceptor.java)
* [RequestTenantPartitionInterceptor Source](https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/partition/RequestTenantPartitionInterceptor.java)
# Response Customizing: Syntax Highlighting
@ -39,7 +39,7 @@ If the JPA server has [partitioning](/docs/server_jpa_partitioning/partitioning.
The ResponseHighlighterInterceptor detects when a request is coming from a browser and returns HTML with syntax highlighted XML/JSON instead of just the raw text. In other words, if a user uses a browser to request `http://foo/Patient/1` by typing this address into their URL bar, they will get a nicely formatted HTML back with a human readable version of the content. This is particularly helpful for testers and public/development APIs where users are likely to invoke the API directly to see how it works.
* [ResponseHighlighterInterceptor JavaDoc](/apidocs/hapi-fhir-server/ca/uhn/fhir/rest/server/interceptor/ResponseHighlighterInterceptor.html)
* [ResponseHighlighterInterceptor Source](https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/ResponseHighlighterInterceptor.java)
* [ResponseHighlighterInterceptor Source](https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/ResponseHighlighterInterceptor.java)
To see an example of how the output of this interceptor looks, see our demo server using the following example query: [http://hapi.fhir.org/baseR4/Patient](http://hapi.fhir.org/baseR4/Patient). The HTML view you see in that page with colour and indenting is provided by ResponseHighlighterInterceptor. Without this interceptor the response will simply be raw JSON/XML (as it will also be with this interceptor if the request is not coming from a browser, or is invoked by JavaScript).
@ -52,7 +52,7 @@ To see an example of how the output of this interceptor looks, see our demo serv
The ExceptionHandlingInterceptor can be used to customize what is returned to the client and what is logged when the server throws an exception for any reason (including routine things like UnprocessableEntityExceptions thrown as a matter of normal processing in a create method, but also including unexpected exceptions thrown by client code).
* [ExceptionHandlingInterceptor JavaDoc](/apidocs/hapi-fhir-server/ca/uhn/fhir/rest/server/interceptor/ExceptionHandlingInterceptor.html)
* [ExceptionHandlingInterceptor Source](https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/ExceptionHandlingInterceptor.java)
* [ExceptionHandlingInterceptor Source](https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/ExceptionHandlingInterceptor.java)
The following example shows how to register the ExceptionHandlingInterceptor.
@ -65,7 +65,7 @@ The following example shows how to register the ExceptionHandlingInterceptor.
The FhirPathFilterInterceptor looks for a request URL parameter in the form `_fhirpath=(expression)` in all REST requests. If this parameter is found, the value is treated as a [FHIRPath](http://hl7.org/fhirpath/) expression. The response resource will be replaced with a [Parameters](http://hl7.org/fhir/parameters.html) resource containing the results of the given expression applied against the response resource.
* [FhirPathFilterInterceptor JavaDoc](/apidocs/hapi-fhir-server/ca/uhn/fhir/rest/server/interceptor/FhirPathFilterInterceptor.html)
* [FhirPathFilterInterceptor Source](https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/FhirPathFilterInterceptor.java)
* [FhirPathFilterInterceptor Source](https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/FhirPathFilterInterceptor.java)
The following example shows how to register the ExceptionHandlingInterceptor.
@ -106,6 +106,23 @@ A sample response to this query is shown below:
}
```
<a name="static-capabilitystatement"/>
# Response Customizing: Static CapabilityStatement
By default the HAPI FHIR RestfulServer will automatically generate a CapabilityStatement that will be used when clients invoke the [Capabilities](http://hl7.org/fhir/http.html#capabilities) (ie. the `/metadata` operation).
If you wish to override this behaviour and supply a static CapabilityStatement, the **StaticCapabilityStatementInterceptor** can achieve this.
* [StaticCapabilityStatementInterceptor JavaDoc](/apidocs/hapi-fhir-server/ca/uhn/fhir/rest/server/interceptor/StaticCapabilityStatementInterceptor.html)
* [StaticCapabilityStatementInterceptor Source](https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/StaticCapabilityStatementInterceptor.java)
The following example shows how to register the ExceptionHandlingInterceptor.
```java
{{snippet:classpath:/ca/uhn/hapi/fhir/docs/ServletExamples.java|staticCapabilityStatementInterceptor}}
```
<a name="request_and_response_validation"/>
# Validation: Request and Response Validation
@ -115,9 +132,9 @@ HAPI FHIR provides a pair of interceptors that can be used to validate incoming
The RequestValidatingInterceptor and ResponseValidatingInterceptor can be used to perform validation of resources on their way into and out of the server respectively.
* [RequestValidatingInterceptor JavaDoc](/apidocs/hapi-fhir-server/ca/uhn/fhir/rest/server/interceptor/RequestValidatingInterceptor.html)
* [RequestValidatingInterceptor Source](https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/RequestValidatingInterceptor.java)
* [RequestValidatingInterceptor Source](https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/RequestValidatingInterceptor.java)
* [ResponseValidatingInterceptor JavaDoc](/apidocs/hapi-fhir-server/ca/uhn/fhir/rest/server/interceptor/ResponseValidatingInterceptor.html)
* [ResponseValidatingInterceptor Source](https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/ResponseValidatingInterceptor.java)
* [ResponseValidatingInterceptor Source](https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/ResponseValidatingInterceptor.java)
The RequestValidatingInterceptor looks at resources coming into the server (e.g. for create, update, $operations, transactions, etc.) and validates them. The ResponseValidatingInterceptor looks at resources being returned by the server (e.g. for read, search, $operations, etc.) and validates them.
@ -159,14 +176,14 @@ HAPI FHIR provides an interceptor that can be used to implement consent rules an
Some security audit tools require that servers return an HTTP 405 if an unsupported HTTP verb is received (e.g. TRACE). The BanUnsupportedHttpMethodsInterceptor can be used to accomplish this.
* [BanUnsupportedHttpMethodsInterceptor JavaDoc](/apidocs/hapi-fhir-server/ca/uhn/fhir/rest/server/interceptor/BanUnsupportedHttpMethodsInterceptor.html)
* [BanUnsupportedHttpMethodsInterceptor Source](https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/BanUnsupportedHttpMethodsInterceptor.java)
* [BanUnsupportedHttpMethodsInterceptor Source](https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/BanUnsupportedHttpMethodsInterceptor.java)
# Subscription: Subscription Debug Log Interceptor
When using Subscriptions, the debug log interceptor can be used to add a number of additional lines to the server logs showing the internals of the subscription processing pipeline.
* [SubscriptionDebugLogInterceptor JavaDoc](/apidocs/hapi-fhir-jpaserver-subscription/ca/uhn/fhir/jpa/subscription/util/SubscriptionDebugLogInterceptor.html)
* [SubscriptionDebugLogInterceptor Source](https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/util/SubscriptionDebugLogInterceptor.java)
* [SubscriptionDebugLogInterceptor Source](https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-jpaserver-subscription/src/main/java/ca/uhn/fhir/jpa/subscription/util/SubscriptionDebugLogInterceptor.java)
# Request Pre-Processing: Override Meta.source
@ -174,19 +191,19 @@ When using Subscriptions, the debug log interceptor can be used to add a number
If you wish to override the value of `Resource.meta.source` using the value supplied in an HTTP header, you can use the CaptureResourceSourceFromHeaderInterceptor to accomplish this.
* [CaptureResourceSourceFromHeaderInterceptor JavaDoc](/apidocs/hapi-fhir-server/ca/uhn/fhir/rest/server/interceptor/CaptureResourceSourceFromHeaderInterceptor.html)
* [CaptureResourceSourceFromHeaderInterceptor Source](https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/CaptureResourceSourceFromHeaderInterceptor.java)
* [CaptureResourceSourceFromHeaderInterceptor Source](https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/CaptureResourceSourceFromHeaderInterceptor.java)
# Utility: ResponseSizeCapturingInterceptor
The ResponseSizeCapturingInterceptor can be used to capture the number of characters written in each HTTP FHIR response.
* [ResponseSizeCapturingInterceptor JavaDoc](/apidocs/hapi-fhir-server/ca/uhn/fhir/rest/server/interceptor/ResponseSizeCapturingInterceptor.html)
* [ResponseSizeCapturingInterceptor Source](https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/ResponseSizeCapturingInterceptor.java)
* [ResponseSizeCapturingInterceptor Source](https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/ResponseSizeCapturingInterceptor.java)
# JPA Server: Allow Cascading Deletes
* [CascadingDeleteInterceptor JavaDoc](/apidocs/hapi-fhir-jpaserver-base/ca/uhn/fhir/jpa/interceptor/CascadingDeleteInterceptor.html)
* [CascadingDeleteInterceptor Source](https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/CascadingDeleteInterceptor.java)
* [CascadingDeleteInterceptor Source](https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/CascadingDeleteInterceptor.java)
The CascadingDeleteInterceptor allows clients to request deletes be cascaded to other resources that contain incoming references. See [Cascading Deletes](/docs/server_jpa/configuration.html#cascading-deletes) for more information.
@ -196,7 +213,7 @@ The CascadingDeleteInterceptor allows clients to request deletes be cascaded to
# JPA Server: Disable Referential Integrity for Some Paths
* [OverridePathBasedReferentialIntegrityForDeletesInterceptor JavaDoc](/apidocs/hapi-fhir-jpaserver-base/ca/uhn/fhir/jpa/interceptor/OverridePathBasedReferentialIntegrityForDeletesInterceptor.html)
* [OverridePathBasedReferentialIntegrityForDeletesInterceptor Source](https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/OverridePathBasedReferentialIntegrityForDeletesInterceptor.java)
* [OverridePathBasedReferentialIntegrityForDeletesInterceptor Source](https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/interceptor/OverridePathBasedReferentialIntegrityForDeletesInterceptor.java)
The OverridePathBasedReferentialIntegrityForDeletesInterceptor can be registered and configured to allow resources to be deleted even if other resources have outgoing references to the deleted resource. While it is generally a bad idea to allow deletion of resources that are referred to from other resources, there are circumstances where it is desirable. For example, if you have Provenance or AuditEvent resources that refer to a Patient resource that was created in error, you might want to alow the Patient to be deleted while leaving the Provenance and AuditEvent resources intact (including the now-invalid outgoing references to that Patient).

View File

@ -47,7 +47,7 @@ out as <a href="/hapi-fhir/docs/introduction/downloading_and_importing.html#snap
</span>
</td>
<td>
<a th:if="${change.issue != null}" th:href="'https://github.com/jamesagnew/hapi-fhir/issues/' + ${change.issue}" th:text="'#' + ${change.issue}"></a>
<a th:if="${change.issue != null}" th:href="'https://github.com/hapifhir/hapi-fhir/issues/' + ${change.issue}" th:text="'#' + ${change.issue}"></a>
</td>
<td>
<th:block th:utext="${change.title}"/>

View File

@ -1,6 +1,6 @@
# Downloading/Importing HAPI FHIR
If you are developing applications in Java, the easiest way to use HAPI FHIR is to use a build system which handles dependency management automatically. The two most common such systems are [Apache Maven](http://maven.apache.org) and [Gradle](https://gradle.org/). These systems will automatically download "dependency" libraries and add them to your classpath. If you are **not** using one of these systems, you can still manually download the latest release of HAPI by looking in the [GitHub Release Section](https://github.com/jamesagnew/hapi-fhir/releases).
If you are developing applications in Java, the easiest way to use HAPI FHIR is to use a build system which handles dependency management automatically. The two most common such systems are [Apache Maven](http://maven.apache.org) and [Gradle](https://gradle.org/). These systems will automatically download "dependency" libraries and add them to your classpath. If you are **not** using one of these systems, you can still manually download the latest release of HAPI by looking in the [GitHub Release Section](https://github.com/hapifhir/hapi-fhir/releases).
# Maven Users

View File

@ -13,7 +13,7 @@ The following table shows the modules that make up the HAPI FHIR library.
<td style="font-weight: bold; white-space: nowrap;">hapi-fhir-base</td>
<td>
<a href="/hapi-fhir/apidocs/hapi-fhir-base/">JavaDoc&nbsp;&rsaquo;</a>
<a href="https://github.com/jamesagnew/hapi-fhir/tree/master/hapi-fhir-base">Sources&nbsp;&rsaquo;</a>
<a href="https://github.com/hapifhir/hapi-fhir/tree/master/hapi-fhir-base">Sources&nbsp;&rsaquo;</a>
</td>
<td>
This is the core HAPI FHIR library and is always required in order to use
@ -103,7 +103,7 @@ The following table shows the modules that make up the HAPI FHIR library.
<td>
<a href="/hapi-fhir/docs/client/">Documentation&nbsp;&rsaquo;</a><br/>
<a href="/hapi-fhir/apidocs/hapi-fhir-client/">JavaDoc&nbsp;&rsaquo;</a>
<a href="https://github.com/jamesagnew/hapi-fhir/tree/master/hapi-fhir-client">Sources&nbsp;&rsaquo;</a>
<a href="https://github.com/hapifhir/hapi-fhir/tree/master/hapi-fhir-client">Sources&nbsp;&rsaquo;</a>
</td>
<td>
This module contains the core FHIR client framework, including an

View File

@ -46,9 +46,9 @@ Activating HAPI's built-in narrative generator is as simple as calling [setNarra
# Built-in Narrative Templates
HAPI currently only comes with built-in support for a few resource types. Our intention is that people enhance these templates and create new ones, and share these back with us so that we can continue to build out the library. To see the current template library, see the source repository [here](https://github.com/jamesagnew/hapi-fhir/tree/master/hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative).
HAPI currently only comes with built-in support for a few resource types. Our intention is that people enhance these templates and create new ones, and share these back with us so that we can continue to build out the library. To see the current template library, see the source repository [here](https://github.com/hapifhir/hapi-fhir/tree/master/hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative).
Note that these templates expect a few specific CSS definitions to be present in your site's CSS file. See the [narrative CSS](https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative/hapi-narrative.css) to see these.
Note that these templates expect a few specific CSS definitions to be present in your site's CSS file. See the [narrative CSS](https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-base/src/main/resources/ca/uhn/fhir/narrative/hapi-narrative.css) to see these.
# Creating your own Templates

View File

@ -5,7 +5,7 @@ HAPI FHIR 1.5 introduced a new interceptor: [AuthorizationInterceptor](/apidocs/
This interceptor can help with the complicated task of determining whether a user has the appropriate permission to perform a given task on a FHIR server. This is done by declaring a set of rules that can selectively allow (whitelist) and/or selectively block (blacklist) requests.
* [AuthorizationInterceptor JavaDoc](/apidocs/hapi-fhir-server/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptor.html)
* [AuthorizationInterceptor Source](https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptor.java)
* [AuthorizationInterceptor Source](https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/AuthorizationInterceptor.java)
<p class="helpInfoCalloutBox">
AuthorizationInterceptor has been well tested, but it is impossible to predict every scenario and environment in which HAPI FHIR will be used. Use with caution, and do lots of testing! We welcome feedback and suggestions on this feature. Please get in touch if you'd like to help test, have suggestions, etc.

View File

@ -5,7 +5,7 @@ HAPI FHIR 4.0.0 introduced a new interceptor, the [ConsentInterceptor](/hapi-fhi
The consent interceptor may be used to examine client requests to apply consent directives and create audit trail events. Like the AuthorizationInterceptor above, this interceptor is not a complete working solution, but instead is a framework designed to make it easier to implement local policies.
* [ConsentInterceptor JavaDoc](/apidocs/hapi-fhir-server/ca/uhn/fhir/rest/server/interceptor/consent/ConsentInterceptor.html)
* [ConsentInterceptor Source](https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/consent/ConsentInterceptor.java)
* [ConsentInterceptor Source](https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/consent/ConsentInterceptor.java)
The consent interceptor has several primary purposes:

View File

@ -14,7 +14,7 @@ The HAPI FHIR server framework includes an interceptor that can be used to provi
Spring is generally unlikely to conflict with other libraries so it is usually safe to add it to your classpath, but it is a fairly large library so if size is a concern you might opt to use a filter instead.
* [CorsInterceptor JavaDoc](/apidocs/hapi-fhir-server/ca/uhn/fhir/rest/server/interceptor/CorsInterceptor.html)
* [CorsInterceptor Source](https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/CorsInterceptor.java)
* [CorsInterceptor Source](https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/CorsInterceptor.java)
The following steps outline how to enable HAPI's CorsInterceptor:

View File

@ -3,7 +3,7 @@
HAPI FHIR 3.7.0 introduced a new interceptor, the [SearchNarrowingInterceptor](/hapi-fhir/apidocs/hapi-fhir-server/ca/uhn/fhir/rest/server/interceptor/auth/SearchNarrowingInterceptor.html).
* [SearchNarrowingInterceptor JavaDoc](/apidocs/hapi-fhir-server/ca/uhn/fhir/rest/server/interceptor/auth/SearchNarrowingInterceptor.html)
* [SearchNarrowingInterceptor Source](https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/SearchNarrowingInterceptor.java)
* [SearchNarrowingInterceptor Source](https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/interceptor/auth/SearchNarrowingInterceptor.java)
This interceptor is designed to be used in conjunction with AuthorizationInterceptor. It uses a similar strategy where a dynamic list is built up for each request, but the purpose of this interceptor is to modify client searches that are received (after HAPI FHIR received the HTTP request, but before the search is actually performed) to restrict the search to only search for specific resources or compartments that the user has access to.

View File

@ -21,7 +21,7 @@ The server currently supports:
* [@Operation](/hapi-fhir/apidocs/hapi-fhir-base/ca/uhn/fhir/rest/annotation/Operation.html)
The primary intention for this project is to ensure that other web technologies (JAX-RS in this case) can be used together with the base-server functionality.
An example server can be found in the Git repo [here](https://github.com/jamesagnew/hapi-fhir/tree/master/hapi-fhir-jaxrsserver-example).
An example server can be found in the Git repo [here](https://github.com/hapifhir/hapi-fhir/tree/master/hapi-fhir-jaxrsserver-example).
# JAX-RS Implementation specifics
@ -54,4 +54,4 @@ In order to create the conformance profile, a conformance provider class needs t
A complete example showing how to implement a JAX-RS RESTful server can be found in our Git repo here:
* [hapi-fhir-jaxrsserver-example](https://github.com/jamesagnew/hapi-fhir/tree/master/hapi-fhir-jaxrsserver-example)
* [hapi-fhir-jaxrsserver-example](https://github.com/hapifhir/hapi-fhir/tree/master/hapi-fhir-jaxrsserver-example)

View File

@ -5,7 +5,7 @@
## Download and Installation
You can get the tool by downloading it from our [GitHub Releases](https://github.com/jamesagnew/hapi-fhir/releases) page (look for the archive named `hapi-fhir-[version]-cli.tar.bz2` on OSX/Linux or `hapi-fhir-[version]-cli.zip` on Windows).
You can get the tool by downloading it from our [GitHub Releases](https://github.com/hapifhir/hapi-fhir/releases) page (look for the archive named `hapi-fhir-[version]-cli.tar.bz2` on OSX/Linux or `hapi-fhir-[version]-cli.zip` on Windows).
When you have downloaded the archive (either ZIP or tar.bz2), expand it into a directory where you will keep it, and add this directory to your path.

View File

@ -8,7 +8,7 @@ Previously, a number of `IValidationSupport` interfaces existed. These interface
These have all been replaced with a single interface that is intended to be used for all versions of FHIR:
* [ca.uhn.fhir.context.support.IContextValidationSupport](https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/support/IContextValidationSupport.java)
* [ca.uhn.fhir.context.support.IContextValidationSupport](https://github.com/hapifhir/hapi-fhir/blob/master/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/support/IContextValidationSupport.java)
This also means that the following classes (which previously existing in multiple packages) have been replaced with a single version supporting multiple FHIR versions. You will need to adjust package names:

View File

@ -12,13 +12,13 @@ There are a several implementations of the [IValidationSupport](/hapi-fhir/apido
# ValidationSupportChain
[JavaDoc](/hapi-fhir/apidocs/hapi-fhir-validation/org/hl7/fhir/common/hapi/validation/support/ValidationSupportChain.html) / [Source](https://github.com/jamesagnew/hapi-fhir/blob/ja_20200218_validation_api_changes/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/support/ValidationSupportChain.java)
[JavaDoc](/hapi-fhir/apidocs/hapi-fhir-validation/org/hl7/fhir/common/hapi/validation/support/ValidationSupportChain.html) / [Source](https://github.com/hapifhir/hapi-fhir/blob/ja_20200218_validation_api_changes/hapi-fhir-validation/src/main/java/org/hl7/fhir/common/hapi/validation/support/ValidationSupportChain.java)
This module can be used to combine multiple implementations together so that for every request, each support class instance in the chain is tried in sequence. Note that nearly all methods in the [IValidationSupport](/hapi-fhir/apidocs/hapi-fhir-base/ca/uhn/fhir/context/support/IValidationSupport.html) interface are permitted to return `null` if they are not able to service a particular method call. So for example, if a call to the [`validateCode`](/hapi-fhir/apidocs/hapi-fhir-base/ca/uhn/fhir/context/support/IValidationSupport.html#validateCode(ca.uhn.fhir.context.support.ValidationSupportContext,ca.uhn.fhir.context.support.ConceptValidationOptions,java.lang.String,java.lang.String,java.lang.String,java.lang.String)) method is made, the validator will try each module in the chain until one of them returns a non-null response.
# DefaultProfileValidationSupport
[JavaDoc](/hapi-fhir/apidocs/hapi-fhir-base/undefined/ca/uhn/fhir/context/support/DefaultProfileValidationSupport.html) / [Source](https://github.com/jamesagnew/hapi-fhir/blob/ja_20200218_validation_api_changes/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/support/DefaultProfileValidationSupport.java)
[JavaDoc](/hapi-fhir/apidocs/hapi-fhir-base/undefined/ca/uhn/fhir/context/support/DefaultProfileValidationSupport.html) / [Source](https://github.com/hapifhir/hapi-fhir/blob/ja_20200218_validation_api_changes/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/support/DefaultProfileValidationSupport.java)
This module supplies the built-in FHIR core structure definitions, including both FHIR resource definitions (StructureDefinition resources) and FHIR built-in vocabulary (ValueSet and CodeSystem resources).

View File

@ -173,7 +173,7 @@ public abstract class BaseHapiFhirDao<T extends IBaseResource> extends BaseStora
public static final long INDEX_STATUS_INDEXED = 1L;
public static final long INDEX_STATUS_INDEXING_FAILED = 2L;
public static final String NS_JPA_PROFILE = "https://github.com/jamesagnew/hapi-fhir/ns/jpa/profile";
public static final String NS_JPA_PROFILE = "https://github.com/hapifhir/hapi-fhir/ns/jpa/profile";
public static final String OO_SEVERITY_ERROR = "error";
public static final String OO_SEVERITY_INFO = "information";
public static final String OO_SEVERITY_WARN = "warning";

View File

@ -31,7 +31,7 @@
<p>
The architecture in use here is shown in the image on the right. This server is built
from a number of modules of the
<a href="https://github.com/jamesagnew/hapi-fhir/">HAPI FHIR</a>
<a href="https://github.com/hapifhir/hapi-fhir/">HAPI FHIR</a>
project, which is a 100% open-source (Apache 2.0 Licensed) Java based
implementation of the FHIR specification.
</p>

View File

@ -7,7 +7,7 @@
<a href="http://uhn.ca">University Health Network</a>. This server
(and the testing application you are currently using to access it)
is entirely built using
<a href="https://github.com/jamesagnew/hapi-fhir">HAPI-FHIR</a>,
<a href="https://github.com/hapifhir/hapi-fhir">HAPI-FHIR</a>,
a 100% open-source Java implementation of the
<a href="http://hl7.org/implement/standards/fhir/">FHIR specification</a>.
</p>

View File

@ -7,7 +7,7 @@
<foreignObject pointer-events="all" width="166" height="30" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility">
<div xmlns="http://www.w3.org/1999/xhtml"
style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.26; vertical-align: top; width: 166px; white-space: normal; text-align: center;">
<a href="https://github.com/jamesagnew/hapi-fhir/tree/master/hapi-fhir-base">hapi-fhir-base</a>
<a href="https://github.com/hapifhir/hapi-fhir/tree/master/hapi-fhir-base">hapi-fhir-base</a>
<br />
(RESTful Server)
</div>
@ -21,7 +21,7 @@
<foreignObject pointer-events="all" width="166" height="45" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility">
<div xmlns="http://www.w3.org/1999/xhtml"
style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.26; vertical-align: top; width: 166px; white-space: normal; text-align: center;">
<a href="https://github.com/jamesagnew/hapi-fhir/tree/master/hapi-fhir-jpaserver-base">hapi-fhir-jpaserver-base</a>
<a href="https://github.com/hapifhir/hapi-fhir/tree/master/hapi-fhir-jpaserver-base">hapi-fhir-jpaserver-base</a>
<br />
Hibernate + Spring
<br />
@ -51,7 +51,7 @@
<foreignObject pointer-events="all" width="166" height="45" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility">
<div xmlns="http://www.w3.org/1999/xhtml"
style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.26; vertical-align: top; width: 166px; white-space: normal; text-align: center;">
<a href="https://github.com/jamesagnew/hapi-fhir/tree/master/hapi-fhir-testpage-overlay">hapi-fhir-testpage-overlay</a>
<a href="https://github.com/hapifhir/hapi-fhir/tree/master/hapi-fhir-testpage-overlay">hapi-fhir-testpage-overlay</a>
<br />
Thymeleaf + Spring
<br />
@ -112,4 +112,4 @@
<path d="M 316 52 L 267 52" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none" />
<path d="M 262 52 L 269 48 L 267 52 L 269 55 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="none" />
</g>
</svg>
</svg>

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@ -0,0 +1,85 @@
package ca.uhn.fhir.rest.server.interceptor;
/*-
* #%L
* HAPI FHIR - Server Framework
* %%
* Copyright (C) 2014 - 2021 Smile CDR, Inc.
* %%
* 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 ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.interceptor.api.Hook;
import ca.uhn.fhir.interceptor.api.Interceptor;
import ca.uhn.fhir.interceptor.api.Pointcut;
import ca.uhn.fhir.rest.api.EncodingEnum;
import ca.uhn.fhir.rest.api.server.RequestDetails;
import ca.uhn.fhir.util.ClasspathUtil;
import org.apache.commons.lang3.Validate;
import org.hl7.fhir.instance.model.api.IBaseConformance;
/**
* This interceptor replaces the auto-generated CapabilityStatement that is generated
* by the HAPI FHIR Server with a static hard-coded resource.
*/
@Interceptor
public class StaticCapabilityStatementInterceptor {
private String myCapabilityStatementResource;
private volatile IBaseConformance myCapabilityStatement;
/**
* Sets the CapabilityStatement to use
*
* @see #setCapabilityStatementResource(String) #setCapabilityStatementResource(String) is an alternate way to supply the CapabilityStatement
*/
public void setCapabilityStatement(IBaseConformance theCapabilityStatement) {
myCapabilityStatement = theCapabilityStatement;
}
/**
* Sets the classpath location of the CapabilityStatement to use. If this method is used to supply
* the CapabiltyStatement, then the given classpath resource will be read and parsed as a FHIR
* CapabilityStatement.
*
* @see #setCapabilityStatement(IBaseConformance) #setCapabilityStatement(IBaseConformance) is an alternate way to supply the CapabilityStatement
*/
public void setCapabilityStatementResource(String theClasspath) {
myCapabilityStatementResource = theClasspath;
myCapabilityStatement = null;
}
@Hook(Pointcut.SERVER_CAPABILITY_STATEMENT_GENERATED)
public IBaseConformance hook(RequestDetails theRequestDetails) {
IBaseConformance retVal = myCapabilityStatement;
if (retVal == null) {
Validate.notBlank(myCapabilityStatementResource, "No CapabilityStatement defined");
String output = ClasspathUtil.loadResource(myCapabilityStatementResource);
FhirContext ctx = theRequestDetails.getFhirContext();
EncodingEnum encoding = EncodingEnum.detectEncodingNoDefault(output);
Validate.notNull(encoding, "Could not determine FHIR encoding for resource: %s", myCapabilityStatementResource);
retVal = (IBaseConformance) encoding
.newParser(ctx)
.parseResource(output);
myCapabilityStatement = retVal;
}
return retVal;
}
}

View File

@ -148,6 +148,8 @@ public class ConformanceMethodBinding extends BaseResourceReturningMethodBinding
if (theRequest.getInterceptorBroadcaster() != null) {
HookParams params = new HookParams();
params.add(IBaseConformance.class, conf);
params.add(RequestDetails.class, theRequest);
params.addIfMatchesType(ServletRequestDetails.class, theRequest);
IBaseConformance outcome = (IBaseConformance) theRequest
.getInterceptorBroadcaster()
.callHooksAndReturnObject(Pointcut.SERVER_CAPABILITY_STATEMENT_GENERATED, params);

View File

@ -6,6 +6,8 @@ import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertSame;
import java.util.Arrays;
import java.util.Collections;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -20,15 +22,13 @@ public class CorsInterceptorTest {
public void testCustomCorsConfig() {
CorsConfiguration corsConfiguration = new CorsConfiguration();
corsConfiguration.applyPermitDefaultValues();
corsConfiguration.setAllowedMethods(Arrays.asList(new String[] { "*" }));
corsConfiguration.setExposedHeaders(Arrays.asList(new String[] {
"Content-Location",
corsConfiguration.setAllowedMethods(Collections.singletonList("*"));
corsConfiguration.setExposedHeaders(Arrays.asList("Content-Location",
"Date",
"ETag",
"Location",
"X-Request-Id",
"X-Correlation-Id"
}));
"X-Correlation-Id"));
CorsInterceptor corsInterceptor = new CorsInterceptor(corsConfiguration);
assertSame(corsConfiguration, corsInterceptor.getConfig());
@ -37,10 +37,10 @@ public class CorsInterceptorTest {
assertNotNull(corsConfiguration.getAllowedMethods());
assertNotNull(corsConfiguration.getAllowedOrigins());
assertNotNull(corsConfiguration.getExposedHeaders());
assertEquals(Long.valueOf(1800l),corsConfiguration.getMaxAge());
assertNotNull(corsConfiguration.checkHeaders(Arrays.asList(new String[] {"Content-Type"})));
assertNotNull(corsConfiguration.checkHeaders(Arrays.asList(new String[] {"Authorization"})));
assertNotNull(corsConfiguration.checkHeaders(Arrays.asList(new String[] {"Authorization", "Content-Type"})));
assertEquals(Long.valueOf(1800L),corsConfiguration.getMaxAge());
assertNotNull(corsConfiguration.checkHeaders(Collections.singletonList("Content-Type")));
assertNotNull(corsConfiguration.checkHeaders(Collections.singletonList("Authorization")));
assertNotNull(corsConfiguration.checkHeaders(Arrays.asList("Authorization", "Content-Type")));
assertNotNull(corsConfiguration.checkHttpMethod(HttpMethod.GET));
assertNotNull(corsConfiguration.checkOrigin("http://clinfhir.com"));
@ -65,9 +65,9 @@ public class CorsInterceptorTest {
assertNotNull(corsConfiguration.getAllowedOrigins());
assertNotNull(corsConfiguration.getExposedHeaders());
assertNull(corsConfiguration.getMaxAge());
assertNotNull(corsConfiguration.checkHeaders(Arrays.asList(new String[] {"Content-Type"})));
assertNotNull(corsConfiguration.checkHeaders(Collections.singletonList("Content-Type")));
// assertNotNull(corsConfiguration.checkHeaders(Arrays.asList(new String[] {"Authorization"})));
assertNotNull(corsConfiguration.checkHeaders(Arrays.asList(new String[] {"Authorization", "Content-Type"})));
assertNotNull(corsConfiguration.checkHeaders(Arrays.asList("Authorization", "Content-Type")));
assertNotNull(corsConfiguration.checkHttpMethod(HttpMethod.GET));
assertNotNull(corsConfiguration.checkOrigin("http://clinfhir.com"));

View File

@ -344,7 +344,7 @@ public class ReferenceParameterTest {
}
/**
* https://github.com/jamesagnew/hapi-fhir/issues/19
* https://github.com/hapifhir/hapi-fhir/issues/19
*/
//@formatter:off
@Search

View File

@ -754,7 +754,7 @@ public class BaseDateTimeDtDstu2Test {
}
/**
* See HAPI #101 - https://github.com/jamesagnew/hapi-fhir/issues/101
* See HAPI #101 - https://github.com/hapifhir/hapi-fhir/issues/101
*/
@Test
public void testPrecisionRespectedForSetValue() throws Exception {
@ -770,7 +770,7 @@ public class BaseDateTimeDtDstu2Test {
}
/**
* See HAPI #101 - https://github.com/jamesagnew/hapi-fhir/issues/101
* See HAPI #101 - https://github.com/hapifhir/hapi-fhir/issues/101
*/
@Test
public void testPrecisionRespectedForSetValueWithPrecision() throws Exception {

View File

@ -742,7 +742,7 @@ public class BaseDateTimeTypeDstu3Test {
}
/**
* See HAPI #101 - https://github.com/jamesagnew/hapi-fhir/issues/101
* See HAPI #101 - https://github.com/hapifhir/hapi-fhir/issues/101
*/
@Test
public void testPrecisionRespectedForSetValue() throws Exception {
@ -758,7 +758,7 @@ public class BaseDateTimeTypeDstu3Test {
}
/**
* See HAPI #101 - https://github.com/jamesagnew/hapi-fhir/issues/101
* See HAPI #101 - https://github.com/hapifhir/hapi-fhir/issues/101
*/
@Test
public void testPrecisionRespectedForSetValueWithPrecision() throws Exception {

View File

@ -0,0 +1,42 @@
package ca.uhn.fhir.rest.server.interceptor;
import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.test.utilities.server.HashMapResourceProviderExtension;
import ca.uhn.fhir.test.utilities.server.RestfulServerExtension;
import org.hl7.fhir.r4.model.CapabilityStatement;
import org.hl7.fhir.r4.model.Patient;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import java.io.IOException;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class StaticCapabilityStatementInterceptorTest {
@RegisterExtension
@Order(0)
protected RestfulServerExtension myRestfulServer = new RestfulServerExtension(FhirVersionEnum.R4);
@RegisterExtension
@Order(1)
protected HashMapResourceProviderExtension<Patient> myResourceProvider = new HashMapResourceProviderExtension<>(myRestfulServer, Patient.class);
@Test
public void testCapabilityStatementResource() throws IOException {
StaticCapabilityStatementInterceptor interceptor = new StaticCapabilityStatementInterceptor();
interceptor.setCapabilityStatementResource("static-capabilitystatement.json");
myRestfulServer.getRestfulServer().registerInterceptor(interceptor);
try {
CapabilityStatement cs = myRestfulServer.getFhirClient().capabilities().ofType(CapabilityStatement.class).execute();
assertEquals("Help I'm a Bug", cs.getSoftware().getName());
} finally {
myRestfulServer.getRestfulServer().unregisterInterceptor(interceptor);
}
}
}

View File

@ -0,0 +1,7 @@
{
"resourceType": "CapabilityStatement",
"software": {
"name": "Help I'm a Bug"
},
"fhirVersion": "4.0.1"
}

View File

@ -73,17 +73,10 @@ public class RestfulServerExtension implements BeforeEachCallback, AfterEachCall
private void createContextIfNeeded() {
if (myFhirVersion != null) {
myFhirContext = new FhirContext(myFhirVersion);
myFhirContext = FhirContext.forCached(myFhirVersion);
}
}
private void destroyContextIfWeCreatedIt() {
if (myFhirVersion != null) {
myFhirContext = null;
}
}
private void stopServer() throws Exception {
JettyUtil.closeServer(myServer);
myServer = null;
@ -125,6 +118,7 @@ public class RestfulServerExtension implements BeforeEachCallback, AfterEachCall
}
public FhirContext getFhirContext() {
createContextIfNeeded();
return myFhirContext;
}
@ -139,7 +133,6 @@ public class RestfulServerExtension implements BeforeEachCallback, AfterEachCall
@Override
public void afterEach(ExtensionContext context) throws Exception {
stopServer();
destroyContextIfWeCreatedIt();
}
@Override

View File

@ -1,6 +1,6 @@
<ul class="navbar-nav" th:fragment="farright" xmlns:th="http://www.thymeleaf.org">
<li class="nav-item">
<a class="nav-link" href="https://github.com/jamesagnew/hapi-fhir"><i class="fab fa-github topbarIcon"></i></span>&nbsp;Source Code</a>
<a class="nav-link" href="https://github.com/hapifhir/hapi-fhir"><i class="fab fa-github topbarIcon"></i></span>&nbsp;Source Code</a>
</li>
<li class="nav-item">
<a class="nav-link" th:href="@{/about}"><span class="fa fa-question-circle topbarIcon"></span>&nbsp;About This Server</a>

View File

@ -199,7 +199,7 @@
The karaf verification step doesn't happen by default
because it doesn't seem to work on Windows.
See https://github.com/jamesagnew/hapi-fhir/issues/921
See https://github.com/hapifhir/hapi-fhir/issues/921
-->
<profile>
<id>DIST</id>