Add some documentation for #59
This commit is contained in:
parent
2d5293c2ef
commit
a46183ddb8
|
@ -33,17 +33,27 @@ import java.lang.annotation.Target;
|
|||
public @interface ResourceDef {
|
||||
|
||||
/**
|
||||
* The name of the resource (e.g. "Patient" or "DiagnosticReport")
|
||||
* The name of the resource (e.g. "Patient" or "DiagnosticReport"). If you are defining your
|
||||
* own custom extension to a built-in FHIR resource definition type (e.g. you are extending
|
||||
* the built-in Patient class) you do not need to supply a value for this property, as it
|
||||
* will be inferred from the parent class.
|
||||
*/
|
||||
String name() default "";
|
||||
|
||||
/**
|
||||
* if set, will be used as the id for any profiles generated for this resource
|
||||
* if set, will be used as the id for any profiles generated for this resource. This property
|
||||
* should be set for custom profile definition classes, and will be used as the resource ID
|
||||
* for the generated profile exported by the server. For example, if you set this value to
|
||||
* "hello" on a custom resource class, your server will automatically export a profile with the
|
||||
* identity: <code>http://localhost:8080/fhir/Profile/hello</code> (the base URL will be whatever
|
||||
* your server uses, not necessarily "http://localhost:8080/fhir")
|
||||
*/
|
||||
String id() default "";
|
||||
|
||||
/**
|
||||
* The URL indicating the profile for this resource definition, if known
|
||||
* The URL indicating the profile for this resource definition, if known. If this value is set
|
||||
* on a custom profile definition class in a server, the profile is assumed to be external to
|
||||
* the server, so the server will not export a profile for it.
|
||||
*/
|
||||
String profile() default "";
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ public class CompleteResourceProviderTest {
|
|||
ourDaoConfig.setHardSearchLimit(100);
|
||||
|
||||
List<IResource> resources = new ArrayList<>();
|
||||
for (int i = 0; i < 300; i++) {
|
||||
for (int i = 0; i < 100; i++) {
|
||||
Organization org = new Organization();
|
||||
org.setName("testCountParam_01");
|
||||
resources.add(org);
|
||||
|
@ -117,11 +117,11 @@ public class CompleteResourceProviderTest {
|
|||
ourClient.transaction().withResources(resources).prettyPrint().encodedXml().execute();
|
||||
|
||||
Bundle found = ourClient.search().forResource(Organization.class).where(Organization.NAME.matches().value("testCountParam_01")).limitTo(10).execute();
|
||||
assertEquals(300, found.getTotalResults().getValue().intValue());
|
||||
assertEquals(100, found.getTotalResults().getValue().intValue());
|
||||
assertEquals(10, found.getEntries().size());
|
||||
|
||||
found = ourClient.search().forResource(Organization.class).where(Organization.NAME.matches().value("testCountParam_01")).limitTo(999).execute();
|
||||
assertEquals(300, found.getTotalResults().getValue().intValue());
|
||||
assertEquals(100, found.getTotalResults().getValue().intValue());
|
||||
assertEquals(50, found.getEntries().size());
|
||||
|
||||
}
|
||||
|
@ -241,7 +241,8 @@ public class CompleteResourceProviderTest {
|
|||
}
|
||||
|
||||
Bundle history = ourClient.history(null, (String) null, null, null);
|
||||
assertEquals(p1Id.getIdPart(), history.getEntries().get(0).getId().getIdPart());
|
||||
|
||||
assertEquals("Expected[" + p1Id.getIdPart() + "] but was " + history.getEntries().get(0).getId(), p1Id.getIdPart(), history.getEntries().get(0).getId().getIdPart());
|
||||
assertNotNull(history.getEntries().get(0).getResource());
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<dependent-module archiveName="hapi-fhir-structures-dstu-0.8-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/hapi-fhir-structures-dstu/hapi-fhir-structures-dstu">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module deploy-path="/" handle="module:/overlay/prj/hapi-fhir-testpage-overlay?includes=**/**&excludes=META-INF/MANIFEST.MF">
|
||||
<dependent-module deploy-path="/" handle="module:/overlay/var/M2_REPO/ca/uhn/hapi/fhir/hapi-fhir-testpage-overlay/0.8-SNAPSHOT/hapi-fhir-testpage-overlay-0.8-SNAPSHOT.war?unpackFolder=target/m2e-wtp/overlays&includes=**/**&excludes=META-INF/MANIFEST.MF">
|
||||
<dependency-type>consumes</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module deploy-path="/" handle="module:/overlay/slf/?includes=**/**&excludes=META-INF/MANIFEST.MF">
|
||||
|
|
|
@ -72,8 +72,7 @@ public class TestRestfulServer extends RestfulServer {
|
|||
|
||||
String baseUrl = System.getProperty("fhir.baseurl");
|
||||
if (StringUtils.isBlank(baseUrl)) {
|
||||
//throw new ServletException("Missing system property: fhir.baseurl");
|
||||
baseUrl = "http://localhost:8080/base";
|
||||
throw new ServletException("Missing system property: fhir.baseurl");
|
||||
}
|
||||
|
||||
setServerAddressStrategy(new HardcodedServerAddressStrategy(baseUrl));
|
||||
|
|
|
@ -189,6 +189,12 @@
|
|||
header, leading to servers incorrectly assuming ISO-8859/1. Thanks to
|
||||
shvoidlee for reporting!
|
||||
</action>
|
||||
<action type="fix" issue="59" dev="wdebeau1">
|
||||
Clean up the way that Profile resources are automatically exported
|
||||
by the server for custom resource profile classes. See the
|
||||
<![CDATA[<a href="http://jamesagnew.github.io/hapi-fhir/apidocs/ca/uhn/fhir/model/api/annotation/ResourceDef.html">@ResourceDef</a>]]>
|
||||
JavaDoc for information on how this works.
|
||||
</action>
|
||||
</release>
|
||||
<release version="0.7" date="2014-Oct-23">
|
||||
<action type="add" issue="30">
|
||||
|
|
Loading…
Reference in New Issue