From ea7377043312d6df063bd247a634f8a4f36922eb Mon Sep 17 00:00:00 2001 From: jamesagnew Date: Fri, 28 Mar 2014 17:11:56 -0400 Subject: [PATCH] Documentation updates --- hapi-fhir-base/furore-conformance.xml | 4893 +++++++++++++++++ .../java/ca/uhn/fhir/context/FhirContext.java | 88 +- .../java/ca/uhn/fhir/parser/ParserState.java | 36 +- .../rest/client/ClientInvocationHandler.java | 15 +- .../rest/client/IRestfulClientFactory.java | 13 +- .../rest/client/RestfulClientFactory.java | 65 +- .../fhir/rest/method/BaseMethodBinding.java | 4 + .../BaseOutcomeReturningMethodBinding.java | 2 +- .../BaseResourceReturningMethodBinding.java | 5 +- .../rest/method/ConformanceMethodBinding.java | 21 +- .../fhir/rest/method/ReadMethodBinding.java | 3 +- .../java/ca/uhn/fhir/rest/method/Request.java | 9 +- .../fhir/rest/method/SearchMethodBinding.java | 3 +- .../fhir/rest/method/UpdateMethodBinding.java | 4 +- .../uhn/fhir/rest/server/RestfulServer.java | 351 +- .../provider/ServerConformanceProvider.java | 8 +- .../site/example/java/example/QuickUsage.java | 6 +- .../RestfulPatientResourceProviderMore.java | 99 +- .../src/site/xdoc/doc_rest_operations.xml | 429 +- .../src/site/xdoc/doc_rest_server.xml | 22 +- hapi-fhir-base/src/site/xdoc/index.xml | 2 +- .../ca/uhn/fhir/parser/JsonParserTest.java | 18 + .../ca/uhn/fhir/parser/XmlParserTest.java | 17 + .../ca/uhn/fhir/rest/client/ClientTest.java | 70 + .../ca/uhn/fhir/rest/client/ITestClient.java | 3 + .../test/resources/furore-conformance.json | 1 + .../src/test/resources/furore-conformance.xml | 4893 +++++++++++++++++ 27 files changed, 10819 insertions(+), 261 deletions(-) create mode 100644 hapi-fhir-base/furore-conformance.xml create mode 100644 hapi-fhir-base/src/test/resources/furore-conformance.json create mode 100644 hapi-fhir-base/src/test/resources/furore-conformance.xml diff --git a/hapi-fhir-base/furore-conformance.xml b/hapi-fhir-base/furore-conformance.xml new file mode 100644 index 00000000000..7dfcfeb73e3 --- /dev/null +++ b/hapi-fhir-base/furore-conformance.xml @@ -0,0 +1,4893 @@ + + + + +
+

The server supports all operations on the Binary resource, including history

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirContext.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirContext.java index 24c23848597..965d8785796 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirContext.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/FhirContext.java @@ -18,15 +18,32 @@ import ca.uhn.fhir.rest.client.IRestfulClientFactory; import ca.uhn.fhir.rest.client.RestfulClientFactory; import ca.uhn.fhir.rest.client.api.IRestfulClient; +/** + * The FHIR context is the central starting point for the use of the HAPI FHIR API. It should be created once, and then used as a factory for various other types of objects (parsers, clients, etc.). + * + *

+ * Important usage notes: + *

    + *
  • Thread safety: This class is thread safe and may be shared between multiple processing threads.
  • + *
  • + * Performance: This class is expensive to create, as it scans every resource class it needs to parse or encode to build up an internal model of those classes. For that reason, you should try + * to create one FhirContext instance which remains for the life of your application and reuse that instance. Note that it will not cause problems to create multiple instances (ie. resources + * originating from one FhirContext may be passed to parsers originating from another) but you will incur a performance penalty if a new FhirContext is created for every message you parse/encode.
  • + *
+ *

+ */ public class FhirContext { private volatile Map, BaseRuntimeElementDefinition> myClassToElementDefinition = Collections.emptyMap(); private volatile Map myIdToResourceDefinition = Collections.emptyMap(); private volatile Map myNameToElementDefinition = Collections.emptyMap(); - private INarrativeGenerator myNarrativeGenerator; - private IRestfulClientFactory myRestfulClientFactory; + private volatile INarrativeGenerator myNarrativeGenerator; + private volatile IRestfulClientFactory myRestfulClientFactory; private volatile RuntimeChildUndeclaredExtensionDefinition myRuntimeChildUndeclaredExtensionDefinition; + /** + * Default constructor. In most cases this is the right constructor to use. + */ public FhirContext() { } @@ -41,7 +58,11 @@ public class FhirContext { public FhirContext(Collection> theResourceTypes) { scanResourceTypes(theResourceTypes); } - + + /** + * Returns the scanned runtime model for the given type. This is an advanced feature + * which is generally only needed for extending the core library. + */ public BaseRuntimeElementDefinition getElementDefinition(Class theElementType) { return myClassToElementDefinition.get(theElementType); } @@ -50,6 +71,10 @@ public class FhirContext { return myNarrativeGenerator; } + /** + * Returns the scanned runtime model for the given type. This is an advanced feature + * which is generally only needed for extending the core library. + */ public RuntimeResourceDefinition getResourceDefinition(Class theResourceType) { RuntimeResourceDefinition retVal = (RuntimeResourceDefinition) myClassToElementDefinition.get(theResourceType); if (retVal == null) { @@ -57,15 +82,23 @@ public class FhirContext { } return retVal; } - + + /** + * Returns the scanned runtime model for the given type. This is an advanced feature + * which is generally only needed for extending the core library. + */ public RuntimeResourceDefinition getResourceDefinition(IResource theResource) { return getResourceDefinition(theResource.getClass()); } + /** + * Returns the scanned runtime model for the given type. This is an advanced feature + * which is generally only needed for extending the core library. + */ @SuppressWarnings("unchecked") public RuntimeResourceDefinition getResourceDefinition(String theResourceName) { RuntimeResourceDefinition retVal = myNameToElementDefinition.get(theResourceName); - + if (retVal == null) { try { String candidateName = Patient.class.getPackage().getName() + "." + theResourceName; @@ -77,20 +110,28 @@ public class FhirContext { return null; } } - + return retVal; } + /** + * Returns the scanned runtime model for the given type. This is an advanced feature + * which is generally only needed for extending the core library. + */ public RuntimeResourceDefinition getResourceDefinitionById(String theId) { return myIdToResourceDefinition.get(theId); } + /** + * Returns the scanned runtime models. This is an advanced feature + * which is generally only needed for extending the core library. + */ public Collection getResourceDefinitions() { return myIdToResourceDefinition.values(); } public IRestfulClientFactory getRestfulClientFactory() { - if (myRestfulClientFactory==null) { + if (myRestfulClientFactory == null) { myRestfulClientFactory = new RestfulClientFactory(this); } return myRestfulClientFactory; @@ -100,12 +141,25 @@ public class FhirContext { return myRuntimeChildUndeclaredExtensionDefinition; } + /** + * Create and return a new JSON parser. + * + *

+ * Performance Note: This class is cheap to create, and may be called once for + * every message being processed without incurring any performance penalty + *

+ */ public IParser newJsonParser() { return new JsonParser(this); } /** - * Instantiates a new client instance + * Instantiates a new client instance. + * + *

+ * Performance Note: This class is cheap to create, and may be called once for + * every message being processed without incurring any performance penalty + *

* * @param theClientType * The client type, which is an interface type to be instantiated @@ -119,14 +173,22 @@ public class FhirContext { return getRestfulClientFactory().newClient(theClientType, theServerBase); } + /** + * Create and return a new JSON parser. + * + *

+ * Performance Note: This class is cheap to create, and may be called once for + * every message being processed without incurring any performance penalty + *

+ */ public IParser newXmlParser() { return new XmlParser(this); } - + public void setNarrativeGenerator(INarrativeGenerator theNarrativeGenerator) { myNarrativeGenerator = theNarrativeGenerator; } - + private RuntimeResourceDefinition scanResourceType(Class theResourceType) { ArrayList> resourceTypes = new ArrayList>(); resourceTypes.add(theResourceType); @@ -139,11 +201,11 @@ public class FhirContext { if (myRuntimeChildUndeclaredExtensionDefinition == null) { myRuntimeChildUndeclaredExtensionDefinition = scanner.getRuntimeChildUndeclaredExtensionDefinition(); } - + Map nameToElementDefinition = new HashMap(); nameToElementDefinition.putAll(myNameToElementDefinition); nameToElementDefinition.putAll(scanner.getNameToResourceDefinitions()); - + Map, BaseRuntimeElementDefinition> classToElementDefinition = new HashMap, BaseRuntimeElementDefinition>(); classToElementDefinition.putAll(myClassToElementDefinition); classToElementDefinition.putAll(scanner.getClassToElementDefinitions()); @@ -155,7 +217,7 @@ public class FhirContext { myNameToElementDefinition = nameToElementDefinition; myClassToElementDefinition = classToElementDefinition; myIdToResourceDefinition = idToElementDefinition; - + return classToElementDefinition; } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/ParserState.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/ParserState.java index 3ed4aaaa255..8830ffb1b09 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/ParserState.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/ParserState.java @@ -550,6 +550,30 @@ class ParserState { } + private class SwallowChildrenWholeState extends BaseState + { + + private int myDepth; + + public SwallowChildrenWholeState(PreResourceState thePreResourceState) { + super(thePreResourceState); + } + + @Override + public void endingElement() throws DataFormatException { + myDepth--; + if (myDepth < 0) { + pop(); + } + } + + @Override + public void enteringNewElement(String theNamespaceURI, String theLocalPart) throws DataFormatException { + myDepth++; + } + + } + private class ElementCompositeState extends BaseState { private BaseRuntimeElementCompositeDefinition myDefinition; @@ -579,7 +603,17 @@ class ParserState { @Override public void enteringNewElement(String theNamespace, String theChildName) throws DataFormatException { - BaseRuntimeChildDefinition child = myDefinition.getChildByNameOrThrowDataFormatException(theChildName); + BaseRuntimeChildDefinition child; + try { + child = myDefinition.getChildByNameOrThrowDataFormatException(theChildName); + } catch (DataFormatException e) { + if (false) {// TODO: make this configurable + throw e; + } + ourLog.warn(e.getMessage()); + push(new SwallowChildrenWholeState(getPreResourceState())); + return; + } BaseRuntimeElementDefinition target = child.getChildByName(theChildName); if (target == null) { throw new DataFormatException("Found unexpected element '" + theChildName + "' in parent element '" + myDefinition.getName() + "'. Valid names are: " + child.getValidChildNames()); diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/ClientInvocationHandler.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/ClientInvocationHandler.java index 5f9aa5384f3..b91f2006c23 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/ClientInvocationHandler.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/ClientInvocationHandler.java @@ -14,6 +14,7 @@ import java.util.Map; import org.apache.commons.io.IOUtils; import org.apache.http.Header; +import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.CloseableHttpResponse; @@ -90,7 +91,7 @@ public class ClientInvocationHandler implements InvocationHandler { list.add(next.getValue()); } } - + return binding.invokeClient(mimeType, reader, response.getStatusLine().getStatusCode(), headers); } finally { @@ -101,9 +102,15 @@ public class ClientInvocationHandler implements InvocationHandler { } public static Reader createReaderFromResponse(HttpResponse theResponse) throws IllegalStateException, IOException { - ContentType ct = ContentType.get(theResponse.getEntity()); - Charset charset = ct.getCharset(); - + HttpEntity entity = theResponse.getEntity(); + if (entity == null) { + return new StringReader(""); + } + Charset charset = null; + if (entity.getContentType().getElements() != null) { + ContentType ct = ContentType.get(entity); + charset = ct.getCharset(); + } if (charset == null) { ourLog.warn("Response did not specify a charset."); charset = Charset.forName("UTF-8"); diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/IRestfulClientFactory.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/IRestfulClientFactory.java index 690bf48108c..71d1b37de6a 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/IRestfulClientFactory.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/IRestfulClientFactory.java @@ -18,16 +18,23 @@ public interface IRestfulClientFactory { * @throws ConfigurationException * If the interface type is not an interface */ - public T newClient(Class theClientType, String theServerBase); + T newClient(Class theClientType, String theServerBase); /** * Sets the Apache HTTP client instance to be used by any new restful clients created by - * this factory. If set to null, which is the default, a new HTTP client with + * this factory. If set to null, a new HTTP client with * default settings will be created. * * @param theHttpClient An HTTP client instance to use, or null */ - public void setHttpClient(HttpClient theHttpClient); + void setHttpClient(HttpClient theHttpClient); + + /** + * Returns the Apache HTTP client instance. This method will not return null. + * + * @see #setHttpClient(HttpClient) + */ + HttpClient getHttpClient(); } \ No newline at end of file diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/RestfulClientFactory.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/RestfulClientFactory.java index 63b9512608f..f1d9af2286b 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/RestfulClientFactory.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/RestfulClientFactory.java @@ -3,6 +3,8 @@ package ca.uhn.fhir.rest.client; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; +import java.util.HashMap; +import java.util.Map; import java.util.concurrent.TimeUnit; import org.apache.http.client.HttpClient; @@ -20,6 +22,7 @@ public class RestfulClientFactory implements IRestfulClientFactory { private FhirContext myContext; private HttpClient myHttpClient; + private Map, ClientInvocationHandler> myInvocationHandlers = new HashMap, ClientInvocationHandler>(); /** * Constructor @@ -50,59 +53,65 @@ public class RestfulClientFactory implements IRestfulClientFactory { */ @SuppressWarnings("unchecked") @Override - public T newClient(Class theClientType, String theServerBase) { + public synchronized T newClient(Class theClientType, String theServerBase) { if (!theClientType.isInterface()) { throw new ConfigurationException(theClientType.getCanonicalName() + " is not an interface"); } - HttpClient client; - if (myHttpClient != null) { - client = myHttpClient; - } else { - PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); - HttpClientBuilder builder = HttpClientBuilder.create(); - builder.setConnectionManager(connectionManager); - client = builder.build(); - } + HttpClient client = getHttpClient(); String serverBase = theServerBase; if (!serverBase.endsWith("/")) { serverBase = serverBase + "/"; } - ClientInvocationHandler invocationHandler = new ClientInvocationHandler(client, myContext, serverBase, theClientType); + ClientInvocationHandler invocationHandler = myInvocationHandlers.get(theClientType); + if (invocationHandler == null) { + invocationHandler = new ClientInvocationHandler(client, myContext, serverBase, theClientType); - for (Method nextMethod : theClientType.getMethods()) { - Class resReturnType = null; - Class returnType = nextMethod.getReturnType(); - if (IResource.class.isAssignableFrom(returnType)) { - resReturnType = (Class) returnType; - } else if (java.util.Collection.class.isAssignableFrom(returnType)) { - Class returnTypeColl = ReflectionUtil.getGenericCollectionTypeOfMethodReturnType(nextMethod); - if (!IResource.class.isAssignableFrom(returnTypeColl)) { - throw new ConfigurationException("Generic type of collection for method '" + nextMethod + "' is not a subclass of IResource"); + for (Method nextMethod : theClientType.getMethods()) { + Class resReturnType = null; + Class returnType = nextMethod.getReturnType(); + if (IResource.class.isAssignableFrom(returnType)) { + resReturnType = (Class) returnType; + } else if (java.util.Collection.class.isAssignableFrom(returnType)) { + Class returnTypeColl = ReflectionUtil.getGenericCollectionTypeOfMethodReturnType(nextMethod); + if (!IResource.class.isAssignableFrom(returnTypeColl)) { + throw new ConfigurationException("Generic type of collection for method '" + nextMethod + "' is not a subclass of IResource"); + } + resReturnType = (Class) returnTypeColl; } - resReturnType = (Class) returnTypeColl; + BaseMethodBinding binding = BaseMethodBinding.bindMethod(resReturnType, nextMethod, myContext); + invocationHandler.addBinding(nextMethod, binding); } - BaseMethodBinding binding = BaseMethodBinding.bindMethod(resReturnType, nextMethod, myContext); - invocationHandler.addBinding(nextMethod, binding); + myInvocationHandlers.put(theClientType, invocationHandler); } - + T proxy = instantiateProxy(theClientType, invocationHandler); return proxy; } + @Override + public synchronized HttpClient getHttpClient() { + if (myHttpClient == null) { + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + myHttpClient = builder.build(); + } + return myHttpClient; + } + /** - * Sets the Apache HTTP client instance to be used by any new restful - * clients created by this factory. If set to null, which is - * the default, a new HTTP client with default settings will be created. + * Sets the Apache HTTP client instance to be used by any new restful clients created by this factory. If set to null, which is the default, a new HTTP client with default settings + * will be created. * * @param theHttpClient * An HTTP client instance to use, or null */ @Override - public void setHttpClient(HttpClient theHttpClient) { + public synchronized void setHttpClient(HttpClient theHttpClient) { myHttpClient = theHttpClient; } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseMethodBinding.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseMethodBinding.java index 18c8bb61135..271e8913e96 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseMethodBinding.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseMethodBinding.java @@ -201,4 +201,8 @@ public abstract class BaseMethodBinding { public abstract Object invokeClient(String theResponseMimeType, Reader theResponseReader, int theResponseStatusCode, Map> theHeaders) throws IOException, BaseServerResponseException; + public static BaseMethodBinding bindSystemMethod(Method theMethod, FhirContext theContext) { + return bindMethod(null, theMethod, theContext); + } + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseOutcomeReturningMethodBinding.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseOutcomeReturningMethodBinding.java index 42dc147843c..1bf82f12f55 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseOutcomeReturningMethodBinding.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseOutcomeReturningMethodBinding.java @@ -66,8 +66,8 @@ public abstract class BaseOutcomeReturningMethodBinding extends BaseMethodBindin resourceParameter = (ResourceParameter) next; myResourceName = theContext.getResourceDefinition(resourceParameter.getResourceType()).getName(); myResourceParameterIndex = index; - index++; } + index++; } if (resourceParameter == null) { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseResourceReturningMethodBinding.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseResourceReturningMethodBinding.java index d31ec3e54de..d09db976bbc 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseResourceReturningMethodBinding.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseResourceReturningMethodBinding.java @@ -14,7 +14,6 @@ import java.util.UUID; import javax.servlet.http.HttpServletResponse; -import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import ca.uhn.fhir.context.ConfigurationException; @@ -27,10 +26,8 @@ import ca.uhn.fhir.model.api.annotation.ResourceDef; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.parser.IParser; import ca.uhn.fhir.rest.client.exceptions.InvalidResponseException; -import ca.uhn.fhir.rest.client.exceptions.NonFhirResponseException; import ca.uhn.fhir.rest.server.Constants; import ca.uhn.fhir.rest.server.EncodingUtil; -import ca.uhn.fhir.rest.server.IResourceProvider; import ca.uhn.fhir.rest.server.RestfulServer; import ca.uhn.fhir.rest.server.RestfulServer.NarrativeModeEnum; import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException; @@ -117,7 +114,7 @@ public abstract class BaseResourceReturningMethodBinding extends BaseMethodBindi } - public abstract List invokeServer(IResourceProvider theResourceProvider, IdDt theId, IdDt theVersionId, Map theParameterValues) throws InvalidRequestException, InternalErrorException; + public abstract List invokeServer(Object theResourceProvider, IdDt theId, IdDt theVersionId, Map theParameterValues) throws InvalidRequestException, InternalErrorException; @Override public void invokeServer(RestfulServer theServer, Request theRequest, HttpServletResponse theResponse) throws BaseServerResponseException, IOException { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/ConformanceMethodBinding.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/ConformanceMethodBinding.java index c102cfff752..9c19cfae5a6 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/ConformanceMethodBinding.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/ConformanceMethodBinding.java @@ -14,7 +14,6 @@ import ca.uhn.fhir.model.dstu.valueset.RestfulOperationTypeEnum; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.rest.client.GetClientInvocation; import ca.uhn.fhir.rest.method.SearchMethodBinding.RequestType; -import ca.uhn.fhir.rest.server.IResourceProvider; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; @@ -22,10 +21,11 @@ public class ConformanceMethodBinding extends BaseResourceReturningMethodBinding public ConformanceMethodBinding(Method theMethod, FhirContext theContext) { super(Conformance.class, theMethod, theContext); - - if (getMethodReturnType() != MethodReturnTypeEnum.RESOURCE) { - throw new ConfigurationException("Conformance resource provider '" + theMethod.getName() + "' should return type " + Conformance.class); + + if (getMethodReturnType() != MethodReturnTypeEnum.RESOURCE || theMethod.getReturnType() != Conformance.class) { + throw new ConfigurationException("Conformance resource provider method '" + theMethod.getName() + "' should return type " + Conformance.class); } + } @Override @@ -35,18 +35,19 @@ public class ConformanceMethodBinding extends BaseResourceReturningMethodBinding @Override public GetClientInvocation invokeClient(Object[] theArgs) throws InternalErrorException { - return new GetClientInvocation("metadata"); + return new GetClientInvocation("metadata"); } @Override - public List invokeServer(IResourceProvider theResourceProvider, IdDt theId, IdDt theVersionId, Map theParameterValues) throws InvalidRequestException, InternalErrorException { + public List invokeServer(Object theResourceProvider, IdDt theId, IdDt theVersionId, Map theParameterValues) throws InvalidRequestException, + InternalErrorException { IResource conf; try { conf = (Conformance) getMethod().invoke(theResourceProvider); } catch (Exception e) { - throw new InternalErrorException("Failed to call access method",e); + throw new InternalErrorException("Failed to call access method", e); } - + return Collections.singletonList(conf); } @@ -55,11 +56,11 @@ public class ConformanceMethodBinding extends BaseResourceReturningMethodBinding if (theRequest.getRequestType() == RequestType.OPTIONS) { return true; } - + if (theRequest.getRequestType() == RequestType.GET && "metadata".equals(theRequest.getOperation())) { return true; } - + return false; } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/ReadMethodBinding.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/ReadMethodBinding.java index b73d5033f62..6533da5a195 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/ReadMethodBinding.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/ReadMethodBinding.java @@ -15,7 +15,6 @@ import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.rest.client.GetClientInvocation; import ca.uhn.fhir.rest.method.SearchMethodBinding.RequestType; import ca.uhn.fhir.rest.server.Constants; -import ca.uhn.fhir.rest.server.IResourceProvider; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; @@ -81,7 +80,7 @@ public class ReadMethodBinding extends BaseResourceReturningMethodBinding { } @Override - public List invokeServer(IResourceProvider theResourceProvider, IdDt theId, IdDt theVersionId, Map theParameterValues) throws InvalidRequestException, + public List invokeServer(Object theResourceProvider, IdDt theId, IdDt theVersionId, Map theParameterValues) throws InvalidRequestException, InternalErrorException { Object[] params = new Object[myParameterCount]; params[myIdIndex] = theId; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/Request.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/Request.java index 7d1519fbdf5..5a7b7abf1c6 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/Request.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/Request.java @@ -9,7 +9,6 @@ import javax.servlet.http.HttpServletRequest; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.rest.method.SearchMethodBinding.RequestType; -import ca.uhn.fhir.rest.server.IResourceProvider; public class Request { @@ -21,7 +20,7 @@ public class Request { private Map myParameters; private RequestType myRequestType; private String myResourceName; - private IResourceProvider myResourceProvider; + private Object myResourceProvider; private IdDt myVersion; private HttpServletRequest myServletRequest; @@ -57,7 +56,7 @@ public class Request { return myResourceName; } - public IResourceProvider getResourceProvider() { + public Object getResourceProvider() { return myResourceProvider; } @@ -99,8 +98,8 @@ public class Request { myResourceName = theResourceName; } - public void setResourceProvider(IResourceProvider theResourceProvider) { - myResourceProvider=theResourceProvider; + public void setResourceProvider(Object theProvider) { + myResourceProvider=theProvider; } public void setVersion(IdDt theVersion) { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/SearchMethodBinding.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/SearchMethodBinding.java index f59f8903022..8dc918f4c36 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/SearchMethodBinding.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/SearchMethodBinding.java @@ -20,7 +20,6 @@ import ca.uhn.fhir.rest.client.GetClientInvocation; import ca.uhn.fhir.rest.param.IParameter; import ca.uhn.fhir.rest.param.IQueryParameter; import ca.uhn.fhir.rest.server.Constants; -import ca.uhn.fhir.rest.server.IResourceProvider; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; @@ -85,7 +84,7 @@ public class SearchMethodBinding extends BaseResourceReturningMethodBinding { } @Override - public List invokeServer(IResourceProvider theResourceProvider, IdDt theId, IdDt theVersionId, Map parameterValues) throws InvalidRequestException, + public List invokeServer(Object theResourceProvider, IdDt theId, IdDt theVersionId, Map parameterValues) throws InvalidRequestException, InternalErrorException { assert theId == null; assert theVersionId == null; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/UpdateMethodBinding.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/UpdateMethodBinding.java index 5556786a41b..d00eac231e4 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/UpdateMethodBinding.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/UpdateMethodBinding.java @@ -93,14 +93,14 @@ public class UpdateMethodBinding extends BaseOutcomeReturningMethodBinding { PutClientInvocation retVal = new PutClientInvocation(getContext(), resource, urlExtension.toString()); if (myVersionIdParameterIndex != null) { - IdDt versionIdDt = (IdDt) theArgs[myIdParameterIndex]; + IdDt versionIdDt = (IdDt) theArgs[myVersionIdParameterIndex]; if (versionIdDt != null) { String versionId = versionIdDt.getValue(); if (StringUtils.isNotBlank(versionId)) { StringBuilder b = new StringBuilder(); b.append('/'); b.append(urlExtension); - b.append('/'); + b.append("/_history/"); b.append(versionId); retVal.addHeader(Constants.HEADER_CONTENT_LOCATION, b.toString()); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java index 670e443f506..396965fc744 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java @@ -21,6 +21,7 @@ import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.narrative.INarrativeGenerator; import ca.uhn.fhir.rest.method.BaseMethodBinding; +import ca.uhn.fhir.rest.method.ConformanceMethodBinding; import ca.uhn.fhir.rest.method.Request; import ca.uhn.fhir.rest.method.SearchMethodBinding; import ca.uhn.fhir.rest.server.exceptions.AuthenticationException; @@ -28,6 +29,7 @@ import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.rest.server.exceptions.MethodNotFoundException; +import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; import ca.uhn.fhir.rest.server.provider.ServerConformanceProvider; import ca.uhn.fhir.rest.server.provider.ServerProfileProvider; import ca.uhn.fhir.util.VersionUtil; @@ -40,143 +42,21 @@ public abstract class RestfulServer extends HttpServlet { private static final long serialVersionUID = 1L; private FhirContext myFhirContext; - private INarrativeGenerator myNarrativeGenerator; + private Map myResourceNameToProvider = new HashMap(); + private Object myServerConformanceProvider; private Map, IResourceProvider> myTypeToProvider = new HashMap, IResourceProvider>(); private boolean myUseBrowserFriendlyContentTypes; - - // map of request handler resources keyed by resource name - private Map resources = new HashMap(); - private ISecurityManager securityManager; - public FhirContext getFhirContext() { - return myFhirContext; + private BaseMethodBinding myServerConformanceMethod; + + public RestfulServer() { + myServerConformanceProvider=new ServerConformanceProvider(this); } - public INarrativeGenerator getNarrativeGenerator() { - return myNarrativeGenerator; - } - - public Collection getResourceBindings() { - return resources.values(); - } - - /** - * This method must be overridden to provide one or more resource providers - */ - public abstract Collection getResourceProviders(); - - /** - * This method should be overridden to provide a security manager instance. By default, returns null. - */ - public ISecurityManager getSecurityManager() { - return null; - } - - public IResourceProvider getServerConformanceProvider() { - return new ServerConformanceProvider(this); - } - - public IResourceProvider getServerProfilesProvider() { - return new ServerProfileProvider(getFhirContext()); - } - - @Override - public final void init() throws ServletException { - initialize(); - try { - ourLog.info("Initializing HAPI FHIR restful server"); - - securityManager = getSecurityManager(); - if (null == securityManager) { - ourLog.warn("No security manager has been provided, requests will not be authenticated!"); - } - - Collection resourceProvider = getResourceProviders(); - for (IResourceProvider nextProvider : resourceProvider) { - Class resourceType = nextProvider.getResourceType(); - if (resourceType==null) { - throw new NullPointerException("getResourceType() on class '" + nextProvider.getClass().getCanonicalName() + "' returned null"); - } - if (myTypeToProvider.containsKey(resourceType)) { - throw new ServletException("Multiple providers for type: " + resourceType.getCanonicalName()); - } - myTypeToProvider.put(resourceType, nextProvider); - } - - ourLog.info("Got {} resource providers", myTypeToProvider.size()); - - myFhirContext = new FhirContext(myTypeToProvider.keySet()); - myFhirContext.setNarrativeGenerator(myNarrativeGenerator); - - for (IResourceProvider provider : myTypeToProvider.values()) { - findResourceMethods(provider); - } - - findResourceMethods(getServerProfilesProvider()); - findResourceMethods(getServerConformanceProvider()); - - } catch (Exception ex) { - ourLog.error("An error occurred while loading request handlers!", ex); - throw new ServletException("Failed to initialize FHIR Restful server", ex); - } - - ourLog.info("A FHIR has been lit on this server"); - } - - public boolean isUseBrowserFriendlyContentTypes() { - return myUseBrowserFriendlyContentTypes; - } - - /** - * Sets the {@link INarrativeGenerator Narrative Generator} to use when serializing responses from this server, or null (which is the default) to disable narrative generation. - * - * @throws IllegalStateException - * Note that this method can only be called prior to {@link #init() initialization} and will throw an {@link IllegalStateException} if called after that. - */ - public void setNarrativeGenerator(INarrativeGenerator theNarrativeGenerator) { - if (myFhirContext != null) { - throw new IllegalStateException("Server has already been initialized, can not change this property"); - } - myNarrativeGenerator = theNarrativeGenerator; - } - - /** - * If set to true (default is false), the server will use browser friendly content-types (instead of standard FHIR ones) when it detects that the request is coming from a browser - * instead of a FHIR - */ - public void setUseBrowserFriendlyContentTypes(boolean theUseBrowserFriendlyContentTypes) { - myUseBrowserFriendlyContentTypes = theUseBrowserFriendlyContentTypes; - } - - - private void findResourceMethods(IResourceProvider theProvider) throws Exception { - - Class resourceType = theProvider.getResourceType(); - RuntimeResourceDefinition definition = myFhirContext.getResourceDefinition(resourceType); - - ResourceBinding r = new ResourceBinding(); - r.setResourceProvider(theProvider); - r.setResourceName(definition.getName()); - resources.put(definition.getName(), r); - - ourLog.info("Scanning type for RESTful methods: {}", theProvider.getClass()); - - Class clazz = theProvider.getClass(); - for (Method m : clazz.getDeclaredMethods()) { - if (Modifier.isPublic(m.getModifiers())) { - ourLog.debug("Scanning public method: {}#{}", theProvider.getClass(), m.getName()); - - BaseMethodBinding foundMethodBinding = BaseMethodBinding.bindMethod(theProvider.getResourceType(), m, myFhirContext); - if (foundMethodBinding != null) { - r.addMethod(foundMethodBinding); - ourLog.info(" * Method: {}#{} is a handler", theProvider.getClass(), m.getName()); - } else { - ourLog.debug(" * Method: {}#{} is not a handler", theProvider.getClass(), m.getName()); - } - } - } + public void addHapiHeader(HttpServletResponse theHttpResponse) { + theHttpResponse.addHeader("X-CatchingFhir", "HAPI FHIR " + VersionUtil.getVersion()); } @Override @@ -203,7 +83,97 @@ public abstract class RestfulServer extends HttpServlet { protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { handleRequest(SearchMethodBinding.RequestType.PUT, request, response); } - + + private void findResourceMethods(IResourceProvider theProvider) throws Exception { + + Class resourceType = theProvider.getResourceType(); + RuntimeResourceDefinition definition = myFhirContext.getResourceDefinition(resourceType); + + ResourceBinding r = new ResourceBinding(); + r.setResourceProvider(theProvider); + r.setResourceName(definition.getName()); + myResourceNameToProvider.put(definition.getName(), r); + + ourLog.info("Scanning type for RESTful methods: {}", theProvider.getClass()); + + Class clazz = theProvider.getClass(); + for (Method m : clazz.getDeclaredMethods()) { + if (Modifier.isPublic(m.getModifiers())) { + ourLog.debug("Scanning public method: {}#{}", theProvider.getClass(), m.getName()); + + BaseMethodBinding foundMethodBinding = BaseMethodBinding.bindMethod(theProvider.getResourceType(), m, myFhirContext); + if (foundMethodBinding != null) { + r.addMethod(foundMethodBinding); + ourLog.info(" * Method: {}#{} is a handler", theProvider.getClass(), m.getName()); + } else { + ourLog.debug(" * Method: {}#{} is not a handler", theProvider.getClass(), m.getName()); + } + } + } + } + + private void findSystemMethods(Object theSystemProvider) { + Class clazz = theSystemProvider.getClass(); + for (Method m : clazz.getDeclaredMethods()) { + if (Modifier.isPublic(m.getModifiers())) { + ourLog.debug("Scanning public method: {}#{}", theSystemProvider.getClass(), m.getName()); + + BaseMethodBinding foundMethodBinding = BaseMethodBinding.bindSystemMethod(m, myFhirContext); + if (foundMethodBinding != null) { + if (foundMethodBinding instanceof ConformanceMethodBinding) { + myServerConformanceMethod = foundMethodBinding; + } + ourLog.info(" * Method: {}#{} is a handler", theSystemProvider.getClass(), m.getName()); + } else { + ourLog.debug(" * Method: {}#{} is not a handler", theSystemProvider.getClass(), m.getName()); + } + } + } + + } + + public FhirContext getFhirContext() { + return myFhirContext; + } + + public INarrativeGenerator getNarrativeGenerator() { + return myNarrativeGenerator; + } + + public Collection getResourceBindings() { + return myResourceNameToProvider.values(); + } + + /** + * This method must be overridden to provide one or more resource providers + */ + public abstract Collection getResourceProviders(); + + + /** + * This method should be overridden to provide a security manager instance. By default, returns null. + */ + public ISecurityManager getSecurityManager() { + return null; + } + + /** + * Returns the server conformance provider, which is the provider that + * is used to generate the server's conformance (metadata) statement. + *

+ * By default, the {@link ServerConformanceProvider} is used, but + * this can be changed, or set to null if you do not wish + * to export a conformance statement. + *

+ */ + public Object getServerConformanceProvider() { + return myServerConformanceProvider; + } + + public IResourceProvider getServerProfilesProvider() { + return new ServerProfileProvider(getFhirContext()); + } + protected void handleRequest(SearchMethodBinding.RequestType requestType, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { @@ -261,17 +231,23 @@ public abstract class RestfulServer extends HttpServlet { } resourceName = tok.nextToken(); - ResourceBinding resourceBinding; + Object provider=null; + ResourceBinding resourceBinding=null; + BaseMethodBinding resourceMethod=null; if ("metadata".equals(resourceName)) { - operation = "metadata"; - resourceBinding = resources.get("Conformance"); + provider = myServerConformanceProvider; + if (provider==null) { + throw new ResourceNotFoundException("This server does not support 'metadata' query"); + } + resourceMethod = myServerConformanceMethod; } else { - resourceBinding = resources.get(resourceName); + resourceBinding = myResourceNameToProvider.get(resourceName); + if (resourceBinding == null) { + throw new MethodNotFoundException("Unknown resource type '" + resourceName+"' - Server knows how to handle: "+myResourceNameToProvider.keySet()); + } + provider = resourceBinding.getResourceProvider(); } - if (resourceBinding == null) { - throw new MethodNotFoundException("Unknown resource type '" + resourceName+"' - Server knows how to handle: "+resources.keySet()); - } if (tok.hasMoreTokens()) { String nextString = tok.nextToken(); @@ -302,13 +278,15 @@ public abstract class RestfulServer extends HttpServlet { r.setOperation(operation); r.setParameters(params); r.setRequestType(requestType); - r.setResourceProvider(resourceBinding.getResourceProvider()); + r.setResourceProvider(provider); r.setInputReader(request.getReader()); r.setFhirServerBase(fhirServerBase); r.setCompleteUrl(completeUrl); r.setServletRequest(request); - BaseMethodBinding resourceMethod = resourceBinding.getMethod(r); + if (resourceMethod == null && resourceBinding != null) { + resourceMethod = resourceBinding.getMethod(r); + } if (null == resourceMethod) { throw new MethodNotFoundException("No resource method available for the supplied parameters " + params); } @@ -344,6 +322,49 @@ public abstract class RestfulServer extends HttpServlet { } + @Override + public final void init() throws ServletException { + initialize(); + try { + ourLog.info("Initializing HAPI FHIR restful server"); + + securityManager = getSecurityManager(); + if (null == securityManager) { + ourLog.warn("No security manager has been provided, requests will not be authenticated!"); + } + + Collection resourceProvider = getResourceProviders(); + for (IResourceProvider nextProvider : resourceProvider) { + Class resourceType = nextProvider.getResourceType(); + if (resourceType==null) { + throw new NullPointerException("getResourceType() on class '" + nextProvider.getClass().getCanonicalName() + "' returned null"); + } + if (myTypeToProvider.containsKey(resourceType)) { + throw new ServletException("Multiple providers for type: " + resourceType.getCanonicalName()); + } + myTypeToProvider.put(resourceType, nextProvider); + } + + ourLog.info("Got {} resource providers", myTypeToProvider.size()); + + myFhirContext = new FhirContext(myTypeToProvider.keySet()); + myFhirContext.setNarrativeGenerator(myNarrativeGenerator); + + for (IResourceProvider provider : myTypeToProvider.values()) { + findResourceMethods(provider); + } + + findResourceMethods(getServerProfilesProvider()); + findSystemMethods(getServerConformanceProvider()); + + } catch (Exception ex) { + ourLog.error("An error occurred while loading request handlers!", ex); + throw new ServletException("Failed to initialize FHIR Restful server", ex); + } + + ourLog.info("A FHIR has been lit on this server"); + } + /** * This method may be overridden by subclasses to do perform initialization that needs to be performed prior to the server being used. */ @@ -351,6 +372,52 @@ public abstract class RestfulServer extends HttpServlet { // nothing by default } + public boolean isUseBrowserFriendlyContentTypes() { + return myUseBrowserFriendlyContentTypes; + } + + /** + * Sets the {@link INarrativeGenerator Narrative Generator} to use when serializing responses from this server, or null (which is the default) to disable narrative generation. + * Note that this method can only be called before the server is initialized. + * + * @throws IllegalStateException + * Note that this method can only be called prior to {@link #init() initialization} and will throw an {@link IllegalStateException} if called after that. + */ + public void setNarrativeGenerator(INarrativeGenerator theNarrativeGenerator) { + if (myFhirContext != null) { + throw new IllegalStateException("Server has already been initialized, can not change this property"); + } + myNarrativeGenerator = theNarrativeGenerator; + } + + /** + * Returns the server conformance provider, which is the provider that + * is used to generate the server's conformance (metadata) statement. + *

+ * By default, the {@link ServerConformanceProvider} is used, but + * this can be changed, or set to null if you do not wish + * to export a conformance statement. + *

+ * Note that this method can only be called before the server is initialized. + * + * @throws IllegalStateException + * Note that this method can only be called prior to {@link #init() initialization} and will throw an {@link IllegalStateException} if called after that. + */ + public void setServerConformanceProvider(Object theServerConformanceProvider) { + if (myFhirContext!=null) { + throw new IllegalStateException("Server is already started"); + } + myServerConformanceProvider = theServerConformanceProvider; + } + + /** + * If set to true (default is false), the server will use browser friendly content-types (instead of standard FHIR ones) when it detects that the request is coming from a browser + * instead of a FHIR + */ + public void setUseBrowserFriendlyContentTypes(boolean theUseBrowserFriendlyContentTypes) { + myUseBrowserFriendlyContentTypes = theUseBrowserFriendlyContentTypes; + } + public enum NarrativeModeEnum { NORMAL, ONLY, @@ -361,8 +428,4 @@ public abstract class RestfulServer extends HttpServlet { } } - public void addHapiHeader(HttpServletResponse theHttpResponse) { - theHttpResponse.addHeader("X-CatchingFhir", "HAPI FHIR " + VersionUtil.getVersion()); - } - } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/provider/ServerConformanceProvider.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/provider/ServerConformanceProvider.java index dcba25ed240..34aa03135be 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/provider/ServerConformanceProvider.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/provider/ServerConformanceProvider.java @@ -24,13 +24,12 @@ import ca.uhn.fhir.rest.method.BaseMethodBinding; import ca.uhn.fhir.rest.method.SearchMethodBinding; import ca.uhn.fhir.rest.param.IParameter; import ca.uhn.fhir.rest.param.IQueryParameter; -import ca.uhn.fhir.rest.server.IResourceProvider; import ca.uhn.fhir.rest.server.ResourceBinding; import ca.uhn.fhir.rest.server.RestfulServer; import ca.uhn.fhir.util.ExtensionConstants; import ca.uhn.fhir.util.VersionUtil; -public class ServerConformanceProvider implements IResourceProvider { +public class ServerConformanceProvider { private volatile Conformance myConformance; private final RestfulServer myRestfulServer; @@ -142,9 +141,4 @@ public class ServerConformanceProvider implements IResourceProvider { return retVal; } - @Override - public Class getResourceType() { - return Conformance.class; - } - } diff --git a/hapi-fhir-base/src/site/example/java/example/QuickUsage.java b/hapi-fhir-base/src/site/example/java/example/QuickUsage.java index b8f8f64b8a2..de9a4cbe3af 100644 --- a/hapi-fhir-base/src/site/example/java/example/QuickUsage.java +++ b/hapi-fhir-base/src/site/example/java/example/QuickUsage.java @@ -1,5 +1,8 @@ package example; +import static ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum.OFFICIAL; +import static ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum.SECONDARY; + import java.io.IOException; import java.util.List; @@ -7,7 +10,6 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.model.dstu.composite.IdentifierDt; import ca.uhn.fhir.model.dstu.resource.Patient; import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum; -import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum; import ca.uhn.fhir.parser.DataFormatException; import ca.uhn.fhir.rest.annotation.Create; import ca.uhn.fhir.rest.annotation.RequiredParam; @@ -15,10 +17,10 @@ import ca.uhn.fhir.rest.annotation.ResourceParam; import ca.uhn.fhir.rest.annotation.Search; import ca.uhn.fhir.rest.api.MethodOutcome; import ca.uhn.fhir.rest.client.api.IRestfulClient; -import static ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum.*; public class QuickUsage { +@SuppressWarnings("unused") public static void main(String[] args) throws DataFormatException, IOException { Patient patient = new Patient(); diff --git a/hapi-fhir-base/src/site/example/java/example/RestfulPatientResourceProviderMore.java b/hapi-fhir-base/src/site/example/java/example/RestfulPatientResourceProviderMore.java index 282a1a68106..2336de75ca7 100644 --- a/hapi-fhir-base/src/site/example/java/example/RestfulPatientResourceProviderMore.java +++ b/hapi-fhir-base/src/site/example/java/example/RestfulPatientResourceProviderMore.java @@ -1,15 +1,18 @@ package example; +import java.io.IOException; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Set; +import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.api.PathSpecification; import ca.uhn.fhir.model.api.TemporalPrecisionEnum; import ca.uhn.fhir.model.dstu.composite.CodingDt; import ca.uhn.fhir.model.dstu.composite.IdentifierDt; +import ca.uhn.fhir.model.dstu.resource.Conformance; import ca.uhn.fhir.model.dstu.resource.DiagnosticReport; import ca.uhn.fhir.model.dstu.resource.Observation; import ca.uhn.fhir.model.dstu.resource.Organization; @@ -17,26 +20,32 @@ import ca.uhn.fhir.model.dstu.resource.Patient; import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.model.primitive.StringDt; +import ca.uhn.fhir.parser.DataFormatException; import ca.uhn.fhir.rest.annotation.Create; import ca.uhn.fhir.rest.annotation.IdParam; import ca.uhn.fhir.rest.annotation.IncludeParam; +import ca.uhn.fhir.rest.annotation.Metadata; import ca.uhn.fhir.rest.annotation.OptionalParam; import ca.uhn.fhir.rest.annotation.Read; import ca.uhn.fhir.rest.annotation.RequiredParam; import ca.uhn.fhir.rest.annotation.ResourceParam; import ca.uhn.fhir.rest.annotation.Search; +import ca.uhn.fhir.rest.annotation.Update; import ca.uhn.fhir.rest.annotation.VersionIdParam; import ca.uhn.fhir.rest.api.MethodOutcome; import ca.uhn.fhir.rest.client.ITestClient; +import ca.uhn.fhir.rest.client.api.IRestfulClient; import ca.uhn.fhir.rest.param.CodingListParam; import ca.uhn.fhir.rest.param.DateRangeParam; import ca.uhn.fhir.rest.param.QualifiedDateParam; import ca.uhn.fhir.rest.server.IResourceProvider; +import ca.uhn.fhir.rest.server.exceptions.ResourceVersionConflictException; import ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException; @SuppressWarnings("unused") public abstract class RestfulPatientResourceProviderMore implements IResourceProvider { +private boolean detectedVersionConflict; //START SNIPPET: searchAll @Search public List getAllOrganizations() { @@ -236,9 +245,97 @@ public abstract MethodOutcome createNewPatient(@ResourceParam Patient thePatient //END SNIPPET: createClient +//START SNIPPET: update +@Update +public MethodOutcome updatePatient(@IdParam IdDt theId, @ResourceParam Patient thePatient) { + + /* + * First we might want to do business validation. The UnprocessableEntityException + * results in an HTTP 422, which is appropriate for business rule failure + */ + if (thePatient.getIdentifierFirstRep().isEmpty()) { + throw new UnprocessableEntityException("No identifier supplied"); + } + + // Save this patient to the database... + savePatientToDatabase(theId, thePatient); + + // This method returns a MethodOutcome object which contains + // the ID and Version ID for the newly saved resource + MethodOutcome retVal = new MethodOutcome(); + retVal.setCreated(true); + retVal.setId(theId); + retVal.setVersionId(new IdDt("2")); // Leave this blank if the server doesn't version + return retVal; +} +//END SNIPPET: update + +//START SNIPPET: updateClient +@Update +public abstract MethodOutcome updateSomePatient(@IdParam IdDt theId, @ResourceParam Patient thePatient); +//END SNIPPET: updateClient + +//START SNIPPET: updateVersion +@Update +public MethodOutcome updatePatient(@IdParam IdDt theId, @VersionIdParam IdDt theVersionId, @ResourceParam Patient thePatient) { + // ..Process.. + if (detectedVersionConflict) { + throw new ResourceVersionConflictException("Invalid version"); + } + MethodOutcome retVal = new MethodOutcome(); +return retVal; +} +//END SNIPPET: updateVersion + + + + +public static void main(String[] args) throws DataFormatException, IOException { + + +} + + private void savePatientToDatabase(Patient thePatient) { // nothing - +} +private void savePatientToDatabase(IdDt theId, Patient thePatient) { + // nothing +} + +//START SNIPPET: metadataProvider +public class ConformanceProvider { + + @Metadata + public Conformance getServerMetadata() { + Conformance retVal = new Conformance(); + // ..populate.. + return retVal; + } + +} +//END SNIPPET: metadataProvider + + + +//START SNIPPET: metadataClient +public interface MetadataClient extends IRestfulClient { + + @Metadata + Conformance getServerMetadata(); + + // ....Other methods can also be added as usual.... + +} +//END SNIPPET: metadataClient + +public void bbbbb() throws DataFormatException, IOException { +//START SNIPPET: metadataClientUsage +FhirContext ctx = new FhirContext(); +MetadataClient client = ctx.newRestfulClient(MetadataClient.class, "http://spark.furore.com/fhir"); +Conformance metadata = client.getServerMetadata(); +System.out.println(ctx.newXmlParser().encodeResourceToString(metadata)); +//END SNIPPET: metadataClientUsage } diff --git a/hapi-fhir-base/src/site/xdoc/doc_rest_operations.xml b/hapi-fhir-base/src/site/xdoc/doc_rest_operations.xml index ef551e48aa3..154994670ae 100644 --- a/hapi-fhir-base/src/site/xdoc/doc_rest_operations.xml +++ b/hapi-fhir-base/src/site/xdoc/doc_rest_operations.xml @@ -24,12 +24,147 @@ implementations, but client methods will follow the same patterns.

- - - +

+ The following table lists the operations supported by + HAPI FHIR RESTful Servers and Clients. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OperationDefinition
+ Instance - Read + + Read the current state of the resource +
+ Instance - VRead + + Read the state of a specific version of the resource +
+ Instance - Update + + Read the state of a specific version of the resource +
+ Instance - Delete + + Delete a resource +
+ Instance - History + + Retrieve the update history for a particular resource +
+ Type - Create + + Create a new resource with a server assigned id +
+ Type - Search + + + + + + Search the resource type based on some filter criteria +
+ Type - Search + + Search the resource type based on some filter criteria +
+ Type - History + + Retrieve the update history for a particular resource type +
+ Type - Validate + + Check that the content would be acceptable as an update +
+ System - Conformance + + Get a conformance statement for the system +
+ System - Transaction + + Update, create or delete a set of resources as a single transaction +
+ System - History + + Retrieve the update history for all resources +
+ System - Search + + Search across all resource types based on some filter criteria +
+ -
+ + + + +
+

The @@ -53,7 +188,12 @@

-
+ + + + +
+

The @@ -77,7 +217,158 @@

-
+ + + + +
+ + +

+ The + update + operation updates a specific resource instance (using its ID), and optionally + accepts a version ID as well (which can be used to detect version conflicts). +

+

+ Update methods must be annotated with the + @Update + annotation, and have a parameter annotated with the + @Resource + annotation. This parameter contains the resource instance to be created. +

+

+ In addition, the method must have a parameter annotated with the + @IdParam + annotation, and optionally may have a parameter annotated with the + @VersionIdParam +

+

+ Update methods must return an object of type + MethodOutcome. This + object contains the identity of the created resource. +

+

+ The following snippet shows how to define an update method on a server: +

+ + + + + + +

+ Example URL to invoke this method (this would be invoked using an HTTP PUT, + with the resource in the PUT body):
+ http://fhir.example.com/Patient +

+ +

+ The following snippet shows how the corresponding client interface + would look: +

+ + + + + + +

+ In the case of a server which is able to do version conflict checking, an + extra parameter would be added: +

+ + + + + + +
+ + + + + +
+ + +

+ Not yet implemented +

+ +
+ + + + + +
+ + +

+ Not yet implemented +

+ +
+ + + + + +
+ + +

+ The + create + operation saves a new resource to the server, allowing the server to + give that resource an ID and version ID. +

+

+ Create methods must be annotated with the + @Create + annotation, and have a single parameter annotated with the + @Resource + annotation. This parameter contains the resource instance to be created. +

+

+ Create methods must return an object of type + MethodOutcome. This + object contains the identity of the created resource. +

+

+ The following snippet shows how to define a server create method: +

+ + + + + + +

+ Example URL to invoke this method (this would be invoked using an HTTP POST, + with the resource in the POST body):
+ http://fhir.example.com/Patient +

+ +

+ The following snippet shows how the corresponding client interface + would look: +

+ + + + + + +
+ + + + + +
+

The @@ -152,7 +443,7 @@

- +

Search methods may take multiple parameters, and these parameters @@ -375,50 +666,128 @@

+ + + + + +
+ -
-

- The - create - operation saves a new resource to the server, allowing the server to - give that resource an ID and version ID. + Not yet implemented

+ +
+ + + + + +
+ +

- Create methods must be annotated with the - @Create - annotation, and have a single parameter annotated with the - @Resource - annotation. This parameter contains the resource instance to be created. + Not yet implemented +

+ +
+ + + + + +
+ + +

+ FHIR defines that a FHIR Server must be able to export a conformance statement, + which is an instance of the + Conformance + resource describing the server itself.

- The following snippet shows how to define a server create method: + The HAPI FHIR RESTful server will automatically export such + a conformance statement. See the + RESTful Server + documentation for more information.

+

+ If you wish to override this default behaviour by creating + your own metadata provider, you simply need to define a class + with a method annotated using the + @Metadata + annotation. +

- + + + + +

+ To create a Client which can retrieve a Server's conformance + statement is simple. First, define your Client Interface, using + the @Metadata annotation: +

+ +

- Example URL to invoke this method (this would be invoked using an HTTP POST, - with the resource in the POST body):
- http://fhir.example.com/Patient + Then use the standard + RESTful Client mechanism for instantiating + a client:

- -

- The following snippet shows how the corresponding client interface - would look: -

- - +
+ + + + + +
+ + +

+ Not yet implemented +

+ +
+ + + + +
+ + +

+ Not yet implemented +

+ +
+ + + + + +
+ + +

+ Not yet implemented +

+ +
+ + diff --git a/hapi-fhir-base/src/site/xdoc/doc_rest_server.xml b/hapi-fhir-base/src/site/xdoc/doc_rest_server.xml index 42d07b606b3..7acc4226953 100644 --- a/hapi-fhir-base/src/site/xdoc/doc_rest_server.xml +++ b/hapi-fhir-base/src/site/xdoc/doc_rest_server.xml @@ -60,7 +60,7 @@

- You will probable wish to add more methods + You will probably wish to add more methods to your resource provider. See RESTful Operations for lots more examples of how to add methods for various operations. @@ -101,6 +101,26 @@

+
+ +

+ The HAPI FHIR RESTful Server will automatically export a + conformance statement, + as required by the + FHIR Specification. +

+

+ This statement is automatically generated based on the various annotated methods which are + provided to the server. This behaviour may be modified by creating a new class + containing a method annotated with a + @Metadata Operation + and then passing an instance of that class to the + setServerConformanceProvider method + on your server. +

+ +
+ diff --git a/hapi-fhir-base/src/site/xdoc/index.xml b/hapi-fhir-base/src/site/xdoc/index.xml index 7b05d15e1a8..833e9302801 100644 --- a/hapi-fhir-base/src/site/xdoc/index.xml +++ b/hapi-fhir-base/src/site/xdoc/index.xml @@ -57,7 +57,7 @@ String jsonEncoded = ctx.newJsonParser().encodeResourceToString(patient); that will be familiar to users of JAX-WS.

- that are not actually + * a part of the spec any more.. + */ + @Test + public void testParseFuroreMetadataWithExtraElements() throws IOException { + String msg = IOUtils.toString(JsonParserTest.class.getResourceAsStream("/furore-conformance.json")); + + IParser p = new FhirContext(ValueSet.class).newJsonParser(); + Conformance conf = p.parseResource(Conformance.class, msg); + RestResource res = conf.getRestFirstRep().getResourceFirstRep(); + assertEquals("_id", res.getSearchParam().get(1).getName().getValue()); + } + + @Test public void testEncodeResourceRef() throws DataFormatException, IOException { diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/XmlParserTest.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/XmlParserTest.java index 321379dd95f..f722516e461 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/XmlParserTest.java +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/XmlParserTest.java @@ -24,6 +24,8 @@ import ca.uhn.fhir.model.api.BundleEntry; import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.dstu.composite.NarrativeDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; +import ca.uhn.fhir.model.dstu.resource.Conformance; +import ca.uhn.fhir.model.dstu.resource.Conformance.RestResource; import ca.uhn.fhir.model.dstu.resource.DiagnosticReport; import ca.uhn.fhir.model.dstu.resource.Observation; import ca.uhn.fhir.model.dstu.resource.Organization; @@ -284,6 +286,21 @@ public class XmlParserTest { assertEquals("LOINC Codes for Cholesterol", resource.getName().getValue()); assertEquals(summaryText.trim(), entry.getSummary().getValueAsString().trim()); } + + /** + * This sample has extra elements in that are not actually + * a part of the spec any more.. + */ + @Test + public void testParseFuroreMetadataWithExtraElements() throws IOException { + String msg = IOUtils.toString(XmlParserTest.class.getResourceAsStream("/furore-conformance.xml")); + + IParser p = new FhirContext(ValueSet.class).newXmlParser(); + Conformance conf = p.parseResource(Conformance.class, msg); + RestResource res = conf.getRestFirstRep().getResourceFirstRep(); + assertEquals("_id", res.getSearchParam().get(1).getName().getValue()); + } + @Test public void testLoadAndAncodeMessage() throws SAXException, IOException { diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/ClientTest.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/ClientTest.java index f6aa2af31b9..b37f947ed88 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/ClientTest.java +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/ClientTest.java @@ -15,10 +15,12 @@ import org.apache.http.HttpResponse; import org.apache.http.ProtocolVersion; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.methods.HttpPut; import org.apache.http.client.methods.HttpUriRequest; import org.apache.http.message.BasicHeader; import org.apache.http.message.BasicStatusLine; import org.hamcrest.core.StringContains; +import org.hamcrest.core.StringEndsWith; import org.junit.Before; import org.junit.Test; import org.mockito.ArgumentCaptor; @@ -40,6 +42,7 @@ import ca.uhn.fhir.rest.param.DateRangeParam; import ca.uhn.fhir.rest.param.QualifiedDateParam; import ca.uhn.fhir.rest.server.Constants; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; +import ca.uhn.fhir.rest.server.exceptions.ResourceVersionConflictException; public class ClientTest { @@ -113,6 +116,73 @@ public class ClientTest { assertEquals("200", response.getVersionId().getValue()); } + + @Test + public void testUpdate() throws Exception { + + Patient patient = new Patient(); + patient.addIdentifier("urn:foo", "123"); + + ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(httpClient.execute(capt.capture())).thenReturn(httpResponse); + when(httpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 201, "OK")); + when(httpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(httpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(""), Charset.forName("UTF-8"))); + when(httpResponse.getAllHeaders()).thenReturn(toHeaderArray("Location" , "http://example.com/fhir/Patient/100/_history/200")); + + ITestClient client = ctx.newRestfulClient(ITestClient.class, "http://foo"); + MethodOutcome response = client.updatePatient(new IdDt("100"), patient); + + assertEquals(HttpPut.class, capt.getValue().getClass()); + HttpPut post = (HttpPut) capt.getValue(); + assertThat(post.getURI().toASCIIString(), StringEndsWith.endsWith("/Patient/100")); + assertThat(IOUtils.toString(post.getEntity().getContent()), StringContains.containsString(" capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(httpClient.execute(capt.capture())).thenReturn(httpResponse); + when(httpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), 201, "OK")); + when(httpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(httpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(""), Charset.forName("UTF-8"))); + when(httpResponse.getAllHeaders()).thenReturn(toHeaderArray("Location" , "http://example.com/fhir/Patient/100/_history/200")); + + ITestClient client = ctx.newRestfulClient(ITestClient.class, "http://foo"); + MethodOutcome response = client.updatePatient(new IdDt("100"), new IdDt("200"), patient); + + assertEquals(HttpPut.class, capt.getValue().getClass()); + HttpPut post = (HttpPut) capt.getValue(); + assertThat(post.getURI().toASCIIString(), StringEndsWith.endsWith("/Patient/100")); + assertThat(IOUtils.toString(post.getEntity().getContent()), StringContains.containsString(" capt = ArgumentCaptor.forClass(HttpUriRequest.class); + when(httpClient.execute(capt.capture())).thenReturn(httpResponse); + when(httpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8")); + when(httpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(""), Charset.forName("UTF-8"))); + when(httpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP", 1, 1), Constants.STATUS_HTTP_409_CONFLICT, "Conflict")); + + ITestClient client = ctx.newRestfulClient(ITestClient.class, "http://foo"); + client.updatePatient(new IdDt("100"), new IdDt("200"), patient); + } + + @Test public void testCreateBad() throws Exception { diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/ITestClient.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/ITestClient.java index b75402e50e5..bd5101b654d 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/ITestClient.java +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/ITestClient.java @@ -62,4 +62,7 @@ public interface ITestClient extends IBasicClient { @Update public MethodOutcome updatePatient(@IdParam IdDt theId, @ResourceParam Patient thePatient); + @Update + public MethodOutcome updatePatient(@IdParam IdDt theId, @VersionIdParam IdDt theVersion, @ResourceParam Patient thePatient); + } diff --git a/hapi-fhir-base/src/test/resources/furore-conformance.json b/hapi-fhir-base/src/test/resources/furore-conformance.json new file mode 100644 index 00000000000..c31db15391b --- /dev/null +++ b/hapi-fhir-base/src/test/resources/furore-conformance.json @@ -0,0 +1 @@ +{"resourceType":"Conformance","text":{"status":"generated","div":"
\r\n

The server supports all operations on the AdverseReaction resource, including history

\r\n

The server supports all operations on the Alert resource, including history

\r\n

The server supports all operations on the AllergyIntolerance resource, including history

\r\n

The server supports all operations on the Appointment resource, including history

\r\n

The server supports all operations on the AppointmentResponse resource, including history

\r\n

The server supports all operations on the Availability resource, including history

\r\n

The server supports all operations on the CarePlan resource, including history

\r\n

The server supports all operations on the Composition resource, including history

\r\n

The server supports all operations on the ConceptMap resource, including history

\r\n

The server supports all operations on the Condition resource, including history

\r\n

The server supports all operations on the Conformance resource, including history

\r\n

The server supports all operations on the Device resource, including history

\r\n

The server supports all operations on the DeviceObservationReport resource, including history

\r\n

The server supports all operations on the DiagnosticOrder resource, including history

\r\n

The server supports all operations on the DiagnosticReport resource, including history

\r\n

The server supports all operations on the DocumentManifest resource, including history

\r\n

The server supports all operations on the DocumentReference resource, including history

\r\n

The server supports all operations on the Encounter resource, including history

\r\n

The server supports all operations on the FamilyHistory resource, including history

\r\n

The server supports all operations on the Group resource, including history

\r\n

The server supports all operations on the ImagingStudy resource, including history

\r\n

The server supports all operations on the Immunization resource, including history

\r\n

The server supports all operations on the ImmunizationRecommendation resource, including history

\r\n

The server supports all operations on the List resource, including history

\r\n

The server supports all operations on the Location resource, including history

\r\n

The server supports all operations on the Media resource, including history

\r\n

The server supports all operations on the Medication resource, including history

\r\n

The server supports all operations on the MedicationAdministration resource, including history

\r\n

The server supports all operations on the MedicationDispense resource, including history

\r\n

The server supports all operations on the MedicationPrescription resource, including history

\r\n

The server supports all operations on the MedicationStatement resource, including history

\r\n

The server supports all operations on the MessageHeader resource, including history

\r\n

The server supports all operations on the Observation resource, including history

\r\n

The server supports all operations on the OperationOutcome resource, including history

\r\n

The server supports all operations on the Order resource, including history

\r\n

The server supports all operations on the OrderResponse resource, including history

\r\n

The server supports all operations on the Organization resource, including history

\r\n

The server supports all operations on the Other resource, including history

\r\n

The server supports all operations on the Patient resource, including history

\r\n

The server supports all operations on the Practitioner resource, including history

\r\n

The server supports all operations on the Procedure resource, including history

\r\n

The server supports all operations on the Profile resource, including history

\r\n

The server supports all operations on the Provenance resource, including history

\r\n

The server supports all operations on the Query resource, including history

\r\n

The server supports all operations on the Questionnaire resource, including history

\r\n

The server supports all operations on the RelatedPerson resource, including history

\r\n

The server supports all operations on the SecurityEvent resource, including history

\r\n

The server supports all operations on the Slot resource, including history

\r\n

The server supports all operations on the Specimen resource, including history

\r\n

The server supports all operations on the Substance resource, including history

\r\n

The server supports all operations on the Supply resource, including history

\r\n

The server supports all operations on the ValueSet resource, including history

\r\n

The server supports all operations on the Binary resource, including history

\r\n
"},"name":"Spark FHIR demo server","publisher":"Furore","telecom":[{"system":"email","value":"e.kramer@furore.com","use":"work"}],"description":"Conformance statement for the Spark FHIR demo server running at AppHarbor","date":"2014-03-28","software":{"name":"Spark.Service","version":"1.0.0.0"},"implementation":{"description":"Furore Spark FHIR demo server running at AppHarbor","url":"http://spark.furore.com/"},"fhirVersion":"0.12","acceptUnknown":false,"format":["xml","json"],"rest":[{"mode":"server","documentation":"Publicly available, no security, use only for TESTING.","resource":[{"type":"AdverseReaction","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["substance","subject"],"searchParam":[{"name":"substance","source":"http://hl7.org/fhir/adversereaction/search#substance","type":"reference","documentation":"The name or code of the substance that produces the sensitivity","xpath":"AdverseReaction.exposure.substance"},{"name":"_id","source":"http://hl7.org/fhir/adversereaction/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"subject","source":"http://hl7.org/fhir/adversereaction/search#subject","type":"reference","documentation":"The subject that the sensitivity is about","xpath":"AdverseReaction.subject"},{"name":"date","source":"http://hl7.org/fhir/adversereaction/search#date","type":"date","documentation":"The date of the reaction","xpath":"AdverseReaction.date"},{"name":"symptom","source":"http://hl7.org/fhir/adversereaction/search#symptom","type":"token","documentation":"One of the symptoms of the reaction","xpath":"AdverseReaction.symptom.code"}]},{"type":"Alert","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["subject"],"searchParam":[{"name":"_id","source":"http://hl7.org/fhir/alert/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"subject","source":"http://hl7.org/fhir/alert/search#subject","type":"reference","documentation":"The identity of a subject to list alerts for","xpath":"Alert.subject"}]},{"type":"AllergyIntolerance","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["substance","recorder","subject"],"searchParam":[{"name":"substance","source":"http://hl7.org/fhir/allergyintolerance/search#substance","type":"reference","documentation":"The name or code of the substance that produces the sensitivity","xpath":"AllergyIntolerance.substance"},{"name":"_id","source":"http://hl7.org/fhir/allergyintolerance/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"status","source":"http://hl7.org/fhir/allergyintolerance/search#status","type":"token","documentation":"The status of the sensitivity","xpath":"AllergyIntolerance.status"},{"name":"recorder","source":"http://hl7.org/fhir/allergyintolerance/search#recorder","type":"reference","documentation":"Who recorded the sensitivity","xpath":"AllergyIntolerance.recorder"},{"name":"subject","source":"http://hl7.org/fhir/allergyintolerance/search#subject","type":"reference","documentation":"The subject that the sensitivity is about","xpath":"AllergyIntolerance.subject"},{"name":"date","source":"http://hl7.org/fhir/allergyintolerance/search#date","type":"date","documentation":"Recorded date/time.","xpath":"AllergyIntolerance.recordedDate"},{"name":"type","source":"http://hl7.org/fhir/allergyintolerance/search#type","type":"token","documentation":"The type of sensitivity","xpath":"AllergyIntolerance.sensitivityType"}]},{"type":"Appointment","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["subject"],"searchParam":[{"name":"partstatus","source":"http://hl7.org/fhir/appointment/search#partstatus","type":"token","documentation":"The Participation status of the subject, or other participant on the appointment","xpath":"Appointment.participant.status"},{"name":"_id","source":"http://hl7.org/fhir/appointment/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"status","source":"http://hl7.org/fhir/appointment/search#status","type":"string","documentation":"The overall status of the appointment","xpath":"Appointment.status"},{"name":"subject","source":"http://hl7.org/fhir/appointment/search#subject","type":"reference","documentation":"The subject that the sensitivity is about","xpath":"Appointment.participant.individual"},{"name":"date","source":"http://hl7.org/fhir/appointment/search#date","type":"date","documentation":"Appointment date/time.","xpath":"Appointment.start"}]},{"type":"AppointmentResponse","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["subject","appointment"],"searchParam":[{"name":"partstatus","source":"http://hl7.org/fhir/appointmentresponse/search#partstatus","type":"string","documentation":"The overall status of the appointment","xpath":"AppointmentResponse.participantStatus"},{"name":"_id","source":"http://hl7.org/fhir/appointmentresponse/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"subject","source":"http://hl7.org/fhir/appointmentresponse/search#subject","type":"reference","documentation":"The subject that the appointment response replies for","xpath":"AppointmentResponse.individual"},{"name":"appointment","source":"http://hl7.org/fhir/appointmentresponse/search#appointment","type":"reference","documentation":"The appointment that the response is attached to","xpath":"AppointmentResponse.appointment"}]},{"type":"Availability","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["individual"],"searchParam":[{"name":"individual","source":"http://hl7.org/fhir/availability/search#individual","type":"reference","documentation":"The individual to find an availability for","xpath":"Availability.individual"},{"name":"_id","source":"http://hl7.org/fhir/availability/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"slottype","source":"http://hl7.org/fhir/availability/search#slottype","type":"token","documentation":"The type of appointments that can be booked into associated slot(s)","xpath":"Availability.type"}]},{"type":"CarePlan","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["patient","condition","activitydetail","participant"],"searchParam":[{"name":"activitycode","source":"http://hl7.org/fhir/careplan/search#activitycode","type":"token","documentation":"Detail type of activity","xpath":"CarePlan.activity.simple.code"},{"name":"patient","source":"http://hl7.org/fhir/careplan/search#patient","type":"reference","documentation":"Who care plan is for","xpath":"CarePlan.patient"},{"name":"_id","source":"http://hl7.org/fhir/careplan/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"condition","source":"http://hl7.org/fhir/careplan/search#condition","type":"reference","documentation":"Health issues this plan addresses","xpath":"CarePlan.concern"},{"name":"activitydetail","source":"http://hl7.org/fhir/careplan/search#activitydetail","type":"reference","documentation":"Activity details defined in specific resource","xpath":"CarePlan.activity.detail"},{"name":"activitydate","source":"http://hl7.org/fhir/careplan/search#activitydate","type":"date","documentation":"Specified date occurs within period specified by CarePlan.activity.timingSchedule","xpath":"CarePlan.activity.simple.timing[x]"},{"name":"participant","source":"http://hl7.org/fhir/careplan/search#participant","type":"reference","documentation":"Who is involved","xpath":"CarePlan.participant.member"},{"name":"date","source":"http://hl7.org/fhir/careplan/search#date","type":"date","documentation":"Time period plan covers","xpath":"CarePlan.period"}]},{"type":"Composition","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["author","attester","subject","section-content"],"searchParam":[{"name":"author","source":"http://hl7.org/fhir/composition/search#author","type":"reference","documentation":"Who/what authored the composition","xpath":"Composition.author"},{"name":"_id","source":"http://hl7.org/fhir/composition/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"attester","source":"http://hl7.org/fhir/composition/search#attester","type":"reference","documentation":"Who attested the composition","xpath":"Composition.attester.party"},{"name":"subject","source":"http://hl7.org/fhir/composition/search#subject","type":"reference","documentation":"Who/what the composition is about","xpath":"Composition.subject"},{"name":"section-content","source":"http://hl7.org/fhir/composition/search#section-content","type":"reference","documentation":"The actual data for the section","xpath":"Composition.section.content"},{"name":"context","source":"http://hl7.org/fhir/composition/search#context","type":"token","documentation":"Code(s) that apply to the event being documented","xpath":"Composition.event.code"},{"name":"class","source":"http://hl7.org/fhir/composition/search#class","type":"token","documentation":"Categorisation of Composition","xpath":"Composition.class"},{"name":"section-type","source":"http://hl7.org/fhir/composition/search#section-type","type":"token","documentation":"Classification of section (recommended)","xpath":"Composition.section.code"},{"name":"type","source":"http://hl7.org/fhir/composition/search#type","type":"token","documentation":"Kind of composition (LOINC if possible)","xpath":"Composition.type"},{"name":"identifier","source":"http://hl7.org/fhir/composition/search#identifier","type":"token","documentation":"Logical identifier of composition (version-independent)","xpath":"Composition.identifier"},{"name":"instant","source":"http://hl7.org/fhir/composition/search#instant","type":"date","documentation":"Composition editing time","xpath":"Composition.instant"}]},{"type":"ConceptMap","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["source","target"],"searchParam":[{"name":"product","source":"http://hl7.org/fhir/conceptmap/search#product","type":"token","documentation":"Reference to element/field/valueset provides the context","xpath":"ConceptMap.concept.map.product.concept"},{"name":"dependson","source":"http://hl7.org/fhir/conceptmap/search#dependson","type":"token","documentation":"Reference to element/field/valueset provides the context","xpath":"ConceptMap.concept.dependsOn.concept"},{"name":"system","source":"http://hl7.org/fhir/conceptmap/search#system","type":"token","documentation":"The system for any destination concepts mapped by this map","xpath":"ConceptMap.concept.map.system"},{"name":"source","source":"http://hl7.org/fhir/conceptmap/search#source","type":"reference","documentation":"The system for any concepts mapped by this concept map","xpath":"ConceptMap.source"},{"name":"_id","source":"http://hl7.org/fhir/conceptmap/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"status","source":"http://hl7.org/fhir/conceptmap/search#status","type":"token","documentation":"Status of the concept map","xpath":"ConceptMap.status"},{"name":"description","source":"http://hl7.org/fhir/conceptmap/search#description","type":"string","documentation":"Text search in the description of the concept map","xpath":"ConceptMap.description"},{"name":"name","source":"http://hl7.org/fhir/conceptmap/search#name","type":"string","documentation":"Name of the concept map","xpath":"ConceptMap.name"},{"name":"target","source":"http://hl7.org/fhir/conceptmap/search#target","type":"reference","documentation":"Provides context to the mappings","xpath":"ConceptMap.target"},{"name":"date","source":"http://hl7.org/fhir/conceptmap/search#date","type":"date","documentation":"The concept map publication date","xpath":"ConceptMap.date"},{"name":"identifier","source":"http://hl7.org/fhir/conceptmap/search#identifier","type":"token","documentation":"The identifier of the concept map","xpath":"ConceptMap.identifier"},{"name":"publisher","source":"http://hl7.org/fhir/conceptmap/search#publisher","type":"string","documentation":"Name of the publisher of the concept map","xpath":"ConceptMap.publisher"},{"name":"version","source":"http://hl7.org/fhir/conceptmap/search#version","type":"token","documentation":"The version identifier of the concept map","xpath":"ConceptMap.version"}]},{"type":"Condition","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["asserter","subject","encounter","related-item"],"searchParam":[{"name":"asserter","source":"http://hl7.org/fhir/condition/search#asserter","type":"reference","documentation":"Person who asserts this condition","xpath":"Condition.asserter"},{"name":"status","source":"http://hl7.org/fhir/condition/search#status","type":"token","documentation":"The status of the condition","xpath":"Condition.status"},{"name":"location","source":"http://hl7.org/fhir/condition/search#location","type":"token","documentation":"Location - may include laterality","xpath":"Condition.location.code"},{"name":"subject","source":"http://hl7.org/fhir/condition/search#subject","type":"reference","documentation":"Who has the condition?","xpath":"Condition.subject"},{"name":"onset","source":"http://hl7.org/fhir/condition/search#onset","type":"date","documentation":"When the Condition started (if started on a date)","xpath":"Condition.onset[x]"},{"name":"evidence","source":"http://hl7.org/fhir/condition/search#evidence","type":"token","documentation":"Manifestation/symptom","xpath":"Condition.evidence.code"},{"name":"severity","source":"http://hl7.org/fhir/condition/search#severity","type":"token","documentation":"The severity of the condition","xpath":"Condition.severity"},{"name":"code","source":"http://hl7.org/fhir/condition/search#code","type":"token","documentation":"Code for the condition","xpath":"Condition.code"},{"name":"encounter","source":"http://hl7.org/fhir/condition/search#encounter","type":"reference","documentation":"Encounter when condition first asserted","xpath":"Condition.encounter"},{"name":"date-asserted","source":"http://hl7.org/fhir/condition/search#date-asserted","type":"date","documentation":"When first detected/suspected/entered","xpath":"Condition.dateAsserted"},{"name":"stage","source":"http://hl7.org/fhir/condition/search#stage","type":"token","documentation":"Simple summary (disease specific)","xpath":"Condition.stage.summary"},{"name":"related-code","source":"http://hl7.org/fhir/condition/search#related-code","type":"token","documentation":"Relationship target by means of a predefined code","xpath":"Condition.relatedItem.code"},{"name":"category","source":"http://hl7.org/fhir/condition/search#category","type":"token","documentation":"The category of the condition","xpath":"Condition.category"},{"name":"_id","source":"http://hl7.org/fhir/condition/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"related-item","source":"http://hl7.org/fhir/condition/search#related-item","type":"reference","documentation":"Relationship target resource","xpath":"Condition.relatedItem.target"}]},{"type":"Conformance","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["supported-profile","profile"],"searchParam":[{"name":"status","source":"http://hl7.org/fhir/conformance/search#status","type":"token","documentation":"The current status of the conformance statement","xpath":"Conformance.status"},{"name":"resource","source":"http://hl7.org/fhir/conformance/search#resource","type":"token","documentation":"Name of a resource mentioned in a conformance statement","xpath":"Conformance.rest.resource.type"},{"name":"security","source":"http://hl7.org/fhir/conformance/search#security","type":"token","documentation":"Information about security of implementation","xpath":"Conformance.rest.security"},{"name":"format","source":"http://hl7.org/fhir/conformance/search#format","type":"token","documentation":"formats supported (xml | json | mime type)","xpath":"Conformance.format"},{"name":"date","source":"http://hl7.org/fhir/conformance/search#date","type":"date","documentation":"The conformance statement publication date","xpath":"Conformance.date"},{"name":"mode","source":"http://hl7.org/fhir/conformance/search#mode","type":"token","documentation":"Mode - restful (server/client) or messaging (sender/receiver)","xpath":"Conformance.rest.mode"},{"name":"version","source":"http://hl7.org/fhir/conformance/search#version","type":"token","documentation":"The version identifier of the conformance statement","xpath":"Conformance.version"},{"name":"publisher","source":"http://hl7.org/fhir/conformance/search#publisher","type":"string","documentation":"Name of the publisher of the conformance statement","xpath":"Conformance.publisher"},{"name":"software","source":"http://hl7.org/fhir/conformance/search#software","type":"string","documentation":"Part of a the name of a software application","xpath":"Conformance.software.name"},{"name":"_id","source":"http://hl7.org/fhir/conformance/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"description","source":"http://hl7.org/fhir/conformance/search#description","type":"string","documentation":"Text search in the description of the conformance statement","xpath":"Conformance.description"},{"name":"event","source":"http://hl7.org/fhir/conformance/search#event","type":"token","documentation":"Event code in a conformance statement","xpath":"Conformance.messaging.event.code"},{"name":"name","source":"http://hl7.org/fhir/conformance/search#name","type":"string","documentation":"Name of the conformance statement","xpath":"Conformance.name"},{"name":"supported-profile","source":"http://hl7.org/fhir/conformance/search#supported-profile","type":"reference","documentation":"Profiles supported by the system","xpath":"Conformance.profile"},{"name":"fhirversion","source":"http://hl7.org/fhir/conformance/search#fhirversion","type":"token","documentation":"The version of FHIR","xpath":"Conformance.version"},{"name":"identifier","source":"http://hl7.org/fhir/conformance/search#identifier","type":"token","documentation":"The identifier of the conformance statement","xpath":"Conformance.identifier"},{"name":"profile","source":"http://hl7.org/fhir/conformance/search#profile","type":"reference","documentation":"A profile id invoked in a conformance statement","xpath":"Conformance.rest.resource.profile"}]},{"type":"Device","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["organization","patient","location"],"searchParam":[{"name":"organization","source":"http://hl7.org/fhir/device/search#organization","type":"reference","documentation":"The organization responsible for the device","xpath":"Device.owner"},{"name":"model","source":"http://hl7.org/fhir/device/search#model","type":"string","documentation":"The model of the device","xpath":"Device.model"},{"name":"patient","source":"http://hl7.org/fhir/device/search#patient","type":"reference","documentation":"If the resource is affixed to a person","xpath":"Device.patient"},{"name":"_id","source":"http://hl7.org/fhir/device/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"location","source":"http://hl7.org/fhir/device/search#location","type":"reference","documentation":"Where the resource is found","xpath":"Device.location"},{"name":"manufacturer","source":"http://hl7.org/fhir/device/search#manufacturer","type":"string","documentation":"The manufacturer of the device","xpath":"Device.manufacturer"},{"name":"udi","source":"http://hl7.org/fhir/device/search#udi","type":"string","documentation":"FDA Mandated Unique Device Identifier","xpath":"Device.udi"},{"name":"type","source":"http://hl7.org/fhir/device/search#type","type":"token","documentation":"The type of the device","xpath":"Device.type"},{"name":"identifier","source":"http://hl7.org/fhir/device/search#identifier","type":"token","documentation":"Instance id from manufacturer, owner and others","xpath":"Device.identifier"}]},{"type":"DeviceObservationReport","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["observation","source","subject"],"searchParam":[{"name":"observation","source":"http://hl7.org/fhir/deviceobservationreport/search#observation","type":"reference","documentation":"The data for the metric","xpath":"DeviceObservationReport.virtualDevice.channel.metric.observation"},{"name":"source","source":"http://hl7.org/fhir/deviceobservationreport/search#source","type":"reference","documentation":"Identifies/describes where the data came from","xpath":"DeviceObservationReport.source"},{"name":"_id","source":"http://hl7.org/fhir/deviceobservationreport/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"subject","source":"http://hl7.org/fhir/deviceobservationreport/search#subject","type":"reference","documentation":"Subject of the measurement","xpath":"DeviceObservationReport.subject"},{"name":"code","source":"http://hl7.org/fhir/deviceobservationreport/search#code","type":"token","documentation":"The compatment code","xpath":"DeviceObservationReport.virtualDevice.code"},{"name":"channel","source":"http://hl7.org/fhir/deviceobservationreport/search#channel","type":"token","documentation":"The channel code","xpath":"DeviceObservationReport.virtualDevice.channel.code"}]},{"type":"DiagnosticOrder","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["orderer","subject","actor","encounter","specimen"],"searchParam":[{"name":"orderer","source":"http://hl7.org/fhir/diagnosticorder/search#orderer","type":"reference","documentation":"Who ordered the test","xpath":"DiagnosticOrder.orderer"},{"name":"status","source":"http://hl7.org/fhir/diagnosticorder/search#status","type":"token","documentation":"requested | received | accepted | in progress | review | completed | suspended | rejected | failed","xpath":"DiagnosticOrder.status"},{"name":"subject","source":"http://hl7.org/fhir/diagnosticorder/search#subject","type":"reference","documentation":"Who/what test is about","xpath":"DiagnosticOrder.subject"},{"name":"item-status","source":"http://hl7.org/fhir/diagnosticorder/search#item-status","type":"token","documentation":"requested | received | accepted | in progress | review | completed | suspended | rejected | failed","xpath":"DiagnosticOrder.item.status"},{"name":"event-status","source":"http://hl7.org/fhir/diagnosticorder/search#event-status","type":"token","documentation":"requested | received | accepted | in progress | review | completed | suspended | rejected | failed","xpath":"DiagnosticOrder.event.status"},{"name":"actor","source":"http://hl7.org/fhir/diagnosticorder/search#actor","type":"reference","documentation":"Who recorded or did this","xpath":"DiagnosticOrder.event.actor,DiagnosticOrder.item.event.actor"},{"name":"code","source":"http://hl7.org/fhir/diagnosticorder/search#code","type":"token","documentation":"Code to indicate the item (test or panel) being ordered","xpath":"DiagnosticOrder.item.code"},{"name":"encounter","source":"http://hl7.org/fhir/diagnosticorder/search#encounter","type":"reference","documentation":"The encounter that this diagnostic order is associated with","xpath":"DiagnosticOrder.encounter"},{"name":"item-past-status","source":"http://hl7.org/fhir/diagnosticorder/search#item-past-status","type":"token","documentation":"requested | received | accepted | in progress | review | completed | suspended | rejected | failed","xpath":"DiagnosticOrder.item.event.status"},{"name":"_id","source":"http://hl7.org/fhir/diagnosticorder/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"bodysite","source":"http://hl7.org/fhir/diagnosticorder/search#bodysite","type":"token","documentation":"Location of requested test (if applicable)","xpath":"DiagnosticOrder.item.bodySite"},{"name":"item-date","source":"http://hl7.org/fhir/diagnosticorder/search#item-date","type":"date","documentation":"The date at which the event happened","xpath":"DiagnosticOrder.item.event.dateTime"},{"name":"specimen","source":"http://hl7.org/fhir/diagnosticorder/search#specimen","type":"reference","documentation":"If the whole order relates to specific specimens","xpath":"DiagnosticOrder.specimen,DiagnosticOrder.item.specimen"},{"name":"event-status-date","source":"http://hl7.org/fhir/diagnosticorder/search#event-status-date","type":"composite","documentation":"A combination of past-status and date"},{"name":"event-date","source":"http://hl7.org/fhir/diagnosticorder/search#event-date","type":"date","documentation":"The date at which the event happened","xpath":"DiagnosticOrder.event.dateTime"},{"name":"identifier","source":"http://hl7.org/fhir/diagnosticorder/search#identifier","type":"token","documentation":"Identifiers assigned to this order","xpath":"DiagnosticOrder.identifier"},{"name":"item-status-date","source":"http://hl7.org/fhir/diagnosticorder/search#item-status-date","type":"composite","documentation":"A combination of item-past-status and item-date"}]},{"type":"DiagnosticReport","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["result","subject","image","request","specimen","performer"],"searchParam":[{"name":"result","source":"http://hl7.org/fhir/diagnosticreport/search#result","type":"reference","documentation":"Link to an atomic result (observation resource)","xpath":"DiagnosticReport.results.result,DiagnosticReport.results.group.result"},{"name":"status","source":"http://hl7.org/fhir/diagnosticreport/search#status","type":"token","documentation":"The status of the report","xpath":"DiagnosticReport.status"},{"name":"subject","source":"http://hl7.org/fhir/diagnosticreport/search#subject","type":"reference","documentation":"The subject of the report","xpath":"DiagnosticReport.subject"},{"name":"issued","source":"http://hl7.org/fhir/diagnosticreport/search#issued","type":"date","documentation":"When the report was issued","xpath":"DiagnosticReport.issued"},{"name":"diagnosis","source":"http://hl7.org/fhir/diagnosticreport/search#diagnosis","type":"token","documentation":"A coded diagnosis on the report","xpath":"DiagnosticReport.codedDiagnosis"},{"name":"image","source":"http://hl7.org/fhir/diagnosticreport/search#image","type":"reference","documentation":"Reference to the image source","xpath":"DiagnosticReport.image.link"},{"name":"date","source":"http://hl7.org/fhir/diagnosticreport/search#date","type":"date","documentation":"The clinically relevant time of the report","xpath":"DiagnosticReport.diagnostic[x]"},{"name":"_id","source":"http://hl7.org/fhir/diagnosticreport/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"request","source":"http://hl7.org/fhir/diagnosticreport/search#request","type":"reference","documentation":"What was requested","xpath":"DiagnosticReport.requestDetail"},{"name":"specimen","source":"http://hl7.org/fhir/diagnosticreport/search#specimen","type":"reference","documentation":"The specimen details","xpath":"DiagnosticReport.results.specimen,DiagnosticReport.results.group.specimen"},{"name":"name","source":"http://hl7.org/fhir/diagnosticreport/search#name","type":"token","documentation":"The name of the report (e.g. the code for the report as a whole, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result)","xpath":"DiagnosticReport.results.name"},{"name":"service","source":"http://hl7.org/fhir/diagnosticreport/search#service","type":"token","documentation":"Which diagnostic discipline/department created the report","xpath":"DiagnosticReport.serviceCategory"},{"name":"performer","source":"http://hl7.org/fhir/diagnosticreport/search#performer","type":"reference","documentation":"Who was the source of the report (organization)","xpath":"DiagnosticReport.performer"},{"name":"group","source":"http://hl7.org/fhir/diagnosticreport/search#group","type":"token","documentation":"Name /code of a group in the report"},{"name":"identifier","source":"http://hl7.org/fhir/diagnosticreport/search#identifier","type":"token","documentation":"An identifier for the report","xpath":"DiagnosticReport.identifier"}]},{"type":"DocumentManifest","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["content","author","supersedes","subject","recipient"],"searchParam":[{"name":"content","source":"http://hl7.org/fhir/documentmanifest/search#content","type":"reference","documentation":"Contents of this set of documents","xpath":"DocumentManifest.content"},{"name":"author","source":"http://hl7.org/fhir/documentmanifest/search#author","type":"reference","documentation":"Who/what authored the document","xpath":"DocumentManifest.author"},{"name":"supersedes","source":"http://hl7.org/fhir/documentmanifest/search#supersedes","type":"reference","documentation":"If this document manifest replaces another","xpath":"DocumentManifest.supercedes"},{"name":"_id","source":"http://hl7.org/fhir/documentmanifest/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"status","source":"http://hl7.org/fhir/documentmanifest/search#status","type":"token","documentation":"current | superceded | entered in error","xpath":"DocumentManifest.status"},{"name":"created","source":"http://hl7.org/fhir/documentmanifest/search#created","type":"date","documentation":"When this document manifest created","xpath":"DocumentManifest.created"},{"name":"confidentiality","source":"http://hl7.org/fhir/documentmanifest/search#confidentiality","type":"token","documentation":"Sensitivity of set of documents","xpath":"DocumentManifest.confidentiality"},{"name":"description","source":"http://hl7.org/fhir/documentmanifest/search#description","type":"string","documentation":"Human-readable description (title)","xpath":"DocumentManifest.description"},{"name":"subject","source":"http://hl7.org/fhir/documentmanifest/search#subject","type":"reference","documentation":"The subject of the set of documents","xpath":"DocumentManifest.subject"},{"name":"type","source":"http://hl7.org/fhir/documentmanifest/search#type","type":"token","documentation":"What kind of document set this is","xpath":"DocumentManifest.type"},{"name":"identifier","source":"http://hl7.org/fhir/documentmanifest/search#identifier","type":"token","documentation":"Unique Identifier for the set of documents","xpath":"DocumentManifest.masterIdentifier,DocumentManifest.identifier"},{"name":"recipient","source":"http://hl7.org/fhir/documentmanifest/search#recipient","type":"reference","documentation":"Intended to get notified about this set of documents","xpath":"DocumentManifest.recipient"}]},{"type":"DocumentReference","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["subject","relatesto","authenticator","author","custodian"],"searchParam":[{"name":"location","source":"http://hl7.org/fhir/documentreference/search#location","type":"string","documentation":"Where to access the document","xpath":"DocumentReference.location"},{"name":"indexed","source":"http://hl7.org/fhir/documentreference/search#indexed","type":"date","documentation":"When this document reference created","xpath":"DocumentReference.indexed"},{"name":"status","source":"http://hl7.org/fhir/documentreference/search#status","type":"token","documentation":"current | superceded | entered in error","xpath":"DocumentReference.status"},{"name":"subject","source":"http://hl7.org/fhir/documentreference/search#subject","type":"reference","documentation":"Who|what is the subject of the document","xpath":"DocumentReference.subject"},{"name":"relatesto","source":"http://hl7.org/fhir/documentreference/search#relatesto","type":"reference","documentation":"Target of the relationship","xpath":"DocumentReference.relatesTo.target"},{"name":"relation","source":"http://hl7.org/fhir/documentreference/search#relation","type":"token","documentation":"replaces | transforms | signs | appends","xpath":"DocumentReference.relatesTo.code"},{"name":"class","source":"http://hl7.org/fhir/documentreference/search#class","type":"token","documentation":"Categorisation of Document","xpath":"DocumentReference.class"},{"name":"format","source":"http://hl7.org/fhir/documentreference/search#format","type":"token","documentation":"Format/content rules for the document","xpath":"DocumentReference.format"},{"name":"period","source":"http://hl7.org/fhir/documentreference/search#period","type":"date","documentation":"Time of service that is being documented","xpath":"DocumentReference.context.period"},{"name":"type","source":"http://hl7.org/fhir/documentreference/search#type","type":"token","documentation":"What kind of document this is (LOINC if possible)","xpath":"DocumentReference.type"},{"name":"authenticator","source":"http://hl7.org/fhir/documentreference/search#authenticator","type":"reference","documentation":"Who/What authenticated the document","xpath":"DocumentReference.authenticator"},{"name":"size","source":"http://hl7.org/fhir/documentreference/search#size","type":"number","documentation":"Size of the document in bytes","xpath":"DocumentReference.size"},{"name":"relationship","source":"http://hl7.org/fhir/documentreference/search#relationship","type":"composite","documentation":"Combination of relation and relatesTo"},{"name":"author","source":"http://hl7.org/fhir/documentreference/search#author","type":"reference","documentation":"Who/what authored the document","xpath":"DocumentReference.author"},{"name":"custodian","source":"http://hl7.org/fhir/documentreference/search#custodian","type":"reference","documentation":"Org which maintains the document","xpath":"DocumentReference.custodian"},{"name":"facility","source":"http://hl7.org/fhir/documentreference/search#facility","type":"token","documentation":"Kind of facility where patient was seen","xpath":"DocumentReference.context.facilityType"},{"name":"_id","source":"http://hl7.org/fhir/documentreference/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"created","source":"http://hl7.org/fhir/documentreference/search#created","type":"date","documentation":"Document creation time","xpath":"DocumentReference.created"},{"name":"event","source":"http://hl7.org/fhir/documentreference/search#event","type":"token","documentation":"Main Clinical Acts Documented","xpath":"DocumentReference.context.event"},{"name":"confidentiality","source":"http://hl7.org/fhir/documentreference/search#confidentiality","type":"token","documentation":"Sensitivity of source document","xpath":"DocumentReference.confidentiality"},{"name":"description","source":"http://hl7.org/fhir/documentreference/search#description","type":"string","documentation":"Human-readable description (title)","xpath":"DocumentReference.description"},{"name":"language","source":"http://hl7.org/fhir/documentreference/search#language","type":"token","documentation":"The marked primary language for the document","xpath":"DocumentReference.primaryLanguage"},{"name":"identifier","source":"http://hl7.org/fhir/documentreference/search#identifier","type":"token","documentation":"Master Version Specific Identifier","xpath":"DocumentReference.masterIdentifier,DocumentReference.identifier"}]},{"type":"Encounter","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["location","subject","indication"],"searchParam":[{"name":"_id","source":"http://hl7.org/fhir/encounter/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"location","source":"http://hl7.org/fhir/encounter/search#location","type":"reference","documentation":"The location the encounter takes place","xpath":"Encounter.location.location"},{"name":"status","source":"http://hl7.org/fhir/encounter/search#status","type":"token","documentation":"planned | in progress | onleave | finished | cancelled","xpath":"Encounter.status"},{"name":"subject","source":"http://hl7.org/fhir/encounter/search#subject","type":"reference","documentation":"The patient present at the encounter","xpath":"Encounter.subject"},{"name":"indication","source":"http://hl7.org/fhir/encounter/search#indication","type":"reference","documentation":"Reason the encounter takes place (resource)","xpath":"Encounter.indication"},{"name":"length","source":"http://hl7.org/fhir/encounter/search#length","type":"number","documentation":"Length of encounter in days","xpath":"Encounter.length"},{"name":"date","source":"http://hl7.org/fhir/encounter/search#date","type":"date","documentation":"A date within the period the Encounter lasted","xpath":"Encounter.period"},{"name":"identifier","source":"http://hl7.org/fhir/encounter/search#identifier","type":"token","documentation":"Identifier(s) by which this encounter is known","xpath":"Encounter.identifier"},{"name":"location-period","source":"http://hl7.org/fhir/encounter/search#location-period","type":"date","documentation":"Time period during which the patient was present at the location","xpath":"Encounter.location.period"}]},{"type":"FamilyHistory","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["subject"],"searchParam":[{"name":"_id","source":"http://hl7.org/fhir/familyhistory/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"subject","source":"http://hl7.org/fhir/familyhistory/search#subject","type":"reference","documentation":"The identity of a subject to list family history items for","xpath":"FamilyHistory.subject"}]},{"type":"Group","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["member"],"searchParam":[{"name":"member","source":"http://hl7.org/fhir/group/search#member","type":"reference","documentation":"Who is in group","xpath":"Group.member"},{"name":"_id","source":"http://hl7.org/fhir/group/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"characteristic-value","source":"http://hl7.org/fhir/group/search#characteristic-value","type":"composite","documentation":"A composite of both characteristic and value"},{"name":"value","source":"http://hl7.org/fhir/group/search#value","type":"token","documentation":"Value held by characteristic","xpath":"Group.characteristic.value[x]"},{"name":"actual","source":"http://hl7.org/fhir/group/search#actual","type":"token","documentation":"Descriptive or actual","xpath":"Group.actual"},{"name":"exclude","source":"http://hl7.org/fhir/group/search#exclude","type":"token","documentation":"Group includes or excludes","xpath":"Group.characteristic.exclude"},{"name":"code","source":"http://hl7.org/fhir/group/search#code","type":"token","documentation":"The kind of resources contained","xpath":"Group.code"},{"name":"characteristic","source":"http://hl7.org/fhir/group/search#characteristic","type":"token","documentation":"Kind of characteristic","xpath":"Group.characteristic.code"},{"name":"type","source":"http://hl7.org/fhir/group/search#type","type":"token","documentation":"The type of resources the group contains","xpath":"Group.type"},{"name":"identifier","source":"http://hl7.org/fhir/group/search#identifier","type":"token","documentation":"Unique id","xpath":"Group.identifier"}]},{"type":"ImagingStudy","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["subject"],"searchParam":[{"name":"uid","source":"http://hl7.org/fhir/imagingstudy/search#uid","type":"token","documentation":"Formal identifier for this instance (0008,0018)","xpath":"ImagingStudy.series.instance.uid"},{"name":"series","source":"http://hl7.org/fhir/imagingstudy/search#series","type":"token","documentation":"The series id for the image","xpath":"ImagingStudy.series.uid"},{"name":"_id","source":"http://hl7.org/fhir/imagingstudy/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"bodysite","source":"http://hl7.org/fhir/imagingstudy/search#bodysite","type":"token","documentation":"Body part examined (Map from 0018,0015)","xpath":"ImagingStudy.series.bodySite"},{"name":"subject","source":"http://hl7.org/fhir/imagingstudy/search#subject","type":"reference","documentation":"Who the study is about","xpath":"ImagingStudy.subject"},{"name":"accession","source":"http://hl7.org/fhir/imagingstudy/search#accession","type":"token","documentation":"The accession id for the image","xpath":"ImagingStudy.accessionNo"},{"name":"study","source":"http://hl7.org/fhir/imagingstudy/search#study","type":"token","documentation":"The study id for the image","xpath":"ImagingStudy.uid"},{"name":"modality","source":"http://hl7.org/fhir/imagingstudy/search#modality","type":"token","documentation":"The modality of the image","xpath":"ImagingStudy.series.modality"},{"name":"date","source":"http://hl7.org/fhir/imagingstudy/search#date","type":"date","documentation":"The date the study was done was taken","xpath":"ImagingStudy.dateTime"},{"name":"dicom-class","source":"http://hl7.org/fhir/imagingstudy/search#dicom-class","type":"token","documentation":"DICOM class type (0008,0016)","xpath":"ImagingStudy.series.instance.sopclass"},{"name":"size","source":"http://hl7.org/fhir/imagingstudy/search#size","type":"number","documentation":"The size of the image in MB - may include > or < in the value"}]},{"type":"Immunization","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["reaction","requester","location","subject","manufacturer","performer"],"searchParam":[{"name":"reaction","source":"http://hl7.org/fhir/immunization/search#reaction","type":"reference","documentation":"Additional information on reaction","xpath":"Immunization.reaction.detail"},{"name":"requester","source":"http://hl7.org/fhir/immunization/search#requester","type":"reference","documentation":"The practitioner who ordered the vaccination","xpath":"Immunization.requester"},{"name":"dose-sequence","source":"http://hl7.org/fhir/immunization/search#dose-sequence","type":"number","documentation":"What dose number within series?","xpath":"Immunization.vaccinationProtocol.doseSequence"},{"name":"vaccine-type","source":"http://hl7.org/fhir/immunization/search#vaccine-type","type":"token","documentation":"Vaccine Product Type Administered","xpath":"Immunization.vaccineType"},{"name":"location","source":"http://hl7.org/fhir/immunization/search#location","type":"reference","documentation":"The service delivery location or facility in which the vaccine was / was to be administered","xpath":"Immunization.location"},{"name":"reason","source":"http://hl7.org/fhir/immunization/search#reason","type":"token","documentation":"Why immunization occurred","xpath":"Immunization.explanation.reason"},{"name":"subject","source":"http://hl7.org/fhir/immunization/search#subject","type":"reference","documentation":"The subject of the vaccination event / refusal","xpath":"Immunization.subject"},{"name":"reaction-date","source":"http://hl7.org/fhir/immunization/search#reaction-date","type":"date","documentation":"When did reaction start?","xpath":"Immunization.reaction.date"},{"name":"date","source":"http://hl7.org/fhir/immunization/search#date","type":"date","documentation":"Vaccination Administration / Refusal Date","xpath":"Immunization.date"},{"name":"lot-number","source":"http://hl7.org/fhir/immunization/search#lot-number","type":"string","documentation":"Vaccine Lot Number","xpath":"Immunization.lotNumber"},{"name":"_id","source":"http://hl7.org/fhir/immunization/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"manufacturer","source":"http://hl7.org/fhir/immunization/search#manufacturer","type":"reference","documentation":"Vaccine Manufacturer","xpath":"Immunization.manufacturer"},{"name":"performer","source":"http://hl7.org/fhir/immunization/search#performer","type":"reference","documentation":"The practitioner who administered the vaccination","xpath":"Immunization.performer"},{"name":"refused","source":"http://hl7.org/fhir/immunization/search#refused","type":"token","documentation":"Was immunization refused?","xpath":"Immunization.refusedIndicator"},{"name":"refusal-reason","source":"http://hl7.org/fhir/immunization/search#refusal-reason","type":"token","documentation":"Explanation of refusal / exemption","xpath":"Immunization.explanation.refusalReason"},{"name":"identifier","source":"http://hl7.org/fhir/immunization/search#identifier","type":"token","documentation":"Business identifier","xpath":"Immunization.identifier"}]},{"type":"ImmunizationRecommendation","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["information","support","subject"],"searchParam":[{"name":"information","source":"http://hl7.org/fhir/immunizationrecommendation/search#information","type":"reference","documentation":"Patient observations supporting recommendation","xpath":"ImmunizationRecommendation.recommendation.supportingPatientInformation"},{"name":"dose-sequence","source":"http://hl7.org/fhir/immunizationrecommendation/search#dose-sequence","type":"token","documentation":"Number of dose within sequence","xpath":"ImmunizationRecommendation.recommendation.protocol.doseSequence"},{"name":"support","source":"http://hl7.org/fhir/immunizationrecommendation/search#support","type":"reference","documentation":"Past immunizations supporting recommendation","xpath":"ImmunizationRecommendation.recommendation.supportingImmunization"},{"name":"vaccine-type","source":"http://hl7.org/fhir/immunizationrecommendation/search#vaccine-type","type":"token","documentation":"Vaccine recommendation applies to","xpath":"ImmunizationRecommendation.recommendation.vaccineType"},{"name":"_id","source":"http://hl7.org/fhir/immunizationrecommendation/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"status","source":"http://hl7.org/fhir/immunizationrecommendation/search#status","type":"token","documentation":"Vaccine administration status","xpath":"ImmunizationRecommendation.recommendation.forecastStatus"},{"name":"dose-number","source":"http://hl7.org/fhir/immunizationrecommendation/search#dose-number","type":"number","documentation":"Recommended dose number","xpath":"ImmunizationRecommendation.recommendation.doseNumber"},{"name":"subject","source":"http://hl7.org/fhir/immunizationrecommendation/search#subject","type":"reference","documentation":"Who this profile is for","xpath":"ImmunizationRecommendation.subject"},{"name":"date","source":"http://hl7.org/fhir/immunizationrecommendation/search#date","type":"date","documentation":"Date recommendation created","xpath":"ImmunizationRecommendation.recommendation.date"},{"name":"identifier","source":"http://hl7.org/fhir/immunizationrecommendation/search#identifier","type":"token","documentation":"Business identifier","xpath":"ImmunizationRecommendation.identifier"}]},{"type":"List","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["source","subject","item"],"searchParam":[{"name":"source","source":"http://hl7.org/fhir/list/search#source","type":"reference","documentation":"Who/what defined the list contents","xpath":"List.source"},{"name":"_id","source":"http://hl7.org/fhir/list/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"subject","source":"http://hl7.org/fhir/list/search#subject","type":"reference","documentation":"If all resources have the same subject","xpath":"List.subject"},{"name":"item","source":"http://hl7.org/fhir/list/search#item","type":"reference","documentation":"Actual entry","xpath":"List.entry.item"},{"name":"code","source":"http://hl7.org/fhir/list/search#code","type":"token","documentation":"What the purpose of this list is","xpath":"List.code"},{"name":"date","source":"http://hl7.org/fhir/list/search#date","type":"date","documentation":"When the list was prepared","xpath":"List.date"},{"name":"empty-reason","source":"http://hl7.org/fhir/list/search#empty-reason","type":"token","documentation":"Why list is empty","xpath":"List.emptyReason"}]},{"type":"Location","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["partof"],"searchParam":[{"name":"near","source":"http://hl7.org/fhir/location/search#near","type":"token","documentation":"The coordinates expressed as [lat],[long] (using KML, see notes) to find locations near to (servers may search using a square rather than a circle for efficiency)"},{"name":"partof","source":"http://hl7.org/fhir/location/search#partof","type":"reference","documentation":"The location of which this location is a part","xpath":"Location.partOf"},{"name":"_id","source":"http://hl7.org/fhir/location/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"status","source":"http://hl7.org/fhir/location/search#status","type":"token","documentation":"Searches for locations with a specific kind of status","xpath":"Location.status"},{"name":"address","source":"http://hl7.org/fhir/location/search#address","type":"string","documentation":"A (part of the) address of the location","xpath":"Location.address"},{"name":"name","source":"http://hl7.org/fhir/location/search#name","type":"string","documentation":"A (portion of the) name of the location","xpath":"Location.name"},{"name":"near-distance","source":"http://hl7.org/fhir/location/search#near-distance","type":"token","documentation":"A distance quantity to limit the near search to locations within a specific distance"},{"name":"type","source":"http://hl7.org/fhir/location/search#type","type":"token","documentation":"A code for the type of location","xpath":"Location.type"},{"name":"identifier","source":"http://hl7.org/fhir/location/search#identifier","type":"token","documentation":"Unique code or number identifying the location to its users","xpath":"Location.identifier"}]},{"type":"Media","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["subject","operator"],"searchParam":[{"name":"_id","source":"http://hl7.org/fhir/media/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"subject","source":"http://hl7.org/fhir/media/search#subject","type":"reference","documentation":"Who/What this Media is a record of","xpath":"Media.subject"},{"name":"subtype","source":"http://hl7.org/fhir/media/search#subtype","type":"token","documentation":"The type of acquisition equipment/process","xpath":"Media.subtype"},{"name":"view","source":"http://hl7.org/fhir/media/search#view","type":"token","documentation":"Imaging view e.g Lateral or Antero-posterior","xpath":"Media.view"},{"name":"date","source":"http://hl7.org/fhir/media/search#date","type":"date","documentation":"When the media was taken/recorded (end)","xpath":"Media.dateTime"},{"name":"type","source":"http://hl7.org/fhir/media/search#type","type":"token","documentation":"photo | video | audio","xpath":"Media.type"},{"name":"identifier","source":"http://hl7.org/fhir/media/search#identifier","type":"token","documentation":"Identifier(s) for the image","xpath":"Media.identifier"},{"name":"operator","source":"http://hl7.org/fhir/media/search#operator","type":"reference","documentation":"The person who generated the image","xpath":"Media.operator"}]},{"type":"Medication","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["content","manufacturer","ingredient"],"searchParam":[{"name":"content","source":"http://hl7.org/fhir/medication/search#content","type":"reference","documentation":"A product in the package","xpath":"Medication.package.content.item"},{"name":"form","source":"http://hl7.org/fhir/medication/search#form","type":"token","documentation":"powder | tablets | carton +","xpath":"Medication.product.form"},{"name":"_id","source":"http://hl7.org/fhir/medication/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"container","source":"http://hl7.org/fhir/medication/search#container","type":"token","documentation":"E.g. box, vial, blister-pack","xpath":"Medication.package.container"},{"name":"manufacturer","source":"http://hl7.org/fhir/medication/search#manufacturer","type":"reference","documentation":"Manufacturer of the item","xpath":"Medication.manufacturer"},{"name":"name","source":"http://hl7.org/fhir/medication/search#name","type":"string","documentation":"Common / Commercial name","xpath":"Medication.name"},{"name":"ingredient","source":"http://hl7.org/fhir/medication/search#ingredient","type":"reference","documentation":"The product contained","xpath":"Medication.product.ingredient.item"},{"name":"code","source":"http://hl7.org/fhir/medication/search#code","type":"token","documentation":"Codes that identify this medication","xpath":"Medication.code"}]},{"type":"MedicationAdministration","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["medication","patient","prescription","device","encounter"],"searchParam":[{"name":"medication","source":"http://hl7.org/fhir/medicationadministration/search#medication","type":"reference","documentation":"Return administrations of this medication","xpath":"MedicationAdministration.medication"},{"name":"patient","source":"http://hl7.org/fhir/medicationadministration/search#patient","type":"reference","documentation":"The identity of a patient to list administrations for","xpath":"MedicationAdministration.patient"},{"name":"_id","source":"http://hl7.org/fhir/medicationadministration/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"status","source":"http://hl7.org/fhir/medicationadministration/search#status","type":"token","documentation":"MedicationAdministration event status (for example one of active/paused/completed/nullified)","xpath":"MedicationAdministration.status"},{"name":"prescription","source":"http://hl7.org/fhir/medicationadministration/search#prescription","type":"reference","documentation":"The identity of a prescription to list administrations from","xpath":"MedicationAdministration.prescription"},{"name":"device","source":"http://hl7.org/fhir/medicationadministration/search#device","type":"reference","documentation":"Return administrations with this administration device identity","xpath":"MedicationAdministration.device"},{"name":"notgiven","source":"http://hl7.org/fhir/medicationadministration/search#notgiven","type":"token","documentation":"Administrations that were not made","xpath":"MedicationAdministration.wasNotGiven"},{"name":"whengiven","source":"http://hl7.org/fhir/medicationadministration/search#whengiven","type":"date","documentation":"Date of administration","xpath":"MedicationAdministration.whenGiven"},{"name":"encounter","source":"http://hl7.org/fhir/medicationadministration/search#encounter","type":"reference","documentation":"Return administrations that share this encounter","xpath":"MedicationAdministration.encounter"},{"name":"identifier","source":"http://hl7.org/fhir/medicationadministration/search#identifier","type":"token","documentation":"Return administrations with this external identity","xpath":"MedicationAdministration.identifier"}]},{"type":"MedicationDispense","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["medication","patient","prescription","responsibleparty","dispenser","destination"],"searchParam":[{"name":"medication","source":"http://hl7.org/fhir/medicationdispense/search#medication","type":"reference","documentation":"Returns dispenses of this medicine","xpath":"MedicationDispense.dispense.medication"},{"name":"patient","source":"http://hl7.org/fhir/medicationdispense/search#patient","type":"reference","documentation":"The identity of a patient to list dispenses for","xpath":"MedicationDispense.patient"},{"name":"_id","source":"http://hl7.org/fhir/medicationdispense/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"status","source":"http://hl7.org/fhir/medicationdispense/search#status","type":"token","documentation":"Status of the dispense","xpath":"MedicationDispense.dispense.status"},{"name":"prescription","source":"http://hl7.org/fhir/medicationdispense/search#prescription","type":"reference","documentation":"The identity of a prescription to list dispenses from","xpath":"MedicationDispense.authorizingPrescription"},{"name":"responsibleparty","source":"http://hl7.org/fhir/medicationdispense/search#responsibleparty","type":"reference","documentation":"Return all dispenses with the specified responsibel party","xpath":"MedicationDispense.substitution.responsibleParty"},{"name":"dispenser","source":"http://hl7.org/fhir/medicationdispense/search#dispenser","type":"reference","documentation":"Return all dispenses performed by a specific indiividual","xpath":"MedicationDispense.dispenser"},{"name":"type","source":"http://hl7.org/fhir/medicationdispense/search#type","type":"token","documentation":"Return all dispenses of a specific type","xpath":"MedicationDispense.dispense.type"},{"name":"identifier","source":"http://hl7.org/fhir/medicationdispense/search#identifier","type":"token","documentation":"Return dispenses with this external identity","xpath":"MedicationDispense.identifier"},{"name":"whenprepared","source":"http://hl7.org/fhir/medicationdispense/search#whenprepared","type":"date","documentation":"Date when medication prepared","xpath":"MedicationDispense.dispense.whenPrepared"},{"name":"whenhandedover","source":"http://hl7.org/fhir/medicationdispense/search#whenhandedover","type":"date","documentation":"Date when medication handed over to patient (outpatient setting), or supplied to ward or clinic (inpatient setting)","xpath":"MedicationDispense.dispense.whenHandedOver"},{"name":"destination","source":"http://hl7.org/fhir/medicationdispense/search#destination","type":"reference","documentation":"Return dispenses that should be sent to a secific destination","xpath":"MedicationDispense.dispense.destination"}]},{"type":"MedicationPrescription","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["medication","patient","encounter"],"searchParam":[{"name":"medication","source":"http://hl7.org/fhir/medicationprescription/search#medication","type":"reference","documentation":"Code for medicine or text in medicine name","xpath":"MedicationPrescription.medication"},{"name":"datewritten","source":"http://hl7.org/fhir/medicationprescription/search#datewritten","type":"date","documentation":"Return prescriptions written on this date","xpath":"MedicationPrescription.dateWritten"},{"name":"patient","source":"http://hl7.org/fhir/medicationprescription/search#patient","type":"reference","documentation":"The identity of a patient to list dispenses for","xpath":"MedicationPrescription.patient"},{"name":"_id","source":"http://hl7.org/fhir/medicationprescription/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"status","source":"http://hl7.org/fhir/medicationprescription/search#status","type":"token","documentation":"Status of the prescription","xpath":"MedicationPrescription.status"},{"name":"encounter","source":"http://hl7.org/fhir/medicationprescription/search#encounter","type":"reference","documentation":"Return prescriptions with this encounter identity","xpath":"MedicationPrescription.encounter"},{"name":"identifier","source":"http://hl7.org/fhir/medicationprescription/search#identifier","type":"token","documentation":"Return prescriptions with this external identity","xpath":"MedicationPrescription.identifier"}]},{"type":"MedicationStatement","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["medication","patient","device"],"searchParam":[{"name":"medication","source":"http://hl7.org/fhir/medicationstatement/search#medication","type":"reference","documentation":"Code for medicine or text in medicine name","xpath":"MedicationStatement.medication"},{"name":"patient","source":"http://hl7.org/fhir/medicationstatement/search#patient","type":"reference","documentation":"The identity of a patient to list administrations for","xpath":"MedicationStatement.patient"},{"name":"_id","source":"http://hl7.org/fhir/medicationstatement/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"device","source":"http://hl7.org/fhir/medicationstatement/search#device","type":"reference","documentation":"Return administrations with this administration device identity","xpath":"MedicationStatement.device"},{"name":"when-given","source":"http://hl7.org/fhir/medicationstatement/search#when-given","type":"date","documentation":"Date of administration","xpath":"MedicationStatement.whenGiven"},{"name":"identifier","source":"http://hl7.org/fhir/medicationstatement/search#identifier","type":"token","documentation":"Return administrations with this external identity","xpath":"MedicationStatement.identifier"}]},{"type":"MessageHeader","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchParam":[{"name":"_id","source":"http://hl7.org/fhir/messageheader/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"}]},{"type":"Observation","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["subject","specimen","performer"],"searchParam":[{"name":"_id","source":"http://hl7.org/fhir/observation/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"status","source":"http://hl7.org/fhir/observation/search#status","type":"token","documentation":"The status of the observation","xpath":"Observation.status"},{"name":"subject","source":"http://hl7.org/fhir/observation/search#subject","type":"reference","documentation":"The subject that the observation is about","xpath":"Observation.subject"},{"name":"specimen","source":"http://hl7.org/fhir/observation/search#specimen","type":"reference","documentation":"Specimen used for this observation","xpath":"Observation.specimen"},{"name":"name","source":"http://hl7.org/fhir/observation/search#name","type":"token","documentation":"The name of the observation type","xpath":"Observation.name"},{"name":"reliability","source":"http://hl7.org/fhir/observation/search#reliability","type":"token","documentation":"The reliability of the observation","xpath":"Observation.reliability"},{"name":"value","source":"http://hl7.org/fhir/observation/search#value","type":"token","documentation":"The code or value of a result","xpath":"Observation.value[x]"},{"name":"performer","source":"http://hl7.org/fhir/observation/search#performer","type":"reference","documentation":"Who/what performed the observation","xpath":"Observation.performer"},{"name":"name-value","source":"http://hl7.org/fhir/observation/search#name-value","type":"composite","documentation":"Both name and value"},{"name":"date","source":"http://hl7.org/fhir/observation/search#date","type":"date","documentation":"Obtained date/time. If the obtained element is a period, a date that falls in the period","xpath":"Observation.applies[x]"}]},{"type":"OperationOutcome","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchParam":[{"name":"_id","source":"http://hl7.org/fhir/operationoutcome/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"}]},{"type":"Order","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["authority","detail","source","subject","target"],"searchParam":[{"name":"authority","source":"http://hl7.org/fhir/order/search#authority","type":"reference","documentation":"If required by policy","xpath":"Order.authority"},{"name":"detail","source":"http://hl7.org/fhir/order/search#detail","type":"reference","documentation":"What action is being ordered","xpath":"Order.detail"},{"name":"source","source":"http://hl7.org/fhir/order/search#source","type":"reference","documentation":"Who initiated the order","xpath":"Order.source"},{"name":"_id","source":"http://hl7.org/fhir/order/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"subject","source":"http://hl7.org/fhir/order/search#subject","type":"reference","documentation":"Patient this order is about","xpath":"Order.subject"},{"name":"when","source":"http://hl7.org/fhir/order/search#when","type":"date","documentation":"A formal schedule","xpath":"Order.when.schedule"},{"name":"target","source":"http://hl7.org/fhir/order/search#target","type":"reference","documentation":"Who is intended to fulfill the order","xpath":"Order.target"},{"name":"when_code","source":"http://hl7.org/fhir/order/search#when_code","type":"token","documentation":"Code specifies when request should be done. The code may simply be a priority code","xpath":"Order.when.code"},{"name":"date","source":"http://hl7.org/fhir/order/search#date","type":"date","documentation":"When the order was made","xpath":"Order.date"}]},{"type":"OrderResponse","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["fulfillment","request","who"],"searchParam":[{"name":"_id","source":"http://hl7.org/fhir/orderresponse/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"fulfillment","source":"http://hl7.org/fhir/orderresponse/search#fulfillment","type":"reference","documentation":"Details of the outcome of performing the order","xpath":"OrderResponse.fulfillment"},{"name":"request","source":"http://hl7.org/fhir/orderresponse/search#request","type":"reference","documentation":"The order that this is a response to","xpath":"OrderResponse.request"},{"name":"code","source":"http://hl7.org/fhir/orderresponse/search#code","type":"token","documentation":"pending | review | rejected | error | accepted | cancelled | replaced | aborted | complete","xpath":"OrderResponse.code"},{"name":"date","source":"http://hl7.org/fhir/orderresponse/search#date","type":"date","documentation":"When the response was made","xpath":"OrderResponse.date"},{"name":"who","source":"http://hl7.org/fhir/orderresponse/search#who","type":"reference","documentation":"Who made the response","xpath":"OrderResponse.who"}]},{"type":"Organization","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["partof"],"searchParam":[{"name":"phonetic","source":"http://hl7.org/fhir/organization/search#phonetic","type":"string","documentation":"A portion of the organization's name using some kind of phonetic matching algorithm"},{"name":"partof","source":"http://hl7.org/fhir/organization/search#partof","type":"reference","documentation":"Search all organizations that are part of the given organization","xpath":"Organization.partOf"},{"name":"_id","source":"http://hl7.org/fhir/organization/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"name","source":"http://hl7.org/fhir/organization/search#name","type":"string","documentation":"A portion of the organization's name","xpath":"Organization.name"},{"name":"active","source":"http://hl7.org/fhir/organization/search#active","type":"token","documentation":"Whether the organization's record is active","xpath":"Organization.active"},{"name":"type","source":"http://hl7.org/fhir/organization/search#type","type":"token","documentation":"A code for the type of organization","xpath":"Organization.type"},{"name":"identifier","source":"http://hl7.org/fhir/organization/search#identifier","type":"token","documentation":"Any identifier for the organization (not the accreditation issuer's identifier)","xpath":"Organization.identifier"}]},{"type":"Other","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["subject"],"searchParam":[{"name":"_id","source":"http://hl7.org/fhir/other/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"created","source":"http://hl7.org/fhir/other/search#created","type":"date","documentation":"When created","xpath":"Other.created"},{"name":"subject","source":"http://hl7.org/fhir/other/search#subject","type":"reference","documentation":"Identifies the","xpath":"Other.subject"},{"name":"code","source":"http://hl7.org/fhir/other/search#code","type":"token","documentation":"Kind of Resource","xpath":"Other.code"}]},{"type":"Patient","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["link","provider"],"searchParam":[{"name":"animal-breed","source":"http://hl7.org/fhir/patient/search#animal-breed","type":"token","documentation":"The breed for animal patients","xpath":"Patient.animal.breed"},{"name":"phonetic","source":"http://hl7.org/fhir/patient/search#phonetic","type":"string","documentation":"A portion of either family or given name using some kind of phonetic matching algorithm"},{"name":"link","source":"http://hl7.org/fhir/patient/search#link","type":"reference","documentation":"All patients linked to the given patient","xpath":"Patient.link.other"},{"name":"provider","source":"http://hl7.org/fhir/patient/search#provider","type":"reference","documentation":"The organization at which this person is a patient","xpath":"Patient.managingOrganization"},{"name":"animal-species","source":"http://hl7.org/fhir/patient/search#animal-species","type":"token","documentation":"The species for animal patients","xpath":"Patient.animal.species"},{"name":"_id","source":"http://hl7.org/fhir/patient/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"given","source":"http://hl7.org/fhir/patient/search#given","type":"string","documentation":"A portion of the given name of the patient","xpath":"Patient.name.given"},{"name":"address","source":"http://hl7.org/fhir/patient/search#address","type":"string","documentation":"An address in any kind of address/part of the patient","xpath":"Patient.address"},{"name":"family","source":"http://hl7.org/fhir/patient/search#family","type":"string","documentation":"A portion of the family name of the patient","xpath":"Patient.name.family"},{"name":"name","source":"http://hl7.org/fhir/patient/search#name","type":"string","documentation":"A portion of either family or given name of the patient","xpath":"Patient.name"},{"name":"telecom","source":"http://hl7.org/fhir/patient/search#telecom","type":"string","documentation":"The value in any kind of telecom details of the patient","xpath":"Patient.telecom"},{"name":"birthdate","source":"http://hl7.org/fhir/patient/search#birthdate","type":"date","documentation":"The patient's date of birth","xpath":"Patient.birthDate"},{"name":"active","source":"http://hl7.org/fhir/patient/search#active","type":"token","documentation":"Whether the patient record is active","xpath":"Patient.active"},{"name":"gender","source":"http://hl7.org/fhir/patient/search#gender","type":"token","documentation":"Gender of the patient","xpath":"Patient.gender"},{"name":"language","source":"http://hl7.org/fhir/patient/search#language","type":"token","documentation":"Language code (irrespective of use value)","xpath":"Patient.communication"},{"name":"identifier","source":"http://hl7.org/fhir/patient/search#identifier","type":"token","documentation":"A patient identifier","xpath":"Patient.identifier"}]},{"type":"Practitioner","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["organization"],"searchParam":[{"name":"organization","source":"http://hl7.org/fhir/practitioner/search#organization","type":"reference","documentation":"The identity of the organization the practitioner represents / acts on behalf of","xpath":"Practitioner.organization"},{"name":"phonetic","source":"http://hl7.org/fhir/practitioner/search#phonetic","type":"string","documentation":"A portion of either family or given name using some kind of phonetic matching algorithm","xpath":"Practitioner.name"},{"name":"given","source":"http://hl7.org/fhir/practitioner/search#given","type":"string","documentation":"A portion of the given name","xpath":"Practitioner.name"},{"name":"_id","source":"http://hl7.org/fhir/practitioner/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"address","source":"http://hl7.org/fhir/practitioner/search#address","type":"string","documentation":"An address in any kind of address/part","xpath":"Practitioner.address"},{"name":"family","source":"http://hl7.org/fhir/practitioner/search#family","type":"string","documentation":"A portion of the family name","xpath":"Practitioner.name"},{"name":"name","source":"http://hl7.org/fhir/practitioner/search#name","type":"string","documentation":"A portion of either family or given name","xpath":"Practitioner.name"},{"name":"telecom","source":"http://hl7.org/fhir/practitioner/search#telecom","type":"string","documentation":"The value in any kind of contact","xpath":"Practitioner.telecom"},{"name":"gender","source":"http://hl7.org/fhir/practitioner/search#gender","type":"token","documentation":"Gender of the practitioner","xpath":"Practitioner.gender"},{"name":"identifier","source":"http://hl7.org/fhir/practitioner/search#identifier","type":"token","documentation":"A practitioner's Identifier","xpath":"Practitioner.identifier"}]},{"type":"Procedure","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["subject"],"searchParam":[{"name":"_id","source":"http://hl7.org/fhir/procedure/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"subject","source":"http://hl7.org/fhir/procedure/search#subject","type":"reference","documentation":"The identity of a patient to list procedures for","xpath":"Procedure.subject"},{"name":"date","source":"http://hl7.org/fhir/procedure/search#date","type":"date","documentation":"The date the procedure was performed on","xpath":"Procedure.date"},{"name":"type","source":"http://hl7.org/fhir/procedure/search#type","type":"token","documentation":"Type of procedure","xpath":"Procedure.type"}]},{"type":"Profile","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["valueset"],"searchParam":[{"name":"extension","source":"http://hl7.org/fhir/profile/search#extension","type":"token","documentation":"An extension code (use or definition)","xpath":"Profile.extensionDefn.code"},{"name":"_id","source":"http://hl7.org/fhir/profile/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"valueset","source":"http://hl7.org/fhir/profile/search#valueset","type":"reference","documentation":"A vocabulary binding code","xpath":"Profile.structure.element.definition.binding.reference[x]"},{"name":"status","source":"http://hl7.org/fhir/profile/search#status","type":"token","documentation":"The current status of the profile","xpath":"Profile.status"},{"name":"description","source":"http://hl7.org/fhir/profile/search#description","type":"string","documentation":"Text search in the description of the profile","xpath":"Profile.description"},{"name":"name","source":"http://hl7.org/fhir/profile/search#name","type":"string","documentation":"Name of the profile","xpath":"Profile.name"},{"name":"code","source":"http://hl7.org/fhir/profile/search#code","type":"token","documentation":"A code for the profile in the format uri::code (server may choose to do subsumption)","xpath":"Profile.code"},{"name":"type","source":"http://hl7.org/fhir/profile/search#type","type":"token","documentation":"Type of resource that is constrained in the profile","xpath":"Profile.structure.type"},{"name":"date","source":"http://hl7.org/fhir/profile/search#date","type":"date","documentation":"The profile publication date","xpath":"Profile.date"},{"name":"identifier","source":"http://hl7.org/fhir/profile/search#identifier","type":"token","documentation":"The identifier of the profile","xpath":"Profile.identifier"},{"name":"publisher","source":"http://hl7.org/fhir/profile/search#publisher","type":"string","documentation":"Name of the publisher of the profile","xpath":"Profile.publisher"},{"name":"version","source":"http://hl7.org/fhir/profile/search#version","type":"token","documentation":"The version identifier of the profile","xpath":"Profile.version"}]},{"type":"Provenance","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["location","target"],"searchParam":[{"name":"_id","source":"http://hl7.org/fhir/provenance/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"location","source":"http://hl7.org/fhir/provenance/search#location","type":"reference","documentation":"Where the activity occurred, if relevant","xpath":"Provenance.location"},{"name":"start","source":"http://hl7.org/fhir/provenance/search#start","type":"date","documentation":"Starting time with inclusive boundary","xpath":"Provenance.period.start"},{"name":"partytype","source":"http://hl7.org/fhir/provenance/search#partytype","type":"token","documentation":"e.g. Resource | Person | Application | Record | Document +","xpath":"Provenance.agent.type"},{"name":"target","source":"http://hl7.org/fhir/provenance/search#target","type":"reference","documentation":"Target resource(s) (usually version specific)","xpath":"Provenance.target"},{"name":"party","source":"http://hl7.org/fhir/provenance/search#party","type":"token","documentation":"Identity of agent (urn or url)","xpath":"Provenance.agent.reference"},{"name":"end","source":"http://hl7.org/fhir/provenance/search#end","type":"date","documentation":"End time with inclusive boundary, if not ongoing","xpath":"Provenance.period.end"}]},{"type":"Query","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchParam":[{"name":"response","source":"http://hl7.org/fhir/query/search#response","type":"token","documentation":"Links response to source query","xpath":"Query.response.identifier"},{"name":"_id","source":"http://hl7.org/fhir/query/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"identifier","source":"http://hl7.org/fhir/query/search#identifier","type":"token","documentation":"Links query and its response(s)","xpath":"Query.identifier"}]},{"type":"Questionnaire","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["author","subject","encounter"],"searchParam":[{"name":"author","source":"http://hl7.org/fhir/questionnaire/search#author","type":"reference","documentation":"The author of the questionnaire","xpath":"Questionnaire.author"},{"name":"authored","source":"http://hl7.org/fhir/questionnaire/search#authored","type":"date","documentation":"When the questionnaire was authored","xpath":"Questionnaire.authored"},{"name":"_id","source":"http://hl7.org/fhir/questionnaire/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"status","source":"http://hl7.org/fhir/questionnaire/search#status","type":"token","documentation":"The status of the questionnaire","xpath":"Questionnaire.status"},{"name":"subject","source":"http://hl7.org/fhir/questionnaire/search#subject","type":"reference","documentation":"The subject of the questionnaire","xpath":"Questionnaire.subject"},{"name":"name","source":"http://hl7.org/fhir/questionnaire/search#name","type":"token","documentation":"Name of the questionnaire","xpath":"Questionnaire.name"},{"name":"encounter","source":"http://hl7.org/fhir/questionnaire/search#encounter","type":"reference","documentation":"Encounter during which questionnaire was authored","xpath":"Questionnaire.encounter"},{"name":"identifier","source":"http://hl7.org/fhir/questionnaire/search#identifier","type":"token","documentation":"An identifier for the questionnaire","xpath":"Questionnaire.identifier"}]},{"type":"RelatedPerson","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["patient"],"searchParam":[{"name":"patient","source":"http://hl7.org/fhir/relatedperson/search#patient","type":"reference","documentation":"The patient this person is related to","xpath":"RelatedPerson.patient"},{"name":"phonetic","source":"http://hl7.org/fhir/relatedperson/search#phonetic","type":"string","documentation":"A portion of name using some kind of phonetic matching algorithm"},{"name":"_id","source":"http://hl7.org/fhir/relatedperson/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"address","source":"http://hl7.org/fhir/relatedperson/search#address","type":"string","documentation":"An address in any kind of address/part","xpath":"RelatedPerson.address"},{"name":"name","source":"http://hl7.org/fhir/relatedperson/search#name","type":"string","documentation":"A portion of name in any name part","xpath":"RelatedPerson.name"},{"name":"telecom","source":"http://hl7.org/fhir/relatedperson/search#telecom","type":"string","documentation":"The value in any kind of contact","xpath":"RelatedPerson.telecom"},{"name":"gender","source":"http://hl7.org/fhir/relatedperson/search#gender","type":"token","documentation":"Gender of the person","xpath":"RelatedPerson.gender"},{"name":"identifier","source":"http://hl7.org/fhir/relatedperson/search#identifier","type":"token","documentation":"A patient Identifier","xpath":"RelatedPerson.identifier"}]},{"type":"SecurityEvent","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["reference"],"searchParam":[{"name":"site","source":"http://hl7.org/fhir/securityevent/search#site","type":"token","documentation":"Logical source location within the enterprise","xpath":"SecurityEvent.source.site"},{"name":"desc","source":"http://hl7.org/fhir/securityevent/search#desc","type":"string","documentation":"Instance-specific descriptor for Object","xpath":"SecurityEvent.object.name"},{"name":"type","source":"http://hl7.org/fhir/securityevent/search#type","type":"token","documentation":"Type/identifier of event","xpath":"SecurityEvent.event.type"},{"name":"date","source":"http://hl7.org/fhir/securityevent/search#date","type":"date","documentation":"Time when the event occurred on source","xpath":"SecurityEvent.event.dateTime"},{"name":"reference","source":"http://hl7.org/fhir/securityevent/search#reference","type":"reference","documentation":"Specific instance of resource (e.g. versioned)","xpath":"SecurityEvent.object.reference"},{"name":"identity","source":"http://hl7.org/fhir/securityevent/search#identity","type":"token","documentation":"Specific instance of object (e.g. versioned)","xpath":"SecurityEvent.object.identifier"},{"name":"altid","source":"http://hl7.org/fhir/securityevent/search#altid","type":"token","documentation":"Alternative User id e.g. authentication","xpath":"SecurityEvent.participant.altId"},{"name":"patientid","source":"http://hl7.org/fhir/securityevent/search#patientid","type":"token","documentation":"The id of the patient (one of multiple kinds of participations)"},{"name":"_id","source":"http://hl7.org/fhir/securityevent/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"source","source":"http://hl7.org/fhir/securityevent/search#source","type":"token","documentation":"The id of source where event originated","xpath":"SecurityEvent.source.identifier"},{"name":"address","source":"http://hl7.org/fhir/securityevent/search#address","type":"token","documentation":"Identifier for the network access point of the user device","xpath":"SecurityEvent.participant.network.identifier"},{"name":"subtype","source":"http://hl7.org/fhir/securityevent/search#subtype","type":"token","documentation":"More specific type/id for the event","xpath":"SecurityEvent.event.subtype"},{"name":"name","source":"http://hl7.org/fhir/securityevent/search#name","type":"string","documentation":"Human-meaningful name for the user","xpath":"SecurityEvent.participant.name"},{"name":"action","source":"http://hl7.org/fhir/securityevent/search#action","type":"token","documentation":"Type of action performed during the event","xpath":"SecurityEvent.event.action"},{"name":"object-type","source":"http://hl7.org/fhir/securityevent/search#object-type","type":"token","documentation":"Object type being audited","xpath":"SecurityEvent.object.type"},{"name":"user","source":"http://hl7.org/fhir/securityevent/search#user","type":"token","documentation":"Unique identifier for the user","xpath":"SecurityEvent.participant.userId"}]},{"type":"Slot","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["availability"],"searchParam":[{"name":"_id","source":"http://hl7.org/fhir/slot/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"start","source":"http://hl7.org/fhir/slot/search#start","type":"date","documentation":"Appointment date/time.","xpath":"Slot.start"},{"name":"slottype","source":"http://hl7.org/fhir/slot/search#slottype","type":"token","documentation":"The type of appointments that can be booked into the slot","xpath":"Slot.type"},{"name":"fbtype","source":"http://hl7.org/fhir/slot/search#fbtype","type":"token","documentation":"The free/busy status of the appointment","xpath":"Slot.freeBusyType"},{"name":"availability","source":"http://hl7.org/fhir/slot/search#availability","type":"reference","documentation":"The Availability Resource that we are seeking a slot within","xpath":"Slot.availability"}]},{"type":"Specimen","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["subject"],"searchParam":[{"name":"_id","source":"http://hl7.org/fhir/specimen/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"subject","source":"http://hl7.org/fhir/specimen/search#subject","type":"reference","documentation":"The subject of the specimen","xpath":"Specimen.subject"}]},{"type":"Substance","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["substance"],"searchParam":[{"name":"substance","source":"http://hl7.org/fhir/substance/search#substance","type":"reference","documentation":"A component of the substance","xpath":"Substance.ingredient.substance"},{"name":"_id","source":"http://hl7.org/fhir/substance/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"quantity","source":"http://hl7.org/fhir/substance/search#quantity","type":"number","documentation":"Amount of substance in the package","xpath":"Substance.instance.quantity"},{"name":"type","source":"http://hl7.org/fhir/substance/search#type","type":"token","documentation":"The type of the substance","xpath":"Substance.type"},{"name":"identifier","source":"http://hl7.org/fhir/substance/search#identifier","type":"token","documentation":"Identifier of the package/container","xpath":"Substance.instance.identifier"},{"name":"expiry","source":"http://hl7.org/fhir/substance/search#expiry","type":"date","documentation":"When no longer valid to use","xpath":"Substance.instance.expiry"}]},{"type":"Supply","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchInclude":["patient","supplier"],"searchParam":[{"name":"patient","source":"http://hl7.org/fhir/supply/search#patient","type":"reference","documentation":"Patient for whom the item is supplied","xpath":"Supply.patient"},{"name":"_id","source":"http://hl7.org/fhir/supply/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"status","source":"http://hl7.org/fhir/supply/search#status","type":"token","documentation":"requested | dispensed | received | failed | cancelled","xpath":"Supply.status"},{"name":"dispenseid","source":"http://hl7.org/fhir/supply/search#dispenseid","type":"token","documentation":"External identifier","xpath":"Supply.dispense.identifier"},{"name":"identifier","source":"http://hl7.org/fhir/supply/search#identifier","type":"token","documentation":"Unique identifier","xpath":"Supply.identifier"},{"name":"supplier","source":"http://hl7.org/fhir/supply/search#supplier","type":"reference","documentation":"Dispenser","xpath":"Supply.dispense.supplier"},{"name":"kind","source":"http://hl7.org/fhir/supply/search#kind","type":"token","documentation":"The kind of supply (central, non-stock, etc)","xpath":"Supply.kind"},{"name":"dispensestatus","source":"http://hl7.org/fhir/supply/search#dispensestatus","type":"token","documentation":"in progress | dispensed | abandoned","xpath":"Supply.dispense.status"}]},{"type":"ValueSet","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true,"searchParam":[{"name":"system","source":"http://hl7.org/fhir/valueset/search#system","type":"token","documentation":"The system for any codes defined by this value set","xpath":"ValueSet.define.system"},{"name":"_id","source":"http://hl7.org/fhir/valueset/search#_id","type":"token","documentation":"The logical resource id associated with the resource (must be supported by all servers)"},{"name":"status","source":"http://hl7.org/fhir/valueset/search#status","type":"token","documentation":"The status of the value set","xpath":"ValueSet.status"},{"name":"description","source":"http://hl7.org/fhir/valueset/search#description","type":"string","documentation":"Text search in the description of the value set","xpath":"ValueSet.description"},{"name":"name","source":"http://hl7.org/fhir/valueset/search#name","type":"string","documentation":"The name of the value set","xpath":"ValueSet.name"},{"name":"code","source":"http://hl7.org/fhir/valueset/search#code","type":"token","documentation":"A code defined in the value set","xpath":"ValueSet.define.concept.code"},{"name":"date","source":"http://hl7.org/fhir/valueset/search#date","type":"date","documentation":"The value set publication date","xpath":"ValueSet.date"},{"name":"identifier","source":"http://hl7.org/fhir/valueset/search#identifier","type":"token","documentation":"The identifier of the value set","xpath":"ValueSet.identifier"},{"name":"reference","source":"http://hl7.org/fhir/valueset/search#reference","type":"token","documentation":"A code system included or excluded in the value set or an imported value set","xpath":"ValueSet.compose.include.system"},{"name":"publisher","source":"http://hl7.org/fhir/valueset/search#publisher","type":"string","documentation":"Name of the publisher of the value set","xpath":"ValueSet.publisher"},{"name":"version","source":"http://hl7.org/fhir/valueset/search#version","type":"token","documentation":"The version identifier of the value set","xpath":"ValueSet.version"}]},{"type":"Binary","operation":[{"code":"create"},{"code":"delete"},{"code":"history-instance"},{"code":"history-type"},{"code":"read"},{"code":"search-type"},{"code":"update"},{"code":"validate"},{"code":"vread"}],"readHistory":true}]}]} \ No newline at end of file diff --git a/hapi-fhir-base/src/test/resources/furore-conformance.xml b/hapi-fhir-base/src/test/resources/furore-conformance.xml new file mode 100644 index 00000000000..7dfcfeb73e3 --- /dev/null +++ b/hapi-fhir-base/src/test/resources/furore-conformance.xml @@ -0,0 +1,4893 @@ + + + + +
+

The server supports all operations on the Binary resource, including history

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +