Site updates

This commit is contained in:
jamesagnew 2015-03-10 21:55:38 -04:00
parent 9a9501c53f
commit 18f1c579ab
9 changed files with 145 additions and 55 deletions

View File

@ -3,16 +3,16 @@ package example;
import java.util.Collections;
import java.util.List;
import ca.uhn.fhir.model.dstu2.valueset.IdentifierUseEnum;
import ca.uhn.fhir.model.dstu2.resource.Patient;
import ca.uhn.fhir.model.dstu2.valueset.AdministrativeGenderEnum;
import ca.uhn.fhir.model.dstu2.valueset.IdentifierUseEnum;
import ca.uhn.fhir.model.primitive.IdDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.model.primitive.UriDt;
import ca.uhn.fhir.rest.annotation.IdParam;
import ca.uhn.fhir.rest.annotation.Read;
import ca.uhn.fhir.rest.annotation.RequiredParam;
import ca.uhn.fhir.rest.annotation.Search;
import ca.uhn.fhir.rest.param.StringParam;
import ca.uhn.fhir.rest.server.IResourceProvider;
//START SNIPPET: provider
@ -60,18 +60,18 @@ public class RestfulPatientResourceProvider implements IResourceProvider {
* this annotation, to support many different search criteria. This
* example searches by family name.
*
* @param theIdentifier
* @param theFamilyName
* This operation takes one parameter which is the search criteria. It is
* annotated with the "@Required" annotation. This annotation takes one argument,
* a string containing the name of the search criteria. The datatype here
* is StringDt, but there are other possible parameter types depending on the
* is StringParam, but there are other possible parameter types depending on the
* specific search criteria.
* @return
* This method returns a list of Patients. This list may contain multiple
* matching resources, or it may also be empty.
*/
@Search()
public List<Patient> getPatient(@RequiredParam(name = Patient.SP_FAMILY) StringDt theFamilyName) {
public List<Patient> getPatient(@RequiredParam(name = Patient.SP_FAMILY) StringParam theFamilyName) {
Patient patient = new Patient();
patient.addIdentifier();
patient.getIdentifier().get(0).setUse(IdentifierUseEnum.OFFICIAL);

View File

@ -9,6 +9,16 @@
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd">
<!--
This file configures the database connection for the HAPI JPA Server.
-->
<!--
The following bean configures the database connection. The 'url' property value
of "jdbc:derby:directory:jpaserver_derby_files;create=true" indicates that the
server should save resources in a directory called "jpaserver_derby_files".
A URL to a remote database could also be placed here, along with login credentials
and other properties supported by BasicDataSource.
-->
<bean id="myPersistenceDataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
<property name="url" value="jdbc:derby:directory:jpaserver_derby_files;create=true" />
@ -17,6 +27,11 @@
<property name="password" value=""/>
</bean>
<!--
Hibernate can be configured with other dialects if you wish to connect to another
database (e.g. Postgres). Consult the Hibernate documentation to see a list of
available dialects.
-->
<bean id="myEntityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="myPersistenceDataSource" />
<property name="persistenceXmlLocation" value="classpath:META-INF/fhirtest_persistence.xml" />

View File

@ -65,7 +65,7 @@
<menu name="HAPI FHIR" inherit="top">
<item name="Home" href="index.html" />
<item name="Download" href="./download.html" />
<item name="Upgrade Guide" href="./doc_upgrading.html" />
<!-- <item name="Upgrade Guide" href="./doc_upgrading.html" /> -->
<item name="Changelog" href="./changes-report.html" />
<item name="License" href="license.html" />
</menu>
@ -89,6 +89,7 @@
<item name="Fluent/Generic Client" href="./doc_rest_client.html" />
<item name="Annotation Client" href="./doc_rest_client_annotation.html" />
<item name="Interceptors (client)" href="./doc_rest_client_interceptor.html"/>
<item name="Client HTTP Configuration" href="./doc_rest_client_http_config.html"/>
</item>
<item name="RESTful Server" href="./doc_rest_server.html" >
<item name="Using RESTful Server" href="./doc_rest_server.html" />

View File

@ -2,7 +2,7 @@
<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">
<properties>
<title>FHIR DSTU2 Support - HAPI FHIR</title>
<title>FHIR DSTU2 Support</title>
<author email="jamesagnew@users.sourceforge.net">James Agnew</author>
</properties>

View File

@ -64,7 +64,8 @@ $ mvn install]]></source>
<b>Deploy to Tomcat/JBoss/Websphere/etc: </b> You will now have a file
in your <code>target</code> directory called <code>hapi-fhir-jpaserver-example.war</code>.
This WAR file can be deployed to any Servlet container, at which point you could
access the server at a URL similar to the following (you may need to adjust the
access the server by pointing your browser at a URL similar to the following
(you may need to adjust the
port depending on which port your container is configured to listen on):
<a href="http://localhost:8080/hapi-fhir-jpaserver-example/">http://localhost:8080/hapi-fhir-jpaserver-example/</a>
</li>
@ -72,7 +73,8 @@ $ mvn install]]></source>
<b>Run with Maven and Embedded Jetty: </b> To start the server
directly within Maven, you can execute the following command:<br/>
<source>$ mvn jetty:run</source>
You can then access the server
You can then access the server by pointing your browser at the following URL:
<a href="http://localhost:8080/hapi-fhir-jpaserver-example/">http://localhost:8080/hapi-fhir-jpaserver-example/</a>
</li>
</ul>
</subsection>
@ -90,14 +92,70 @@ $ mvn install]]></source>
<li>
<b>Resource Providers: </b>
A RESTful server <a href="./doc_rest_server.html#resource_providers">Resource Provider</a> is
provided for each resource type in a given release of FHIR, which
provided for each resource type in a given release of FHIR. Each resource provider implements
a
<a href="./apidocs/ca/uhn/fhir/rest/annotation/Search.html">@Search</a>
method implementing the complete set of search parameters defined in the FHIR
specification for the given resource type.<br/><br/>
The resource providers also extend a superclass which implements all of the
other FHIR methods, such as Read, Create, Delete, etc.<br/><br/>
Note that these resource providers are generated as a part of the HAPI build process,
so they are not checked into Git. You can see their source
in the <a href="./xref-jpaserver/">JXR Report</a>,
for example the
<a href="./xref-jpaserver/ca/uhn/fhir/jpa/rp/dstu2/PatientResourceProvider.html">PatientResourceProvider</a>.
<br/><br/>
The resource providers do not actually implement any of the logic
in searching, updating, etc. They simply receive the incoming HTTP calls (via the RestfulServer)
and pass along the incoming requests to the DAOs.
<br/><br/>
</li>
<li><b>Database: </b></li> The
<li>
<b>HAPI DAOs: </b>
The DAOs actually implement all of the database business logic relating to
the storage, indexing, and retrieval of FHIR resources, using the underlying JPA
API.
<br/><br/>
</li>
<li>
<b>Hibernate: </b>
The HAPI JPA Server uses the JPA library, implemented by Hibernate. No Hibernate
specific features are used, so the library should also work with other
providers (e.g. Eclipselink) but it is not tested regularly with them.
<br/><br/>
</li>
<li>
<b>Database: </b>
The RESTful server uses an embedded Derby database, but can be configured to
talk to
<a href="https://developer.jboss.org/wiki/SupportedDatabases2?_sscc=t">any database supported by Hibernate</a>.
</li>
</ul>
</section>
<section name="Configuring The JPA Server">
<p>
The JPA server is configured through a series of configuration files, most
of which are documented inline.
</p>
<ul>
<li>
<a href="https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-jpaserver-example/src/main/webapp/WEB-INF/hapi-fhir-server-database-config.xml"><b>hapi-fhir-server-database-config.xml</b></a>:
Configures the database connection settings
</li>
</ul>
</section>
<section name="Not yet complete">
<p>
The documentation for the JPA server is not yet complete. Please get in touch
if you are able to help us complete it!
</p>
</section>
</body>
</document>

View File

@ -151,49 +151,6 @@
</section>
<section name="Configuring the HTTP Client">
<p>
RESTful clients (both Generic and Annotation-Driven) use
<a href="http://hc.apache.org/httpcomponents-client-ga/">Apache HTTP Client</a>
as a provider. The Apache HTTP Client is very powerful and extremely flexible,
but can be confusing at first to configure, because of the low-level approach that
the library uses.
</p>
<p>
In many cases, the default configuration should suffice. However, if you require anything
more sophisticated (username/password, HTTP proxy settings, etc.) you will need
to configure the underlying client.
</p>
<p>
The underlying client configuration is provided by accessing the
<a href="./apidocs/ca/uhn/fhir/rest/client/IRestfulClientFactory.html">IRestfulClientFactory</a>
class from the FhirContext.
</p>
<p>
Note that individual requests and responses
can be tweaked using <a href="./doc_rest_client_interceptor.html">Client Interceptors</a>.
</p>
<subsection name="Configuring an HTTP Proxy">
<p>
The following example shows how to configure the use of an HTTP
proxy in the client.
</p>
<macro name="snippet">
<param name="id" value="proxy" />
<param name="file" value="examples/src/main/java/example/ClientExamples.java" />
</macro>
</subsection>
</section>
</body>
</document>

View File

@ -0,0 +1,57 @@
<?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">
<properties>
<title>Client HTTP Configuration</title>
<author email="jamesagnew@users.sourceforge.net">James Agnew</author>
</properties>
<body>
<section name="Configuring the HTTP Client">
<p>
RESTful clients (both Generic and Annotation-Driven) use
<a href="http://hc.apache.org/httpcomponents-client-ga/">Apache HTTP Client</a>
as a provider. The Apache HTTP Client is very powerful and extremely flexible,
but can be confusing at first to configure, because of the low-level approach that
the library uses.
</p>
<p>
In many cases, the default configuration should suffice. However, if you require anything
more sophisticated (username/password, HTTP proxy settings, etc.) you will need
to configure the underlying client.
</p>
<p>
The underlying client configuration is provided by accessing the
<a href="./apidocs/ca/uhn/fhir/rest/client/IRestfulClientFactory.html">IRestfulClientFactory</a>
class from the FhirContext.
</p>
<p>
Note that individual requests and responses
can be tweaked using <a href="./doc_rest_client_interceptor.html">Client Interceptors</a>.
</p>
<subsection name="Configuring an HTTP Proxy">
<p>
The following example shows how to configure the use of an HTTP
proxy in the client.
</p>
<macro name="snippet">
<param name="id" value="proxy" />
<param name="file" value="examples/src/main/java/example/ClientExamples.java" />
</macro>
</subsection>
</section>
</body>
</document>

View File

@ -9,7 +9,7 @@
<body>
<section name="Upgrading to HAPI FHIR 0.8">
<!--
<p>
<b>This section is still incomplete: </b> Note that HAPI 0.8 has not
@ -123,6 +123,7 @@
</subsection>
-->
</section>
</body>

View File

@ -34,6 +34,7 @@
<li><a href="./doc_rest_client.html">Fluent/Generic Client</a></li>
<li><a href="./doc_rest_client_annotation.html">Annotation Client</a></li>
<li><a href="./doc_rest_client_interceptor.html">Interceptors (client)</a></li>
<li><a href="./doc_rest_client_http_config.html">Client HTTP Configuration</a></li>
</ul>
<h4>RESTful Server</h4>