From af3c35cbc07df69c760e200b4a80f4bcc3d183e9 Mon Sep 17 00:00:00 2001
From: jamesagnew
]]>
+ All annotation-based clients and all server search method parameters are now named
+ (type)Param, for example: StringParam, TokenParam, etc.
+
]]>
+ All generic/fluent client method parameters are now named
+ (type)ClientParam, for example: StringClientParam, TokenClientParam, etc.
+
]]>
+ All renamed classes have been retained and deprocated, so this change should not cause any issues
+ for existing applications but those applications should be refactored to use the
+ new parameters when possible.
+
*
Parameters which take a string as their format should use the - StringParameter - type. They may also use normal java Strings (or HAPI's StringDt), although it is + StringParam + type. They may also use normal java Strings, although it is not possible to use the ":exact" qualifier in that case.
@@ -507,11 +507,6 @@- Searches method parameters may be of any type that implements the - IQueryParameterType - interface. -
The "token" type is used for parameters which have two parts, such as an idnetifier (which has a system URI, as well as the actual identifier) @@ -537,7 +532,7 @@
The FHIR specification provides a sytax for specifying - dates (and date/times as well, but for simplicity we will just say dates here) + dates+times (but for simplicity we will just say dates here) as search criteria.
@@ -550,8 +545,7 @@To accept a qualified date parameter, use the - QualifiedDateParam - parameter type. + DateParam parameter type.
http://fhir.example.com/Patient?provider:Organization.name=FooOrg
+ + It is also possible to explicitly state a chained value right in the parameter name. + This is useful if you want to only support a search by a specific given chained + parameter. It has the added bonus that you can use the correct parameter type of + the chained parameter (in this case a TokenParameter because the Patient.identifier + parameter is a token) +
+ +Search methods may take multiple parameters, and these parameters may (or may not) be optional. - aaaa To add a second required parameter, annotate the parameter with @RequiredParam @@ -743,6 +751,25 @@ only @OptionalParam parameters, or any combination of the two.
++ If you wish to create a server that can accept any combination of a large number + of parameters, (this is how the various reference servers behave, as well as the + public HAPI server) + the easiest way to accomplish this is to simply create one method + with all allowable parameters, each annotated as @OptionalParam. +
+ ++ On the other hand, if you have specific combinations of parameters you wish to + support (a common scenario if you are building FHIR on top of existing data sources + and only have certain indexes you can use) you could create multiple search methods, + each with specific required and optional parameters matching the database indexes. +
+ ++ The following example shows a method with two parameters. +
+It is possible to accept multiple values of a single parameter @@ -853,7 +880,7 @@
Example URL to invoke this method:
- http://fhir.example.com/DiagnosticReport?subject.identifier=7000135&_include=DiagnosticReport.subject
+ http://fhir.example.com/DiagnosticReport?identifier=7000135&_include=DiagnosticReport.subject
@@ -869,6 +896,25 @@
+ It is also possible to annotate search methods and/or parameters with + the + @Description + annotation. This annotation allows you to add a description of the method + and the individual parameters. These descriptions will be placed in the + server's metadata statement, which cam be helpful to anyone who is developing + software against your server. +
+ +@@ -948,7 +994,7 @@ validate - tests whether a resource passes business validation, and would be + operation tests whether a resource passes business validation, and would be acceptable for saving to a server (e.g. by a create or update method).
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirResourceDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirResourceDao.java
index ac1f8cf53dd..377a554f64f 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirResourceDao.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirResourceDao.java
@@ -150,29 +150,28 @@ public class FhirResourceDao
*