Ongoing work on docs migration
|
@ -0,0 +1,46 @@
|
|||
# Android Client
|
||||
|
||||
HAPI now has a specially built module for use on Android. Android developers may use this JAR to take advantage of the FHIR model classes, and the FHIR client (running a FHIR server on Android is not yet supported. Get in touch if this is something you are interested in working on!)
|
||||
|
||||
As of HAPI FHIR 3.1.0, the <code>hapi-fhir-android</code> module has been streamlined in order to reduce its footprint. Previous versions of the library included both an XML and a JSON parser but this has been streamlined to only include JSON support in order to reduce the number of libraries required in an Android build.
|
||||
|
||||
When using the HAPI FHIR Android client, the client will request only JSON responses (via the HTTP <code>Accept</code> header) and will not be able to communicate with FHIR servers that support only XML encoding (few, if any, servers actually exist with this limitation that we are aware of).
|
||||
|
||||
The Android client also uses the <code>hapi-fhir-client-okhttp</code> module, which is an HTTP client based on the OkHttp library. This library has proven to be more powerful and less likely to cause issues on Android than the Apache HttpClient implementation which is bundled by default.
|
||||
|
||||
Note that the Android JAR is still new and hasn't received as much testing as other parts of the library. We would greatly appreciate feedback, testing, etc. Also note that because mobile apps run on less powerful hardware compared to desktop and server applications, it is all the more important to keep a single instance of the `FhirContext` around for good performance, since this object is expensive to create. We are hoping to improve performance of the creation of this object in a future release. If you are an Android developer and would like to help with this, please get in touch!
|
||||
|
||||
## Get the Android JAR
|
||||
|
||||
To add the HAPI library via Gradle, you should add the [hapi-fhir-android](https://search.maven.org/search?q=g:ca.uhn.hapi.fhir%20AND%20a:hapi-fhir-android&core=gav) library to your Gradle file, as well as a structures library for the appropriate version of FHIR that you want to support, e.g. [hapi-fhir-structures-r4](https://search.maven.org/search?q=g:ca.uhn.hapi.fhir%20AND%20a:hapi-fhir-structures-r4&core=gav).
|
||||
|
||||
```groovy
|
||||
dependencies {
|
||||
compile "ca.uhn.hapi.fhir:hapi-fhir-android:3.1.0-SNAPSHOT"
|
||||
compile "ca.uhn.hapi.fhir:hapi-fhir-structures-dstu2:3.1.0-SNAPSHOT"
|
||||
}
|
||||
```
|
||||
|
||||
You will also need to manually exclude the Woodstox StAX library from inclusion, as this library uses namespaces which are prohibited on Android. You should also exclude:
|
||||
|
||||
```groovy
|
||||
configurations {
|
||||
all*.exclude group: 'org.codehaus.woodstox'
|
||||
all*.exclude group: 'org.apache.httpcomponents'
|
||||
}
|
||||
```
|
||||
|
||||
To see a sample Gradle file for a working Android project using HAPI FHIR, see the [Android Integration Test](https://github.com/hapifhir/hapi-fhir-android-integration-test) project.
|
||||
|
||||
# Performance
|
||||
|
||||
On mobile devices, performance problems are particularly noticeable. This is made worse by the fact that some economy Android devices have much slower performance than modern desktop computers. See the [Client Configuration Performance](/docs/client/rest_client_http_config.html#performance) page for some tips on how to improve client performance.
|
||||
|
||||
# Examples
|
||||
|
||||
The following is intended to be a selection of publicly available open source Android applications which use HAPI FHIR and might be useful as a reference.
|
||||
|
||||
If you know of others, please let us know!
|
||||
|
||||
* [https://github.com/hapifhir/hapi-fhir-android-integration-test](https://github.com/hapifhir/hapi-fhir-android-integration-test) - hapi-fhir-android Integration Test and Reference Application is our test platform for validating new releases. Created by Thomas Andersen.
|
||||
* [https://github.com/SynappzMA/FHIR-Android](https://github.com/SynappzMA/FHIR-Android) - Nice FHIR DSTU2 search app
|
|
@ -3,5 +3,19 @@ section.introduction.title=Welcome to HAPI FHIR
|
|||
page.introduction.table_of_contents=Table of Contents
|
||||
page.introduction.introduction=Introduction
|
||||
|
||||
section.model.title=Working With The FHIR Model
|
||||
page.model.profiles_and_extensions=Profiles and Extensions
|
||||
page.model.converter=Version Converters
|
||||
page.model.custom_structures=Custom Structures
|
||||
|
||||
section.server.title=Server
|
||||
page.server.cors=CORS
|
||||
|
||||
section.android.title=Android Support
|
||||
page.android.client=Android Client
|
||||
|
||||
section.tools.title=Tools
|
||||
page.tools.hapi_fhir_cli=Command Line Interface (CLI) Tool
|
||||
|
||||
section.appendix.title=Appendix
|
||||
page.appendix.changelog=Changelog
|
||||
|
|
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 73 KiB |
After Width: | Height: | Size: 9.5 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 82 KiB |
After Width: | Height: | Size: 70 KiB |
After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 2.0 KiB |
|
@ -0,0 +1,37 @@
|
|||
|
||||
# HL7 FHIR Converter
|
||||
|
||||
Beginning in HAPI FHIR 2.3, a new module called `hapi-fhir-converter` has been added to the project. This is an <b>experimental feature</b> so use it with caution!
|
||||
|
||||
This feature allows automated conversion from earlier versions of the FHIR structures to a later version.
|
||||
|
||||
The following page shows some basic examples. Please get in touch if you are able to contribute better examples!
|
||||
|
||||
## Importing the Module
|
||||
|
||||
To use the `hapi-fhir-converter` module, import the following dependency into your project pom.xml (or equivalent)
|
||||
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>ca.uhn.hapi.fhir</groupId>
|
||||
<artifactId>hapi-fhir-converter</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
## Converting from DSTU2 to DSTU3
|
||||
|
||||
The following example shows a conversion from a `hapi-fhir-structures-hl7org-dstu2` structure to a `hapi-fhir-structures-dstu3` structure.
|
||||
|
||||
```java
|
||||
{{snippet:classpath:/ca/uhn/hapi/fhir/docs/ConverterExamples.java|1020}}
|
||||
```
|
||||
|
||||
## Converting from DSTU2.1 to DSTU3
|
||||
|
||||
The following example shows a conversion from a `hapi-fhir-structures-dstu2.1` structure to a `hapi-fhir-structures-dstu3` structure.
|
||||
|
||||
```java
|
||||
{{snippet:classpath:/ca/uhn/hapi/fhir/docs/ConverterExamples.java|1420}}
|
||||
```
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
# Custom Structures
|
||||
|
||||
Typically, when working with FHIR the right way to provide your own extensions is to work with existing resource types and simply add your own extensions and/or constrain out fields you don't need.
|
||||
|
||||
This process is described on the [Profiles & Extensions](./profiles_and_extensions.html) page.
|
||||
|
||||
There are situations however when you might want to create an entirely custom resource type. This feature should be used only if there is no other option, since it means you are creating a resource type that will not be interoperable with other FHIR implementations.
|
||||
|
||||
<p class="doc_info_bubble">
|
||||
This is an advanced features and isn't needed for most uses of HAPI-FHIR. Feel free to skip this page.
|
||||
</p>
|
||||
|
||||
# Custom Resource Structure
|
||||
|
||||
The following example shows a custom resource structure class:
|
||||
|
||||
```java
|
||||
{{snippet:classpath:/ca/uhn/hapi/fhir/docs/customtype/CustomResource.java|resource}}
|
||||
```
|
||||
|
||||
## Custom Datatype Structure
|
||||
|
||||
The following example shows a custom datatype structure class:
|
||||
|
||||
```java
|
||||
{{snippet:classpath:/ca/uhn/hapi/fhir/docs/customtype/CustomDatatype.java|datatype}}
|
||||
```
|
||||
|
||||
## Using the Custom Structure
|
||||
|
||||
And now let's try the custom structure out:
|
||||
|
||||
```java
|
||||
{{snippet:classpath:/ca/uhn/hapi/fhir/docs/customtype/CustomUsage.java|usage}}
|
||||
```
|
||||
|
||||
This produces the following output (some spacing has been added for readability):
|
||||
|
||||
```xml
|
||||
<CustomResource xmlns="http://hl7.org/fhir">
|
||||
<meta>
|
||||
<profile value="http://hl7.org/fhir/profiles/custom-resource"/>
|
||||
</meta>
|
||||
|
||||
<televisionDate value="2015-01-01"/>
|
||||
<televisionCustomDatatype>
|
||||
<date value="2016-05-22T08:30:36-04:00"/>
|
||||
<kittens value="FOO"/>
|
||||
</televisionCustomDatatype>
|
||||
|
||||
<dogs value="Some Dogs"/>
|
||||
|
||||
</CustomResource>
|
||||
```
|
|
@ -0,0 +1,174 @@
|
|||
# Profiles and Extensions
|
||||
|
||||
This page describes how to extend and constrain the FHIR data model for your own purposes.
|
||||
|
||||
# Extensions
|
||||
|
||||
<p class="doc_info_bubble">
|
||||
Note on FHIR Versions: Because of the differences in the way the structures work between DSTU2 and DSTU3, we have provided two versions of many of the examples on this page. See the <a href="/hapi-fhir/download.html">download page</a> for more information on FHIR versions.
|
||||
</p>
|
||||
|
||||
Extensions are a key part of the FHIR specification, providing a standardized way of placing additional data in a resource.
|
||||
|
||||
The simplest way to interact with extensions (i.e. to add them to resources you are creating, or to read them from resources you are consuming) is to treat them as "undeclared extensions". Undeclared extensions can be added to any of the built in FHIR resource types that come with HAPI-FHIR.
|
||||
|
||||
### DSTU2
|
||||
|
||||
```java
|
||||
{{snippet:classpath:/ca/uhn/hapi/fhir/docs/ExtensionsDstu2.java|resourceExtension}}
|
||||
```
|
||||
|
||||
### DSTU3 and Later
|
||||
|
||||
```java
|
||||
{{snippet:classpath:/ca/uhn/hapi/fhir/docs/ExtensionsDstu3.java|resourceExtension}}
|
||||
```
|
||||
|
||||
Undeclared extensions can also be added to datatypes (composite or primitive).
|
||||
|
||||
### DSTU2
|
||||
|
||||
```java
|
||||
{{snippet:classpath:/ca/uhn/hapi/fhir/docs/ExtensionsDstu2.java|resourceStringExtension}}
|
||||
```
|
||||
|
||||
### DSTU3 and Later
|
||||
|
||||
```java
|
||||
{{snippet:classpath:/ca/uhn/hapi/fhir/docs/ExtensionsDstu3.java|resourceStringExtension}}
|
||||
```
|
||||
|
||||
## Sub-Extensions
|
||||
|
||||
Extensions may also have child extensions as their content, instead of a datatype. This is done by adding a child undeclared extension to the parent extension.
|
||||
|
||||
### DSTU2
|
||||
|
||||
```java
|
||||
{{snippet:classpath:/ca/uhn/hapi/fhir/docs/ExtensionsDstu2.java|subExtension}}
|
||||
```
|
||||
|
||||
### DSTU3 and Later
|
||||
|
||||
```java
|
||||
{{snippet:classpath:/ca/uhn/hapi/fhir/docs/ExtensionsDstu3.java|subExtension}}
|
||||
```
|
||||
|
||||
## Retrieving Extension Values
|
||||
|
||||
HAPI provides a few ways of accessing extension values in resources which are received from other sources (i.e. downloaded by a client).
|
||||
|
||||
### DSTU2
|
||||
|
||||
```java
|
||||
{{snippet:classpath:/ca/uhn/hapi/fhir/docs/ExtensionsDstu2.java|parseExtension}}
|
||||
```
|
||||
|
||||
### DSTU3 and Later
|
||||
|
||||
```java
|
||||
{{snippet:classpath:/ca/uhn/hapi/fhir/docs/ExtensionsDstu3.java|parseExtension}}
|
||||
```
|
||||
|
||||
# Custom Resource Types
|
||||
|
||||
The most elegant way of adding extensions to a resource is through the use of custom fields. The following example shows a custom type which extends the FHIR Patient resource definition through two extensions.
|
||||
|
||||
```java
|
||||
{{snippet:classpath:/ca/uhn/hapi/fhir/docs/MyPatient.java|patientDef}}
|
||||
```
|
||||
|
||||
Using this custom type is as simple as instantiating the type and working with the new fields.
|
||||
|
||||
```java
|
||||
{{snippet:classpath:/ca/uhn/hapi/fhir/docs/MyPatientUse.java|patientUse}}
|
||||
```
|
||||
|
||||
This example produces the following output:
|
||||
|
||||
```xml
|
||||
<Patient xmlns="http://hl7.org/fhir">
|
||||
<modifierExtension url="http://example.com/dontuse#importantDates">
|
||||
<valueDateTime value="2010-01-02"/>
|
||||
</modifierExtension>
|
||||
<modifierExtension url="http://example.com/dontuse#importantDates">
|
||||
<valueDateTime value="2014-01-26T11:11:11"/>
|
||||
</modifierExtension>
|
||||
<extension url="http://example.com/dontuse#petname">
|
||||
<valueString value="Fido"/>
|
||||
</extension>
|
||||
<name>
|
||||
<family value="Smith"/>
|
||||
<given value="John"/>
|
||||
<given value="Quincy"/>
|
||||
<suffix value="Jr"/>
|
||||
</name>
|
||||
</Patient>
|
||||
```
|
||||
|
||||
Parsing messages using your new custom type is equally simple. These types can also be used as method return types in clients and servers.
|
||||
|
||||
```java
|
||||
{{snippet:classpath:/ca/uhn/hapi/fhir/docs/MyPatientUse.java|patientParse}}
|
||||
```
|
||||
|
||||
## Using Custom Types in a Client
|
||||
|
||||
If you are using a client and wish to use a specific custom structure, you may simply use the custom structure as you would a build in HAPI type.
|
||||
|
||||
```java
|
||||
{{snippet:classpath:/ca/uhn/hapi/fhir/docs/ExtensionsDstu3.java|customTypeClientSimple}}
|
||||
```
|
||||
|
||||
You may also explicitly use custom types in searches and other operations which return resources.
|
||||
|
||||
```java
|
||||
{{snippet:classpath:/ca/uhn/hapi/fhir/docs/ExtensionsDstu3.java|customTypeClientSearch}}
|
||||
```
|
||||
|
||||
You can also explicitly declare a preferred response resource custom type. This is useful for some operations that do not otherwise declare their resource types in the method signature.
|
||||
|
||||
```java
|
||||
{{snippet:classpath:/ca/uhn/hapi/fhir/docs/ExtensionsDstu3.java|customTypeClientSearch2}}
|
||||
```
|
||||
|
||||
## Using Multiple Custom Types in a Client
|
||||
|
||||
Sometimes you may not know in advance exactly which type you will be receiving. For example, there are Patient resources which conform to several different profiles on a server and you aren't sure which profile you will get back for a specific read, you can declare the "primary" type for a given profile.
|
||||
|
||||
This is declared at the FhirContext level, and will apply to any clients created from this context (including clients created before the default was set).
|
||||
|
||||
```java
|
||||
{{snippet:classpath:/ca/uhn/hapi/fhir/docs/ExtensionsDstu3.java|customTypeClientDeclared}}
|
||||
```
|
||||
## Using Custom Types in a Server
|
||||
|
||||
If you are using a client and wish to use a specific custom structure, you may simply use the custom structure as you would a build in HAPI type.
|
||||
|
||||
```java
|
||||
{{snippet:classpath:/ca/uhn/hapi/fhir/docs/ExtensionsDstu3.java|customTypeClientSimple}}
|
||||
```
|
||||
|
||||
## Custom Type Examples: Composite Extensions
|
||||
|
||||
The following example shows a resource containing a composite extension.
|
||||
|
||||
```java
|
||||
{{snippet:classpath:/ca/uhn/hapi/fhir/docs/customtype/CustomCompositeExtension.java|resource}}
|
||||
```
|
||||
|
||||
This could be used to create a resource such as the following:
|
||||
|
||||
```xml
|
||||
<Patient xmlns="http://hl7.org/fhir">
|
||||
<id value="123"/>
|
||||
<extension url="http://acme.org/fooParent">
|
||||
<extension url="http://acme.org/fooChildA">
|
||||
<valueString value="ValueA"/>
|
||||
</extension>
|
||||
<extension url="http://acme.org/fooChildB">
|
||||
<valueString value="ValueB"/>
|
||||
</extension>
|
||||
</extension>
|
||||
</Patient>
|
||||
```
|
|
@ -0,0 +1,94 @@
|
|||
# CORS
|
||||
|
||||
<p class="doc_info_bubble">
|
||||
Note that in previous revisions of this document we recommended using the <a href="https://github.com/ebay/cors-filter">eBay CORS Filter</a>, but as of 2016 the eBay filter is no longer being maintained and contains known bugs. We now recommend against using this filter.
|
||||
</p>
|
||||
|
||||
If you are intending to support JavaScript clients in your server application, you will generally need to enable Cross Origin Resource Sharing (CORS). There are a number of ways of supporting this, so two are shown here:
|
||||
|
||||
* An approach using a HAPI FHIR Server Interceptor (Requires SpringFramework)
|
||||
* An approach using a servlet Filter (Container Specific)
|
||||
|
||||
## HAPI FHIR Server Interceptor
|
||||
|
||||
The HAPI FHIR server framework includes an interceptor that can be used to provide CORS functionality on your server. This mechanism is nice because it relies purely on Java configuration (no messing around with web.xml files). HAPI's interceptor is a thin wrapper around Spring Framework's CorsProcessor class, so it requires Spring to be present on your classpath.
|
||||
|
||||
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.
|
||||
|
||||
The following steps outline how to enable HAPI's CorsInterceptor:
|
||||
|
||||
Add the following dependency to your POM. Note the exclusion of commons-logging, as we are using SLF4j without commons-logging in most of our examples. If your application uses commons-logging you don't need to exclude that dependency.
|
||||
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-web</artifactId>
|
||||
<version>${spring_version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<groupId>commons-logging</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
In your server's initialization method, create and register a CorsInterceptor:
|
||||
|
||||
```java
|
||||
{{snippet:classpath:/ca/uhn/hapi/fhir/docs/ServletExamples.java|corsInterceptor}}
|
||||
```
|
||||
|
||||
## Add the Dependency
|
||||
|
||||
The following examples show how to use the Apache Tomcat CorsFilter to enable CORS support. The filter being used (`org.apache.catalina.filters.CorsFilter`) is bundled with Apache Tomcat so if you are deploying to that server you can use the filter.
|
||||
|
||||
Other containers have similar filters you can use, so consult the documentation for the given container you are using for more information. (If you have an example for how to configure a different CORS filter, please send it our way! Examples are always useful!)
|
||||
|
||||
In your web.xml file (within the WEB-INF directory in your WAR file), the following filter definition adds the CORS filter, including support for the X-FHIR-Starter header defined by SMART Platforms.
|
||||
|
||||
```xml
|
||||
<filter>
|
||||
<filter-name>CORS Filter</filter-name>
|
||||
<filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
|
||||
<init-param>
|
||||
<description>A comma separated list of allowed origins. Note: An '*' cannot be used for an allowed origin when using credentials.</description>
|
||||
<param-name>cors.allowed.origins</param-name>
|
||||
<param-value>*</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<description>A comma separated list of HTTP verbs, using which a CORS request can be made.</description>
|
||||
<param-name>cors.allowed.methods</param-name>
|
||||
<param-value>GET,POST,PUT,DELETE,OPTIONS</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<description>A comma separated list of allowed headers when making a non simple CORS request.</description>
|
||||
<param-name>cors.allowed.headers</param-name>
|
||||
<param-value>X-FHIR-Starter,Origin,Accept,X-Requested-With,Content-Type,Access-Control-Request-Method,Access-Control-Request-Headers,Authorization</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<description>A comma separated list non-standard response headers that will be exposed to XHR2 object.</description>
|
||||
<param-name>cors.exposed.headers</param-name>
|
||||
<param-value>Location,Content-Location</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<description>A flag that suggests if CORS is supported with cookies</description>
|
||||
<param-name>cors.support.credentials</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<description>A flag to control logging</description>
|
||||
<param-name>cors.logging.enabled</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<description>Indicates how long (in seconds) the results of a preflight request can be cached in a preflight result cache.</description>
|
||||
<param-name>cors.preflight.maxage</param-name>
|
||||
<param-value>300</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>CORS Filter</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>]]></source>
|
||||
```
|
|
@ -0,0 +1,87 @@
|
|||
|
||||
# Command Line Tool for HAPI FHIR
|
||||
|
||||
**hapi-fhir-cli** is the HAPI FHIR Command Line tool. It features a number of HAPI's built-in features as easy to use command line options.
|
||||
|
||||
## 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).
|
||||
|
||||
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.
|
||||
|
||||
You can now try the tool out by executing the following command: `hapi-fhir-cli`
|
||||
|
||||
This command should show a help screen, as shown in the screeenshot below.
|
||||
|
||||
<img src="/hapi-fhir/docs/images/hapi-fhir-cli.png" alt="Basic screen shot" style="margin-left: 40px;"/>
|
||||
|
||||
## Download and Installation - Mac/OSX
|
||||
|
||||
hapi-fhir-cli is available as a <a href="https://brew.sh/">Homebrew</a> package for Mac. It can be installed using the following command:
|
||||
|
||||
```bash
|
||||
brew install hapi-fhir-cli
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
The tool should work correctly on any system that has Java 8 (or newer) installed. If it is not working correctly, first try the following command to test if Java is installed:
|
||||
|
||||
```bash
|
||||
java -version
|
||||
```
|
||||
|
||||
If this command does not produce output similar to the following, you should install/reinstall Java.
|
||||
|
||||
```
|
||||
java version "1.8.0_60"
|
||||
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
|
||||
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
|
||||
```
|
||||
If this does not help, please post a question on our [Google Group](https://groups.google.com/d/forum/hapi-fhir).
|
||||
|
||||
# Server (run-server)
|
||||
|
||||
The CLI tool can be used to start a local, fully functional FHIR server which you can use for testing. To start this server, simply issue the command <code>hapi-fhir-cli run-server</code> as shown in the example below:
|
||||
|
||||
<img src="/hapi-fhir/docs/images/hapi-fhir-cli-run-server.png" alt="Run Server" style="margin-left: 40px;"/>
|
||||
|
||||
Once the server has started, you can access the testing webpage by pointing your browser at <a href="http://localhost:8080/">http://localhost:8080/</a>. The FHIR server base URL will be <a href="http://localhost:8080/baseDstu2/">http://localhost:8080/baseDstu2/</a>.
|
||||
|
||||
Note that by default this server will not be populated with any resources at all. You can easily populate it with the FHIR example resources by <b>leaving it running</b> and opening a second terminal window, then using the <code>hapi-fhir-cli upload-examples</code> command (see the section below).
|
||||
|
||||
The server uses a local Derby database instance for storage. You may want to execute this command in an empty directory, which you can clear if you want to reset the server.
|
||||
|
||||
# Upload Example Resources (upload-examples)
|
||||
|
||||
The <b>upload-examples</b> command downloads the complete set of FHIR example resources from the HL7 website, and uploads them to a server of your choice. This can be useful to populate a server with test data.
|
||||
|
||||
To execute this command, uploading test resources to a local CLI server, issue the following: `hapi-fhir-cli upload-examples -t http://localhost:8080/baseDstu2`
|
||||
|
||||
Note that this command may take a surprisingly long time to complete because of the large number of examples.
|
||||
|
||||
# Upload Terminology
|
||||
|
||||
The HAPI FHIR JPA server has a terminology server, and has the ability to be populated with "external" code systems. These code systems are systems that contain large numbers of codes, so the codes are not stored directly inside the resource body.
|
||||
|
||||
HAPI has methods for uploading several popular code systems into its tables using the distribution files produced by the respective code systems. This is done using the <code>upload-terminology</code> command. The following examples show how to do this for several popular code systems.
|
||||
|
||||
Note that the path and exact filename of the terminology files will likely need to be adjusted for your local disk structure.
|
||||
|
||||
### SNOMED CT
|
||||
|
||||
```
|
||||
./hapi-fhir-cli upload-terminology -d Downloads/SnomedCT_RF2Release_INT_20160131.zip -f dstu3 -t http://localhost:8080/baseDstu3 -u http://snomed.info/sct
|
||||
```
|
||||
|
||||
### LOINC
|
||||
|
||||
```
|
||||
./hapi-fhir-cli upload-terminology -d Downloads/LOINC_2.54_MULTI-AXIAL_HIERARCHY.zip -d Downloads/LOINC_2.54_Text.zip -f dstu3 -t http://localhost:8080/baseDstu3 -u http://loinc.org
|
||||
```
|
||||
|
||||
# Migrate Database
|
||||
|
||||
The `migrate-database` command may be used to Migrate a database schema when upgrading a <a href="./doc_jpa.html">HAPI FHIR JPA</a> project from one version of HAPI FHIR to another version.
|
||||
|
||||
See <a href="./doc_jpa.html#upgrading">Upgrading HAPI FHIR JPA</a> for information on how to use this command.
|
|
@ -1293,7 +1293,7 @@ public class GenericClientTest {
|
|||
|
||||
assertThat(capt.getValue().getURI().toString(), containsString("http://example.com/fhir/Patient?"));
|
||||
assertThat(capt.getValue().getURI().toString(), containsString("_include=" + UrlUtil.escapeUrlParam(Patient.INCLUDE_ORGANIZATION.getValue())));
|
||||
assertThat(capt.getValue().getURI().toString(), containsString("_include%3Arecurse=" + UrlUtil.escapeUrlParam(Patient.INCLUDE_LINK.getValue())));
|
||||
assertThat(capt.getValue().getURI().toString(), containsString("_include%3Aiterate=" + UrlUtil.escapeUrlParam(Patient.INCLUDE_LINK.getValue())));
|
||||
assertThat(capt.getValue().getURI().toString(), containsString("_include=*"));
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document xmlns="http://maven.apache.org/XDOC/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">
|
||||
|
||||
<!-- This content is migrated -->
|
||||
|
||||
<properties>
|
||||
<title>Android Support</title>
|
||||
<author email="jamesagnew@users.sourceforge.net">James Agnew</author>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document xmlns="http://maven.apache.org/XDOC/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">
|
||||
|
||||
<!-- This content is migrated -->
|
||||
|
||||
<properties>
|
||||
<title>Command Line Tool</title>
|
||||
<author email="jamesagnew@users.sourceforge.net">James Agnew</author>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document xmlns="http://maven.apache.org/XDOC/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">
|
||||
|
||||
<!-- This content is migrated -->
|
||||
|
||||
<properties>
|
||||
<title>HL7 FHIR Converter</title>
|
||||
<author email="jamesagnew@users.sourceforge.net">James Agnew</author>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document xmlns="http://maven.apache.org/XDOC/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">
|
||||
|
||||
<!-- This has been migrated -->
|
||||
|
||||
<properties>
|
||||
<title>CORS</title>
|
||||
<author email="jamesagnew@gmail.com">James Agnew</author>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document xmlns="http://maven.apache.org/XDOC/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">
|
||||
|
||||
<!-- This has been migrated -->
|
||||
|
||||
<properties>
|
||||
<title>Custom Structures</title>
|
||||
</properties>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document xmlns="http://maven.apache.org/XDOC/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 http://maven.apache.org/xsd/xdoc-2.0.xsd">
|
||||
|
||||
<!-- This content has been migrated -->
|
||||
|
||||
<properties>
|
||||
<title>Profiles and Extensions</title>
|
||||
<author email="jamesagnew@gmail.com">James Agnew</author>
|
||||
|
|