diff --git a/examples/src/main/java/example/GenericClientExample.java b/examples/src/main/java/example/GenericClientExample.java index 8aa03d4af05..1a18b9321f9 100644 --- a/examples/src/main/java/example/GenericClientExample.java +++ b/examples/src/main/java/example/GenericClientExample.java @@ -75,7 +75,7 @@ public class GenericClientExample { // resource, the OperationOutcome response, etc. (assuming that // any of these things were provided by the server! They may not // always be) - IdDt id = outcome.getId(); + IdDt id = (IdDt) outcome.getId(); System.out.println("Got ID: " + id.getValue()); // END SNIPPET: create } @@ -100,7 +100,7 @@ public class GenericClientExample { Boolean created = outcome.getCreated(); // The ID of the created, or the pre-existing resource - IdDt id = outcome.getId(); + IdDt id = (IdDt) outcome.getId(); // END SNIPPET: createConditional } { @@ -149,7 +149,7 @@ public class GenericClientExample { // resource, the OperationOutcome response, etc. (assuming that // any of these things were provided by the server! They may not // always be) - IdDt id = outcome.getId(); + IdDt id = (IdDt) outcome.getId(); System.out.println("Got ID: " + id.getValue()); // END SNIPPET: update } diff --git a/hapi-deployable-pom/pom.xml b/hapi-deployable-pom/pom.xml index 0af7779d6c5..e592c96e03a 100644 --- a/hapi-deployable-pom/pom.xml +++ b/hapi-deployable-pom/pom.xml @@ -1,4 +1,5 @@ - + 4.0.0 @@ -10,9 +11,42 @@ hapi-deployable-pom pom - + HAPI FHIR - Deployable Artifact Parent POM + + + + org.codehaus.mojo + animal-sniffer-maven-plugin + + + check-java-api + test + + check + + + + org.codehaus.mojo.signature + + java16 + 1.1 + + + + + + + org.ow2.asm + asm-all + 5.0.4 + + + + + + diff --git a/hapi-fhir-base-test-mindeps-client/pom.xml b/hapi-fhir-base-test-mindeps-client/pom.xml index 30ee275d8af..662b50ea7f7 100644 --- a/hapi-fhir-base-test-mindeps-client/pom.xml +++ b/hapi-fhir-base-test-mindeps-client/pom.xml @@ -20,10 +20,17 @@ junit ${junit_version} + + + + org.slf4j + slf4j-api + 1.6.0 + org.slf4j slf4j-simple - 1.7.7 + 1.6.0 diff --git a/hapi-fhir-base/.gitignore b/hapi-fhir-base/.gitignore index d4c1bbda97b..e4fe5bd7402 100644 --- a/hapi-fhir-base/.gitignore +++ b/hapi-fhir-base/.gitignore @@ -127,3 +127,5 @@ local.properties # TeXlipse plugin .texlipse +/target/ +/target/ diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/ModelScanner.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/ModelScanner.java index a425da2a4e2..405803b8ae6 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/ModelScanner.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/context/ModelScanner.java @@ -693,7 +693,9 @@ class ModelScanner { resourceDef = new RuntimePrimitiveDatatypeDefinition(theDatatypeDefinition, theClass, isStandardType(theClass)); } myClassToElementDefinitions.put(theClass, resourceDef); - myNameToElementDefinitions.put(resourceName, resourceDef); + if (!theDatatypeDefinition.isSpecialization()) { + myNameToElementDefinitions.put(resourceName, resourceDef); + } return resourceName; } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IFhirVersion.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IFhirVersion.java index fde893ffe86..a07077ceded 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IFhirVersion.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IFhirVersion.java @@ -21,9 +21,11 @@ package ca.uhn.fhir.model.api; */ import java.io.InputStream; +import java.util.Date; import org.hl7.fhir.instance.model.api.IBase; import org.hl7.fhir.instance.model.api.IBaseResource; +import org.hl7.fhir.instance.model.api.IPrimitiveType; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.FhirVersionEnum; @@ -56,4 +58,6 @@ public interface IFhirVersion { IVersionSpecificBundleFactory newBundleFactory(FhirContext theContext); + IPrimitiveType getLastUpdated(IBaseResource theResource); + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/composite/BaseResourceReferenceDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/composite/BaseResourceReferenceDt.java index 0fed60ec504..ae25822568c 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/composite/BaseResourceReferenceDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/composite/BaseResourceReferenceDt.java @@ -30,6 +30,7 @@ import org.apache.http.client.methods.HttpGet; import org.hl7.fhir.instance.model.api.IBaseDatatype; import org.hl7.fhir.instance.model.api.IBaseReference; import org.hl7.fhir.instance.model.api.IBaseResource; +import org.hl7.fhir.instance.model.api.IIdType; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.model.api.BaseIdentifiableElement; @@ -56,25 +57,30 @@ public abstract class BaseResourceReferenceDt extends BaseIdentifiableElement im * Constructor * * @param theResource - * The loaded resource itself + * The loaded resource itself */ public BaseResourceReferenceDt(IResource theResource) { myResource = theResource; setReference(theResource.getId()); } + @Override public abstract StringDt getDisplayElement(); public abstract IdDt getReference(); /** - * Gets the actual loaded and parsed resource instance, if it is already present. This method will return the resource instance only if it has previously been loaded using - * {@link #loadResource(IRestfulClient)} or it was contained within the resource containing this resource. + * Gets the actual loaded and parsed resource instance, if it is already present. This method will return the + * resource instance only if it has previously been loaded using {@link #loadResource(IRestfulClient)} or it was + * contained within the resource containing this resource. * - * See the FHIR specification section on contained resources for more information. + * See the FHIR specification section on contained resources for more + * information. * * @see #loadResource(IRestfulClient) */ + @Override public IBaseResource getResource() { return myResource; } @@ -85,8 +91,9 @@ public abstract class BaseResourceReferenceDt extends BaseIdentifiableElement im } /** - * Returns the referenced resource, fetching it if it has not already been loaded. This method invokes the HTTP client to retrieve the resource unless it has already been loaded, or was a - * contained resource in which case it is simply returned. + * Returns the referenced resource, fetching it if it has not already been loaded. This method invokes the + * HTTP client to retrieve the resource unless it has already been loaded, or was a contained resource in which case + * it is simply returned. */ public IBaseResource loadResource(IRestfulClient theClient) throws IOException { if (myResource != null) { @@ -116,7 +123,7 @@ public abstract class BaseResourceReferenceDt extends BaseIdentifiableElement im IParser parser = context.newXmlParser(); Reader responseReader = BaseClient.createReaderFromResponse(response); - myResource = (IResource) parser.parseResource(responseReader); + myResource = parser.parseResource(responseReader); } finally { if (response instanceof CloseableHttpResponse) { @@ -129,6 +136,18 @@ public abstract class BaseResourceReferenceDt extends BaseIdentifiableElement im public abstract BaseResourceReferenceDt setReference(IdDt theReference); + public BaseResourceReferenceDt setReference(IIdType theReference) { + if (theReference instanceof IdDt) { + setReference((IdDt) theReference); + } else if (theReference != null) { + setReference(new IdDt(theReference.getValue())); + } else { + setReference((IdDt) null); + } + return this; + } + + @Override public void setResource(IBaseResource theResource) { myResource = theResource; } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/resource/BaseOperationOutcome.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/resource/BaseOperationOutcome.java index 6dd6974fa4a..f011d4220c3 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/resource/BaseOperationOutcome.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/base/resource/BaseOperationOutcome.java @@ -22,13 +22,15 @@ package ca.uhn.fhir.model.base.resource; import java.util.List; +import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; + import ca.uhn.fhir.model.api.BaseIdentifiableElement; import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.api.IResourceBlock; import ca.uhn.fhir.model.primitive.CodeDt; import ca.uhn.fhir.model.primitive.StringDt; -public interface BaseOperationOutcome extends IResource { +public interface BaseOperationOutcome extends IResource, IBaseOperationOutcome { public abstract BaseIssue addIssue(); diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/BaseParser.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/BaseParser.java index 51756353aca..0065e3e5f5d 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/BaseParser.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/BaseParser.java @@ -54,6 +54,7 @@ import ca.uhn.fhir.context.BaseRuntimeElementDefinition; import ca.uhn.fhir.context.BaseRuntimeElementDefinition.ChildTypeEnum; import ca.uhn.fhir.context.ConfigurationException; import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.context.FhirVersionEnum; import ca.uhn.fhir.context.RuntimeChildChoiceDefinition; import ca.uhn.fhir.context.RuntimeResourceDefinition; import ca.uhn.fhir.model.api.Bundle; @@ -353,6 +354,9 @@ public abstract class BaseParser implements IParser { @Override public Bundle parseBundle(Reader theReader) { + if (myContext.getVersion().getVersion() == FhirVersionEnum.DSTU2_HL7ORG) { + throw new IllegalStateException("Can't parse DSTU1 (Atom) bundle in HL7.org DSTU2 mode. Use parseResource(Bundle.class, foo) instead."); + } return parseBundle(null, theReader); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/annotation/Search.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/annotation/Search.java index 0376e40f6c8..38cdce0bb6a 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/annotation/Search.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/annotation/Search.java @@ -25,7 +25,8 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import ca.uhn.fhir.model.api.IResource; +import org.hl7.fhir.instance.model.api.IBaseResource; + import ca.uhn.fhir.rest.client.api.IBasicClient; import ca.uhn.fhir.rest.client.api.IRestfulClient; import ca.uhn.fhir.rest.server.IDynamicSearchResourceProvider; @@ -77,7 +78,7 @@ public @interface Search { *

*/ // NB: Read, Search (maybe others) share this annotation method, so update the javadocs everywhere - Class type() default IResource.class; + Class type() default IBaseResource.class; /** * This is an experimental option - Use with caution diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/MethodOutcome.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/MethodOutcome.java index 70cf63a0f84..3579a7703ac 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/MethodOutcome.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/MethodOutcome.java @@ -20,13 +20,15 @@ package ca.uhn.fhir.rest.api; * #L% */ -import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; +import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; +import org.hl7.fhir.instance.model.api.IIdType; + import ca.uhn.fhir.model.primitive.IdDt; public class MethodOutcome { - private IdDt myId; - private BaseOperationOutcome myOperationOutcome; + private IIdType myId; + private IBaseOperationOutcome myOperationOutcome; private IdDt myVersionId; private Boolean myCreated; @@ -42,7 +44,7 @@ public class MethodOutcome { * @param theId * The ID of the created/updated resource */ - public MethodOutcome(IdDt theId) { + public MethodOutcome(IIdType theId) { myId = theId; } @@ -70,7 +72,7 @@ public class MethodOutcome { * @param theBaseOperationOutcome * The operation outcome to return with the response (or null for none) */ - public MethodOutcome(IdDt theId, BaseOperationOutcome theBaseOperationOutcome) { + public MethodOutcome(IdDt theId, IBaseOperationOutcome theBaseOperationOutcome) { myId = theId; myOperationOutcome = theBaseOperationOutcome; } @@ -88,7 +90,7 @@ public class MethodOutcome { * If not null, indicates whether the resource was created (as opposed to being updated). This is generally not needed, since the server can assume based on the method being called * whether the result was a creation or an update. However, it can be useful if you are implementing an update method that does a create if the ID doesn't already exist. */ - public MethodOutcome(IdDt theId, BaseOperationOutcome theBaseOperationOutcome, Boolean theCreated) { + public MethodOutcome(IdDt theId, IBaseOperationOutcome theBaseOperationOutcome, Boolean theCreated) { myId = theId; myOperationOutcome = theBaseOperationOutcome; myCreated = theCreated; @@ -107,22 +109,22 @@ public class MethodOutcome { * @deprecated Use the constructor which accepts a single IdDt parameter, and include the logical ID and version ID in that IdDt instance */ @Deprecated - public MethodOutcome(IdDt theId, IdDt theVersionId, BaseOperationOutcome theBaseOperationOutcome) { + public MethodOutcome(IdDt theId, IdDt theVersionId, IBaseOperationOutcome theBaseOperationOutcome) { myId = theId; myVersionId = theVersionId; myOperationOutcome = theBaseOperationOutcome; } - public IdDt getId() { + public IIdType getId() { return myId; } /** - * Returns the {@link BaseOperationOutcome} resource to return to the client or null if none. + * Returns the {@link IBaseOperationOutcome} resource to return to the client or null if none. * * @return This method will return null, unlike many methods in the API. */ - public BaseOperationOutcome getOperationOutcome() { + public IBaseOperationOutcome getOperationOutcome() { return myOperationOutcome; } @@ -167,9 +169,9 @@ public class MethodOutcome { } /** - * Sets the {@link BaseOperationOutcome} resource to return to the client. Set to null (which is the default) if none. + * Sets the {@link IBaseOperationOutcome} resource to return to the client. Set to null (which is the default) if none. */ - public void setOperationOutcome(BaseOperationOutcome theBaseOperationOutcome) { + public void setOperationOutcome(IBaseOperationOutcome theBaseOperationOutcome) { myOperationOutcome = theBaseOperationOutcome; } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/GenericClient.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/GenericClient.java index 495941c3c32..b745ff98b5b 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/GenericClient.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/GenericClient.java @@ -216,9 +216,9 @@ public class GenericClient extends BaseClient implements IGenericClient { return delete(theType, new IdDt(theId)); } - private T doReadOrVRead(final Class theType, IdDt theId, boolean theVRead, ICallable theNotModifiedHandler, String theIfVersionMatches) { + private T doReadOrVRead(final Class theType, IIdType theId, boolean theVRead, ICallable theNotModifiedHandler, String theIfVersionMatches) { String resName = toResourceName(theType); - IdDt id = theId; + IIdType id = theId; if (!id.hasBaseUrl()) { id = new IdDt(resName, id.getIdPart(), id.getVersionIdPart()); } @@ -1289,7 +1289,7 @@ public class GenericClient extends BaseClient implements IGenericClient { @SuppressWarnings({ "rawtypes", "unchecked" }) private class ReadInternal extends BaseClientExecutable implements IRead, IReadTyped, IReadExecutable { - private IdDt myId; + private IIdType myId; private String myIfVersionMatches; private ICallable myNotModifiedHandler; private RuntimeResourceDefinition myType; @@ -1370,7 +1370,7 @@ public class GenericClient extends BaseClient implements IGenericClient { } @Override - public IReadExecutable withId(IdDt theId) { + public IReadExecutable withId(IIdType theId) { Validate.notNull(theId, "The ID can not be null"); Validate.notBlank(theId.getIdPart(), "The ID can not be blank"); myId = theId.toUnqualified(); @@ -1392,7 +1392,7 @@ public class GenericClient extends BaseClient implements IGenericClient { } @Override - public IReadExecutable withUrl(IdDt theUrl) { + public IReadExecutable withUrl(IIdType theUrl) { Validate.notNull(theUrl, "theUrl can not be null"); myId = theUrl; processUrl(); @@ -1434,10 +1434,10 @@ public class GenericClient extends BaseClient implements IGenericClient { private final class ResourceResponseHandler implements IClientResponseHandler { - private IdDt myId; + private IIdType myId; private Class myType; - public ResourceResponseHandler(Class theType, IdDt theId) { + public ResourceResponseHandler(Class theType, IIdType theId) { myType = theType; myId = theId; } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/IGenericClient.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/IGenericClient.java index ebd0e647fb8..780336972a9 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/IGenericClient.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/IGenericClient.java @@ -382,5 +382,6 @@ public interface IGenericClient extends IRestfulClient { */ T vread(Class theType, String theId, String theVersionId); + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/gclient/IReadTyped.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/gclient/IReadTyped.java index 7fb52bb54a0..434057182a4 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/gclient/IReadTyped.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/gclient/IReadTyped.java @@ -21,8 +21,7 @@ package ca.uhn.fhir.rest.gclient; */ import org.hl7.fhir.instance.model.api.IBaseResource; - -import ca.uhn.fhir.model.primitive.IdDt; +import org.hl7.fhir.instance.model.api.IIdType; public interface IReadTyped { @@ -34,11 +33,11 @@ public interface IReadTyped { * Search using an ID. Note that even if theId contains a base URL it will be * ignored in favour of the base url for the given client. If you want to specify * an absolute URL including a base and have that base used instead, use - * {@link #withUrl(IdDt)} + * {@link #withUrl(IIdType)} */ - IReadExecutable withId(IdDt theId); + IReadExecutable withId(IIdType theId); IReadExecutable withUrl(String theUrl); - IReadExecutable withUrl(IdDt theUrl); + IReadExecutable withUrl(IIdType theUrl); } 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 2154d68a1b9..2960211cf4b 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 @@ -35,6 +35,7 @@ import java.util.Set; import java.util.TreeSet; import org.apache.commons.io.IOUtils; +import org.hl7.fhir.instance.model.api.IAnyResource; import org.hl7.fhir.instance.model.api.IBaseResource; import ca.uhn.fhir.context.ConfigurationException; @@ -362,8 +363,8 @@ public abstract class BaseMethodBinding implements IClientResponseHandler return BundleProviders.newEmptyList(); } else if (response instanceof IBundleProvider) { return (IBundleProvider) response; - } else if (response instanceof IResource) { - return BundleProviders.newList((IResource) response); + } else if (response instanceof IBaseResource) { + return BundleProviders.newList((IBaseResource) response); } else if (response instanceof Collection) { List retVal = new ArrayList(); for (Object next : ((Collection) response)) { @@ -427,18 +428,18 @@ public abstract class BaseMethodBinding implements IClientResponseHandler // returns a bundle } else if (Collection.class.isAssignableFrom(returnTypeFromMethod)) { returnTypeFromMethod = ReflectionUtil.getGenericCollectionTypeOfMethodReturnType(theMethod); - if (!verifyIsValidResourceReturnType(returnTypeFromMethod) && !IResource.class.equals(returnTypeFromMethod)) { + if (!verifyIsValidResourceReturnType(returnTypeFromMethod) && !isResourceInterface(returnTypeFromMethod)) { throw new ConfigurationException("Method '" + theMethod.getName() + "' from " + IResourceProvider.class.getSimpleName() + " type " + theMethod.getDeclaringClass().getCanonicalName() + " returns a collection with generic type " + toLogString(returnTypeFromMethod) - + " - Must return a resource type or a collection (List, Set) with a resource type parameter (e.g. List or List )"); + + " - Must return a resource type or a collection (List, Set) with a resource type parameter (e.g. List or List )"); } } else { - if (!IResource.class.equals(returnTypeFromMethod) && !verifyIsValidResourceReturnType(returnTypeFromMethod)) { + if (!isResourceInterface(returnTypeFromMethod) && !verifyIsValidResourceReturnType(returnTypeFromMethod)) { throw new ConfigurationException("Method '" + theMethod.getName() + "' from " + IResourceProvider.class.getSimpleName() + " type " + theMethod.getDeclaringClass().getCanonicalName() + " returns " + toLogString(returnTypeFromMethod) + " - Must return a resource type (eg Patient, " + Bundle.class.getSimpleName() + ", " + IBundleProvider.class.getSimpleName() + ", etc., see the documentation for more details)"); } } - Class returnTypeFromAnnotation = IResource.class; + Class returnTypeFromAnnotation = IBaseResource.class; if (read != null) { returnTypeFromAnnotation = read.type(); } else if (search != null) { @@ -462,7 +463,7 @@ public abstract class BaseMethodBinding implements IClientResponseHandler } if (returnTypeFromRp != null) { - if (returnTypeFromAnnotation != null && returnTypeFromAnnotation != IResource.class) { + if (returnTypeFromAnnotation != null && !isResourceInterface(returnTypeFromAnnotation)) { if (!returnTypeFromRp.isAssignableFrom(returnTypeFromAnnotation)) { throw new ConfigurationException("Method '" + theMethod.getName() + "' in type " + theMethod.getDeclaringClass().getCanonicalName() + " returns type " + returnTypeFromMethod.getCanonicalName() + " - Must return " + returnTypeFromRp.getCanonicalName() + " (or a subclass of it) per IResourceProvider contract"); @@ -476,7 +477,7 @@ public abstract class BaseMethodBinding implements IClientResponseHandler returnType = returnTypeFromRp; } } else { - if (returnTypeFromAnnotation != IResource.class) { + if (!isResourceInterface(returnTypeFromAnnotation)) { if (!verifyIsValidResourceReturnType(returnTypeFromAnnotation)) { throw new ConfigurationException("Method '" + theMethod.getName() + "' from " + IResourceProvider.class.getSimpleName() + " type " + theMethod.getDeclaringClass().getCanonicalName() + " returns " + toLogString(returnTypeFromAnnotation) + " according to annotation - Must return a resource type"); @@ -486,7 +487,7 @@ public abstract class BaseMethodBinding implements IClientResponseHandler // if (IRestfulClient.class.isAssignableFrom(theMethod.getDeclaringClass())) { // Clients don't define their methods in resource specific types, so they can // infer their resource type from the method return type. - returnType = (Class) returnTypeFromMethod; + returnType = (Class) returnTypeFromMethod; // } else { // This is a plain provider method returning a resource, so it should be // an operation or global search presumably @@ -555,6 +556,10 @@ public abstract class BaseMethodBinding implements IClientResponseHandler // return sm; } + private static boolean isResourceInterface(Class theReturnTypeFromMethod) { + return theReturnTypeFromMethod.equals(IBaseResource.class) || theReturnTypeFromMethod.equals(IResource.class) || theReturnTypeFromMethod.equals(IAnyResource.class); + } + private static void populateException(BaseServerResponseException theEx, Reader theResponseReader) { try { String responseText = IOUtils.toString(theResponseReader); 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 6886d35084b..502b32cef43 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 @@ -31,11 +31,11 @@ import java.util.Set; import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang3.StringUtils; +import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; import ca.uhn.fhir.context.ConfigurationException; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.parser.IParser; import ca.uhn.fhir.rest.api.MethodOutcome; @@ -170,7 +170,7 @@ abstract class BaseOutcomeReturningMethodBinding extends BaseMethodBinding= 0; i--) { IServerInterceptor next = theServer.getInterceptors().get(i); boolean continueProcessing = next.outgoingResponse(theRequest, outcome, theRequest.getServletRequest(), theRequest.getServletResponse()); diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseOutcomeReturningMethodBindingWithResourceParam.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseOutcomeReturningMethodBindingWithResourceParam.java index 38a53709529..50090f76885 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseOutcomeReturningMethodBindingWithResourceParam.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseOutcomeReturningMethodBindingWithResourceParam.java @@ -24,10 +24,12 @@ import java.lang.reflect.Method; import java.lang.reflect.Modifier; import org.hl7.fhir.instance.model.api.IBaseResource; +import org.hl7.fhir.instance.model.api.IIdType; import ca.uhn.fhir.context.ConfigurationException; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.model.api.IResource; +import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.rest.annotation.ResourceParam; import ca.uhn.fhir.rest.client.BaseHttpClientInvocation; import ca.uhn.fhir.rest.param.ResourceParameter; @@ -39,7 +41,9 @@ abstract class BaseOutcomeReturningMethodBindingWithResourceParam extends BaseOu private String myResourceName; private int myResourceParameterIndex; private Class myResourceType; + private Class myIdParamType; + @SuppressWarnings("unchecked") public BaseOutcomeReturningMethodBindingWithResourceParam(Method theMethod, FhirContext theContext, Class theMethodAnnotation, Object theProvider) { super(theMethod, theContext, theMethodAnnotation, theProvider); @@ -72,7 +76,10 @@ abstract class BaseOutcomeReturningMethodBindingWithResourceParam extends BaseOu myResourceName = theContext.getResourceDefinition(myResourceType).getName(); myIdParamIndex = MethodUtil.findIdParameterIndex(theMethod); - + if (myIdParamIndex != null) { + myIdParamType = (Class) theMethod.getParameterTypes()[myIdParamIndex]; + } + if (resourceParameter == null) { throw new ConfigurationException("Method " + theMethod.getName() + " in type " + theMethod.getDeclaringClass().getCanonicalName() + " does not have a resource parameter annotated with @" + ResourceParam.class.getSimpleName()); } @@ -82,10 +89,11 @@ abstract class BaseOutcomeReturningMethodBindingWithResourceParam extends BaseOu @Override protected void addParametersForServerRequest(RequestDetails theRequest, Object[] theParams) { if (myIdParamIndex != null) { - theParams[myIdParamIndex] = theRequest.getId(); + theParams[myIdParamIndex] = MethodUtil.convertIdToType(theRequest.getId(), myIdParamType); } } + @Override public String getResourceName() { return myResourceName; 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 757286e83e1..133aa7e4d20 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 @@ -29,6 +29,7 @@ import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -38,6 +39,7 @@ import java.util.Set; import javax.servlet.http.HttpServletResponse; import org.hl7.fhir.instance.model.api.IBaseResource; +import org.hl7.fhir.instance.model.api.IPrimitiveType; import ca.uhn.fhir.context.ConfigurationException; import ca.uhn.fhir.context.FhirContext; @@ -124,17 +126,12 @@ abstract class BaseResourceReturningMethodBinding extends BaseMethodBinding) theReturnResourceType; - myResourceName = resourceDefAnnotation.name(); + myResourceName = theContext.getResourceDefinition(myResourceType).getName(); } } } @@ -309,14 +306,14 @@ abstract class BaseResourceReturningMethodBinding extends BaseMethodBinding lastUpdated; if (resultObj instanceof IBundleProvider) { IBundleProvider result = (IBundleProvider) resultObj; resource = result.getResources(0, 1).get(0); lastUpdated = result.getPublished(); } else { - resource = (IResource) resultObj; - lastUpdated = ResourceMetadataKeyEnum.UPDATED.get((IResource) resource); + resource = (IBaseResource) resultObj; + lastUpdated = theServer.getFhirContext().getVersion().getLastUpdated(resource); } /* 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 e0756f1f535..34eb532ffa8 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 @@ -22,10 +22,11 @@ package ca.uhn.fhir.rest.method; import java.lang.reflect.Method; +import org.hl7.fhir.instance.model.api.IBaseConformance; +import org.hl7.fhir.instance.model.api.IBaseResource; + import ca.uhn.fhir.context.ConfigurationException; import ca.uhn.fhir.context.FhirContext; -import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.base.resource.BaseConformance; import ca.uhn.fhir.model.dstu.valueset.RestfulOperationSystemEnum; import ca.uhn.fhir.model.dstu.valueset.RestfulOperationTypeEnum; import ca.uhn.fhir.model.valueset.BundleTypeEnum; @@ -43,7 +44,9 @@ public class ConformanceMethodBinding extends BaseResourceReturningMethodBinding // if (Modifier.isAbstract(theMethod.getReturnType().getModifiers())) { // throw new ConfigurationException("Conformance resource provider method '" + theMethod.getName() + "' must not be abstract"); // } - if (getMethodReturnType() != MethodReturnTypeEnum.RESOURCE || !BaseConformance.class.isAssignableFrom((Class) theMethod.getGenericReturnType())) { + MethodReturnTypeEnum methodReturnType = getMethodReturnType(); + Class genericReturnType = (Class) theMethod.getGenericReturnType(); + if (methodReturnType != MethodReturnTypeEnum.RESOURCE || !IBaseConformance.class.isAssignableFrom(genericReturnType)) { throw new ConfigurationException("Conformance resource provider method '" + theMethod.getName() + "' should return a Conformance resource class, returns: " + theMethod.getReturnType()); } @@ -70,7 +73,7 @@ public class ConformanceMethodBinding extends BaseResourceReturningMethodBinding @Override public IBundleProvider invokeServer(RequestDetails theRequest, Object[] theMethodParams) throws BaseServerResponseException { - IResource conf = (IResource) invokeServerMethod(theMethodParams); + IBaseResource conf = (IBaseResource) invokeServerMethod(theMethodParams); return new SimpleBundleProvider(conf); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/DynamicSearchMethodBinding.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/DynamicSearchMethodBinding.java index 99e00231182..abbae1da479 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/DynamicSearchMethodBinding.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/DynamicSearchMethodBinding.java @@ -110,7 +110,7 @@ public class DynamicSearchMethodBinding extends BaseResourceReturningMethodBindi @Override public boolean incomingServerRequestMatchesMethod(RequestDetails theRequest) { if (!theRequest.getResourceName().equals(getResourceName())) { - ourLog.trace("Method {} doesn't match because resource name {} != {}", getMethod().getName(), theRequest.getResourceName(), getResourceName()); + ourLog.trace("Method {} doesn't match because resource name {} != {}", new Object[] { getMethod().getName(), theRequest.getResourceName(), getResourceName() } ); return false; } if (theRequest.getId() != null && myIdParamIndex == null) { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/MethodUtil.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/MethodUtil.java index a082c8593e9..d827a6bcdd8 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/MethodUtil.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/MethodUtil.java @@ -127,6 +127,22 @@ public class MethodUtil { } } + + public static IIdType convertIdToType(IIdType value, Class idParamType) { + if (value != null && !idParamType.isAssignableFrom(value.getClass())) { + try { + IIdType newValue = idParamType.newInstance(); + newValue.setValue(value.getValue()); + value = newValue; + } catch (InstantiationException e) { + throw new ConfigurationException("Failed to instantiate " + idParamType, e); + } catch (IllegalAccessException e) { + throw new ConfigurationException("Failed to instantiate " + idParamType, e); + } + } + return value; + } + public static HttpGetClientInvocation createConformanceInvocation() { return new HttpGetClientInvocation("metadata"); } @@ -181,42 +197,6 @@ public class MethodUtil { return retVal; } - public static HttpPutClientInvocation createUpdateInvocation(IBaseResource theResource, String theResourceBody, IIdType theId, FhirContext theContext) { - String resourceName = theContext.getResourceDefinition(theResource).getName(); - StringBuilder urlBuilder = new StringBuilder(); - urlBuilder.append(resourceName); - urlBuilder.append('/'); - urlBuilder.append(theId.getIdPart()); - String urlExtension = urlBuilder.toString(); - - HttpPutClientInvocation retVal; - if (StringUtils.isBlank(theResourceBody)) { - retVal = new HttpPutClientInvocation(theContext, theResource, urlExtension); - } else { - retVal = new HttpPutClientInvocation(theContext, theResourceBody, false, urlExtension); - } - - if (theId.hasVersionIdPart()) { - if (theContext.getVersion().getVersion().isNewerThan(FhirVersionEnum.DSTU1)) { - retVal.addHeader(Constants.HEADER_IF_MATCH, '"' + theId.getVersionIdPart() + '"'); - } else { - String versionId = theId.getVersionIdPart(); - if (StringUtils.isNotBlank(versionId)) { - urlBuilder.append('/'); - urlBuilder.append(Constants.PARAM_HISTORY); - urlBuilder.append('/'); - urlBuilder.append(versionId); - retVal.addHeader(Constants.HEADER_CONTENT_LOCATION, urlBuilder.toString()); - } - } - } - - addTagsToPostOrPut(theContext, theResource, retVal); - // addContentTypeHeaderBasedOnDetectedType(retVal, theResourceBody); - - return retVal; - } - public static HttpPutClientInvocation createUpdateInvocation(FhirContext theContext, IBaseResource theResource, String theResourceBody, Map> theMatchParams) { StringBuilder b = new StringBuilder(); @@ -263,6 +243,42 @@ public class MethodUtil { return retVal; } + public static HttpPutClientInvocation createUpdateInvocation(IBaseResource theResource, String theResourceBody, IIdType theId, FhirContext theContext) { + String resourceName = theContext.getResourceDefinition(theResource).getName(); + StringBuilder urlBuilder = new StringBuilder(); + urlBuilder.append(resourceName); + urlBuilder.append('/'); + urlBuilder.append(theId.getIdPart()); + String urlExtension = urlBuilder.toString(); + + HttpPutClientInvocation retVal; + if (StringUtils.isBlank(theResourceBody)) { + retVal = new HttpPutClientInvocation(theContext, theResource, urlExtension); + } else { + retVal = new HttpPutClientInvocation(theContext, theResourceBody, false, urlExtension); + } + + if (theId.hasVersionIdPart()) { + if (theContext.getVersion().getVersion().isNewerThan(FhirVersionEnum.DSTU1)) { + retVal.addHeader(Constants.HEADER_IF_MATCH, '"' + theId.getVersionIdPart() + '"'); + } else { + String versionId = theId.getVersionIdPart(); + if (StringUtils.isNotBlank(versionId)) { + urlBuilder.append('/'); + urlBuilder.append(Constants.PARAM_HISTORY); + urlBuilder.append('/'); + urlBuilder.append(versionId); + retVal.addHeader(Constants.HEADER_CONTENT_LOCATION, urlBuilder.toString()); + } + } + } + + addTagsToPostOrPut(theContext, theResource, retVal); + // addContentTypeHeaderBasedOnDetectedType(retVal, theResourceBody); + + return retVal; + } + public static EncodingEnum detectEncoding(String theBody) { EncodingEnum retVal = detectEncodingNoDefault(theBody); if (retVal == null) { @@ -299,6 +315,10 @@ public class MethodUtil { } } + public static Integer findConditionalOperationParameterIndex(Method theMethod) { + return MethodUtil.findParamAnnotationIndex(theMethod, ConditionalUrlParam.class); + } + public static Integer findIdParameterIndex(Method theMethod) { return MethodUtil.findParamAnnotationIndex(theMethod, IdParam.class); } @@ -322,10 +342,6 @@ public class MethodUtil { return MethodUtil.findParamAnnotationIndex(theMethod, TagListParam.class); } - public static Integer findConditionalOperationParameterIndex(Method theMethod) { - return MethodUtil.findParamAnnotationIndex(theMethod, ConditionalUrlParam.class); - } - @SuppressWarnings("deprecation") public static Integer findVersionIdParameterIndex(Method theMethod) { return MethodUtil.findParamAnnotationIndex(theMethod, VersionIdParam.class); @@ -447,13 +463,13 @@ public class MethodUtil { } param = new OperationParameter(Constants.EXTOP_VALIDATE, Constants.EXTOP_VALIDATE_MODE, 0, 1).setConverter(new IConverter() { @Override - public Object outgoingClient(Object theObject) { - return new StringDt(((ValidationModeEnum)theObject).name().toLowerCase()); + public Object incomingServer(Object theObject) { + return ValidationModeEnum.valueOf(theObject.toString().toUpperCase()); } @Override - public Object incomingServer(Object theObject) { - return ValidationModeEnum.valueOf(theObject.toString().toUpperCase()); + public Object outgoingClient(Object theObject) { + return new StringDt(((ValidationModeEnum)theObject).name().toLowerCase()); } }); } else if (nextAnnotation instanceof Validate.Profile) { @@ -462,13 +478,13 @@ public class MethodUtil { } param = new OperationParameter(Constants.EXTOP_VALIDATE, Constants.EXTOP_VALIDATE_PROFILE, 0, 1).setConverter(new IConverter() { @Override - public Object outgoingClient(Object theObject) { - return new StringDt(theObject.toString()); + public Object incomingServer(Object theObject) { + return theObject.toString(); } @Override - public Object incomingServer(Object theObject) { - return theObject.toString(); + public Object outgoingClient(Object theObject) { + return new StringDt(theObject.toString()); } }); } else { @@ -492,7 +508,7 @@ public class MethodUtil { return parameters; } - public static void parseClientRequestResourceHeaders(IdDt theRequestedId, Map> theHeaders, IBaseResource resource) { + public static void parseClientRequestResourceHeaders(IIdType theRequestedId, Map> theHeaders, IBaseResource resource) { List lmHeaders = theHeaders.get(Constants.HEADER_LAST_MODIFIED_LOWERCASE); if (lmHeaders != null && lmHeaders.size() > 0 && StringUtils.isNotBlank(lmHeaders.get(0))) { String headerValue = lmHeaders.get(0); 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 986b6070703..f2482e3ac5b 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 @@ -33,6 +33,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBaseBinary; import org.hl7.fhir.instance.model.api.IBaseResource; +import org.hl7.fhir.instance.model.api.IIdType; import ca.uhn.fhir.context.ConfigurationException; import ca.uhn.fhir.context.FhirContext; @@ -60,7 +61,9 @@ public class ReadMethodBinding extends BaseResourceReturningMethodBinding implem private Integer myIdIndex; private boolean mySupportsVersion; private Integer myVersionIdIndex; + private Class myIdParameterType; + @SuppressWarnings("unchecked") public ReadMethodBinding(Class theAnnotatedResourceType, Method theMethod, FhirContext theContext, Object theProvider) { super(theAnnotatedResourceType, theMethod, theContext, theProvider); @@ -69,17 +72,19 @@ public class ReadMethodBinding extends BaseResourceReturningMethodBinding implem Integer idIndex = MethodUtil.findIdParameterIndex(theMethod); Integer versionIdIndex = MethodUtil.findVersionIdParameterIndex(theMethod); + Class[] parameterTypes = theMethod.getParameterTypes(); + mySupportsVersion = theMethod.getAnnotation(Read.class).version(); myIdIndex = idIndex; myVersionIdIndex = versionIdIndex; - if (myIdIndex== null) { + if (myIdIndex == null) { throw new ConfigurationException("@" + Read.class.getSimpleName() + " method " + theMethod.getName() + " on type \"" + theMethod.getDeclaringClass().getName() + "\" does not have a parameter annotated with @" + IdParam.class.getSimpleName()); } - - Class[] parameterTypes = theMethod.getParameterTypes(); - if (!IdDt.class.equals(parameterTypes[myIdIndex])) { - throw new ConfigurationException("ID parameter must be of type: " + IdDt.class.getCanonicalName() + " - Found: " + parameterTypes[myIdIndex]); + myIdParameterType = (Class) parameterTypes[myIdIndex]; + + if (!IIdType.class.isAssignableFrom(myIdParameterType)) { + throw new ConfigurationException("ID parameter must be of type IdDt or IdType - Found: " + myIdParameterType); } if (myVersionIdIndex != null && !IdDt.class.equals(parameterTypes[myVersionIdIndex])) { throw new ConfigurationException("Version ID parameter must be of type: " + IdDt.class.getCanonicalName() + " - Found: " + parameterTypes[myVersionIdIndex]); @@ -173,7 +178,7 @@ public class ReadMethodBinding extends BaseResourceReturningMethodBinding implem @Override public Object invokeClient(String theResponseMimeType, InputStream theResponseReader, int theResponseStatusCode, Map> theHeaders) throws IOException, BaseServerResponseException { byte[] contents = IOUtils.toByteArray(theResponseReader); - + IBaseBinary resource = (IBaseBinary) getContext().getResourceDefinition("Binary").newInstance(); resource.setContentType(theResponseMimeType); resource.setContent(contents); @@ -194,7 +199,7 @@ public class ReadMethodBinding extends BaseResourceReturningMethodBinding implem @Override public IBundleProvider invokeServer(RequestDetails theRequest, Object[] theMethodParams) throws InvalidRequestException, InternalErrorException { - theMethodParams[myIdIndex] = theRequest.getId(); + theMethodParams[myIdIndex] = MethodUtil.convertIdToType(theRequest.getId(), myIdParameterType); if (myVersionIdIndex != null) { theMethodParams[myVersionIdIndex] = new IdDt(theRequest.getId().getVersionIdPart()); } @@ -207,7 +212,7 @@ public class ReadMethodBinding extends BaseResourceReturningMethodBinding implem if (retVal.size() == 1 && StringUtils.isNotBlank(ifNoneMatch)) { List responseResources = retVal.getResources(0, 1); IBaseResource responseResource = responseResources.get(0); - + ifNoneMatch = MethodUtil.parseETagValue(ifNoneMatch); if (responseResource.getIdElement() != null && responseResource.getIdElement().hasVersionIdPart()) { if (responseResource.getIdElement().getVersionIdPart().equals(ifNoneMatch)) { @@ -230,19 +235,19 @@ public class ReadMethodBinding extends BaseResourceReturningMethodBinding implem return mySupportsVersion || myVersionIdIndex != null; } - public static HttpGetClientInvocation createAbsoluteReadInvocation(IdDt theId) { + public static HttpGetClientInvocation createAbsoluteReadInvocation(IIdType theId) { return new HttpGetClientInvocation(theId.toVersionless().getValue()); } - public static HttpGetClientInvocation createAbsoluteVReadInvocation(IdDt theId) { + public static HttpGetClientInvocation createAbsoluteVReadInvocation(IIdType theId) { return new HttpGetClientInvocation(theId.getValue()); } - public static HttpGetClientInvocation createReadInvocation(IdDt theId, String theResourceName) { + public static HttpGetClientInvocation createReadInvocation(IIdType theId, String theResourceName) { return new HttpGetClientInvocation(new IdDt(theResourceName, theId.getIdPart()).getValue()); } - public static HttpGetClientInvocation createVReadInvocation(IdDt theId, String theResourceName) { + public static HttpGetClientInvocation createVReadInvocation(IIdType theId, String theResourceName) { return new HttpGetClientInvocation(new IdDt(theResourceName, theId.getIdPart(), theId.getVersionIdPart()).getValue()); } 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 072224592d6..e4d786df100 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 @@ -150,7 +150,7 @@ public class SearchMethodBinding extends BaseResourceReturningMethodBinding { @Override public boolean incomingServerRequestMatchesMethod(RequestDetails theRequest) { if (!theRequest.getResourceName().equals(getResourceName())) { - ourLog.trace("Method {} doesn't match because resource name {} != {}", getMethod().getName(), theRequest.getResourceName(), getResourceName()); + ourLog.trace("Method {} doesn't match because resource name {} != {}", new Object[] { getMethod().getName(), theRequest.getResourceName(), getResourceName() } ); return false; } if (theRequest.getId() != null && myIdParamIndex == null) { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/BaseQueryParameter.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/BaseQueryParameter.java index 49b72fb358f..accdf2bf860 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/BaseQueryParameter.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/BaseQueryParameter.java @@ -144,7 +144,7 @@ public abstract class BaseQueryParameter implements IParameter { if (paramList.isEmpty()) { - ourLog.debug("No value for parameter '{}' - Qualified names {} and qualifier whitelist {}", getName(), qualified, getQualifierWhitelist()); + ourLog.debug("No value for parameter '{}' - Qualified names {} and qualifier whitelist {}", new Object[] { getName(), qualified, getQualifierWhitelist() } ); if (handlesMissing()) { return parse(theRequest.getServer().getFhirContext(), paramList); diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/Dstu1BundleFactory.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/Dstu1BundleFactory.java index 52a8cea8695..b6262625035 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/Dstu1BundleFactory.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/Dstu1BundleFactory.java @@ -20,9 +20,10 @@ package ca.uhn.fhir.rest.server; * #L% */ -import static org.apache.commons.lang3.StringUtils.isNotBlank; +import static org.apache.commons.lang3.StringUtils.*; import java.util.ArrayList; +import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -32,6 +33,7 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; +import org.hl7.fhir.instance.model.api.IPrimitiveType; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.FhirVersionEnum; @@ -44,7 +46,6 @@ import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum; import ca.uhn.fhir.model.base.composite.BaseResourceReferenceDt; import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; import ca.uhn.fhir.model.primitive.IdDt; -import ca.uhn.fhir.model.primitive.InstantDt; import ca.uhn.fhir.model.valueset.BundleEntrySearchModeEnum; import ca.uhn.fhir.model.valueset.BundleTypeEnum; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; @@ -224,7 +225,7 @@ public class Dstu1BundleFactory implements IVersionSpecificBundleFactory { } @Override - public void addRootPropertiesToBundle(String theAuthor, String theServerBase, String theCompleteUrl, Integer theTotalResults, BundleTypeEnum theBundleType, InstantDt theLastUpdated) { + public void addRootPropertiesToBundle(String theAuthor, String theServerBase, String theCompleteUrl, Integer theTotalResults, BundleTypeEnum theBundleType, IPrimitiveType theLastUpdated) { if (myBundle.getAuthorName().isEmpty()) { myBundle.getAuthorName().setValue(theAuthor); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/IVersionSpecificBundleFactory.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/IVersionSpecificBundleFactory.java index 2a667d9cbc8..a2f7c93b1c5 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/IVersionSpecificBundleFactory.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/IVersionSpecificBundleFactory.java @@ -20,14 +20,15 @@ package ca.uhn.fhir.rest.server; * #L% */ +import java.util.Date; import java.util.List; import java.util.Set; import org.hl7.fhir.instance.model.api.IBaseResource; +import org.hl7.fhir.instance.model.api.IPrimitiveType; import ca.uhn.fhir.model.api.Bundle; import ca.uhn.fhir.model.api.Include; -import ca.uhn.fhir.model.primitive.InstantDt; import ca.uhn.fhir.model.valueset.BundleTypeEnum; /** @@ -38,7 +39,7 @@ public interface IVersionSpecificBundleFactory { void addResourcesToBundle(List theResult, BundleTypeEnum theBundleType, String theServerBase, BundleInclusionRule theBundleInclusionRule, Set theIncludes); - void addRootPropertiesToBundle(String theAuthor, String theServerBase, String theCompleteUrl, Integer theTotalResults, BundleTypeEnum theBundleType, InstantDt theLastUpdated); + void addRootPropertiesToBundle(String theAuthor, String theServerBase, String theCompleteUrl, Integer theTotalResults, BundleTypeEnum theBundleType, IPrimitiveType theLastUpdated); void initializeBundleFromBundleProvider(RestfulServer theServer, IBundleProvider theResult, EncodingEnum theResponseEncoding, String theServerBase, String theCompleteUrl, boolean thePrettyPrint, int theOffset, Integer theCount, String theSearchId, BundleTypeEnum theBundleType, Set theIncludes); diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/interceptor/ExceptionHandlingInterceptor.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/interceptor/ExceptionHandlingInterceptor.java index 277227fa0d8..7434cea37a8 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/interceptor/ExceptionHandlingInterceptor.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/interceptor/ExceptionHandlingInterceptor.java @@ -31,10 +31,10 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang3.exception.ExceptionUtils; +import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; import ca.uhn.fhir.context.FhirContext; -import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; -import ca.uhn.fhir.model.base.resource.BaseOperationOutcome.BaseIssue; +import ca.uhn.fhir.context.RuntimeResourceDefinition; import ca.uhn.fhir.rest.method.RequestDetails; import ca.uhn.fhir.rest.server.Constants; import ca.uhn.fhir.rest.server.RestfulServer; @@ -42,28 +42,16 @@ import ca.uhn.fhir.rest.server.RestfulServer.NarrativeModeEnum; import ca.uhn.fhir.rest.server.RestfulServerUtils; import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; +import ca.uhn.fhir.util.OperationOutcomeUtil; public class ExceptionHandlingInterceptor extends InterceptorAdapter { private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ExceptionHandlingInterceptor.class); private Class[] myReturnStackTracesForExceptionTypes; - /** - * If any server methods throw an exception which extends any of the given exception types, the exception - * stack trace will be returned to the user. This can be useful for helping to diagnose issues, but may - * not be desirable for production situations. - * - * @param theExceptionTypes The exception types for which to return the stack trace to the user. - * @return Returns an instance of this interceptor, to allow for easy method chaining. - */ - public ExceptionHandlingInterceptor setReturnStackTracesForExceptionTypes(Class... theExceptionTypes) { - myReturnStackTracesForExceptionTypes = theExceptionTypes; - return this; - } - @Override public boolean handleException(RequestDetails theRequestDetails, Throwable theException, HttpServletRequest theRequest, HttpServletResponse theResponse) throws ServletException, IOException { - BaseOperationOutcome oo = null; + IBaseOperationOutcome oo = null; int statusCode = Constants.STATUS_HTTP_500_INTERNAL_ERROR; FhirContext ctx = theRequestDetails.getServer().getFhirContext(); @@ -78,34 +66,31 @@ public class ExceptionHandlingInterceptor extends InterceptorAdapter { */ if (oo == null) { try { - oo = (BaseOperationOutcome) ctx.getResourceDefinition("OperationOutcome").getImplementingClass().newInstance(); + RuntimeResourceDefinition ooDef = ctx.getResourceDefinition("OperationOutcome"); + oo = (IBaseOperationOutcome) ooDef.getImplementingClass().newInstance(); + + if (theException instanceof InternalErrorException) { + ourLog.error("Failure during REST processing", theException); + populateDetails(ctx, theException, oo); + } else if (theException instanceof BaseServerResponseException) { + ourLog.warn("Failure during REST processing: {}", theException); + BaseServerResponseException baseServerResponseException = (BaseServerResponseException) theException; + statusCode = baseServerResponseException.getStatusCode(); + populateDetails(ctx, theException, oo); + if (baseServerResponseException.getAdditionalMessages() != null) { + for (String next : baseServerResponseException.getAdditionalMessages()) { + OperationOutcomeUtil.addIssue(ctx, oo, "error", next); + } + } + } else { + ourLog.error("Failure during REST processing: " + theException.toString(), theException); + populateDetails(ctx, theException, oo); + statusCode = Constants.STATUS_HTTP_500_INTERNAL_ERROR; + } } catch (Exception e1) { ourLog.error("Failed to instantiate OperationOutcome resource instance", e1); throw new ServletException("Failed to instantiate OperationOutcome resource instance", e1); } - - BaseIssue issue = oo.addIssue(); - issue.getSeverityElement().setValue("error"); - if (theException instanceof InternalErrorException) { - ourLog.error("Failure during REST processing", theException); - populateDetails(theException, issue); - } else if (theException instanceof BaseServerResponseException) { - ourLog.warn("Failure during REST processing: {}", theException); - BaseServerResponseException baseServerResponseException = (BaseServerResponseException) theException; - statusCode = baseServerResponseException.getStatusCode(); - populateDetails(theException, issue); - if (baseServerResponseException.getAdditionalMessages() != null) { - for (String next : baseServerResponseException.getAdditionalMessages()) { - BaseIssue issue2 = oo.addIssue(); - issue2.getSeverityElement().setValue("error"); - issue2.setDetails(next); - } - } - } else { - ourLog.error("Failure during REST processing: " + theException.toString(), theException); - populateDetails(theException, issue); - statusCode = Constants.STATUS_HTTP_500_INTERNAL_ERROR; - } } else { ourLog.error("Unknown error during processing", theException); } @@ -127,30 +112,44 @@ public class ExceptionHandlingInterceptor extends InterceptorAdapter { boolean requestIsBrowser = RestfulServer.requestIsBrowser(theRequest); String fhirServerBase = theRequestDetails.getFhirServerBase(); - RestfulServerUtils.streamResponseAsResource(theRequestDetails.getServer(), theResponse, oo, RestfulServerUtils.determineResponseEncodingNoDefault(theRequest), true, requestIsBrowser, - NarrativeModeEnum.NORMAL, statusCode, false, fhirServerBase, false); + RestfulServerUtils.streamResponseAsResource(theRequestDetails.getServer(), theResponse, oo, RestfulServerUtils.determineResponseEncodingNoDefault(theRequest), true, requestIsBrowser, NarrativeModeEnum.NORMAL, statusCode, false, fhirServerBase, false); -// theResponse.setStatus(statusCode); -// theRequestDetails.getServer().addHeadersToResponse(theResponse); -// theResponse.setContentType("text/plain"); -// theResponse.setCharacterEncoding("UTF-8"); -// theResponse.getWriter().append(theException.getMessage()); -// theResponse.getWriter().close(); + // theResponse.setStatus(statusCode); + // theRequestDetails.getServer().addHeadersToResponse(theResponse); + // theResponse.setContentType("text/plain"); + // theResponse.setCharacterEncoding("UTF-8"); + // theResponse.getWriter().append(theException.getMessage()); + // theResponse.getWriter().close(); return false; } - private void populateDetails(Throwable theException, BaseIssue issue) { + private void populateDetails(FhirContext theCtx, Throwable theException, IBaseOperationOutcome theOo) { if (myReturnStackTracesForExceptionTypes != null) { for (Class next : myReturnStackTracesForExceptionTypes) { if (next.isAssignableFrom(theException.getClass())) { - issue.getDetailsElement().setValue(theException.getMessage() + "\n\n" + ExceptionUtils.getStackTrace(theException)); + String detailsValue = theException.getMessage() + "\n\n" + ExceptionUtils.getStackTrace(theException); + OperationOutcomeUtil.addIssue(theCtx, theOo, "error", detailsValue); return; } } } - issue.getDetailsElement().setValue(theException.getMessage()); + OperationOutcomeUtil.addIssue(theCtx, theOo, "error", theException.getMessage()); } + /** + * If any server methods throw an exception which extends any of the given exception types, the exception stack trace + * will be returned to the user. This can be useful for helping to diagnose issues, but may not be desirable for + * production situations. + * + * @param theExceptionTypes + * The exception types for which to return the stack trace to the user. + * @return Returns an instance of this interceptor, to allow for easy method chaining. + */ + public ExceptionHandlingInterceptor setReturnStackTracesForExceptionTypes(Class... theExceptionTypes) { + myReturnStackTracesForExceptionTypes = theExceptionTypes; + return this; + } + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/OperationOutcomeUtil.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/OperationOutcomeUtil.java new file mode 100644 index 00000000000..d78595b158f --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/OperationOutcomeUtil.java @@ -0,0 +1,124 @@ +package ca.uhn.fhir.util; + +import static org.apache.commons.lang3.StringUtils.*; + +import java.util.List; + +import org.hl7.fhir.instance.model.api.IBase; +import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.hl7.fhir.instance.model.api.IPrimitiveType; + +import ca.uhn.fhir.context.BaseRuntimeChildDefinition; +import ca.uhn.fhir.context.BaseRuntimeElementCompositeDefinition; +import ca.uhn.fhir.context.BaseRuntimeElementDefinition; +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.context.RuntimeResourceDefinition; +/** + * Utilities for dealing with OperationOutcome resources across various model versions + */ +public class OperationOutcomeUtil { + + /** + * Add an issue to an OperationOutcome + * + * @param theCtx The fhir context + * @param theOperationOutcome The OO resource to add to + * @param theSeverity The severity (e.g. "error") + * @param theDetails The details string + */ + public static void addIssue(FhirContext theCtx, IBaseOperationOutcome theOperationOutcome, String theSeverity, String theDetails) { + IBase issue = createIssue(theCtx, theOperationOutcome); + populateDetails(theCtx, issue, theSeverity, theDetails, null); + } + + /** + * Add an issue to an OperationOutcome + * + * @param theCtx The fhir context + * @param theOperationOutcome The OO resource to add to + * @param theSeverity The severity (e.g. "error") + * @param theDetails The details string + */ + public static void addIssue(FhirContext theCtx, IBaseOperationOutcome theOperationOutcome, String theSeverity, String theDetails, String theLocation) { + IBase issue = createIssue(theCtx, theOperationOutcome); + populateDetails(theCtx, issue, theSeverity, theDetails, theLocation); + } + + private static IBase createIssue(FhirContext theCtx, IBaseResource theOutcome) { + RuntimeResourceDefinition ooDef = theCtx.getResourceDefinition(theOutcome); + BaseRuntimeChildDefinition issueChild = ooDef.getChildByName("issue"); + BaseRuntimeElementCompositeDefinition issueElement = (BaseRuntimeElementCompositeDefinition) issueChild.getChildByName("issue"); + + IBase issue = issueElement.newInstance(); + issueChild.getMutator().addValue(theOutcome, issue); + return issue; + } + + private static void populateDetails(FhirContext theCtx, IBase theIssue, String theSeverity, String theDetails, String theLocation) { + BaseRuntimeElementCompositeDefinition issueElement = (BaseRuntimeElementCompositeDefinition) theCtx.getElementDefinition(theIssue.getClass()); + BaseRuntimeChildDefinition detailsChild = issueElement.getChildByName("details"); + BaseRuntimeElementDefinition stringDef = theCtx.getElementDefinition("string"); + BaseRuntimeChildDefinition severityChild = issueElement.getChildByName("severity"); + BaseRuntimeChildDefinition locationChild = issueElement.getChildByName("location"); + + IPrimitiveType severityElem = (IPrimitiveType) severityChild.getChildByName("severity").newInstance(severityChild.getInstanceConstructorArguments()); + severityElem.setValueAsString(theSeverity); + severityChild.getMutator().addValue(theIssue, severityElem); + + IPrimitiveType string = (IPrimitiveType) stringDef.newInstance(); + string.setValueAsString(theDetails); + detailsChild.getMutator().setValue(theIssue, string); + + if (isNotBlank(theLocation)) { + IPrimitiveType locationElem = (IPrimitiveType) locationChild.getChildByName("location").newInstance(locationChild.getInstanceConstructorArguments()); + locationElem.setValueAsString(theLocation); + locationChild.getMutator().addValue(theIssue, locationElem); + } + } + + /** + * Returns true if the given OperationOutcome has 1 or more Operation.issue repetitions + */ + public static boolean hasIssues(FhirContext theCtx, IBaseOperationOutcome theOutcome) { + if (theOutcome == null) { + return false; + } + RuntimeResourceDefinition ooDef = theCtx.getResourceDefinition(theOutcome); + BaseRuntimeChildDefinition issueChild = ooDef.getChildByName("issue"); + return issueChild.getAccessor().getValues(theOutcome).size() > 0; + } + + public static String getFirstIssueDetails(FhirContext theCtx, IBaseOperationOutcome theOutcome) { + return getFirstIssueStringPart(theCtx, theOutcome, "details"); + } + + public static String getFirstIssueLocation(FhirContext theCtx, IBaseOperationOutcome theOutcome) { + return getFirstIssueStringPart(theCtx, theOutcome, "location"); + } + + private static String getFirstIssueStringPart(FhirContext theCtx, IBaseOperationOutcome theOutcome, String name) { + if (theOutcome == null) { + return null; + } + + RuntimeResourceDefinition ooDef = theCtx.getResourceDefinition(theOutcome); + BaseRuntimeChildDefinition issueChild = ooDef.getChildByName("issue"); + + List issues = issueChild.getAccessor().getValues(theOutcome); + if (issues.isEmpty()) { + return null; + } + + IBase issue = issues.get(0); + BaseRuntimeElementCompositeDefinition issueElement = (BaseRuntimeElementCompositeDefinition) theCtx.getElementDefinition(issue.getClass()); + BaseRuntimeChildDefinition detailsChild = issueElement.getChildByName(name); + + List details = detailsChild.getAccessor().getValues(issue); + if (details.isEmpty()) { + return null; + } + return ((IPrimitiveType)details.get(0)).getValueAsString(); + } + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/XmlUtil.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/XmlUtil.java index 4e33ecf8df3..1dd29588b6a 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/XmlUtil.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/XmlUtil.java @@ -1656,7 +1656,7 @@ public class XmlUtil { version = attrs.getValue(BUNDLE_VERSION); } if (ourLog.isDebugEnabled()) { - ourLog.debug("FHIR XML procesing will use StAX implementation at {}\n Title: {}\n Symbolic name: {}\n Vendor: {}\n Version: {}", rootUrl, title, symbolicName, vendor, version); + ourLog.debug("FHIR XML procesing will use StAX implementation at {}\n Title: {}\n Symbolic name: {}\n Vendor: {}\n Version: {}", new Object[] { rootUrl, title, symbolicName, vendor, version } ); } else { ourLog.info("FHIR XML procesing will use StAX implementation '{}' version '{}'", title, version); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/FhirValidator.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/FhirValidator.java index 3140dfa49a0..c8ee78032ec 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/FhirValidator.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/FhirValidator.java @@ -25,12 +25,13 @@ import java.util.Iterator; import java.util.List; import org.apache.commons.lang3.Validate; +import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; import org.hl7.fhir.instance.model.api.IBaseResource; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.model.api.Bundle; import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; +import ca.uhn.fhir.util.OperationOutcomeUtil; /** * Resource validator, which checks resources for compliance against various validation schemes (schemas, schematrons, etc.) @@ -148,9 +149,9 @@ public class FhirValidator { next.validateBundle(ctx); } - BaseOperationOutcome oo = ctx.getOperationOutcome(); - if (oo != null && oo.getIssue().size() > 0) { - throw new ValidationFailureException(oo); + IBaseOperationOutcome oo = ctx.getOperationOutcome(); + if (oo != null && OperationOutcomeUtil.hasIssues(myContext, oo)) { + throw new ValidationFailureException(myContext, oo); } } @@ -168,7 +169,7 @@ public class FhirValidator { public void validate(IResource theResource) throws ValidationFailureException { ValidationResult validationResult = validateWithResult(theResource); if (!validationResult.isSuccessful()) { - throw new ValidationFailureException(validationResult.getOperationOutcome()); + throw new ValidationFailureException(myContext, validationResult.getOperationOutcome()); } } @@ -189,8 +190,8 @@ public class FhirValidator { next.validateBundle(ctx); } - BaseOperationOutcome oo = ctx.getOperationOutcome(); - return ValidationResult.valueOf(oo); + IBaseOperationOutcome oo = ctx.getOperationOutcome(); + return ValidationResult.valueOf(myContext, oo); } /** @@ -209,7 +210,7 @@ public class FhirValidator { next.validateResource(ctx); } - BaseOperationOutcome oo = ctx.getOperationOutcome(); - return ValidationResult.valueOf(oo); + IBaseOperationOutcome oo = ctx.getOperationOutcome(); + return ValidationResult.valueOf(myContext, oo); } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/SchemaBaseValidator.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/SchemaBaseValidator.java index b7a44db9bba..e2cf184bfe0 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/SchemaBaseValidator.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/SchemaBaseValidator.java @@ -51,6 +51,7 @@ import ca.uhn.fhir.context.FhirVersionEnum; import ca.uhn.fhir.model.api.Bundle; import ca.uhn.fhir.model.base.resource.BaseOperationOutcome.BaseIssue; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; +import ca.uhn.fhir.util.OperationOutcomeUtil; class SchemaBaseValidator implements IValidator { private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(SchemaBaseValidator.class); @@ -85,7 +86,8 @@ class SchemaBaseValidator implements IValidator { validator.setErrorHandler(handler); String encodedResource = theContext.getXmlEncodedResource(); - // ourLog.info(new FhirContext().newXmlParser().setPrettyPrint(true).encodeBundleToString((Bundle) theContext.getResource())); + // ourLog.info(new FhirContext().newXmlParser().setPrettyPrint(true).encodeBundleToString((Bundle) + // theContext.getResource())); validator.validate(new StreamSource(new StringReader(encodedResource))); } catch (SAXException e) { @@ -123,25 +125,25 @@ class SchemaBaseValidator implements IValidator { private Source loadXml(String theVersion, String theSystemId, String theSchemaName) { String pathToBase = myCtx.getVersion().getPathToSchemaDefinitions() + '/' + theSchemaName; ourLog.debug("Going to load resource: {}", pathToBase); - InputStream baseIs = FhirValidator.class.getClassLoader().getResourceAsStream(pathToBase); + InputStream baseIs = FhirValidator.class.getResourceAsStream(pathToBase); if (baseIs == null) { throw new InternalErrorException("No FHIR-BASE schema found"); } - baseIs = new BOMInputStream(baseIs, false); - InputStreamReader baseReader = new InputStreamReader(baseIs, Charset.forName("UTF-8")); - Source baseSource = new StreamSource(baseReader, theSystemId); + baseIs = new BOMInputStream(baseIs, false); + InputStreamReader baseReader = new InputStreamReader(baseIs, Charset.forName("UTF-8")); + Source baseSource = new StreamSource(baseReader, theSystemId); -// String schema; -// try { -// schema = IOUtils.toString(baseIs, Charset.forName("UTF-8")); -// } catch (IOException e) { -// throw new InternalErrorException(e); -// } -// -// ourLog.info("Schema is:\n{}", schema); -// -// Source baseSource = new StreamSource(new StringReader(schema), theSystemId); -// Source baseSource = new StreamSource(baseIs, theSystemId); + // String schema; + // try { + // schema = IOUtils.toString(baseIs, Charset.forName("UTF-8")); + // } catch (IOException e) { + // throw new InternalErrorException(e); + // } + // + // ourLog.info("Schema is:\n{}", schema); + // + // Source baseSource = new StreamSource(new StringReader(schema), theSystemId); + // Source baseSource = new StreamSource(baseIs, theSystemId); return baseSource; } @@ -167,11 +169,10 @@ class SchemaBaseValidator implements IValidator { myContext = theContext; } - private void addIssue(SAXParseException theException, String severity) { - BaseIssue issue = myContext.getOperationOutcome().addIssue(); - issue.getSeverityElement().setValue(severity); - issue.getDetailsElement().setValue(theException.getLocalizedMessage()); - issue.addLocation("Line[" + theException.getLineNumber() + "] Col[" + theException.getColumnNumber() + "]"); + private void addIssue(SAXParseException theException, String theSeverity) { + String details = theException.getLocalizedMessage(); + String location = "Line[" + theException.getLineNumber() + "] Col[" + theException.getColumnNumber() + "]"; + OperationOutcomeUtil.addIssue(myContext.getFhirContext(), myContext.getOperationOutcome(), theSeverity, details, location); } @Override @@ -205,12 +206,12 @@ class SchemaBaseValidator implements IValidator { input.setPublicId(thePublicId); input.setSystemId(theSystemId); input.setBaseURI(theBaseURI); -// String pathToBase = "ca/uhn/fhir/model/" + myVersion + "/schema/" + theSystemId; + // String pathToBase = "ca/uhn/fhir/model/" + myVersion + "/schema/" + theSystemId; String pathToBase = myCtx.getVersion().getPathToSchemaDefinitions() + '/' + theSystemId; ourLog.debug("Loading referenced schema file: " + pathToBase); - InputStream baseIs = FhirValidator.class.getClassLoader().getResourceAsStream(pathToBase); + InputStream baseIs = FhirValidator.class.getResourceAsStream(pathToBase); if (baseIs == null) { throw new InternalErrorException("Schema file not found: " + pathToBase); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/SchematronBaseValidator.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/SchematronBaseValidator.java index 099de60884f..98f5dd41575 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/SchematronBaseValidator.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/SchematronBaseValidator.java @@ -34,8 +34,8 @@ import org.oclc.purl.dsdl.svrl.SchematronOutputType; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.model.api.Bundle; import ca.uhn.fhir.model.api.BundleEntry; -import ca.uhn.fhir.model.base.resource.BaseOperationOutcome.BaseIssue; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; +import ca.uhn.fhir.util.OperationOutcomeUtil; import com.phloc.commons.error.IResourceError; import com.phloc.commons.error.IResourceErrorGroup; @@ -70,23 +70,25 @@ public class SchematronBaseValidator implements IValidator { } for (IResourceError next : errors.getAllErrors().getAllResourceErrors()) { - BaseIssue issue = theCtx.getOperationOutcome().addIssue(); + String severity; switch (next.getErrorLevel()) { case ERROR: - issue.getSeverityElement().setValue("error"); + severity = ("error"); break; case FATAL_ERROR: - issue.getSeverityElement().setValue("fatal"); + severity = ("fatal"); break; case WARN: - issue.getSeverityElement().setValue("warning"); + severity = ("warning"); break; case INFO: case SUCCESS: + default: continue; } - issue.getDetailsElement().setValue(next.getAsString(Locale.getDefault())); + String details = next.getAsString(Locale.getDefault()); + OperationOutcomeUtil.addIssue(myCtx, theCtx.getOperationOutcome(), severity, details); } } @@ -107,7 +109,7 @@ public class SchematronBaseValidator implements IValidator { String pathToBase = myCtx.getVersion().getPathToSchemaDefinitions() + '/' + theCtx.getFhirContext().getResourceDefinition(theCtx.getResource()).getBaseDefinition().getName().toLowerCase() + ".sch"; - InputStream baseIs = FhirValidator.class.getClassLoader().getResourceAsStream(pathToBase); + InputStream baseIs = FhirValidator.class.getResourceAsStream(pathToBase); if (baseIs == null) { throw new InternalErrorException("No schematron found for resource type: " + theCtx.getFhirContext().getResourceDefinition(theCtx.getResource()).getBaseDefinition().getImplementingClass().getCanonicalName()); diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/ValidationContext.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/ValidationContext.java index 2fa91486b74..5fa2efd43b0 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/ValidationContext.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/ValidationContext.java @@ -20,18 +20,18 @@ package ca.uhn.fhir.validation; * #L% */ +import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; import org.hl7.fhir.instance.model.api.IBaseResource; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.model.api.Bundle; -import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; class ValidationContext { private final IEncoder myEncoder; private final FhirContext myFhirContext; - private BaseOperationOutcome myOperationOutcome; + private IBaseOperationOutcome myOperationOutcome; private final T myResource; private String myXmlEncodedResource; private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ValidationContext.class); @@ -45,10 +45,10 @@ private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger return myFhirContext; } - public BaseOperationOutcome getOperationOutcome() { + public IBaseOperationOutcome getOperationOutcome() { if (myOperationOutcome == null) { try { - myOperationOutcome = (BaseOperationOutcome) myFhirContext.getResourceDefinition("OperationOutcome").getImplementingClass().newInstance(); + myOperationOutcome = (IBaseOperationOutcome) myFhirContext.getResourceDefinition("OperationOutcome").getImplementingClass().newInstance(); } catch (Exception e1) { ourLog.error("Failed to instantiate OperationOutcome resource instance", e1); throw new InternalErrorException("Failed to instantiate OperationOutcome resource instance", e1); diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/ValidationFailureException.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/ValidationFailureException.java index 47694fb1cc5..e2e483aa016 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/ValidationFailureException.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/ValidationFailureException.java @@ -20,20 +20,23 @@ package ca.uhn.fhir.validation; * #L% */ -import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; +import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.util.OperationOutcomeUtil; public class ValidationFailureException extends RuntimeException { private static final long serialVersionUID = 1L; - private BaseOperationOutcome myOperationOutcome; + private IBaseOperationOutcome myOperationOutcome; // public ValidationFailureException(String theProblem) { // this(theProblem, IssueSeverityEnum.FATAL, null); // } - private static String toDescription(BaseOperationOutcome theOo) { + private static String toDescription(FhirContext theCtx, IBaseOperationOutcome theOo) { StringBuilder b = new StringBuilder(); - b.append(theOo.getIssueFirstRep().getDetailsElement().getValue()); + b.append(OperationOutcomeUtil.getFirstIssueDetails(theCtx, theOo)); // b.append(" - "); // b.append(theOo.getIssueFirstRep().getLocationFirstRep().getValue()); return b.toString(); @@ -49,12 +52,12 @@ public class ValidationFailureException extends RuntimeException { // myOperationOutcome.addIssue().setSeverity(theSeverity).setDetails(theProblem); // } - public ValidationFailureException(BaseOperationOutcome theOperationOutcome) { - super(toDescription(theOperationOutcome)); + public ValidationFailureException(FhirContext theCtx, IBaseOperationOutcome theOperationOutcome) { + super(toDescription(theCtx, theOperationOutcome)); myOperationOutcome = theOperationOutcome; } - public BaseOperationOutcome getOperationOutcome() { + public IBaseOperationOutcome getOperationOutcome() { return myOperationOutcome; } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/ValidationResult.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/ValidationResult.java index b3bc4d8db52..3d4cea1d709 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/ValidationResult.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/ValidationResult.java @@ -20,7 +20,10 @@ package ca.uhn.fhir.validation; * #L% */ -import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; +import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.util.OperationOutcomeUtil; /** * Encapsulates the results of validation @@ -29,50 +32,48 @@ import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; * @since 0.7 */ public class ValidationResult { - private BaseOperationOutcome myOperationOutcome; - private boolean isSuccessful; + private IBaseOperationOutcome myOperationOutcome; + private boolean myIsSuccessful; + private FhirContext myCtx; - private ValidationResult(BaseOperationOutcome myOperationOutcome, boolean isSuccessful) { - this.myOperationOutcome = myOperationOutcome; - this.isSuccessful = isSuccessful; - } + private ValidationResult(FhirContext theCtx, IBaseOperationOutcome theOperationOutcome, boolean isSuccessful) { + this.myCtx = theCtx; + this.myOperationOutcome = theOperationOutcome; + this.myIsSuccessful = isSuccessful; + } - public static ValidationResult valueOf(BaseOperationOutcome myOperationOutcome) { - boolean noIssues = myOperationOutcome == null || myOperationOutcome.getIssue().isEmpty(); - return new ValidationResult(myOperationOutcome, noIssues); - } + public static ValidationResult valueOf(FhirContext theCtx, IBaseOperationOutcome myOperationOutcome) { + boolean noIssues = !OperationOutcomeUtil.hasIssues(theCtx, myOperationOutcome); + return new ValidationResult(theCtx, myOperationOutcome, noIssues); + } - public BaseOperationOutcome getOperationOutcome() { - return myOperationOutcome; - } + public IBaseOperationOutcome getOperationOutcome() { + return myOperationOutcome; + } - @Override - public String toString() { - return "ValidationResult{" + - "myOperationOutcome=" + myOperationOutcome + - ", isSuccessful=" + isSuccessful + - ", description='" + toDescription() + '\'' + - '}'; - } + @Override + public String toString() { + return "ValidationResult{" + "myOperationOutcome=" + myOperationOutcome + ", isSuccessful=" + myIsSuccessful + ", description='" + toDescription() + '\'' + '}'; + } - private String toDescription() { - StringBuilder b = new StringBuilder(100); - if (myOperationOutcome != null && myOperationOutcome.getIssue().size() > 0) { - BaseOperationOutcome.BaseIssue issueFirstRep = myOperationOutcome.getIssueFirstRep(); - b.append(issueFirstRep.getDetailsElement().getValue()); - b.append(" - "); - b.append(issueFirstRep.getLocationFirstRep().getValue()); - }else { - b.append("No issues"); - } - return b.toString(); - } + private String toDescription() { + StringBuilder b = new StringBuilder(100); + if (myOperationOutcome != null && OperationOutcomeUtil.hasIssues(myCtx, myOperationOutcome)) { + b.append(OperationOutcomeUtil.getFirstIssueDetails(myCtx, myOperationOutcome)); + b.append(" - "); + b.append(OperationOutcomeUtil.getFirstIssueLocation(myCtx, myOperationOutcome)); + } else { + b.append("No issues"); + } + return b.toString(); + } - /** - * Was the validation successful - * @return true if the validation was successful - */ - public boolean isSuccessful() { - return isSuccessful; - } + /** + * Was the validation successful + * + * @return true if the validation was successful + */ + public boolean isSuccessful() { + return myIsSuccessful; + } } diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBaseOperationOutcome.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBaseOperationOutcome.java new file mode 100644 index 00000000000..daee24be886 --- /dev/null +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IBaseOperationOutcome.java @@ -0,0 +1,6 @@ +package org.hl7.fhir.instance.model.api; + + +public interface IBaseOperationOutcome extends IBaseResource { + +} diff --git a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IIdType.java b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IIdType.java index 97eb992b832..1151419d3fd 100644 --- a/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IIdType.java +++ b/hapi-fhir-base/src/main/java/org/hl7/fhir/instance/model/api/IIdType.java @@ -1,6 +1,7 @@ package org.hl7.fhir.instance.model.api; + /* * #%L * HAPI FHIR - Core Library @@ -21,11 +22,23 @@ package org.hl7.fhir.instance.model.api; * #L% */ - +/** + * Base interface for ID datatype. + * + *

+ * Concrete Implementations: This interface is often returned and/or accepted by methods in HAPI's API + * where either {@link ca.uhn.fhir.model.primitive.IdDt} (the HAPI structure ID type) or + * org.hl7.fhir.instance.model.IdType (the RI structure ID type) will be used, depending on + * which version of the strctures your application is using. + *

+ */ public interface IIdType { boolean isEmpty(); + /** + * Returns true if the ID is a local reference (in other words, it begins with the '#' character) + */ boolean isLocal(); /** @@ -42,8 +55,16 @@ public interface IIdType { */ String getIdPart(); + /** + * Returns true if this ID contains an actual ID part. For example, the ID part is + * the '123' in the following ID: http://example.com/fhir/Patient/123/_history/55 + */ boolean hasIdPart(); + /** + * Returns the server base URL if this ID contains one. For example, the base URL is + * the 'http://example.com/fhir' in the following ID: http://example.com/fhir/Patient/123/_history/55 + */ String getBaseUrl(); IIdType toUnqualifiedVersionless(); @@ -72,4 +93,10 @@ public interface IIdType { Long getIdPartAsLong(); + boolean hasBaseUrl(); + + IIdType withVersion(String theVersion); + + void applyTo(IBaseResource theResource); + } diff --git a/hapi-fhir-cobertura/pom.xml b/hapi-fhir-cobertura/pom.xml index 76949cfafc5..becbad852bb 100644 --- a/hapi-fhir-cobertura/pom.xml +++ b/hapi-fhir-cobertura/pom.xml @@ -62,18 +62,17 @@ ${thymeleaf-version}
- - org.slf4j - jcl-over-slf4j - ${slf4j_version} - - - - ch.qos.logback - logback-classic - ${logback_version} - + + + org.slf4j + slf4j-api + 1.6.0 + + + org.slf4j + slf4j-simple + 1.6.0 + diff --git a/hapi-fhir-jpaserver-base/.classpath b/hapi-fhir-jpaserver-base/.classpath index efb0e370ed4..7d7605fb4cc 100644 --- a/hapi-fhir-jpaserver-base/.classpath +++ b/hapi-fhir-jpaserver-base/.classpath @@ -20,6 +20,7 @@ + diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseFhirDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseFhirDao.java index b778239350f..77685987c34 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseFhirDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseFhirDao.java @@ -140,7 +140,7 @@ public abstract class BaseFhirDao implements IDao { private ISearchParamExtractor mySearchParamExtractor; - protected void createForcedIdIfNeeded(ResourceTable entity, IdDt id) { + protected void createForcedIdIfNeeded(ResourceTable entity, IIdType id) { if (id.isEmpty() == false && id.hasIdPart()) { if (isValidPid(id)) { return; @@ -276,13 +276,13 @@ public abstract class BaseFhirDao implements IDao { values.addAll(t.getValues(theResource, nextPathTrimmed)); } catch (Exception e) { RuntimeResourceDefinition def = myContext.getResourceDefinition(theResource); - ourLog.warn("Failed to index values from path[{}] in resource type[{}]: ", nextPathTrimmed, def.getName(), e.toString()); + ourLog.warn("Failed to index values from path[{}] in resource type[{}]: ", new Object[] { nextPathTrimmed, def.getName(), e.toString() } ); } } return values; } - private void findMatchingTagIds(String theResourceName, IdDt theResourceId, Set tagIds, Class entityClass) { + private void findMatchingTagIds(String theResourceName, IIdType theResourceId, Set tagIds, Class entityClass) { { CriteriaBuilder builder = myEntityManager.getCriteriaBuilder(); CriteriaQuery cq = builder.createTupleQuery(); @@ -375,7 +375,7 @@ public abstract class BaseFhirDao implements IDao { } } - protected TagList getTags(Class theResourceType, IdDt theResourceId) { + protected TagList getTags(Class theResourceType, IIdType theResourceId) { String resourceName = null; if (theResourceType != null) { resourceName = toResourceName(theResourceType); @@ -610,7 +610,7 @@ public abstract class BaseFhirDao implements IDao { List profiles = ResourceMetadataKeyEnum.PROFILES.get(theResource); if (profiles != null) { - for (IdDt next : profiles) { + for (IIdType next : profiles) { TagDefinition tag = getTag(TagTypeEnum.PROFILE, NS_JPA_PROFILE, next.getValue(), null); theEntity.addTag(tag); theEntity.setHasTags(true); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseFhirResourceDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseFhirResourceDao.java index dd465e8d56e..d8f6453fbfc 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseFhirResourceDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseFhirResourceDao.java @@ -577,7 +577,7 @@ public abstract class BaseFhirResourceDao extends BaseFhirD if (isBlank(ref.getChain())) { if (resourceId.contains("/")) { - IdDt dt = new IdDt(resourceId); + IIdType dt = new IdDt(resourceId); resourceId = dt.getIdPart(); } Long targetPid = translateForcedIdToPid(new IdDt(resourceId)); @@ -780,7 +780,7 @@ public abstract class BaseFhirResourceDao extends BaseFhirD } @Override - public void addTag(IdDt theId, TagTypeEnum theTagType, String theScheme, String theTerm, String theLabel) { + public void addTag(IIdType theId, TagTypeEnum theTagType, String theScheme, String theTerm, String theLabel) { StopWatch w = new StopWatch(); BaseHasResource entity = readEntity(theId); if (entity == null) { @@ -1062,10 +1062,10 @@ public abstract class BaseFhirResourceDao extends BaseFhirD } @Override - public DaoMethodOutcome delete(IdDt theId) { + public DaoMethodOutcome delete(IIdType theId) { StopWatch w = new StopWatch(); final ResourceTable entity = readEntityLatestVersion(theId); - if (theId.hasVersionIdPart() && theId.getVersionIdPartAsLong().longValue() != entity.getVersion()) { + if (theId.hasVersionIdPart() && Long.parseLong(theId.getVersionIdPart()) != entity.getVersion()) { throw new InvalidRequestException("Trying to update " + theId + " but this is not the current version"); } @@ -1169,7 +1169,7 @@ public abstract class BaseFhirResourceDao extends BaseFhirD } @Override - public TagList getTags(IdDt theResourceId) { + public TagList getTags(IIdType theResourceId) { StopWatch w = new StopWatch(); TagList retVal = super.getTags(myResourceType, theResourceId); ourLog.info("Processed getTags on {} in {}ms", theResourceId, w.getMillisAndRestart()); @@ -1185,7 +1185,7 @@ public abstract class BaseFhirResourceDao extends BaseFhirD } @Override - public IBundleProvider history(final IdDt theId, final Date theSince) { + public IBundleProvider history(final IIdType theId, final Date theSince) { final InstantDt end = createHistoryToTimestamp(); final String resourceType = getContext().getResourceDefinition(myResourceType).getName(); @@ -1375,7 +1375,7 @@ public abstract class BaseFhirResourceDao extends BaseFhirD } @Override - public MetaDt metaAddOperation(IdDt theResourceId, MetaDt theMetaAdd) { + public MetaDt metaAddOperation(IIdType theResourceId, MetaDt theMetaAdd) { StopWatch w = new StopWatch(); BaseHasResource entity = readEntity(theResourceId); if (entity == null) { @@ -1415,7 +1415,7 @@ public abstract class BaseFhirResourceDao extends BaseFhirD } @Override - public MetaDt metaDeleteOperation(IdDt theResourceId, MetaDt theMetaDel) { + public MetaDt metaDeleteOperation(IIdType theResourceId, MetaDt theMetaDel) { StopWatch w = new StopWatch(); BaseHasResource entity = readEntity(theResourceId); if (entity == null) { @@ -1461,7 +1461,7 @@ public abstract class BaseFhirResourceDao extends BaseFhirD } @Override - public MetaDt metaGetOperation(IdDt theId) { + public MetaDt metaGetOperation(IIdType theId) { Long pid = super.translateForcedIdToPid(theId); String sql = "SELECT d FROM TagDefinition d WHERE d.myId IN (SELECT DISTINCT t.myTagId FROM ResourceTag t WHERE t.myResourceType = :res_type AND t.myResourceId = :res_id)"; @@ -1494,7 +1494,7 @@ public abstract class BaseFhirResourceDao extends BaseFhirD } @Override - public T read(IdDt theId) { + public T read(IIdType theId) { validateResourceTypeAndThrowIllegalArgumentException(theId); StopWatch w = new StopWatch(); @@ -1513,7 +1513,7 @@ public abstract class BaseFhirResourceDao extends BaseFhirD } @Override - public BaseHasResource readEntity(IdDt theId) { + public BaseHasResource readEntity(IIdType theId) { boolean checkForForcedId = true; BaseHasResource entity = readEntity(theId, checkForForcedId); @@ -1522,13 +1522,13 @@ public abstract class BaseFhirResourceDao extends BaseFhirD } @Override - public BaseHasResource readEntity(IdDt theId, boolean theCheckForForcedId) { + public BaseHasResource readEntity(IIdType theId, boolean theCheckForForcedId) { validateResourceTypeAndThrowIllegalArgumentException(theId); Long pid = translateForcedIdToPid(theId); BaseHasResource entity = myEntityManager.find(ResourceTable.class, pid); if (theId.hasVersionIdPart()) { - if (entity.getVersion() != theId.getVersionIdPartAsLong()) { + if (entity.getVersion() != Long.parseLong(theId.getVersionIdPart())) { entity = null; } } @@ -1539,7 +1539,7 @@ public abstract class BaseFhirResourceDao extends BaseFhirD "SELECT t from ResourceHistoryTable t WHERE t.myResourceId = :RID AND t.myResourceType = :RTYP AND t.myResourceVersion = :RVER", ResourceHistoryTable.class); q.setParameter("RID", pid); q.setParameter("RTYP", myResourceName); - q.setParameter("RVER", theId.getVersionIdPartAsLong()); + q.setParameter("RVER", Long.parseLong(theId.getVersionIdPart())); entity = q.getSingleResult(); } if (entity == null) { @@ -1555,7 +1555,7 @@ public abstract class BaseFhirResourceDao extends BaseFhirD return entity; } - private ResourceTable readEntityLatestVersion(IdDt theId) { + private ResourceTable readEntityLatestVersion(IIdType theId) { ResourceTable entity = myEntityManager.find(ResourceTable.class, translateForcedIdToPid(theId)); if (entity == null) { throw new ResourceNotFoundException(theId); @@ -1565,7 +1565,7 @@ public abstract class BaseFhirResourceDao extends BaseFhirD } @Override - public void removeTag(IdDt theId, TagTypeEnum theTagType, String theScheme, String theTerm) { + public void removeTag(IIdType theId, TagTypeEnum theTagType, String theScheme, String theTerm) { StopWatch w = new StopWatch(); BaseHasResource entity = readEntity(theId); if (entity == null) { @@ -1728,7 +1728,7 @@ public abstract class BaseFhirResourceDao extends BaseFhirD previouslyLoadedPids.add(next.getIdElement().toUnqualifiedVersionless()); } - Set includePids = new HashSet(); + Set includePids = new HashSet(); List resources = retVal; do { includePids.clear(); @@ -1754,7 +1754,7 @@ public abstract class BaseFhirResourceDao extends BaseFhirD continue; } - IdDt nextId = rr.getReference().toUnqualified(); + IIdType nextId = rr.getReference().toUnqualified(); if (!previouslyLoadedPids.contains(nextId)) { includePids.add(nextId); previouslyLoadedPids.add(nextId); @@ -1842,7 +1842,7 @@ public abstract class BaseFhirResourceDao extends BaseFhirD } else { for (IQueryParameterType next : nextValue) { String value = next.getValueAsQueryToken(); - IdDt valueId = new IdDt(value); + IIdType valueId = new IdDt(value); try { long valueLong = translateForcedIdToPid(valueId); joinPids.add(valueLong); @@ -2039,7 +2039,7 @@ public abstract class BaseFhirResourceDao extends BaseFhirD final ResourceTable entity; - IdDt resourceId; + IIdType resourceId; if (isNotBlank(theMatchUrl)) { Set match = processMatchUrl(theMatchUrl, myResourceType); if (match.size() > 1) { @@ -2067,7 +2067,7 @@ public abstract class BaseFhirResourceDao extends BaseFhirD } } - if (resourceId.hasVersionIdPart() && resourceId.getVersionIdPartAsLong().longValue() != entity.getVersion()) { + if (resourceId.hasVersionIdPart() && Long.parseLong(resourceId.getVersionIdPart()) != entity.getVersion()) { throw new InvalidRequestException("Trying to update " + resourceId + " but this is not the current version"); } @@ -2078,7 +2078,7 @@ public abstract class BaseFhirResourceDao extends BaseFhirD return toMethodOutcome(savedEntity, theResource).setCreated(false); } - private void validateGivenIdIsAppropriateToRetrieveResource(IdDt theId, BaseHasResource entity) { + private void validateGivenIdIsAppropriateToRetrieveResource(IIdType theId, BaseHasResource entity) { if (entity.getForcedId() != null) { if (theId.isIdPartValidLong()) { // This means that the resource with the given numeric ID exists, but it has a "forced ID", meaning that @@ -2097,7 +2097,7 @@ public abstract class BaseFhirResourceDao extends BaseFhirD } } - private void validateResourceTypeAndThrowIllegalArgumentException(IdDt theId) { + private void validateResourceTypeAndThrowIllegalArgumentException(IIdType theId) { if (theId.hasResourceType() && !theId.getResourceType().equals(myResourceName)) { throw new IllegalArgumentException("Incorrect resource type (" + theId.getResourceType() + ") for this DAO, wanted: " + myResourceName); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseSearchParamExtractor.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseSearchParamExtractor.java index 25ebeea4ff2..ab5c7774c6c 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseSearchParamExtractor.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseSearchParamExtractor.java @@ -50,7 +50,7 @@ public class BaseSearchParamExtractor { values.addAll(t.getValues(theResource, nextPathTrimmed)); } catch (Exception e) { RuntimeResourceDefinition def = myContext.getResourceDefinition(theResource); - ourLog.warn("Failed to index values from path[{}] in resource type[{}]: ", nextPathTrimmed, def.getName(), e.toString()); + ourLog.warn("Failed to index values from path[{}] in resource type[{}]: ", new Object[] { nextPathTrimmed, def.getName(), e.toString() } ); } } return values; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoDstu2.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoDstu2.java index afe8f2e05e9..4f5b263e902 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoDstu2.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoDstu2.java @@ -32,6 +32,7 @@ import java.util.Set; import javax.persistence.TypedQuery; import org.hl7.fhir.instance.model.api.IBaseResource; +import org.hl7.fhir.instance.model.api.IIdType; import org.springframework.jmx.access.InvalidInvocationException; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; @@ -363,7 +364,7 @@ public class FhirSystemDaoDstu2 extends BaseFhirSystemDao { private static void handleTransactionCreateOrUpdateOutcome(Map idSubstitutions, Map idToPersistedOutcome, IdDt nextResourceId, DaoMethodOutcome outcome, Entry newEntry, String theResourceType) { - IdDt newId = outcome.getId().toUnqualifiedVersionless(); + IdDt newId = (IdDt) outcome.getId().toUnqualifiedVersionless(); IdDt resourceId = isPlaceholder(nextResourceId) ? nextResourceId : nextResourceId.toUnqualifiedVersionless(); if (newId.equals(resourceId) == false) { idSubstitutions.put(resourceId, newId); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/IFhirResourceDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/IFhirResourceDao.java index 07062057e5d..17f2d9bc49d 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/IFhirResourceDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/IFhirResourceDao.java @@ -24,19 +24,20 @@ import java.util.Date; import java.util.Map; import java.util.Set; +import org.hl7.fhir.instance.model.api.IIdType; + import ca.uhn.fhir.jpa.entity.BaseHasResource; import ca.uhn.fhir.jpa.entity.TagTypeEnum; import ca.uhn.fhir.model.api.IQueryParameterType; import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.api.TagList; import ca.uhn.fhir.model.dstu2.composite.MetaDt; -import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.rest.server.IBundleProvider; import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; public interface IFhirResourceDao extends IDao { - void addTag(IdDt theId, TagTypeEnum theTagType, String theScheme, String theTerm, String theLabel); + void addTag(IIdType theId, TagTypeEnum theTagType, String theScheme, String theTerm, String theLabel); DaoMethodOutcome create(T theResource); @@ -48,7 +49,7 @@ public interface IFhirResourceDao extends IDao { */ DaoMethodOutcome create(T theResource, String theIfNoneExist, boolean thePerformIndexing); - DaoMethodOutcome delete(IdDt theResource); + DaoMethodOutcome delete(IIdType theResource); DaoMethodOutcome deleteByUrl(String theString); @@ -56,11 +57,11 @@ public interface IFhirResourceDao extends IDao { Class getResourceType(); - TagList getTags(IdDt theResourceId); + TagList getTags(IIdType theResourceId); IBundleProvider history(Date theSince); - IBundleProvider history(IdDt theId, Date theSince); + IBundleProvider history(IIdType theId, Date theSince); IBundleProvider history(Long theId, Date theSince); @@ -71,17 +72,17 @@ public interface IFhirResourceDao extends IDao { * @throws ResourceNotFoundException * If the ID is not known to the server */ - T read(IdDt theId); + T read(IIdType theId); - BaseHasResource readEntity(IdDt theId); + BaseHasResource readEntity(IIdType theId); /** * @param theCheckForForcedId If true, this method should fail if the requested ID contains a numeric PID which exists, but is * obscured by a "forced ID" so should not exist as far as the outside world is concerned. */ - BaseHasResource readEntity(IdDt theId, boolean theCheckForForcedId); + BaseHasResource readEntity(IIdType theId, boolean theCheckForForcedId); - void removeTag(IdDt theId, TagTypeEnum theTagType, String theScheme, String theTerm); + void removeTag(IIdType theId, TagTypeEnum theTagType, String theScheme, String theTerm); IBundleProvider search(Map theParams); @@ -114,15 +115,15 @@ public interface IFhirResourceDao extends IDao { /** * Not supported in DSTU1! */ - MetaDt metaGetOperation(IdDt theId); + MetaDt metaGetOperation(IIdType theId); /** * Not supported in DSTU1! */ - MetaDt metaDeleteOperation(IdDt theId1, MetaDt theMetaDel); + MetaDt metaDeleteOperation(IIdType theId1, MetaDt theMetaDel); /** * Not supported in DSTU1! */ - MetaDt metaAddOperation(IdDt theId1, MetaDt theMetaAdd); + MetaDt metaAddOperation(IIdType theId1, MetaDt theMetaAdd); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaResourceProvider.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaResourceProvider.java index a4a9353c9bc..f982fb53e77 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaResourceProvider.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaResourceProvider.java @@ -24,38 +24,24 @@ import java.util.Date; import javax.servlet.http.HttpServletRequest; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Required; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.jpa.dao.IFhirResourceDao; import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.api.TagList; -import ca.uhn.fhir.model.base.resource.BaseOperationOutcome.BaseIssue; -import ca.uhn.fhir.model.dstu.resource.OperationOutcome; -import ca.uhn.fhir.model.dstu.valueset.IssueSeverityEnum; import ca.uhn.fhir.model.primitive.IdDt; -import ca.uhn.fhir.rest.annotation.Create; -import ca.uhn.fhir.rest.annotation.Delete; import ca.uhn.fhir.rest.annotation.GetTags; import ca.uhn.fhir.rest.annotation.History; import ca.uhn.fhir.rest.annotation.IdParam; import ca.uhn.fhir.rest.annotation.Read; -import ca.uhn.fhir.rest.annotation.ResourceParam; import ca.uhn.fhir.rest.annotation.Since; -import ca.uhn.fhir.rest.annotation.Update; -import ca.uhn.fhir.rest.annotation.Validate; -import ca.uhn.fhir.rest.api.MethodOutcome; import ca.uhn.fhir.rest.server.IBundleProvider; import ca.uhn.fhir.rest.server.IResourceProvider; -import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; public abstract class BaseJpaResourceProvider extends BaseJpaProvider implements IResourceProvider { - private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(BaseJpaResourceProvider.class); - private FhirContext myContext; - private IFhirResourceDao myDao; public BaseJpaResourceProvider() { @@ -138,19 +124,4 @@ public abstract class BaseJpaResourceProvider extends BaseJ myDao = theDao; } - @Validate - public MethodOutcome validate(HttpServletRequest theRequest, @ResourceParam T theResource) { - startRequest(theRequest); - try { - MethodOutcome retVal = new MethodOutcome(); - retVal.setOperationOutcome(new OperationOutcome()); - BaseIssue issue = retVal.getOperationOutcome().addIssue(); - issue.getSeverityElement().setValue("information"); - issue.setDetails("Resource validates successfully"); - return retVal; - } finally { - endRequest(theRequest); - } - } - } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/JpaResourceProviderDstu1.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/JpaResourceProviderDstu1.java index 2af3ed275d1..a78c4e42280 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/JpaResourceProviderDstu1.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/JpaResourceProviderDstu1.java @@ -24,12 +24,15 @@ import javax.servlet.http.HttpServletRequest; import ca.uhn.fhir.jpa.dao.IFhirResourceDao; import ca.uhn.fhir.model.api.IResource; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome.BaseIssue; +import ca.uhn.fhir.model.dstu.resource.OperationOutcome; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.rest.annotation.Create; import ca.uhn.fhir.rest.annotation.Delete; import ca.uhn.fhir.rest.annotation.IdParam; import ca.uhn.fhir.rest.annotation.ResourceParam; import ca.uhn.fhir.rest.annotation.Update; +import ca.uhn.fhir.rest.annotation.Validate; import ca.uhn.fhir.rest.api.MethodOutcome; import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; @@ -80,4 +83,19 @@ public class JpaResourceProviderDstu1 extends BaseJpaResour } } + @Validate + public MethodOutcome validate(HttpServletRequest theRequest, @ResourceParam T theResource) { + startRequest(theRequest); + try { + MethodOutcome retVal = new MethodOutcome(); + retVal.setOperationOutcome(new OperationOutcome()); + BaseIssue issue = ((OperationOutcome)retVal.getOperationOutcome()).addIssue(); + issue.getSeverityElement().setValue("information"); + issue.setDetails("Resource validates successfully (note that on this server, the DSTU1 endpoint validation only validates basic ability to parse the resource)"); + return retVal; + } finally { + endRequest(theRequest); + } + } + } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/JpaResourceProviderDstu2.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/JpaResourceProviderDstu2.java index 966e5ed933b..3ac7dd20062 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/JpaResourceProviderDstu2.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/JpaResourceProviderDstu2.java @@ -153,6 +153,12 @@ public class JpaResourceProviderDstu2 extends BaseJpaResour } } + @Validate + public MethodOutcome validate(@ResourceParam T theResource, @ResourceParam String theRawResource, @ResourceParam EncodingEnum theEncoding, @Validate.Mode ValidationModeEnum theMode, + @Validate.Profile String theProfile) { + return validate(theResource, null, theRawResource, theEncoding, theMode, theProfile); + } + @Validate public MethodOutcome validate(@ResourceParam T theResource, @IdParam IdDt theId, @ResourceParam String theRawResource, @ResourceParam EncodingEnum theEncoding, @Validate.Mode ValidationModeEnum theMode, @Validate.Profile String theProfile) { @@ -177,7 +183,8 @@ public class JpaResourceProviderDstu2 extends BaseJpaResour validator.setValidateAgainstStandardSchema(true); validator.setValidateAgainstStandardSchematron(true); ValidationResult result = validator.validateWithResult(theResource); - for (BaseIssue next : result.getOperationOutcome().getIssue()) { + OperationOutcome operationOutcome = (OperationOutcome) result.getOperationOutcome(); + for (BaseIssue next : operationOutcome.getIssue()) { oo.getIssue().add((Issue) next); } diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirResourceDaoDstu1Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirResourceDaoDstu1Test.java index 5ca7b29edfb..86eedaf1a39 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirResourceDaoDstu1Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirResourceDaoDstu1Test.java @@ -6,6 +6,7 @@ import static org.junit.Assert.assertThat; import static org.junit.Assert.fail; import org.hamcrest.core.StringContains; +import org.hl7.fhir.instance.model.api.IIdType; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -46,7 +47,7 @@ public class FhirResourceDaoDstu1Test extends BaseJpaTest { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.setId("Patient/" + methodName); - IdDt id = ourPatientDao.create(p).getId(); + IIdType id = ourPatientDao.create(p).getId(); ourLog.info("Created patient, got it: {}", id); p = new Patient(); @@ -95,13 +96,13 @@ public class FhirResourceDaoDstu1Test extends BaseJpaTest { p1.addIdentifier().setSystem("urn:system").setValue("testUpdateRejectsIdWhichPointsToForcedId01"); p1.addName().addFamily("Tester").addGiven("testUpdateRejectsIdWhichPointsToForcedId01"); p1.setId("ABABA"); - IdDt p1id = ourPatientDao.create(p1).getId(); + IIdType p1id = ourPatientDao.create(p1).getId(); assertEquals("ABABA", p1id.getIdPart()); Patient p2 = new Patient(); p2.addIdentifier().setSystem("urn:system").setValue("testUpdateRejectsIdWhichPointsToForcedId02"); p2.addName().addFamily("Tester").addGiven("testUpdateRejectsIdWhichPointsToForcedId02"); - IdDt p2id = ourPatientDao.create(p2).getId(); + IIdType p2id = ourPatientDao.create(p2).getId(); long p1longId = p2id.getIdPartAsLong() - 1; try { diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirResourceDaoDstu2Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirResourceDaoDstu2Test.java index b324c32e0c6..f196cd8ecde 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirResourceDaoDstu2Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirResourceDaoDstu2Test.java @@ -1,22 +1,7 @@ package ca.uhn.fhir.jpa.dao; -import static org.hamcrest.Matchers.contains; -import static org.hamcrest.Matchers.containsInAnyOrder; -import static org.hamcrest.Matchers.containsInRelativeOrder; -import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.endsWith; -import static org.hamcrest.Matchers.greaterThan; -import static org.hamcrest.Matchers.hasItem; -import static org.hamcrest.Matchers.hasItems; -import static org.hamcrest.Matchers.not; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.hamcrest.Matchers.*; +import static org.junit.Assert.*; import java.math.BigDecimal; import java.util.ArrayList; @@ -30,6 +15,7 @@ import java.util.Set; import org.apache.commons.lang3.RandomStringUtils; import org.hamcrest.core.StringContains; import org.hl7.fhir.instance.model.api.IBaseResource; +import org.hl7.fhir.instance.model.api.IIdType; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -113,10 +99,10 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { public void testQuestionnaireTitleGetsIndexed() { Questionnaire q = new Questionnaire(); q.getGroup().setTitle("testQuestionnaireTitleGetsIndexedQ_TITLE"); - IdDt qid1 = ourQuestionnaireDao.create(q).getId().toUnqualifiedVersionless(); + IIdType qid1 = ourQuestionnaireDao.create(q).getId().toUnqualifiedVersionless(); q = new Questionnaire(); q.getGroup().setTitle("testQuestionnaireTitleGetsIndexedQ_NOTITLE"); - IdDt qid2 = ourQuestionnaireDao.create(q).getId().toUnqualifiedVersionless(); + IIdType qid2 = ourQuestionnaireDao.create(q).getId().toUnqualifiedVersionless(); IBundleProvider results = ourQuestionnaireDao.search("title", new StringParam("testQuestionnaireTitleGetsIndexedQ_TITLE")); assertEquals(1, results.size()); @@ -131,7 +117,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { Observation o1 = new Observation(); o1.getCode().addCoding().setSystem("foo").setCode("testChoiceParam01"); o1.setValue(new CodeableConceptDt("testChoiceParam01CCS", "testChoiceParam01CCV")); - IdDt id1 = ourObservationDao.create(o1).getId(); + IIdType id1 = ourObservationDao.create(o1).getId(); { IBundleProvider found = ourObservationDao.search(Observation.SP_VALUE_CONCEPT, new TokenParam("testChoiceParam01CCS", "testChoiceParam01CCV")); @@ -145,7 +131,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { Observation o2 = new Observation(); o2.getCode().addCoding().setSystem("foo").setCode("testChoiceParam02"); o2.setValue(new PeriodDt().setStart(new DateTimeDt("2001-01-01")).setEnd(new DateTimeDt("2001-01-03"))); - IdDt id2 = ourObservationDao.create(o2).getId(); + IIdType id2 = ourObservationDao.create(o2).getId(); { IBundleProvider found = ourObservationDao.search(Observation.SP_VALUE_DATE, new DateParam("2001-01-02")); @@ -159,7 +145,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { Observation o2 = new Observation(); o2.getCode().addCoding().setSystem("foo").setCode("testChoiceParamDateAlt02"); o2.setApplies(new DateTimeDt("2015-03-08T11:11:11")); - IdDt id2 = ourObservationDao.create(o2).getId(); + IIdType id2 = ourObservationDao.create(o2).getId(); { Set found = ourObservationDao.searchForIds(Observation.SP_DATE, new DateParam(">2001-01-02")); @@ -176,7 +162,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { Observation o3 = new Observation(); o3.getCode().addCoding().setSystem("foo").setCode("testChoiceParam03"); o3.setValue(new QuantityDt(QuantityComparatorEnum.GREATERTHAN, 123.0, "foo", "bar").setCode("bar")); - IdDt id3 = ourObservationDao.create(o3).getId(); + IIdType id3 = ourObservationDao.create(o3).getId(); { IBundleProvider found = ourObservationDao.search(Observation.SP_VALUE_QUANTITY, new QuantityParam(">100", "foo", "bar")); @@ -205,7 +191,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { Observation o4 = new Observation(); o4.getCode().addCoding().setSystem("foo").setCode("testChoiceParam04"); o4.setValue(new StringDt("testChoiceParam04Str")); - IdDt id4 = ourObservationDao.create(o4).getId(); + IIdType id4 = ourObservationDao.create(o4).getId(); { IBundleProvider found = ourObservationDao.search(Observation.SP_VALUE_STRING, new StringParam("testChoiceParam04Str")); @@ -249,7 +235,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - IdDt id = ourPatientDao.create(p).getId(); + IIdType id = ourPatientDao.create(p).getId(); ourLog.info("Created patient, got it: {}", id); p = new Patient(); @@ -438,9 +424,9 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { public void testDeleteResource() { int initialHistory = ourPatientDao.history(null).size(); - IdDt id1; - IdDt id2; - IdDt id2b; + IIdType id1; + IIdType id2; + IIdType id2b; { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); @@ -502,7 +488,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); patient.addName().addFamily("Tester_testDeleteThenUndelete").addGiven("Joe"); - IdDt id = ourPatientDao.create(patient).getId(); + IIdType id = ourPatientDao.create(patient).getId(); assertThat(id.getValue(), endsWith("/_history/1")); // should be ok @@ -522,11 +508,11 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { patient.addIdentifier().setSystem("urn:system").setValue("001"); patient.addName().addFamily("Tester_testDeleteThenUndelete").addGiven("Joe"); patient.setId(id.toUnqualifiedVersionless()); - IdDt id2 = ourPatientDao.update(patient).getId(); + IIdType id2 = ourPatientDao.update(patient).getId(); assertThat(id2.getValue(), endsWith("/_history/3")); - IdDt gotId = ourPatientDao.read(id.toUnqualifiedVersionless()).getId(); + IIdType gotId = ourPatientDao.read(id.toUnqualifiedVersionless()).getId(); assertEquals(id2, gotId); } @@ -536,7 +522,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - IdDt id = ourPatientDao.create(p).getId(); + IIdType id = ourPatientDao.create(p).getId(); ourLog.info("Created patient, got it: {}", id); Bundle request = new Bundle(); @@ -569,8 +555,8 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { @Test public void testHistoryByForcedId() { - IdDt idv1; - IdDt idv2; + IIdType idv1; + IIdType idv2; { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("testHistoryByForcedId"); @@ -706,26 +692,26 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { public void testPersistResourceLink() { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("testPersistResourceLink01"); - IdDt patientId01 = ourPatientDao.create(patient).getId(); + IIdType patientId01 = ourPatientDao.create(patient).getId(); Patient patient02 = new Patient(); patient02.addIdentifier().setSystem("urn:system").setValue("testPersistResourceLink02"); - IdDt patientId02 = ourPatientDao.create(patient02).getId(); + IIdType patientId02 = ourPatientDao.create(patient02).getId(); Observation obs01 = new Observation(); obs01.setApplies(new DateTimeDt(new Date())); obs01.setSubject(new ResourceReferenceDt(patientId01)); - IdDt obsId01 = ourObservationDao.create(obs01).getId(); + IIdType obsId01 = ourObservationDao.create(obs01).getId(); Observation obs02 = new Observation(); obs02.setApplies(new DateTimeDt(new Date())); obs02.setSubject(new ResourceReferenceDt(patientId02)); - IdDt obsId02 = ourObservationDao.create(obs02).getId(); + IIdType obsId02 = ourObservationDao.create(obs02).getId(); // Create another type, that shouldn't be returned DiagnosticReport dr01 = new DiagnosticReport(); dr01.setSubject(new ResourceReferenceDt(patientId01)); - IdDt drId01 = ourDiagnosticReportDao.create(dr01).getId(); + IIdType drId01 = ourDiagnosticReportDao.create(dr01).getId(); ourLog.info("P1[{}] P2[{}] O1[{}] O2[{}] D1[{}]", new Object[] { patientId01, patientId02, obsId01, obsId02, drId01 }); @@ -871,12 +857,12 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue("testReadVorcedIdVersionHistory01"); p1.setId("testReadVorcedIdVersionHistory"); - IdDt p1id = ourPatientDao.update(p1).getId(); + IIdType p1id = ourPatientDao.update(p1).getId(); assertEquals("testReadVorcedIdVersionHistory", p1id.getIdPart()); p1.addIdentifier().setSystem("urn:system").setValue("testReadVorcedIdVersionHistory02"); p1.setId(p1id); - IdDt p1idv2 = ourPatientDao.update(p1).getId(); + IIdType p1idv2 = ourPatientDao.update(p1).getId(); assertEquals("testReadVorcedIdVersionHistory", p1idv2.getIdPart()); assertNotEquals(p1id.getValue(), p1idv2.getValue()); @@ -894,7 +880,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { String methodName = "testReverseIncludes"; Organization org = new Organization(); org.setName("X" + methodName + "X"); - IdDt orgId = ourOrganizationDao.create(org).getId(); + IIdType orgId = ourOrganizationDao.create(org).getId(); Patient pat = new Patient(); pat.addName().addFamily("X" + methodName + "X"); @@ -917,7 +903,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { deleteEverything(); String methodName = "testResourceInstanceMetaOperation"; - IdDt id1, id2; + IIdType id1, id2; { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue(methodName); @@ -1035,7 +1021,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { deleteEverything(); String methodName = "testResourceMetaOperation"; - IdDt id1, id2; + IIdType id1, id2; { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue(methodName); @@ -1172,13 +1158,13 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { @Test public void testSearchByIdParam() { - IdDt id1; + IIdType id1; { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); id1 = ourPatientDao.create(patient).getId(); } - IdDt id2; + IIdType id2; { Organization patient = new Organization(); patient.addIdentifier().setSystem("urn:system").setValue("001"); @@ -1202,12 +1188,12 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { Observation o1 = new Observation(); o1.getCode().addCoding().setSystem("foo").setCode("testSearchCompositeParamN01"); o1.setValue(new StringDt("testSearchCompositeParamS01")); - IdDt id1 = ourObservationDao.create(o1).getId(); + IIdType id1 = ourObservationDao.create(o1).getId(); Observation o2 = new Observation(); o2.getCode().addCoding().setSystem("foo").setCode("testSearchCompositeParamN01"); o2.setValue(new StringDt("testSearchCompositeParamS02")); - IdDt id2 = ourObservationDao.create(o2).getId(); + IIdType id2 = ourObservationDao.create(o2).getId(); { TokenParam v0 = new TokenParam("foo", "testSearchCompositeParamN01"); @@ -1232,12 +1218,12 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { Observation o1 = new Observation(); o1.getCode().addCoding().setSystem("foo").setCode("testSearchCompositeParamDateN01"); o1.setValue(new PeriodDt().setStart(new DateTimeDt("2001-01-01T11:11:11"))); - IdDt id1 = ourObservationDao.create(o1).getId().toUnqualifiedVersionless(); + IIdType id1 = ourObservationDao.create(o1).getId().toUnqualifiedVersionless(); Observation o2 = new Observation(); o2.getCode().addCoding().setSystem("foo").setCode("testSearchCompositeParamDateN01"); o2.setValue(new PeriodDt().setStart(new DateTimeDt("2001-01-01T12:12:12"))); - IdDt id2 = ourObservationDao.create(o2).getId().toUnqualifiedVersionless(); + IIdType id2 = ourObservationDao.create(o2).getId().toUnqualifiedVersionless(); { TokenParam v0 = new TokenParam("foo", "testSearchCompositeParamDateN01"); @@ -1271,7 +1257,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { @Test public void testSearchLanguageParam() { - IdDt id1; + IIdType id1; { Patient patient = new Patient(); patient.getLanguage().setValue("en_CA"); @@ -1279,7 +1265,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { patient.addName().addFamily("testSearchLanguageParam").addGiven("Joe"); id1 = ourPatientDao.create(patient).getId(); } - IdDt id2; + IIdType id2; { Patient patient = new Patient(); patient.getLanguage().setValue("en_US"); @@ -1318,14 +1304,14 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { Thread.sleep(sleep); DateTimeDt beforeAny = new DateTimeDt(new Date(), TemporalPrecisionEnum.MILLI); - IdDt id1a; + IIdType id1a; { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); patient.addName().addFamily(methodName).addGiven("Joe"); id1a = ourPatientDao.create(patient).getId().toUnqualifiedVersionless(); } - IdDt id1b; + IIdType id1b; { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("002"); @@ -1337,7 +1323,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { DateTimeDt beforeR2 = new DateTimeDt(new Date(), TemporalPrecisionEnum.MILLI); Thread.sleep(1100); - IdDt id2; + IIdType id2; { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("002"); @@ -1347,33 +1333,33 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { { SearchParameterMap params = new SearchParameterMap(); - List patients = toUnqualifiedVersionlessIds(ourPatientDao.search(params)); + List patients = toUnqualifiedVersionlessIds(ourPatientDao.search(params)); assertThat(patients, hasItems(id1a, id1b, id2)); } { SearchParameterMap params = new SearchParameterMap(); params.setLastUpdated(new DateRangeParam(beforeAny, null)); - List patients = toUnqualifiedVersionlessIds(ourPatientDao.search(params)); + List patients = toUnqualifiedVersionlessIds(ourPatientDao.search(params)); assertThat(patients, hasItems(id1a, id1b, id2)); } { SearchParameterMap params = new SearchParameterMap(); params.setLastUpdated(new DateRangeParam(beforeR2, null)); - List patients = toUnqualifiedVersionlessIds(ourPatientDao.search(params)); + List patients = toUnqualifiedVersionlessIds(ourPatientDao.search(params)); assertThat(patients, hasItems(id2)); assertThat(patients, not(hasItems(id1a, id1b))); } { SearchParameterMap params = new SearchParameterMap(); params.setLastUpdated(new DateRangeParam(beforeAny, beforeR2)); - List patients = toUnqualifiedVersionlessIds(ourPatientDao.search(params)); + List patients = toUnqualifiedVersionlessIds(ourPatientDao.search(params)); assertThat(patients.toString(), patients, not(hasItems(id2))); assertThat(patients.toString(), patients, (hasItems(id1a, id1b))); } { SearchParameterMap params = new SearchParameterMap(); params.setLastUpdated(new DateRangeParam(null, beforeR2)); - List patients = toUnqualifiedVersionlessIds(ourPatientDao.search(params)); + List patients = toUnqualifiedVersionlessIds(ourPatientDao.search(params)); assertThat(patients, (hasItems(id1a, id1b))); assertThat(patients, not(hasItems(id2))); } @@ -1381,7 +1367,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { @Test public void testSearchNameParam() { - IdDt id1; + IIdType id1; { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); @@ -1433,12 +1419,12 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { Encounter e1 = new Encounter(); e1.addIdentifier().setSystem("foo").setValue("testSearchNumberParam01"); e1.getLength().setSystem(BaseFhirDao.UCUM_NS).setCode("min").setValue(4.0 * 24 * 60); - IdDt id1 = ourEncounterDao.create(e1).getId(); + IIdType id1 = ourEncounterDao.create(e1).getId(); Encounter e2 = new Encounter(); e2.addIdentifier().setSystem("foo").setValue("testSearchNumberParam02"); e2.getLength().setSystem(BaseFhirDao.UCUM_NS).setCode("year").setValue(2.0); - IdDt id2 = ourEncounterDao.create(e2).getId(); + IIdType id2 = ourEncounterDao.create(e2).getId(); { IBundleProvider found = ourEncounterDao.search(Encounter.SP_LENGTH, new NumberParam(">2")); assertEquals(2, found.size()); @@ -1460,27 +1446,27 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("testSearchResourceLinkWithChainXX"); patient.addIdentifier().setSystem("urn:system").setValue("testSearchResourceLinkWithChain01"); - IdDt patientId01 = ourPatientDao.create(patient).getId(); + IIdType patientId01 = ourPatientDao.create(patient).getId(); Patient patient02 = new Patient(); patient02.addIdentifier().setSystem("urn:system").setValue("testSearchResourceLinkWithChainXX"); patient02.addIdentifier().setSystem("urn:system").setValue("testSearchResourceLinkWithChain02"); - IdDt patientId02 = ourPatientDao.create(patient02).getId(); + IIdType patientId02 = ourPatientDao.create(patient02).getId(); Observation obs01 = new Observation(); obs01.setApplies(new DateTimeDt(new Date())); obs01.setSubject(new ResourceReferenceDt(patientId01)); - IdDt obsId01 = ourObservationDao.create(obs01).getId(); + IIdType obsId01 = ourObservationDao.create(obs01).getId(); Observation obs02 = new Observation(); obs02.setApplies(new DateTimeDt(new Date())); obs02.setSubject(new ResourceReferenceDt(patientId02)); - IdDt obsId02 = ourObservationDao.create(obs02).getId(); + IIdType obsId02 = ourObservationDao.create(obs02).getId(); // Create another type, that shouldn't be returned DiagnosticReport dr01 = new DiagnosticReport(); dr01.setSubject(new ResourceReferenceDt(patientId01)); - IdDt drId01 = ourDiagnosticReportDao.create(dr01).getId(); + IIdType drId01 = ourDiagnosticReportDao.create(dr01).getId(); ourLog.info("P1[{}] P2[{}] O1[{}] O2[{}] D1[{}]", new Object[] { patientId01, patientId02, obsId01, obsId02, drId01 }); @@ -1513,21 +1499,21 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { Patient patient = new Patient(); patient.addName().addFamily("testSearchResourceLinkWithChainWithMultipleTypes01"); patient.addName().addFamily("testSearchResourceLinkWithChainWithMultipleTypesXX"); - IdDt patientId01 = ourPatientDao.create(patient).getId(); + IIdType patientId01 = ourPatientDao.create(patient).getId(); Location loc01 = new Location(); loc01.getNameElement().setValue("testSearchResourceLinkWithChainWithMultipleTypes01"); - IdDt locId01 = ourLocationDao.create(loc01).getId(); + IIdType locId01 = ourLocationDao.create(loc01).getId(); Observation obs01 = new Observation(); obs01.setApplies(new DateTimeDt(new Date())); obs01.setSubject(new ResourceReferenceDt(patientId01)); - IdDt obsId01 = ourObservationDao.create(obs01).getId(); + IIdType obsId01 = ourObservationDao.create(obs01).getId(); Observation obs02 = new Observation(); obs02.setApplies(new DateTimeDt(new Date())); obs02.setSubject(new ResourceReferenceDt(locId01)); - IdDt obsId02 = ourObservationDao.create(obs02).getId(); + IIdType obsId02 = ourObservationDao.create(obs02).getId(); ourLog.info("P1[{}] L1[{}] Obs1[{}] Obs2[{}]", new Object[] { patientId01, locId01, obsId01, obsId02 }); @@ -1552,28 +1538,28 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { patient.setId("testSearchResourceLinkWithTextLogicalId01"); patient.addIdentifier().setSystem("urn:system").setValue("testSearchResourceLinkWithTextLogicalIdXX"); patient.addIdentifier().setSystem("urn:system").setValue("testSearchResourceLinkWithTextLogicalId01"); - IdDt patientId01 = ourPatientDao.update(patient).getId(); + IIdType patientId01 = ourPatientDao.update(patient).getId(); Patient patient02 = new Patient(); patient02.setId("testSearchResourceLinkWithTextLogicalId02"); patient02.addIdentifier().setSystem("urn:system").setValue("testSearchResourceLinkWithTextLogicalIdXX"); patient02.addIdentifier().setSystem("urn:system").setValue("testSearchResourceLinkWithTextLogicalId02"); - IdDt patientId02 = ourPatientDao.update(patient02).getId(); + IIdType patientId02 = ourPatientDao.update(patient02).getId(); Observation obs01 = new Observation(); obs01.setApplies(new DateTimeDt(new Date())); obs01.setSubject(new ResourceReferenceDt(patientId01)); - IdDt obsId01 = ourObservationDao.create(obs01).getId(); + IIdType obsId01 = ourObservationDao.create(obs01).getId(); Observation obs02 = new Observation(); obs02.setApplies(new DateTimeDt(new Date())); obs02.setSubject(new ResourceReferenceDt(patientId02)); - IdDt obsId02 = ourObservationDao.create(obs02).getId(); + IIdType obsId02 = ourObservationDao.create(obs02).getId(); // Create another type, that shouldn't be returned DiagnosticReport dr01 = new DiagnosticReport(); dr01.setSubject(new ResourceReferenceDt(patientId01)); - IdDt drId01 = ourDiagnosticReportDao.create(dr01).getId(); + IIdType drId01 = ourDiagnosticReportDao.create(dr01).getId(); ourLog.info("P1[{}] P2[{}] O1[{}] O2[{}] D1[{}]", new Object[] { patientId01, patientId02, obsId01, obsId02, drId01 }); @@ -1625,9 +1611,9 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { @Test public void testSearchWithMissingString() { - IdDt orgId = ourOrganizationDao.create(new Organization()).getId(); - IdDt notMissing; - IdDt missing; + IIdType orgId = ourOrganizationDao.create(new Organization()).getId(); + IIdType notMissing; + IIdType missing; { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); @@ -1647,7 +1633,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { StringParam param = new StringParam(); param.setMissing(false); params.put(Patient.SP_FAMILY, param); - List patients = toUnqualifiedVersionlessIds(ourPatientDao.search(params)); + List patients = toUnqualifiedVersionlessIds(ourPatientDao.search(params)); assertThat(patients, not(containsInRelativeOrder(missing))); assertThat(patients, containsInRelativeOrder(notMissing)); } @@ -1656,7 +1642,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { StringParam param = new StringParam(); param.setMissing(true); params.put(Patient.SP_FAMILY, param); - List patients = toUnqualifiedVersionlessIds(ourPatientDao.search(params)); + List patients = toUnqualifiedVersionlessIds(ourPatientDao.search(params)); assertThat(patients, containsInRelativeOrder(missing)); assertThat(patients, not(containsInRelativeOrder(notMissing))); } @@ -1664,8 +1650,8 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { @Test public void testSearchWithMissingQuantity() { - IdDt notMissing; - IdDt missing; + IIdType notMissing; + IIdType missing; { Observation obs = new Observation(); obs.addIdentifier().setSystem("urn:system").setValue("001"); @@ -1683,7 +1669,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { QuantityParam param = new QuantityParam(); param.setMissing(false); params.put(Observation.SP_VALUE_QUANTITY, param); - List patients = toUnqualifiedVersionlessIds(ourObservationDao.search(params)); + List patients = toUnqualifiedVersionlessIds(ourObservationDao.search(params)); assertThat(patients, not(containsInRelativeOrder(missing))); assertThat(patients, containsInRelativeOrder(notMissing)); } @@ -1692,7 +1678,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { QuantityParam param = new QuantityParam(); param.setMissing(true); params.put(Observation.SP_VALUE_QUANTITY, param); - List patients = toUnqualifiedVersionlessIds(ourObservationDao.search(params)); + List patients = toUnqualifiedVersionlessIds(ourObservationDao.search(params)); assertThat(patients, containsInRelativeOrder(missing)); assertThat(patients, not(containsInRelativeOrder(notMissing))); } @@ -1700,8 +1686,8 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { @Test public void testSearchWithToken() { - IdDt notMissing; - IdDt missing; + IIdType notMissing; + IIdType missing; { Observation obs = new Observation(); obs.addIdentifier().setSystem("urn:system").setValue("001"); @@ -1719,7 +1705,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { TokenParam param = new TokenParam(); param.setMissing(false); params.put(Observation.SP_CODE, param); - List patients = toUnqualifiedVersionlessIds(ourObservationDao.search(params)); + List patients = toUnqualifiedVersionlessIds(ourObservationDao.search(params)); assertThat(patients, not(containsInRelativeOrder(missing))); assertThat(patients, containsInRelativeOrder(notMissing)); } @@ -1728,7 +1714,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { TokenParam param = new TokenParam(); param.setMissing(true); params.put(Observation.SP_CODE, param); - List patients = toUnqualifiedVersionlessIds(ourObservationDao.search(params)); + List patients = toUnqualifiedVersionlessIds(ourObservationDao.search(params)); assertThat(patients, containsInRelativeOrder(missing)); assertThat(patients, not(containsInRelativeOrder(notMissing))); } @@ -1736,9 +1722,9 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { @Test public void testSearchWithMissingDate() { - IdDt orgId = ourOrganizationDao.create(new Organization()).getId(); - IdDt notMissing; - IdDt missing; + IIdType orgId = ourOrganizationDao.create(new Organization()).getId(); + IIdType notMissing; + IIdType missing; { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); @@ -1758,7 +1744,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { DateParam param = new DateParam(); param.setMissing(false); params.put(Patient.SP_BIRTHDATE, param); - List patients = toUnqualifiedVersionlessIds(ourPatientDao.search(params)); + List patients = toUnqualifiedVersionlessIds(ourPatientDao.search(params)); assertThat(patients, not(containsInRelativeOrder(missing))); assertThat(patients, containsInRelativeOrder(notMissing)); } @@ -1767,7 +1753,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { DateParam param = new DateParam(); param.setMissing(true); params.put(Patient.SP_BIRTHDATE, param); - List patients = toUnqualifiedVersionlessIds(ourPatientDao.search(params)); + List patients = toUnqualifiedVersionlessIds(ourPatientDao.search(params)); assertThat(patients, containsInRelativeOrder(missing)); assertThat(patients, not(containsInRelativeOrder(notMissing))); } @@ -1775,9 +1761,9 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { @Test public void testSearchWithMissingReference() { - IdDt orgId = ourOrganizationDao.create(new Organization()).getId().toUnqualifiedVersionless(); - IdDt notMissing; - IdDt missing; + IIdType orgId = ourOrganizationDao.create(new Organization()).getId().toUnqualifiedVersionless(); + IIdType notMissing; + IIdType missing; { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); @@ -1797,7 +1783,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { ReferenceParam param = new ReferenceParam(); param.setMissing(false); params.put(Patient.SP_ORGANIZATION, param); - List patients = toUnqualifiedVersionlessIds(ourPatientDao.search(params)); + List patients = toUnqualifiedVersionlessIds(ourPatientDao.search(params)); assertThat(patients, not(containsInRelativeOrder(missing))); assertThat(patients, containsInRelativeOrder(notMissing)); } @@ -1806,7 +1792,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { ReferenceParam param = new ReferenceParam(); param.setMissing(true); params.put(Patient.SP_ORGANIZATION, param); - List patients = toUnqualifiedVersionlessIds(ourPatientDao.search(params)); + List patients = toUnqualifiedVersionlessIds(ourPatientDao.search(params)); assertThat(patients, containsInRelativeOrder(missing)); assertThat(patients, not(containsInRelativeOrder(notMissing))); assertThat(patients, not(containsInRelativeOrder(orgId))); @@ -1939,7 +1925,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { @Test public void testSearchWithIncludes() { - IdDt parentOrgId; + IIdType parentOrgId; { Organization org = new Organization(); org.getNameElement().setValue("testSearchWithIncludes_O1Parent"); @@ -1949,7 +1935,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { Organization org = new Organization(); org.getNameElement().setValue("testSearchWithIncludes_O1"); org.setPartOf(new ResourceReferenceDt(parentOrgId)); - IdDt orgId = ourOrganizationDao.create(org).getId(); + IIdType orgId = ourOrganizationDao.create(org).getId(); Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); @@ -2028,7 +2014,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { Organization org = new Organization(); org.setId("testSearchWithIncludesThatHaveTextId_id1"); org.getNameElement().setValue("testSearchWithIncludesThatHaveTextId_O1"); - IdDt orgId = ourOrganizationDao.update(org).getId(); + IIdType orgId = ourOrganizationDao.update(org).getId(); assertThat(orgId.getValue(), endsWith("Organization/testSearchWithIncludesThatHaveTextId_id1/_history/1")); Patient patient = new Patient(); @@ -2066,26 +2052,26 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { p.addIdentifier().setSystem("urn:system").setValue("testtestSortByDate"); p.addName().addFamily("testSortF1").addGiven("testSortG1"); p.setBirthDate(new DateDt("2001-01-01")); - IdDt id1 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); + IIdType id1 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); // Create out of order p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue("testtestSortByDate"); p.addName().addFamily("testSortF2").addGiven("testSortG2"); p.setBirthDate(new DateDt("2001-01-03")); - IdDt id3 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); + IIdType id3 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue("testtestSortByDate"); p.addName().addFamily("testSortF3").addGiven("testSortG3"); p.setBirthDate(new DateDt("2001-01-02")); - IdDt id2 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); + IIdType id2 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue("testtestSortByDate"); - IdDt id4 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); + IIdType id4 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); - List actual; + List actual; SearchParameterMap pm; pm = new SearchParameterMap(); @@ -2117,28 +2103,28 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - IdDt id1 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); + IIdType id1 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - IdDt id2 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); + IIdType id2 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); p = new Patient(); p.setId(methodName); p.addIdentifier().setSystem("urn:system").setValue(methodName); - IdDt idMethodName = ourPatientDao.update(p).getId().toUnqualifiedVersionless(); + IIdType idMethodName = ourPatientDao.update(p).getId().toUnqualifiedVersionless(); assertEquals(methodName, idMethodName.getIdPart()); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - IdDt id3 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); + IIdType id3 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - IdDt id4 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); + IIdType id4 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); SearchParameterMap pm; - List actual; + List actual; pm = new SearchParameterMap(); pm.add(Patient.SP_IDENTIFIER, new TokenParam("urn:system", methodName)); @@ -2167,25 +2153,25 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue("testSortByString"); p.addName().addFamily("testSortF1").addGiven("testSortG1"); - IdDt id1 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); + IIdType id1 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); // Create out of order p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue("testSortByString"); p.addName().addFamily("testSortF3").addGiven("testSortG3"); - IdDt id3 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); + IIdType id3 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue("testSortByString"); p.addName().addFamily("testSortF2").addGiven("testSortG2"); - IdDt id2 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); + IIdType id2 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue("testSortByString"); - IdDt id4 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); + IIdType id4 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); SearchParameterMap pm; - List actual; + List actual; pm = new SearchParameterMap(); pm.add(Patient.SP_IDENTIFIER, new TokenParam("urn:system", "testSortByString")); @@ -2214,36 +2200,36 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { String methodName = "testSortByReference"; Organization o1 = new Organization(); - IdDt oid1 = ourOrganizationDao.create(o1).getId().toUnqualifiedVersionless(); + IIdType oid1 = ourOrganizationDao.create(o1).getId().toUnqualifiedVersionless(); Organization o2 = new Organization(); - IdDt oid2 = ourOrganizationDao.create(o2).getId().toUnqualifiedVersionless(); + IIdType oid2 = ourOrganizationDao.create(o2).getId().toUnqualifiedVersionless(); Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.addName().addFamily("testSortF1").addGiven("testSortG1"); p.getManagingOrganization().setReference(oid1); - IdDt id1 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); + IIdType id1 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.addName().addFamily("testSortF2").addGiven("testSortG2"); p.getManagingOrganization().setReference(oid2); - IdDt id2 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); + IIdType id2 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.addName().addFamily("testSortF3").addGiven("testSortG3"); p.getManagingOrganization().setReference(oid1); - IdDt id3 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); + IIdType id3 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.getManagingOrganization().setReference(oid2); - IdDt id4 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); + IIdType id4 = ourPatientDao.create(p).getId().toUnqualifiedVersionless(); SearchParameterMap pm; - List actual; + List actual; pm = new SearchParameterMap(); pm.add(Patient.SP_IDENTIFIER, new TokenParam("urn:system", methodName)); @@ -2274,13 +2260,13 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { public void testStoreUnversionedResources() { Organization o1 = new Organization(); o1.getNameElement().setValue("AAA"); - IdDt o1id = ourOrganizationDao.create(o1).getId(); + IIdType o1id = ourOrganizationDao.create(o1).getId(); assertTrue(o1id.hasVersionIdPart()); Patient p1 = new Patient(); p1.addName().addFamily("AAAA"); p1.getManagingOrganization().setReference(o1id); - IdDt p1id = ourPatientDao.create(p1).getId(); + IIdType p1id = ourPatientDao.create(p1).getId(); p1 = ourPatientDao.read(p1id); @@ -2296,7 +2282,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { Organization org = new Organization(); org.setName("測試醫院"); org.addIdentifier().setSystem("urn:system").setValue("testStoreUtf8Characters_01"); - IdDt orgId = ourOrganizationDao.create(org).getId(); + IIdType orgId = ourOrganizationDao.create(org).getId(); Organization returned = ourOrganizationDao.read(orgId); String val = ourFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(returned); @@ -2357,7 +2343,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { ResourceMetadataKeyEnum.PROFILES.put(patient, profiles); MethodOutcome outcome = ourPatientDao.create(patient); - IdDt patientId = outcome.getId(); + IIdType patientId = outcome.getId(); assertNotNull(patientId); assertFalse(patientId.isEmpty()); @@ -2534,7 +2520,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - IdDt id = ourPatientDao.create(p).getId(); + IIdType id = ourPatientDao.create(p).getId(); ourLog.info("Created patient, got it: {}", id); p = new Patient(); @@ -2560,7 +2546,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { p.addName().addFamily("Hello"); p.setId("Patient/" + methodName); - IdDt id = ourPatientDao.update(p).getId(); + IIdType id = ourPatientDao.update(p).getId(); assertEquals("Patient/" + methodName, id.toUnqualifiedVersionless().getValue()); p = ourPatientDao.read(id); @@ -2587,7 +2573,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue("testUpdateMaintainsSearchParamsDstu2AAA"); p1.addName().addFamily("Tester").addGiven("testUpdateMaintainsSearchParamsDstu2AAA"); - IdDt p1id = ourPatientDao.create(p1).getId(); + IIdType p1id = ourPatientDao.create(p1).getId(); Patient p2 = new Patient(); p2.addIdentifier().setSystem("urn:system").setValue("testUpdateMaintainsSearchParamsDstu2BBB"); @@ -2601,7 +2587,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { // Update the name p1.getNameFirstRep().getGivenFirstRep().setValue("testUpdateMaintainsSearchParamsDstu2BBB"); MethodOutcome update2 = ourPatientDao.update(p1); - IdDt p1id2 = update2.getId(); + IIdType p1id2 = update2.getId(); ids = ourPatientDao.searchForIds(Patient.SP_GIVEN, new StringDt("testUpdateMaintainsSearchParamsDstu2AAA")); assertEquals(0, ids.size()); @@ -2623,7 +2609,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue("testUpdateRejectsInvalidTypes"); p1.addName().addFamily("Tester").addGiven("testUpdateRejectsInvalidTypes"); - IdDt p1id = ourPatientDao.create(p1).getId(); + IIdType p1id = ourPatientDao.create(p1).getId(); Organization p2 = new Organization(); p2.getNameElement().setValue("testUpdateRejectsInvalidTypes"); @@ -2664,10 +2650,10 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { return theSearch.getResources(0, theSearch.size()); } - private List toUnqualifiedVersionlessIds(IBundleProvider theFound) { - List retVal = new ArrayList(); + private List toUnqualifiedVersionlessIds(IBundleProvider theFound) { + List retVal = new ArrayList(); for (IBaseResource next : theFound.getResources(0, theFound.size())) { - retVal.add((IdDt) next.getIdElement().toUnqualifiedVersionless()); + retVal.add((IIdType) next.getIdElement().toUnqualifiedVersionless()); } return retVal; } @@ -2707,7 +2693,7 @@ public class FhirResourceDaoDstu2Test extends BaseJpaTest { ourLog.info("Initial size: " + value.size()); for (IBaseResource next : value.getResources(0, value.size())) { ourLog.info("Deleting: {}", next.getIdElement()); - ourDeviceDao.delete((IdDt) next.getIdElement()); + ourDeviceDao.delete((IIdType) next.getIdElement()); } value = ourDeviceDao.search(new SearchParameterMap()); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoDstu1Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoDstu1Test.java index 37cfda114ef..9ee1499722a 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoDstu1Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoDstu1Test.java @@ -88,19 +88,19 @@ public class FhirSystemDaoDstu1Test extends BaseJpaTest { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("testHistory"); patient.addName().addFamily("Tester").addGiven("Joe"); - IdDt pid = ourPatientDao.create(patient).getId().toVersionless(); + IIdType pid = ourPatientDao.create(patient).getId().toVersionless(); Thread.sleep(10); patient.setId(pid); - IdDt newpid = ourPatientDao.update(patient).getId(); + IIdType newpid = ourPatientDao.update(patient).getId(); Thread.sleep(10); patient.setId(pid); - IdDt newpid2 = ourPatientDao.update(patient).getId(); + IIdType newpid2 = ourPatientDao.update(patient).getId(); Thread.sleep(10); patient.setId(pid); - IdDt newpid3 = ourPatientDao.update(patient).getId(); + IIdType newpid3 = ourPatientDao.update(patient).getId(); IBundleProvider values = ourSystemDao.history(start); assertEquals(4, values.size()); @@ -113,7 +113,7 @@ public class FhirSystemDaoDstu1Test extends BaseJpaTest { Location loc = new Location(); loc.getAddress().addLine("AAA"); - IdDt lid = ourLocationDao.create(loc).getId(); + IIdType lid = ourLocationDao.create(loc).getId(); Location loc2 = new Location(); loc2.getAddress().addLine("AAA"); @@ -224,7 +224,7 @@ public class FhirSystemDaoDstu1Test extends BaseJpaTest { Observation o1 = new Observation(); o1.getName().setText("testGetAllTags02"); ResourceMetadataKeyEnum.TAG_LIST.put(o1, tl2); - IdDt o1id = ourObservationDao.create(o1).getId(); + IIdType o1id = ourObservationDao.create(o1).getId(); assertTrue(o1id.getVersionIdPart() != null); TagList postSystemTl = ourSystemDao.getAllTags(); @@ -241,7 +241,7 @@ public class FhirSystemDaoDstu1Test extends BaseJpaTest { o1.getResourceMetadata().remove(ResourceMetadataKeyEnum.TAG_LIST); o1.setId(o1id); - IdDt o1id2 = ourObservationDao.update(o1).getId(); + IIdType o1id2 = ourObservationDao.update(o1).getId(); assertTrue(o1id2.getVersionIdPart() != null); tags2 = ourObservationDao.getTags(o1id); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoDstu2Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoDstu2Test.java index def1ab6fe8a..eca31dacf11 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoDstu2Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoDstu2Test.java @@ -1,18 +1,7 @@ package ca.uhn.fhir.jpa.dao; -import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.emptyString; -import static org.hamcrest.Matchers.endsWith; -import static org.hamcrest.Matchers.greaterThan; -import static org.hamcrest.Matchers.not; -import static org.hamcrest.Matchers.startsWith; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.hamcrest.Matchers.*; +import static org.junit.Assert.*; import java.io.InputStream; import java.sql.SQLException; @@ -21,11 +10,11 @@ import java.util.List; import org.apache.commons.io.IOUtils; import org.hl7.fhir.instance.model.api.IBaseResource; +import org.hl7.fhir.instance.model.api.IIdType; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import org.springframework.context.support.ClassPathXmlApplicationContext; -import org.springframework.jmx.access.InvalidInvocationException; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.FhirVersionEnum; @@ -76,7 +65,7 @@ public class FhirSystemDaoDstu2Test extends BaseJpaTest { assertEquals(0, published.size()); String methodName = "testSystemMetaOperation"; - IdDt id1; + IIdType id1; { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue(methodName); @@ -165,7 +154,7 @@ public class FhirSystemDaoDstu2Test extends BaseJpaTest { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.setId("Patient/" + methodName); - IdDt id = ourPatientDao.update(p).getId(); + IIdType id = ourPatientDao.update(p).getId(); ourLog.info("Created patient, got it: {}", id); p = new Patient(); @@ -205,7 +194,7 @@ public class FhirSystemDaoDstu2Test extends BaseJpaTest { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - IdDt id = ourPatientDao.create(p).getId(); + IIdType id = ourPatientDao.create(p).getId(); ourLog.info("Created patient, got it: {}", id); p = new Patient(); @@ -333,13 +322,13 @@ public class FhirSystemDaoDstu2Test extends BaseJpaTest { Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue(methodName); - IdDt id1 = ourPatientDao.create(p1).getId(); + IIdType id1 = ourPatientDao.create(p1).getId(); ourLog.info("Created patient, got it: {}", id1); Patient p2 = new Patient(); p2.addIdentifier().setSystem("urn:system").setValue(methodName); p2.setId("Patient/" + methodName); - IdDt id2 = ourPatientDao.update(p2).getId(); + IIdType id2 = ourPatientDao.update(p2).getId(); ourLog.info("Created patient, got it: {}", id2); Bundle request = new Bundle(); @@ -379,7 +368,7 @@ public class FhirSystemDaoDstu2Test extends BaseJpaTest { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - IdDt id = ourPatientDao.create(p).getId(); + IIdType id = ourPatientDao.create(p).getId(); ourLog.info("Created patient, got it: {}", id); Bundle request = new Bundle(); @@ -420,7 +409,7 @@ public class FhirSystemDaoDstu2Test extends BaseJpaTest { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - IdDt id = ourPatientDao.create(p).getId(); + IIdType id = ourPatientDao.create(p).getId(); ourLog.info("Created patient, got it: {}", id); p = new Patient(); @@ -466,7 +455,7 @@ public class FhirSystemDaoDstu2Test extends BaseJpaTest { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.setId("Patient/" + methodName); - IdDt id = ourPatientDao.update(p).getId(); + IIdType id = ourPatientDao.update(p).getId(); ourLog.info("Created patient, got it: {}", id); Bundle request = new Bundle(); @@ -531,14 +520,14 @@ public class FhirSystemDaoDstu2Test extends BaseJpaTest { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.setId("Patient/" + methodName); - IdDt idv1 = ourPatientDao.update(p).getId(); + IIdType idv1 = ourPatientDao.update(p).getId(); ourLog.info("Created patient, got id: {}", idv1); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.addName().addFamily("Family Name"); p.setId("Patient/" + methodName); - IdDt idv2 = ourPatientDao.update(p).getId(); + IIdType idv2 = ourPatientDao.update(p).getId(); ourLog.info("Updated patient, got id: {}", idv2); Bundle request = new Bundle(); @@ -573,14 +562,14 @@ public class FhirSystemDaoDstu2Test extends BaseJpaTest { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.setId("Patient/" + methodName); - IdDt idv1 = ourPatientDao.update(p).getId(); + IIdType idv1 = ourPatientDao.update(p).getId(); ourLog.info("Created patient, got id: {}", idv1); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.addName().addFamily("Family Name"); p.setId("Patient/" + methodName); - IdDt idv2 = ourPatientDao.update(p).getId(); + IIdType idv2 = ourPatientDao.update(p).getId(); ourLog.info("Updated patient, got id: {}", idv2); Bundle request = new Bundle(); @@ -619,14 +608,14 @@ public class FhirSystemDaoDstu2Test extends BaseJpaTest { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.setId("Patient/" + methodName); - IdDt idv1 = ourPatientDao.update(p).getId(); + IIdType idv1 = ourPatientDao.update(p).getId(); ourLog.info("Created patient, got id: {}", idv1); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.addName().addFamily("Family Name"); p.setId("Patient/" + methodName); - IdDt idv2 = ourPatientDao.update(p).getId(); + IIdType idv2 = ourPatientDao.update(p).getId(); ourLog.info("Updated patient, got id: {}", idv2); Bundle request = new Bundle(); @@ -664,7 +653,7 @@ public class FhirSystemDaoDstu2Test extends BaseJpaTest { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - IdDt id = ourPatientDao.create(p).getId(); + IIdType id = ourPatientDao.create(p).getId(); ourLog.info("Created patient, got it: {}", id); p = new Patient(); @@ -705,7 +694,7 @@ public class FhirSystemDaoDstu2Test extends BaseJpaTest { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); - IdDt id = ourPatientDao.create(p).getId(); + IIdType id = ourPatientDao.create(p).getId(); ourLog.info("Created patient, got it: {}", id); p = new Patient(); @@ -739,7 +728,7 @@ public class FhirSystemDaoDstu2Test extends BaseJpaTest { Patient p = new Patient(); p.addName().addFamily("Hello"); - IdDt id = ourPatientDao.create(p).getId(); + IIdType id = ourPatientDao.create(p).getId(); p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); @@ -778,7 +767,7 @@ public class FhirSystemDaoDstu2Test extends BaseJpaTest { Patient p = new Patient(); p.addIdentifier().setSystem("urn:system").setValue(methodName); p.setId("Patient/" + methodName); - IdDt id = ourPatientDao.update(p).getId(); + IIdType id = ourPatientDao.update(p).getId(); ourLog.info("Created patient, got it: {}", id); p = new Patient(); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/ResourceProviderDstu1Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/ResourceProviderDstu1Test.java index 05546effce1..6a5557b5dfa 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/ResourceProviderDstu1Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/ResourceProviderDstu1Test.java @@ -11,6 +11,7 @@ import org.apache.commons.io.IOUtils; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.instance.model.api.IIdType; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -111,7 +112,7 @@ public class ResourceProviderDstu1Test extends BaseJpaTest { Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue("testCreateWithId01"); - IdDt p1Id = ourClient.create().resource(p1).withId("testCreateWithId").execute().getId(); + IIdType p1Id = ourClient.create().resource(p1).withId("testCreateWithId").execute().getId(); assertThat(p1Id.getValue(), containsString("Patient/testCreateWithId/_history")); @@ -143,12 +144,12 @@ public class ResourceProviderDstu1Test extends BaseJpaTest { Location l1 = new Location(); l1.getNameElement().setValue("testDeepChainingL1"); - IdDt l1id = ourClient.create().resource(l1).execute().getId(); + IIdType l1id = ourClient.create().resource(l1).execute().getId(); Location l2 = new Location(); l2.getNameElement().setValue("testDeepChainingL2"); l2.getPartOf().setReference(l1id.toVersionless().toUnqualified()); - IdDt l2id = ourClient.create().resource(l2).execute().getId(); + IIdType l2id = ourClient.create().resource(l2).execute().getId(); Encounter e1 = new Encounter(); e1.addIdentifier().setSystem("urn:foo").setValue("testDeepChainingE1"); @@ -157,7 +158,7 @@ public class ResourceProviderDstu1Test extends BaseJpaTest { ca.uhn.fhir.model.dstu.resource.Encounter.Location location = e1.addLocation(); location.getLocation().setReference(l2id.toUnqualifiedVersionless()); location.setPeriod(new PeriodDt().setStartWithSecondsPrecision(new Date()).setEndWithSecondsPrecision(new Date())); - IdDt e1id = ourClient.create().resource(e1).execute().getId(); + IIdType e1id = ourClient.create().resource(e1).execute().getId(); //@formatter:off Bundle res = ourClient.search() @@ -257,9 +258,9 @@ public class ResourceProviderDstu1Test extends BaseJpaTest { p1.getText().getDiv().setValueAsString("
HELLO WORLD
"); p1.addIdentifier().setSystem("urn:system").setValue("testSaveAndRetrieveExistingNarrative01"); - IdDt newId = ourClient.create().resource(p1).execute().getId(); + IIdType newId = ourClient.create().resource(p1).execute().getId(); - Patient actual = ourClient.read(Patient.class, newId); + Patient actual = ourClient.read(Patient.class, (IdDt)newId); assertEquals("
HELLO WORLD
", actual.getText().getDiv().getValueAsString()); } @@ -273,9 +274,9 @@ public class ResourceProviderDstu1Test extends BaseJpaTest { p1.getManagingOrganization().setResource(o1); - IdDt newId = ourClient.create().resource(p1).execute().getId(); + IIdType newId = ourClient.create().resource(p1).execute().getId(); - Patient actual = ourClient.read(Patient.class, newId); + Patient actual = ourClient.read(Patient.class, (IdDt)newId); assertEquals(1, actual.getContained().getContainedResources().size()); assertThat(actual.getText().getDiv().getValueAsString(), containsString("IdentifiertestSaveAndRetrieveWithContained01")); @@ -289,9 +290,9 @@ public class ResourceProviderDstu1Test extends BaseJpaTest { Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue("testSearchByResourceChain01"); - IdDt newId = ourClient.create().resource(p1).execute().getId(); + IIdType newId = ourClient.create().resource(p1).execute().getId(); - Patient actual = ourClient.read(Patient.class, newId); + Patient actual = ourClient.read(Patient.class, (IdDt)newId); assertThat(actual.getText().getDiv().getValueAsString(), containsString("IdentifiertestSearchByResourceChain01")); } @@ -303,7 +304,7 @@ public class ResourceProviderDstu1Test extends BaseJpaTest { Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue("testSearchByIdentifier01"); p1.addName().addFamily("testSearchByIdentifierFamily01").addGiven("testSearchByIdentifierGiven01"); - IdDt p1Id = ourClient.create().resource(p1).execute().getId(); + IIdType p1Id = ourClient.create().resource(p1).execute().getId(); Patient p2 = new Patient(); p2.addIdentifier().setSystem("urn:system").setValue("testSearchByIdentifier02"); @@ -321,7 +322,7 @@ public class ResourceProviderDstu1Test extends BaseJpaTest { Patient p1 = new Patient(); p1.addIdentifier().setValue("testSearchByIdentifierWithoutSystem01"); - IdDt p1Id = ourClient.create().resource(p1).execute().getId(); + IIdType p1Id = ourClient.create().resource(p1).execute().getId(); Bundle actual = ourClient.search().forResource(Patient.class).where(Patient.IDENTIFIER.exactly().systemAndCode(null, "testSearchByIdentifierWithoutSystem01")).encodedJson().prettyPrint().execute(); assertEquals(1, actual.size()); @@ -336,13 +337,13 @@ public class ResourceProviderDstu1Test extends BaseJpaTest { Organization o1 = new Organization(); o1.setName("testSearchByResourceChainName01"); - IdDt o1id = ourClient.create().resource(o1).execute().getId(); + IIdType o1id = ourClient.create().resource(o1).execute().getId(); Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue("testSearchByResourceChain01"); p1.addName().addFamily("testSearchByResourceChainFamily01").addGiven("testSearchByResourceChainGiven01"); p1.setManagingOrganization(new ResourceReferenceDt(o1id)); - IdDt p1Id = ourClient.create().resource(p1).execute().getId(); + IIdType p1Id = ourClient.create().resource(p1).execute().getId(); //@formatter:off Bundle actual = ourClient.search() @@ -368,7 +369,7 @@ public class ResourceProviderDstu1Test extends BaseJpaTest { public void testSearchWithInclude() throws Exception { Organization org = new Organization(); org.addIdentifier().setSystem("urn:system").setValue( "testSearchWithInclude01"); - IdDt orgId = ourClient.create().resource(org).prettyPrint().encodedXml().execute().getId(); + IIdType orgId = ourClient.create().resource(org).prettyPrint().encodedXml().execute().getId(); Patient pat = new Patient(); pat.addIdentifier().setSystem("urn:system").setValue("testSearchWithInclude02"); @@ -401,7 +402,7 @@ public class ResourceProviderDstu1Test extends BaseJpaTest { Organization org = new Organization(); org.setName("測試醫院"); org.addIdentifier().setSystem("urn:system").setValue("testStoreUtf8Characters_01"); - IdDt orgId = ourClient.create().resource(org).prettyPrint().encodedXml().execute().getId(); + IIdType orgId = ourClient.create().resource(org).prettyPrint().encodedXml().execute().getId(); // Read back directly from the DAO { @@ -412,7 +413,7 @@ public class ResourceProviderDstu1Test extends BaseJpaTest { } // Read back through the HTTP API { - Organization returned = ourClient.read(Organization.class, orgId); + Organization returned = ourClient.read(Organization.class, (IdDt)orgId); String val = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(returned); ourLog.info(val); assertThat(val, containsString("")); @@ -444,7 +445,7 @@ public class ResourceProviderDstu1Test extends BaseJpaTest { Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue("testUpdateRejectsInvalidTypes"); p1.addName().addFamily("Tester").addGiven("testUpdateRejectsInvalidTypes"); - IdDt p1id = ourClient.create().resource(p1).execute().getId(); + IIdType p1id = ourClient.create().resource(p1).execute().getId(); Organization p2 = new Organization(); p2.getNameElement().setValue("testUpdateRejectsInvalidTypes"); @@ -472,7 +473,7 @@ public class ResourceProviderDstu1Test extends BaseJpaTest { p1.addIdentifier().setSystem("urn:system").setValue("testUpdateWithClientSuppliedIdWhichDoesntExist"); MethodOutcome outcome = ourClient.update().resource(p1).withId("testUpdateWithClientSuppliedIdWhichDoesntExist").execute(); assertEquals(true, outcome.getCreated().booleanValue()); - IdDt p1Id = outcome.getId(); + IIdType p1Id = outcome.getId(); assertThat(p1Id.getValue(), containsString("Patient/testUpdateWithClientSuppliedIdWhichDoesntExist/_history")); diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/ResourceProviderDstu2Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/ResourceProviderDstu2Test.java index 0a51fb7a09a..5f2d747524e 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/ResourceProviderDstu2Test.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/ResourceProviderDstu2Test.java @@ -1,12 +1,6 @@ package ca.uhn.fhir.jpa.provider; -import static org.hamcrest.Matchers.containsInAnyOrder; -import static org.hamcrest.Matchers.containsInRelativeOrder; -import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.greaterThan; -import static org.hamcrest.Matchers.hasItems; -import static org.hamcrest.Matchers.not; -import static org.hamcrest.Matchers.startsWith; +import static org.hamcrest.Matchers.*; import static org.junit.Assert.*; import java.io.BufferedReader; @@ -38,6 +32,7 @@ import org.eclipse.jetty.server.Server; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; import org.hl7.fhir.instance.model.api.IBaseResource; +import org.hl7.fhir.instance.model.api.IIdType; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -77,6 +72,7 @@ import ca.uhn.fhir.model.primitive.DateTimeDt; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.model.primitive.InstantDt; import ca.uhn.fhir.model.primitive.UnsignedIntDt; +import ca.uhn.fhir.model.primitive.UriDt; import ca.uhn.fhir.model.valueset.BundleEntrySearchModeEnum; import ca.uhn.fhir.model.valueset.BundleTypeEnum; import ca.uhn.fhir.narrative.DefaultThymeleafNarrativeGenerator; @@ -141,7 +137,7 @@ public class ResourceProviderDstu2Test extends BaseJpaTest { IGenericClient client = ourClient; String resBody = IOUtils.toString(ResourceProviderDstu2Test.class.getResource("/document-father.json")); - IdDt id = client.create().resource(resBody).execute().getId(); + IIdType id = client.create().resource(resBody).execute().getId(); ourLog.info("Created: {}", id); @@ -246,12 +242,12 @@ public class ResourceProviderDstu2Test extends BaseJpaTest { Location l1 = new Location(); l1.getNameElement().setValue("testDeepChainingL1"); - IdDt l1id = ourClient.create().resource(l1).execute().getId(); + IIdType l1id = ourClient.create().resource(l1).execute().getId(); Location l2 = new Location(); l2.getNameElement().setValue("testDeepChainingL2"); l2.getPartOf().setReference(l1id.toVersionless().toUnqualified()); - IdDt l2id = ourClient.create().resource(l2).execute().getId(); + IIdType l2id = ourClient.create().resource(l2).execute().getId(); Encounter e1 = new Encounter(); e1.addIdentifier().setSystem("urn:foo").setValue("testDeepChainingE1"); @@ -260,7 +256,7 @@ public class ResourceProviderDstu2Test extends BaseJpaTest { ca.uhn.fhir.model.dstu2.resource.Encounter.Location location = e1.addLocation(); location.getLocation().setReference(l2id.toUnqualifiedVersionless()); location.setPeriod(new PeriodDt().setStartWithSecondsPrecision(new Date()).setEndWithSecondsPrecision(new Date())); - IdDt e1id = ourClient.create().resource(e1).execute().getId(); + IIdType e1id = ourClient.create().resource(e1).execute().getId(); //@formatter:off Bundle res = ourClient.search() @@ -542,30 +538,30 @@ public class ResourceProviderDstu2Test extends BaseJpaTest { Organization org1 = new Organization(); org1.setName(methodName + "1"); - IdDt orgId1 = ourClient.create().resource(org1).execute().getId(); + IIdType orgId1 = ourClient.create().resource(org1).execute().getId(); Patient p = new Patient(); p.addName().addFamily(methodName); p.getManagingOrganization().setReference(orgId1); - IdDt patientId = ourClient.create().resource(p).execute().getId(); + IIdType patientId = ourClient.create().resource(p).execute().getId(); Organization org2 = new Organization(); org2.setName(methodName + "1"); - IdDt orgId2 = ourClient.create().resource(org2).execute().getId(); + IIdType orgId2 = ourClient.create().resource(org2).execute().getId(); Device dev = new Device(); dev.setModel(methodName); dev.getOwner().setReference(orgId2); - IdDt devId = ourClient.create().resource(dev).execute().getId(); + IIdType devId = ourClient.create().resource(dev).execute().getId(); Observation obs = new Observation(); obs.getSubject().setReference(patientId); obs.getDevice().setReference(devId); - IdDt obsId = ourClient.create().resource(obs).execute().getId(); + IIdType obsId = ourClient.create().resource(obs).execute().getId(); Encounter enc = new Encounter(); enc.getPatient().setReference(patientId); - IdDt encId = ourClient.create().resource(enc).execute().getId(); + IIdType encId = ourClient.create().resource(enc).execute().getId(); Parameters output = ourClient.operation().onInstance(patientId).named("everything").withNoParameters(Parameters.class).execute(); ca.uhn.fhir.model.dstu2.resource.Bundle b = (ca.uhn.fhir.model.dstu2.resource.Bundle) output.getParameterFirstRep().getResource(); @@ -636,9 +632,9 @@ public class ResourceProviderDstu2Test extends BaseJpaTest { p1.getText().getDiv().setValueAsString("
HELLO WORLD
"); p1.addIdentifier().setSystem("urn:system").setValue("testSaveAndRetrieveExistingNarrative01"); - IdDt newId = ourClient.create().resource(p1).execute().getId(); + IIdType newId = ourClient.create().resource(p1).execute().getId(); - Patient actual = ourClient.read(Patient.class, newId); + Patient actual = ourClient.read(Patient.class, (UriDt)newId); assertEquals("
HELLO WORLD
", actual.getText().getDiv().getValueAsString()); } @@ -652,9 +648,9 @@ public class ResourceProviderDstu2Test extends BaseJpaTest { p1.getManagingOrganization().setResource(o1); - IdDt newId = ourClient.create().resource(p1).execute().getId(); + IIdType newId = ourClient.create().resource(p1).execute().getId(); - Patient actual = ourClient.read(Patient.class, newId); + Patient actual = ourClient.read(Patient.class, (UriDt)newId); assertEquals(1, actual.getContained().getContainedResources().size()); assertThat(actual.getText().getDiv().getValueAsString(), containsString("IdentifiertestSaveAndRetrieveWithContained01")); @@ -668,7 +664,7 @@ public class ResourceProviderDstu2Test extends BaseJpaTest { Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue("testSearchByResourceChain01"); - IdDt newId = ourClient.create().resource(p1).execute().getId(); + IdDt newId = (IdDt) ourClient.create().resource(p1).execute().getId(); Patient actual = ourClient.read(Patient.class, newId); assertThat(actual.getText().getDiv().getValueAsString(), containsString("IdentifiertestSearchByResourceChain01")); @@ -696,7 +692,7 @@ public class ResourceProviderDstu2Test extends BaseJpaTest { Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue("testSearchByIdentifier01"); p1.addName().addFamily("testSearchByIdentifierFamily01").addGiven("testSearchByIdentifierGiven01"); - IdDt p1Id = ourClient.create().resource(p1).execute().getId(); + IdDt p1Id = (IdDt) ourClient.create().resource(p1).execute().getId(); Patient p2 = new Patient(); p2.addIdentifier().setSystem("urn:system").setValue("testSearchByIdentifier02"); @@ -715,7 +711,7 @@ public class ResourceProviderDstu2Test extends BaseJpaTest { Patient p1 = new Patient(); p1.addIdentifier().setValue("testSearchByIdentifierWithoutSystem01"); - IdDt p1Id = ourClient.create().resource(p1).execute().getId(); + IdDt p1Id = (IdDt) ourClient.create().resource(p1).execute().getId(); Bundle actual = ourClient.search().forResource(Patient.class).where(Patient.IDENTIFIER.exactly().systemAndCode(null, "testSearchByIdentifierWithoutSystem01")).encodedJson().prettyPrint() .execute(); @@ -731,13 +727,13 @@ public class ResourceProviderDstu2Test extends BaseJpaTest { Organization o1 = new Organization(); o1.setName("testSearchByResourceChainName01"); - IdDt o1id = ourClient.create().resource(o1).execute().getId(); + IdDt o1id = (IdDt) ourClient.create().resource(o1).execute().getId(); Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue("testSearchByResourceChain01"); p1.addName().addFamily("testSearchByResourceChainFamily01").addGiven("testSearchByResourceChainGiven01"); p1.setManagingOrganization(new ResourceReferenceDt(o1id)); - IdDt p1Id = ourClient.create().resource(p1).execute().getId(); + IdDt p1Id = (IdDt) ourClient.create().resource(p1).execute().getId(); //@formatter:off Bundle actual = ourClient.search() @@ -763,7 +759,7 @@ public class ResourceProviderDstu2Test extends BaseJpaTest { public void testSearchWithInclude() throws Exception { Organization org = new Organization(); org.addIdentifier().setSystem("urn:system:rpdstu2").setValue("testSearchWithInclude01"); - IdDt orgId = ourClient.create().resource(org).prettyPrint().encodedXml().execute().getId(); + IdDt orgId = (IdDt) ourClient.create().resource(org).prettyPrint().encodedXml().execute().getId(); Patient pat = new Patient(); pat.addIdentifier().setSystem("urn:system:rpdstu2").setValue("testSearchWithInclude02"); @@ -827,12 +823,12 @@ public class ResourceProviderDstu2Test extends BaseJpaTest { String methodName = "testSearchWithMissing"; Organization org = new Organization(); - IdDt deletedIdMissingTrue = ourClient.create().resource(org).execute().getId().toUnqualifiedVersionless(); + IdDt deletedIdMissingTrue = (IdDt) ourClient.create().resource(org).execute().getId().toUnqualifiedVersionless(); ourClient.delete().resourceById(deletedIdMissingTrue).execute(); org = new Organization(); org.setName("Help I'm a Bug"); - IdDt deletedIdMissingFalse = ourClient.create().resource(org).execute().getId().toUnqualifiedVersionless(); + IdDt deletedIdMissingFalse = (IdDt) ourClient.create().resource(org).execute().getId().toUnqualifiedVersionless(); ourClient.delete().resourceById(deletedIdMissingFalse).execute(); List resources = new ArrayList(); @@ -846,11 +842,11 @@ public class ResourceProviderDstu2Test extends BaseJpaTest { org = new Organization(); org.addIdentifier().setSystem("urn:system:rpdstu2").setValue(methodName + "01"); org.setName(methodName + "name"); - IdDt orgNotMissing = ourClient.create().resource(org).prettyPrint().encodedXml().execute().getId().toUnqualifiedVersionless(); + IdDt orgNotMissing = (IdDt) ourClient.create().resource(org).prettyPrint().encodedXml().execute().getId().toUnqualifiedVersionless(); org = new Organization(); org.addIdentifier().setSystem("urn:system:rpdstu2").setValue(methodName + "01"); - IdDt orgMissing = ourClient.create().resource(org).prettyPrint().encodedXml().execute().getId().toUnqualifiedVersionless(); + IdDt orgMissing = (IdDt) ourClient.create().resource(org).prettyPrint().encodedXml().execute().getId().toUnqualifiedVersionless(); { //@formatter:off @@ -896,7 +892,7 @@ public class ResourceProviderDstu2Test extends BaseJpaTest { Organization org = new Organization(); org.setName("測試醫院"); org.addIdentifier().setSystem("urn:system").setValue("testStoreUtf8Characters_01"); - IdDt orgId = ourClient.create().resource(org).prettyPrint().encodedXml().execute().getId(); + IdDt orgId = (IdDt) ourClient.create().resource(org).prettyPrint().encodedXml().execute().getId(); // Read back directly from the DAO { @@ -939,7 +935,7 @@ public class ResourceProviderDstu2Test extends BaseJpaTest { Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue("testUpdateRejectsInvalidTypes"); p1.addName().addFamily("Tester").addGiven("testUpdateRejectsInvalidTypes"); - IdDt p1id = ourClient.create().resource(p1).execute().getId(); + IdDt p1id = (IdDt) ourClient.create().resource(p1).execute().getId(); Organization p2 = new Organization(); p2.getNameElement().setValue("testUpdateRejectsInvalidTypes"); @@ -1002,7 +998,7 @@ public class ResourceProviderDstu2Test extends BaseJpaTest { p1.addIdentifier().setSystem("urn:system").setValue("testUpdateWithClientSuppliedIdWhichDoesntExistRpDstu2"); MethodOutcome outcome = ourClient.update().resource(p1).withId("testUpdateWithClientSuppliedIdWhichDoesntExistRpDstu2").execute(); assertEquals(true, outcome.getCreated().booleanValue()); - IdDt p1Id = outcome.getId(); + IdDt p1Id = (IdDt) outcome.getId(); assertThat(p1Id.getValue(), containsString("Patient/testUpdateWithClientSuppliedIdWhichDoesntExistRpDstu2/_history")); @@ -1040,6 +1036,33 @@ public class ResourceProviderDstu2Test extends BaseJpaTest { } } + @Test + public void testValidateResourceWithId() throws IOException { + + Patient patient = new Patient(); + patient.addName().addGiven("James"); + patient.setBirthDate(new DateDt("2011-02-02")); + + Parameters input = new Parameters(); + input.addParameter().setName("resource").setResource(patient); + + String inputStr = ourCtx.newXmlParser().encodeResourceToString(input); + ourLog.info(inputStr); + + HttpPost post = new HttpPost(ourServerBase + "/Patient/123/$validate"); + post.setEntity(new StringEntity(inputStr, ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + + CloseableHttpResponse response = ourHttpClient.execute(post); + try { + String resp = IOUtils.toString(response.getEntity().getContent()); + ourLog.info(resp); + assertEquals(200, response.getStatusLine().getStatusCode()); + } finally { + IOUtils.closeQuietly(response.getEntity().getContent()); + response.close(); + } + } + @Test public void testValidateResourceHuge() throws IOException { @@ -1148,14 +1171,14 @@ public class ResourceProviderDstu2Test extends BaseJpaTest { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("001"); patient.addName().addFamily(methodName).addGiven("Joe"); - id1a = ourClient.create().resource(patient).execute().getId().toUnqualifiedVersionless(); + id1a = (IdDt) ourClient.create().resource(patient).execute().getId().toUnqualifiedVersionless(); } IdDt id1b; { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("002"); patient.addName().addFamily(methodName + "XXXX").addGiven("Joe"); - id1b = ourClient.create().resource(patient).execute().getId().toUnqualifiedVersionless(); + id1b = (IdDt) ourClient.create().resource(patient).execute().getId().toUnqualifiedVersionless(); } Thread.sleep(1100); @@ -1167,7 +1190,7 @@ public class ResourceProviderDstu2Test extends BaseJpaTest { Patient patient = new Patient(); patient.addIdentifier().setSystem("urn:system").setValue("002"); patient.addName().addFamily(methodName).addGiven("John"); - id2 = ourClient.create().resource(patient).execute().getId().toUnqualifiedVersionless(); + id2 = (IdDt) ourClient.create().resource(patient).execute().getId().toUnqualifiedVersionless(); } { diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/ResourceProviderMultiVersionTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/ResourceProviderMultiVersionTest.java index fb1823338d0..eedbf544c3c 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/ResourceProviderMultiVersionTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/ResourceProviderMultiVersionTest.java @@ -46,7 +46,7 @@ public class ResourceProviderMultiVersionTest extends BaseJpaTest { p.addIdentifier("urn:MultiFhirVersionTest", "testSubmitPatient01"); p.addUndeclaredExtension(false, "http://foo#ext1", new StringDt("The value")); p.getGender().setValueAsEnum(AdministrativeGenderCodesEnum.M); - IdDt id = ourClientDstu1.create().resource(p).execute().getId(); + IdDt id = (IdDt) ourClientDstu1.create().resource(p).execute().getId(); // Read back as DSTU1 Patient patDstu1 = ourClientDstu1.read(Patient.class, id); @@ -76,7 +76,7 @@ public class ResourceProviderMultiVersionTest extends BaseJpaTest { p.addIdentifier().setSystem("urn:MultiFhirVersionTest").setValue("testSubmitPatientDstu201"); p.addUndeclaredExtension(false, "http://foo#ext1", new StringDt("The value")); p.setGender(AdministrativeGenderEnum.MALE); - IdDt id = ourClientDstu2.create().resource(p).execute().getId(); + IdDt id = (IdDt) ourClientDstu2.create().resource(p).execute().getId(); // Read back as DSTU1 Patient patDstu1 = ourClientDstu1.read(Patient.class, id); @@ -105,7 +105,7 @@ public class ResourceProviderMultiVersionTest extends BaseJpaTest { public void testUnknownResourceType() { ca.uhn.fhir.model.dstu2.resource.Patient p = new ca.uhn.fhir.model.dstu2.resource.Patient(); p.addIdentifier().setSystem("urn:MultiFhirVersionTest").setValue("testUnknownResourceType01"); - IdDt id = ourClientDstu2.create().resource(p).execute().getId(); + IdDt id = (IdDt) ourClientDstu2.create().resource(p).execute().getId(); PaymentNotice s = new PaymentNotice(); s.addIdentifier().setSystem("urn:MultiFhirVersionTest").setValue("testUnknownResourceType02"); diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/test/java/ca/uhn/fhirtest/UhnFhirTestApp.java b/hapi-fhir-jpaserver-uhnfhirtest/src/test/java/ca/uhn/fhirtest/UhnFhirTestApp.java index 1ba1c8e4637..f409dd0bd92 100644 --- a/hapi-fhir-jpaserver-uhnfhirtest/src/test/java/ca/uhn/fhirtest/UhnFhirTestApp.java +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/test/java/ca/uhn/fhirtest/UhnFhirTestApp.java @@ -55,7 +55,7 @@ public class UhnFhirTestApp { Organization o1 = new Organization(); o1.getName().setValue("Some Org"); MethodOutcome create = client.create(o1); - IdDt orgId = create.getId(); + IdDt orgId = (IdDt) create.getId(); Patient p1 = new Patient(); p1.addIdentifier("foo:bar", "12345"); diff --git a/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/model/dstu/FhirDstu1.java b/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/model/dstu/FhirDstu1.java index f0a5439c108..5bbeba35c24 100644 --- a/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/model/dstu/FhirDstu1.java +++ b/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/model/dstu/FhirDstu1.java @@ -25,6 +25,7 @@ import static org.apache.commons.lang3.StringUtils.*; import java.io.InputStream; import java.util.Collections; import java.util.Comparator; +import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; @@ -34,6 +35,7 @@ import java.util.Map; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.text.WordUtils; import org.hl7.fhir.instance.model.api.IBaseResource; +import org.hl7.fhir.instance.model.api.IPrimitiveType; import ca.uhn.fhir.context.BaseRuntimeChildDefinition; import ca.uhn.fhir.context.BaseRuntimeDeclaredChildDefinition; @@ -60,6 +62,7 @@ import ca.uhn.fhir.model.api.ICompositeDatatype; import ca.uhn.fhir.model.api.IFhirVersion; import ca.uhn.fhir.model.api.IPrimitiveDatatype; import ca.uhn.fhir.model.api.IResource; +import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum; import ca.uhn.fhir.model.api.annotation.Child; import ca.uhn.fhir.model.base.composite.BaseCodingDt; import ca.uhn.fhir.model.base.composite.BaseContainedDt; @@ -85,7 +88,8 @@ import ca.uhn.fhir.rest.server.provider.ServerProfileProvider; public class FhirDstu1 implements IFhirVersion { private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirDstu1.class); -// private Map myExtensionDefToCode = new HashMap(); + // private Map myExtensionDefToCode = new + // HashMap(); private String myId; @Override @@ -93,6 +97,11 @@ public class FhirDstu1 implements IFhirVersion { return new ServerConformanceProvider(theServer); } + @Override + public IResourceProvider createServerProfilesProvider(RestfulServer theRestfulServer) { + return new ServerProfileProvider(theRestfulServer); + } + private void fillBasics(StructureElement theElement, BaseRuntimeElementDefinition def, LinkedList path, BaseRuntimeDeclaredChildDefinition theChild) { if (path.isEmpty()) { path.add(def.getName()); @@ -234,8 +243,7 @@ public class FhirDstu1 implements IFhirVersion { // ignore } else if (child instanceof RuntimeChildDeclaredExtensionDefinition) { throw new IllegalStateException("Unexpected child type: " + child.getClass().getCanonicalName()); - } else if (child instanceof RuntimeChildCompositeDatatypeDefinition || child instanceof RuntimeChildPrimitiveDatatypeDefinition || child instanceof RuntimeChildChoiceDefinition - || child instanceof RuntimeChildResourceDefinition) { + } else if (child instanceof RuntimeChildCompositeDatatypeDefinition || child instanceof RuntimeChildPrimitiveDatatypeDefinition || child instanceof RuntimeChildChoiceDefinition || child instanceof RuntimeChildResourceDefinition) { Iterator childNamesIter = child.getValidChildNames().iterator(); String nextName = childNamesIter.next(); BaseRuntimeElementDefinition nextDef = child.getChildByName(nextName); @@ -295,6 +303,53 @@ public class FhirDstu1 implements IFhirVersion { return retVal; } + @Override + public Class getContainedType() { + return ContainedDt.class; + } + + @Override + public InputStream getFhirVersionPropertiesFile() { + InputStream str = FhirDstu1.class.getResourceAsStream("/ca/uhn/fhir/model/dstu/fhirversion.properties"); + if (str == null) { + str = FhirDstu1.class.getResourceAsStream("ca/uhn/fhir/model/dstu/fhirversion.properties"); + } + if (str == null) { + throw new ConfigurationException("Can not find model property file on classpath: " + "/ca/uhn/fhir/model/dstu/model.properties"); + } + return str; + } + + @Override + public IPrimitiveType getLastUpdated(IBaseResource theResource) { + return ResourceMetadataKeyEnum.UPDATED.get((IResource) theResource); + } + + @Override + public String getPathToSchemaDefinitions() { + return "/ca/uhn/fhir/model/dstu/schema"; + } + + @Override + public Class getResourceReferenceType() { + return ResourceReferenceDt.class; + } + + @Override + public FhirVersionEnum getVersion() { + return FhirVersionEnum.DSTU1; + } + + @Override + public IVersionSpecificBundleFactory newBundleFactory(FhirContext theContext) { + return new Dstu1BundleFactory(theContext); + } + + @Override + public BaseCodingDt newCodingDt() { + return new CodingDt(); + } + private Map scanForExtensions(Profile theProfile, BaseRuntimeElementDefinition def, Map theExtensionDefToCode) { BaseRuntimeElementCompositeDefinition cdef = ((BaseRuntimeElementCompositeDefinition) def); @@ -339,57 +394,8 @@ public class FhirDstu1 implements IFhirVersion { } } - + return theExtensionDefToCode; } - @Override - public IResourceProvider createServerProfilesProvider(RestfulServer theRestfulServer) { - return new ServerProfileProvider(theRestfulServer); - } - - @Override - public FhirVersionEnum getVersion() { - return FhirVersionEnum.DSTU1; - } - - @Override - public InputStream getFhirVersionPropertiesFile() { - InputStream str = FhirDstu1.class.getResourceAsStream("/ca/uhn/fhir/model/dstu/fhirversion.properties"); - if (str == null) { - str = FhirDstu1.class.getResourceAsStream("ca/uhn/fhir/model/dstu/fhirversion.properties"); - } - if (str == null) { - throw new ConfigurationException("Can not find model property file on classpath: " + "/ca/uhn/fhir/model/dstu/model.properties"); - } - return str; - } - - - @Override - public String getPathToSchemaDefinitions() { - return "ca/uhn/fhir/model/dstu/schema"; - } - - @Override - public Class getResourceReferenceType() { - return ResourceReferenceDt.class; - } - - @Override - public Class getContainedType() { - return ContainedDt.class; - } - - @Override - public BaseCodingDt newCodingDt() { - return new CodingDt(); - } - - @Override - public IVersionSpecificBundleFactory newBundleFactory(FhirContext theContext) { - return new Dstu1BundleFactory(theContext); - } - - } diff --git a/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/model/dstu/composite/ResourceReferenceDt.java b/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/model/dstu/composite/ResourceReferenceDt.java index 0849ac18119..cdb2938ecb9 100644 --- a/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/model/dstu/composite/ResourceReferenceDt.java +++ b/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/model/dstu/composite/ResourceReferenceDt.java @@ -38,6 +38,8 @@ package ca.uhn.fhir.model.dstu.composite; import java.util.List; +import org.hl7.fhir.instance.model.api.IIdType; + import ca.uhn.fhir.model.api.ICompositeDatatype; import ca.uhn.fhir.model.api.IElement; import ca.uhn.fhir.model.api.IResource; @@ -110,7 +112,7 @@ public class ResourceReferenceDt * @param theResourceId * The reference itself */ - public ResourceReferenceDt(IdDt theResourceId) { + public ResourceReferenceDt(IIdType theResourceId) { setReference(theResourceId); } diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/ClientDstu1Test.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/ClientDstu1Test.java index 12ae8aae412..dfaad73e894 100644 --- a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/ClientDstu1Test.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/client/ClientDstu1Test.java @@ -245,7 +245,7 @@ public class ClientDstu1Test { assertEquals(HttpDelete.class, capt.getValue().getClass()); assertEquals("http://foo/Patient/1234", capt.getValue().getURI().toString()); - assertEquals("Hello", response.getOperationOutcome().getIssueFirstRep().getDetailsElement().getValue()); + assertEquals("Hello", ((OperationOutcome)response.getOperationOutcome()).getIssueFirstRep().getDetailsElement().getValue()); } @Test diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/RestfulServerMethodTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/RestfulServerMethodTest.java index 852e897b4ed..1d61fad0e8a 100644 --- a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/RestfulServerMethodTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/rest/server/RestfulServerMethodTest.java @@ -1155,7 +1155,7 @@ public class RestfulServerMethodTest { public MethodOutcome deletePatient(@IdParam IdDt theId) { MethodOutcome retVal = new MethodOutcome(); retVal.setOperationOutcome(new OperationOutcome()); - retVal.getOperationOutcome().addIssue().setDetails(theId.getValue()); + ((OperationOutcome)retVal.getOperationOutcome()).addIssue().setDetails(theId.getValue()); return retVal; } diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/validation/ResourceValidatorTest.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/validation/ResourceValidatorTest.java index e098b2e6d96..47c04ce735a 100644 --- a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/validation/ResourceValidatorTest.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/validation/ResourceValidatorTest.java @@ -1,5 +1,17 @@ package ca.uhn.fhir.validation; +import static org.hamcrest.Matchers.*; +import static org.junit.Assert.*; + +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.Locale; + +import org.apache.commons.io.IOUtils; +import org.hamcrest.core.StringContains; +import org.junit.BeforeClass; +import org.junit.Test; + import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.model.api.Bundle; import ca.uhn.fhir.model.dstu.resource.OperationOutcome; @@ -7,23 +19,6 @@ import ca.uhn.fhir.model.dstu.resource.Patient; import ca.uhn.fhir.model.dstu.valueset.ContactSystemEnum; import ca.uhn.fhir.model.primitive.DateTimeDt; -import org.apache.commons.io.IOUtils; -import org.hamcrest.core.StringContains; -import org.junit.BeforeClass; -import org.junit.Test; - -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.Locale; - -import static org.hamcrest.Matchers.containsString; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - public class ResourceValidatorTest { private static FhirContext ourCtx = FhirContext.forDstu1(); @@ -46,9 +41,10 @@ public class ResourceValidatorTest { val.validate(p); fail(); } catch (ValidationFailureException e) { - ourLog.info(ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(e.getOperationOutcome())); - assertEquals(1, e.getOperationOutcome().getIssue().size()); - assertThat(e.getOperationOutcome().getIssueFirstRep().getDetailsElement().getValue(), containsString("cvc-complex-type.2.4.a")); + OperationOutcome outcome = (OperationOutcome) e.getOperationOutcome(); + ourLog.info(ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(outcome)); + assertEquals(1, outcome.getIssue().size()); + assertThat(outcome.getIssueFirstRep().getDetailsElement().getValue(), containsString("cvc-complex-type.2.4.a")); } } @@ -91,7 +87,7 @@ public class ResourceValidatorTest { String resultString = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(result.getOperationOutcome()); ourLog.info(resultString); - assertEquals(2, result.getOperationOutcome().getIssue().size()); + assertEquals(2, ((OperationOutcome)result.getOperationOutcome()).getIssue().size()); assertThat(resultString, StringContains.containsString("cvc-datatype-valid.1.2.3")); } @@ -111,9 +107,10 @@ public class ResourceValidatorTest { val.validate(b); fail(); } catch (ValidationFailureException e) { - ourLog.info(ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(e.getOperationOutcome())); - assertEquals(1, e.getOperationOutcome().getIssue().size()); - assertThat(e.getOperationOutcome().getIssueFirstRep().getDetailsElement().getValue(), containsString("Inv-2:")); + OperationOutcome outcome = (OperationOutcome) e.getOperationOutcome(); + ourLog.info(ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(outcome)); + assertEquals(1, outcome.getIssue().size()); + assertThat(outcome.getIssueFirstRep().getDetailsElement().getValue(), containsString("Inv-2:")); } } diff --git a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/validation/ValidationResultDstu1Test.java b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/validation/ValidationResultDstu1Test.java index d5ee0386698..b60edc0d4b3 100644 --- a/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/validation/ValidationResultDstu1Test.java +++ b/hapi-fhir-structures-dstu/src/test/java/ca/uhn/fhir/validation/ValidationResultDstu1Test.java @@ -1,7 +1,9 @@ package ca.uhn.fhir.validation; +import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.model.base.resource.BaseOperationOutcome.BaseIssue; import ca.uhn.fhir.model.dstu.resource.OperationOutcome; + import org.junit.Test; import java.util.List; @@ -15,46 +17,48 @@ import static org.junit.Assert.assertTrue; public class ValidationResultDstu1Test { - @Test - public void isSuccessful_IsTrueForNullOperationOutcome() { - ValidationResult result = ValidationResult.valueOf(null); - assertTrue(result.isSuccessful()); - } + private static final FhirContext ourCtx = FhirContext.forDstu1(); - @Test - public void isSuccessful_IsTrueForNoIssues() { - OperationOutcome operationOutcome = new OperationOutcome(); - // make sure a non-null ID doesn't cause the validation result to be a fail - operationOutcome.setId(UUID.randomUUID().toString()); - ValidationResult result = ValidationResult.valueOf(operationOutcome); - assertTrue(result.isSuccessful()); - } + @Test + public void isSuccessful_FalseForIssues() { + OperationOutcome operationOutcome = new OperationOutcome(); + OperationOutcome.Issue issue = operationOutcome.addIssue(); + String errorMessage = "There was a validation problem"; + issue.setDetails(errorMessage); + ValidationResult result = ValidationResult.valueOf(ourCtx, operationOutcome); + assertFalse(result.isSuccessful()); + List issues = ((OperationOutcome) result.getOperationOutcome()).getIssue(); + assertEquals(1, issues.size()); + assertEquals(errorMessage, issues.get(0).getDetailsElement().getValue()); - @Test - public void isSuccessful_FalseForIssues() { - OperationOutcome operationOutcome = new OperationOutcome(); - OperationOutcome.Issue issue = operationOutcome.addIssue(); - String errorMessage = "There was a validation problem"; - issue.setDetails(errorMessage); - ValidationResult result = ValidationResult.valueOf(operationOutcome); - assertFalse(result.isSuccessful()); - List issues = result.getOperationOutcome().getIssue(); - assertEquals(1, issues.size()); - assertEquals(errorMessage, issues.get(0).getDetailsElement().getValue()); + assertThat("ValidationResult#toString should contain the issue description", result.toString(), containsString(errorMessage)); + } - assertThat("ValidationResult#toString should contain the issue description", result.toString(), containsString(errorMessage)); - } + @Test + public void isSuccessful_IsTrueForNoIssues() { + OperationOutcome operationOutcome = new OperationOutcome(); + // make sure a non-null ID doesn't cause the validation result to be a fail + operationOutcome.setId(UUID.randomUUID().toString()); + ValidationResult result = ValidationResult.valueOf(ourCtx, operationOutcome); + assertTrue(result.isSuccessful()); + } - /* - Test for https://github.com/jamesagnew/hapi-fhir/issues/51 - */ - @Test - public void toString_ShouldNotCauseResultToBecomeFailure() { - OperationOutcome operationOutcome = new OperationOutcome(); - ValidationResult result = ValidationResult.valueOf(operationOutcome); - assertEquals(true, result.isSuccessful()); - // need to call toString to make sure any unwanted side effects are generated - @SuppressWarnings("UnusedDeclaration") String unused = result.toString(); - assertEquals(true, result.isSuccessful()); - } + @Test + public void isSuccessful_IsTrueForNullOperationOutcome() { + ValidationResult result = ValidationResult.valueOf(ourCtx, null); + assertTrue(result.isSuccessful()); + } + + /* + * Test for https://github.com/jamesagnew/hapi-fhir/issues/51 + */ + @Test + public void toString_ShouldNotCauseResultToBecomeFailure() { + OperationOutcome operationOutcome = new OperationOutcome(); + ValidationResult result = ValidationResult.valueOf(ourCtx, operationOutcome); + assertEquals(true, result.isSuccessful()); + // need to call toString to make sure any unwanted side effects are generated + result.toString(); + assertEquals(true, result.isSuccessful()); + } } diff --git a/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/model/dstu2/FhirDstu2.java b/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/model/dstu2/FhirDstu2.java index 0582cf11a4e..88b598c9552 100644 --- a/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/model/dstu2/FhirDstu2.java +++ b/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/model/dstu2/FhirDstu2.java @@ -21,8 +21,11 @@ package ca.uhn.fhir.model.dstu2; */ import java.io.InputStream; +import java.util.Date; import org.apache.commons.lang3.StringUtils; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.hl7.fhir.instance.model.api.IPrimitiveType; import ca.uhn.fhir.context.ConfigurationException; import ca.uhn.fhir.context.FhirContext; @@ -30,6 +33,7 @@ import ca.uhn.fhir.context.FhirVersionEnum; import ca.uhn.fhir.context.RuntimeResourceDefinition; import ca.uhn.fhir.model.api.IFhirVersion; import ca.uhn.fhir.model.api.IResource; +import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum; import ca.uhn.fhir.model.base.composite.BaseCodingDt; import ca.uhn.fhir.model.base.composite.BaseContainedDt; import ca.uhn.fhir.model.base.composite.BaseResourceReferenceDt; @@ -54,6 +58,11 @@ public class FhirDstu2 implements IFhirVersion { return new ServerConformanceProvider(theServer); } + @Override + public IResourceProvider createServerProfilesProvider(RestfulServer theRestfulServer) { + return new ServerProfileProvider(theRestfulServer); + } + @Override public IResource generateProfile(RuntimeResourceDefinition theRuntimeResourceDefinition, String theServerBase) { StructureDefinition retVal = new StructureDefinition(); @@ -70,13 +79,8 @@ public class FhirDstu2 implements IFhirVersion { } @Override - public IResourceProvider createServerProfilesProvider(RestfulServer theRestfulServer) { - return new ServerProfileProvider(theRestfulServer); - } - - @Override - public FhirVersionEnum getVersion() { - return FhirVersionEnum.DSTU2; + public Class getContainedType() { + return ContainedDt.class; } @Override @@ -91,9 +95,14 @@ public class FhirDstu2 implements IFhirVersion { return str; } + @Override + public IPrimitiveType getLastUpdated(IBaseResource theResource) { + return ResourceMetadataKeyEnum.UPDATED.get((IResource) theResource); + } + @Override public String getPathToSchemaDefinitions() { - return "ca/uhn/fhir/model/dstu2/schema"; + return "/ca/uhn/fhir/model/dstu2/schema"; } @Override @@ -102,13 +111,8 @@ public class FhirDstu2 implements IFhirVersion { } @Override - public Class getContainedType() { - return ContainedDt.class; - } - - @Override - public BaseCodingDt newCodingDt() { - return new CodingDt(); + public FhirVersionEnum getVersion() { + return FhirVersionEnum.DSTU2; } @Override @@ -116,5 +120,9 @@ public class FhirDstu2 implements IFhirVersion { return new Dstu2BundleFactory(theContext); } + @Override + public BaseCodingDt newCodingDt() { + return new CodingDt(); + } } diff --git a/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/model/dstu2/composite/ResourceReferenceDt.java b/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/model/dstu2/composite/ResourceReferenceDt.java index 40acc270865..09e19c868b9 100644 --- a/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/model/dstu2/composite/ResourceReferenceDt.java +++ b/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/model/dstu2/composite/ResourceReferenceDt.java @@ -38,6 +38,8 @@ package ca.uhn.fhir.model.dstu2.composite; import java.util.List; +import org.hl7.fhir.instance.model.api.IIdType; + import ca.uhn.fhir.model.api.ICompositeDatatype; import ca.uhn.fhir.model.api.IElement; import ca.uhn.fhir.model.api.IResource; @@ -114,6 +116,17 @@ public class ResourceReferenceDt setReference(theResourceId); } + /** + * Constructor which accepts a reference directly (this can be an ID, a partial/relative URL or a complete/absolute + * URL) + * + * @param theResourceId + * The reference itself + */ + public ResourceReferenceDt(IIdType theResourceId) { + setReference(theResourceId); + } + @Child(name="reference", type=IdDt.class, order=0, min=0, max=1) @Description( shortDefinition="Relative, internal or absolute URL reference", diff --git a/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/rest/server/provider/dstu2/Dstu2BundleFactory.java b/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/rest/server/provider/dstu2/Dstu2BundleFactory.java index 9e206f93cf8..8070ed1a3f4 100644 --- a/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/rest/server/provider/dstu2/Dstu2BundleFactory.java +++ b/hapi-fhir-structures-dstu2/src/main/java/ca/uhn/fhir/rest/server/provider/dstu2/Dstu2BundleFactory.java @@ -24,23 +24,22 @@ import static org.apache.commons.lang3.StringUtils.*; import java.util.ArrayList; import java.util.Collections; +import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.UUID; -import ca.uhn.fhir.model.api.Include; -import ca.uhn.fhir.rest.server.*; -import ca.uhn.fhir.util.ResourceReferenceInfo; - import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.Validate; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; +import org.hl7.fhir.instance.model.api.IPrimitiveType; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.RuntimeResourceDefinition; import ca.uhn.fhir.model.api.IResource; +import ca.uhn.fhir.model.api.Include; import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum; import ca.uhn.fhir.model.base.composite.BaseResourceReferenceDt; import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; @@ -53,7 +52,17 @@ import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.model.primitive.InstantDt; import ca.uhn.fhir.model.valueset.BundleEntrySearchModeEnum; import ca.uhn.fhir.model.valueset.BundleTypeEnum; +import ca.uhn.fhir.rest.server.AddProfileTagEnum; +import ca.uhn.fhir.rest.server.BundleInclusionRule; +import ca.uhn.fhir.rest.server.Constants; +import ca.uhn.fhir.rest.server.EncodingEnum; +import ca.uhn.fhir.rest.server.IBundleProvider; +import ca.uhn.fhir.rest.server.IPagingProvider; +import ca.uhn.fhir.rest.server.IVersionSpecificBundleFactory; +import ca.uhn.fhir.rest.server.RestfulServer; +import ca.uhn.fhir.rest.server.RestfulServerUtils; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; +import ca.uhn.fhir.util.ResourceReferenceInfo; public class Dstu2BundleFactory implements IVersionSpecificBundleFactory { @@ -159,14 +168,14 @@ public class Dstu2BundleFactory implements IVersionSpecificBundleFactory { } @Override - public void addRootPropertiesToBundle(String theAuthor, String theServerBase, String theCompleteUrl, Integer theTotalResults, BundleTypeEnum theBundleType, InstantDt theLastUpdated) { + public void addRootPropertiesToBundle(String theAuthor, String theServerBase, String theCompleteUrl, Integer theTotalResults, BundleTypeEnum theBundleType, IPrimitiveType theLastUpdated) { if (myBundle.getId().isEmpty()) { myBundle.setId(UUID.randomUUID().toString()); } if (ResourceMetadataKeyEnum.UPDATED.get(myBundle) == null) { - ResourceMetadataKeyEnum.UPDATED.put(myBundle, theLastUpdated); + ResourceMetadataKeyEnum.UPDATED.put(myBundle, (InstantDt) theLastUpdated); } if (!hasLink(Constants.LINK_SELF, myBundle) && isNotBlank(theCompleteUrl)) { diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/client/GenericClientDstu2Test.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/client/GenericClientDstu2Test.java index d42794d956d..1a1fc811706 100644 --- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/client/GenericClientDstu2Test.java +++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/client/GenericClientDstu2Test.java @@ -27,6 +27,7 @@ import org.apache.http.client.methods.HttpUriRequest; import org.apache.http.message.BasicHeader; import org.apache.http.message.BasicStatusLine; import org.hl7.fhir.instance.model.api.IBaseBundle; +import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; import org.hl7.fhir.instance.model.api.IBaseResource; import org.junit.Before; import org.junit.BeforeClass; @@ -1174,10 +1175,14 @@ public class GenericClientDstu2Test { assertEquals("POST", capt.getAllValues().get(idx).getRequestLine().getMethod()); assertEquals("", extractBody(capt, idx)); assertNotNull(response.getOperationOutcome()); - assertEquals("FOOBAR", response.getOperationOutcome().getIssueFirstRep().getDetailsElement().getValue()); + assertEquals("FOOBAR", toOo(response.getOperationOutcome()).getIssueFirstRep().getDetailsElement().getValue()); idx++; } + private OperationOutcome toOo(IBaseOperationOutcome theOperationOutcome) { + return (OperationOutcome) theOperationOutcome; + } + @Test public void testValidateFluent() throws Exception { @@ -1209,7 +1214,7 @@ public class GenericClientDstu2Test { assertEquals("POST", capt.getAllValues().get(idx).getRequestLine().getMethod()); assertEquals("", extractBody(capt, idx)); assertNotNull(response.getOperationOutcome()); - assertEquals("FOOBAR", response.getOperationOutcome().getIssueFirstRep().getDetailsElement().getValue()); + assertEquals("FOOBAR", toOo(response.getOperationOutcome()).getIssueFirstRep().getDetailsElement().getValue()); idx++; response = client.validate().resource(ourCtx.newXmlParser().encodeResourceToString(p)).execute(); @@ -1217,7 +1222,7 @@ public class GenericClientDstu2Test { assertEquals("POST", capt.getAllValues().get(idx).getRequestLine().getMethod()); assertEquals("", extractBody(capt, idx)); assertNotNull(response.getOperationOutcome()); - assertEquals("FOOBAR", response.getOperationOutcome().getIssueFirstRep().getDetailsElement().getValue()); + assertEquals("FOOBAR", toOo(response.getOperationOutcome()).getIssueFirstRep().getDetailsElement().getValue()); idx++; response = client.validate().resource(ourCtx.newJsonParser().encodeResourceToString(p)).execute(); @@ -1225,7 +1230,7 @@ public class GenericClientDstu2Test { assertEquals("POST", capt.getAllValues().get(idx).getRequestLine().getMethod()); assertEquals("{\"resourceType\":\"Parameters\",\"parameter\":[{\"name\":\"resource\",\"resource\":{\"resourceType\":\"Patient\",\"name\":[{\"given\":[\"GIVEN\"]}]}}]}", extractBody(capt, idx)); assertNotNull(response.getOperationOutcome()); - assertEquals("FOOBAR", response.getOperationOutcome().getIssueFirstRep().getDetailsElement().getValue()); + assertEquals("FOOBAR", toOo(response.getOperationOutcome()).getIssueFirstRep().getDetailsElement().getValue()); idx++; response = client.validate().resource(ourCtx.newJsonParser().encodeResourceToString(p)).prettyPrint().execute(); @@ -1233,7 +1238,7 @@ public class GenericClientDstu2Test { assertEquals("POST", capt.getAllValues().get(idx).getRequestLine().getMethod()); assertThat(extractBody(capt, idx), containsString("\"resourceType\":\"Parameters\",\n")); assertNotNull(response.getOperationOutcome()); - assertEquals("FOOBAR", response.getOperationOutcome().getIssueFirstRep().getDetailsElement().getValue()); + assertEquals("FOOBAR", toOo(response.getOperationOutcome()).getIssueFirstRep().getDetailsElement().getValue()); idx++; } diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/BinaryTestDstu2.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/BinaryDstu2Test.java similarity index 99% rename from hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/BinaryTestDstu2.java rename to hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/BinaryDstu2Test.java index 08ebbc7aa49..c07fe78177d 100644 --- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/BinaryTestDstu2.java +++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/BinaryDstu2Test.java @@ -43,13 +43,13 @@ import ca.uhn.fhir.util.PortUtil; /** * Created by dsotnikov on 2/25/2014. */ -public class BinaryTestDstu2 { +public class BinaryDstu2Test { private static CloseableHttpClient ourClient; private static FhirContext ourCtx = FhirContext.forDstu2(); private static Binary ourLast; - private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(BinaryTestDstu2.class); + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(BinaryDstu2Test.class); private static int ourPort; diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/IncludeDstu2Test.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/IncludeDstu2Test.java index 7fd65eb5238..02d18edd328 100644 --- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/IncludeDstu2Test.java +++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/IncludeDstu2Test.java @@ -235,11 +235,13 @@ public class IncludeDstu2Test { @Test public void testTwoInclude() throws Exception { - HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?name=Hello&_include=foo&_include=bar"); + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?name=Hello&_include=foo&_include=bar&_pretty=true"); HttpResponse status = ourClient.execute(httpGet); String responseContent = IOUtils.toString(status.getEntity().getContent()); IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info(responseContent); + assertEquals(200, status.getStatusLine().getStatusCode()); Bundle bundle = ourCtx.newXmlParser().parseBundle(responseContent); assertEquals(1, bundle.size()); diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/validation/ResourceValidatorDstu2Test.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/validation/ResourceValidatorDstu2Test.java index 6a33833535c..96bf91b0b8c 100644 --- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/validation/ResourceValidatorDstu2Test.java +++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/validation/ResourceValidatorDstu2Test.java @@ -14,6 +14,7 @@ import java.util.Locale; import org.apache.commons.io.IOUtils; import org.hamcrest.core.StringContains; +import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; import org.junit.Test; import ca.uhn.fhir.context.FhirContext; @@ -65,7 +66,7 @@ public class ResourceValidatorDstu2Test { String resultString = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(result.getOperationOutcome()); ourLog.info(resultString); - assertEquals(2, result.getOperationOutcome().getIssue().size()); + assertEquals(2, ((OperationOutcome)result.getOperationOutcome()).getIssue().size()); assertThat(resultString, StringContains.containsString("2000-15-31")); } @@ -156,9 +157,10 @@ public class ResourceValidatorDstu2Test { val.validate(p); fail(); } catch (ValidationFailureException e) { - ourLog.info(ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(e.getOperationOutcome())); - assertEquals(1, e.getOperationOutcome().getIssue().size()); - assertThat(e.getOperationOutcome().getIssueFirstRep().getDetailsElement().getValue(), containsString("cvc-complex-type")); + OperationOutcome operationOutcome = (OperationOutcome) e.getOperationOutcome(); + ourLog.info(ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(operationOutcome)); + assertEquals(1, operationOutcome.getIssue().size()); + assertThat(operationOutcome.getIssueFirstRep().getDetailsElement().getValue(), containsString("cvc-complex-type")); } } diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/validation/ValidationResultDstu2Test.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/validation/ValidationResultDstu2Test.java index 5ce8e1f737f..84fe118ee0d 100644 --- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/validation/ValidationResultDstu2Test.java +++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/validation/ValidationResultDstu2Test.java @@ -11,14 +11,17 @@ import java.util.UUID; import org.junit.Test; +import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.model.base.resource.BaseOperationOutcome.BaseIssue; import ca.uhn.fhir.model.dstu2.resource.OperationOutcome; public class ValidationResultDstu2Test { + private static final FhirContext ourCtx = FhirContext.forDstu2(); + @Test public void isSuccessful_IsTrueForNullOperationOutcome() { - ValidationResult result = ValidationResult.valueOf(null); + ValidationResult result = ValidationResult.valueOf(ourCtx, null); assertTrue(result.isSuccessful()); } @@ -27,7 +30,7 @@ public class ValidationResultDstu2Test { OperationOutcome operationOutcome = new OperationOutcome(); // make sure a non-null ID doesn't cause the validation result to be a fail operationOutcome.setId(UUID.randomUUID().toString()); - ValidationResult result = ValidationResult.valueOf(operationOutcome); + ValidationResult result = ValidationResult.valueOf(ourCtx, operationOutcome); assertTrue(result.isSuccessful()); } @@ -37,9 +40,9 @@ public class ValidationResultDstu2Test { OperationOutcome.Issue issue = operationOutcome.addIssue(); String errorMessage = "There was a validation problem"; issue.setDetails(errorMessage); - ValidationResult result = ValidationResult.valueOf(operationOutcome); + ValidationResult result = ValidationResult.valueOf(ourCtx, operationOutcome); assertFalse(result.isSuccessful()); - List issues = result.getOperationOutcome().getIssue(); + List issues = ((OperationOutcome)result.getOperationOutcome()).getIssue(); assertEquals(1, issues.size()); assertEquals(errorMessage, issues.get(0).getDetailsElement().getValue()); @@ -52,7 +55,7 @@ public class ValidationResultDstu2Test { @Test public void toString_ShouldNotCauseResultToBecomeFailure() { OperationOutcome operationOutcome = new OperationOutcome(); - ValidationResult result = ValidationResult.valueOf(operationOutcome); + ValidationResult result = ValidationResult.valueOf(ourCtx, operationOutcome); assertEquals(true, result.isSuccessful()); // need to call toString to make sure any unwanted side effects are generated @SuppressWarnings("UnusedDeclaration") String unused = result.toString(); diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/ca/uhn/fhir/rest/server/provider/dstu2hl7org/Dstu2Hl7OrgBundleFactory.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/ca/uhn/fhir/rest/server/provider/dstu2hl7org/Dstu2Hl7OrgBundleFactory.java index a8270224df3..1cd30a8c063 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/ca/uhn/fhir/rest/server/provider/dstu2hl7org/Dstu2Hl7OrgBundleFactory.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/ca/uhn/fhir/rest/server/provider/dstu2hl7org/Dstu2Hl7OrgBundleFactory.java @@ -23,6 +23,8 @@ package ca.uhn.fhir.rest.server.provider.dstu2hl7org; import static org.apache.commons.lang3.StringUtils.*; import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -43,11 +45,11 @@ import org.hl7.fhir.instance.model.api.IBaseReference; import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IDomainResource; import org.hl7.fhir.instance.model.api.IIdType; +import org.hl7.fhir.instance.model.api.IPrimitiveType; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.RuntimeResourceDefinition; import ca.uhn.fhir.model.api.Include; -import ca.uhn.fhir.model.primitive.InstantDt; import ca.uhn.fhir.model.valueset.BundleTypeEnum; import ca.uhn.fhir.rest.server.AddProfileTagEnum; import ca.uhn.fhir.rest.server.BundleInclusionRule; @@ -85,14 +87,18 @@ public class Dstu2Hl7OrgBundleFactory implements IVersionSpecificBundleFactory { } } - for (IBaseResource nextBaseRes : theResult) { - if (!(nextBaseRes instanceof IDomainResource)) { - continue; + for (IBaseResource next : theResult) { + + List contained; + if (next instanceof IDomainResource) { + IDomainResource nextDomain = (IDomainResource) next; + contained = nextDomain.getContained(); + } else { + contained = Collections.emptyList(); } - IDomainResource next = (IDomainResource) nextBaseRes; Set containedIds = new HashSet(); - for (IAnyResource nextContained : next.getContained()) { + for (IAnyResource nextContained : contained) { if (nextContained.getId().isEmpty() == false) { containedIds.add(nextContained.getIdElement().getValue()); } @@ -157,9 +163,9 @@ public class Dstu2Hl7OrgBundleFactory implements IVersionSpecificBundleFactory { } @Override - public void addRootPropertiesToBundle(String theAuthor, String theServerBase, String theCompleteUrl, Integer theTotalResults, BundleTypeEnum theBundleType, InstantDt theLastUpdated) { + public void addRootPropertiesToBundle(String theAuthor, String theServerBase, String theCompleteUrl, Integer theTotalResults, BundleTypeEnum theBundleType, IPrimitiveType theLastUpdated) { - if (myBundle.getId().isEmpty()) { + if (isBlank(myBundle.getId())) { myBundle.setId(UUID.randomUUID().toString()); } @@ -203,9 +209,12 @@ public class Dstu2Hl7OrgBundleFactory implements IVersionSpecificBundleFactory { List resourceList; if (theServer.getPagingProvider() == null) { numToReturn = theResult.size(); - resourceList = theResult.getResources(0, numToReturn); - RestfulServerUtils.validateResourceListNotNull(resourceList); - + if (numToReturn == 0) { + resourceList = Collections.emptyList(); + } else { + resourceList = theResult.getResources(0, numToReturn); + RestfulServerUtils.validateResourceListNotNull(resourceList); + } } else { IPagingProvider pagingProvider = theServer.getPagingProvider(); if (theLimit == null) { diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/FhirDstu2Hl7Org.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/FhirDstu2Hl7Org.java index 3c622658f1d..c7002225e97 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/FhirDstu2Hl7Org.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/FhirDstu2Hl7Org.java @@ -22,12 +22,16 @@ package org.hl7.fhir.instance; import java.io.InputStream; import java.util.ArrayList; +import java.util.Date; import org.apache.commons.lang3.StringUtils; import org.hl7.fhir.instance.conf.ServerConformanceProvider; import org.hl7.fhir.instance.conf.ServerProfileProvider; import org.hl7.fhir.instance.model.Reference; +import org.hl7.fhir.instance.model.Resource; import org.hl7.fhir.instance.model.StructureDefinition; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.hl7.fhir.instance.model.api.IPrimitiveType; import ca.uhn.fhir.context.ConfigurationException; import ca.uhn.fhir.context.FhirContext; @@ -89,7 +93,7 @@ public class FhirDstu2Hl7Org implements IFhirVersion { @Override public String getPathToSchemaDefinitions() { - return "ca/uhn/fhir/model/dstu2/schema"; + return "/org/hl7/fhir/instance/model/schema"; } @Override @@ -113,4 +117,9 @@ public class FhirDstu2Hl7Org implements IFhirVersion { return new Dstu2Hl7OrgBundleFactory(theContext); } + @Override + public IPrimitiveType getLastUpdated(IBaseResource theResource) { + return ((Resource)theResource).getMeta().getLastUpdatedElement(); + } + } diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/conf/ServerConformanceProvider.java b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/conf/ServerConformanceProvider.java index 113b41f32a6..9d322a68343 100644 --- a/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/conf/ServerConformanceProvider.java +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/conf/ServerConformanceProvider.java @@ -2,7 +2,7 @@ package org.hl7.fhir.instance.conf; /* * #%L - * HAPI FHIR Structures - HL7.org DSTU2 + * HAPI FHIR Structures - DSTU2 (FHIR v0.5.0) * %% * Copyright (C) 2014 - 2015 University Health Network * %% @@ -20,12 +20,18 @@ package org.hl7.fhir.instance.conf; * #L% */ +import static org.apache.commons.lang3.StringUtils.*; + import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; +import java.util.Date; import java.util.HashSet; import java.util.List; +import java.util.Map; +import java.util.Map.Entry; import java.util.Set; +import java.util.TreeMap; import java.util.TreeSet; import javax.servlet.http.HttpServletRequest; @@ -39,18 +45,20 @@ import org.hl7.fhir.instance.model.Conformance.ResourceInteractionComponent; import org.hl7.fhir.instance.model.Conformance.RestfulConformanceMode; import org.hl7.fhir.instance.model.Conformance.SystemRestfulInteraction; import org.hl7.fhir.instance.model.Conformance.TypeRestfulInteraction; -import org.hl7.fhir.instance.model.DateTimeType; -import org.hl7.fhir.instance.model.ResourceType; +import org.hl7.fhir.instance.model.Enumerations.ConformanceResourceStatus; +import org.hl7.fhir.instance.model.OperationDefinition; +import org.hl7.fhir.instance.model.OperationDefinition.OperationDefinitionParameterComponent; +import org.hl7.fhir.instance.model.OperationDefinition.OperationParameterUse; import ca.uhn.fhir.context.RuntimeResourceDefinition; import ca.uhn.fhir.context.RuntimeSearchParam; import ca.uhn.fhir.model.api.IResource; -import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.rest.annotation.Metadata; import ca.uhn.fhir.rest.method.BaseMethodBinding; import ca.uhn.fhir.rest.method.DynamicSearchMethodBinding; import ca.uhn.fhir.rest.method.IParameter; +import ca.uhn.fhir.rest.method.OperationMethodBinding; +import ca.uhn.fhir.rest.method.OperationParameter; import ca.uhn.fhir.rest.method.SearchMethodBinding; import ca.uhn.fhir.rest.method.SearchParameter; import ca.uhn.fhir.rest.server.Constants; @@ -63,8 +71,10 @@ import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; * Server FHIR Provider which serves the conformance statement for a RESTful server implementation * *

- * Note: This class is safe to extend, but it is important to note that the same instance of {@link Conformance} is always returned unless {@link #setCache(boolean)} is called with a value of - * false. This means that if you are adding anything to the returned conformance instance on each call you should call setCache(false) in your provider constructor. + * Note: This class is safe to extend, but it is important to note that the same instance of {@link Conformance} is + * always returned unless {@link #setCache(boolean)} is called with a value of false. This means that if + * you are adding anything to the returned conformance instance on each call you should call + * setCache(false) in your provider constructor. *

*/ public class ServerConformanceProvider implements IServerConformanceProvider { @@ -79,8 +89,9 @@ public class ServerConformanceProvider implements IServerConformanceProvider systemOps = new HashSet(); - List bindings = new ArrayList(myRestfulServer.getResourceBindings()); - Collections.sort(bindings, new Comparator() { - @Override - public int compare(ResourceBinding theArg0, ResourceBinding theArg1) { - return theArg0.getResourceName().compareToIgnoreCase(theArg1.getResourceName()); - } - }); - - for (ResourceBinding next : bindings) { - - Set resourceOps = new HashSet(); - ConformanceRestResourceComponent resource = rest.addResource(); - + Map>> resourceToMethods = new TreeMap>>(); + for (ResourceBinding next : myRestfulServer.getResourceBindings()) { String resourceName = next.getResourceName(); - RuntimeResourceDefinition def = myRestfulServer.getFhirContext().getResourceDefinition(resourceName); - resource.getTypeElement().setValue(def.getName()); - resource.getProfile().setReference(def.getResourceProfile(myRestfulServer.getServerBaseForRequest(theRequest))); - - TreeSet includes = new TreeSet(); - - // Map nameToSearchParam = new HashMap(); for (BaseMethodBinding nextMethodBinding : next.getMethodBindings()) { - if (nextMethodBinding.getResourceOperationType() != null) { - String resOpCode = nextMethodBinding.getResourceOperationType().getCode(); - if (resOpCode != null) { - TypeRestfulInteraction resOp; - try { - resOp = TypeRestfulInteraction.fromCode(resOpCode); - } catch (Exception e) { - resOp = null; - } - if (resOp == null) { - throw new InternalErrorException("Unknown type-restful-interaction: " + resOpCode); - } - if (resourceOps.contains(resOp) == false) { - resourceOps.add(resOp); - resource.addInteraction().setCode(resOp); - } - } + if (resourceToMethods.containsKey(resourceName) == false) { + resourceToMethods.put(resourceName, new ArrayList>()); } - - if (nextMethodBinding.getSystemOperationType() != null) { - String sysOpCode = nextMethodBinding.getSystemOperationType().getCode(); - if (sysOpCode != null) { - SystemRestfulInteraction sysOp; - try { - sysOp = SystemRestfulInteraction.fromCode(sysOpCode); - } catch (Exception e) { - sysOp = null; - } - if (sysOp == null) { - throw new InternalErrorException("Unknown system-restful-interaction: " + sysOpCode); - } - if (systemOps.contains(sysOp) == false) { - systemOps.add(sysOp); - rest.addInteraction().setCode(sysOp); - } - } - } - - if (nextMethodBinding instanceof SearchMethodBinding) { - handleSearchMethodBinding(rest, resource, resourceName, def, includes, (SearchMethodBinding) nextMethodBinding); - } else if (nextMethodBinding instanceof DynamicSearchMethodBinding) { - handleDynamicSearchMethodBinding(resource, def, includes, (DynamicSearchMethodBinding) nextMethodBinding); - } - - Collections.sort(resource.getInteraction(), new Comparator() { - @Override - public int compare(ResourceInteractionComponent theO1, ResourceInteractionComponent theO2) { - TypeRestfulInteraction o1 = theO1.getCodeElement().getValue(); - TypeRestfulInteraction o2 = theO2.getCodeElement().getValue(); - if (o1 == null && o2 == null) { - return 0; - } - if (o1 == null) { - return 1; - } - if (o2 == null) { - return -1; - } - return o1.ordinal() - o2.ordinal(); - } - }); - + resourceToMethods.get(resourceName).add(nextMethodBinding); } - - for (String nextInclude : includes) { - resource.addSearchInclude(nextInclude); + } + for (BaseMethodBinding nextMethodBinding : myRestfulServer.getServerBindings()) { + String resourceName = ""; + if (resourceToMethods.containsKey(resourceName) == false) { + resourceToMethods.put(resourceName, new ArrayList>()); } + resourceToMethods.get(resourceName).add(nextMethodBinding); + } + for (Entry>> nextEntry : resourceToMethods.entrySet()) { + + if (nextEntry.getKey().isEmpty() == false) { + Set resourceOps = new HashSet(); + ConformanceRestResourceComponent resource = rest.addResource(); + String resourceName = nextEntry.getKey(); + RuntimeResourceDefinition def = myRestfulServer.getFhirContext().getResourceDefinition(resourceName); + resource.getTypeElement().setValue(def.getName()); + resource.getProfile().setReference(def.getResourceProfile(myRestfulServer.getServerBaseForRequest(theRequest))); + + TreeSet includes = new TreeSet(); + + // Map nameToSearchParam = new HashMap(); + for (BaseMethodBinding nextMethodBinding : nextEntry.getValue()) { + if (nextMethodBinding.getResourceOperationType() != null) { + String resOpCode = nextMethodBinding.getResourceOperationType().getCode(); + if (resOpCode != null) { + TypeRestfulInteraction resOp; + try { + resOp = TypeRestfulInteraction.fromCode(resOpCode); + assert resOp != null; + } catch (Exception e) { + throw new InternalErrorException("Unknown type-restful-interaction: " + resOpCode); + } + if (resourceOps.contains(resOp) == false) { + resourceOps.add(resOp); + resource.addInteraction().setCode(resOp); + } + if ("vread".equals(resOpCode)) { + // vread implies read + resOp = TypeRestfulInteraction.READ; + if (resourceOps.contains(resOp) == false) { + resourceOps.add(resOp); + resource.addInteraction().setCode(resOp); + } + } + + if (nextMethodBinding.isSupportsConditional()) { + switch (resOp) { + case CREATE: + resource.setConditionalCreate(true); + break; + case DELETE: + resource.setConditionalDelete(true); + break; + case UPDATE: + resource.setConditionalUpdate(true); + break; + default: + break; + } + } + } + } + + checkBindingForSystemOps(rest, systemOps, nextMethodBinding); + + if (nextMethodBinding instanceof SearchMethodBinding) { + handleSearchMethodBinding(rest, resource, resourceName, def, includes, (SearchMethodBinding) nextMethodBinding); + } else if (nextMethodBinding instanceof DynamicSearchMethodBinding) { + handleDynamicSearchMethodBinding(resource, def, includes, (DynamicSearchMethodBinding) nextMethodBinding); + } else if (nextMethodBinding instanceof OperationMethodBinding) { + OperationMethodBinding methodBinding = (OperationMethodBinding) nextMethodBinding; + OperationDefinition op = new OperationDefinition(); + rest.addOperation().setName(methodBinding.getName()).getDefinition().setResource(op); + ; + + op.setStatus(ConformanceResourceStatus.ACTIVE); + op.setDescription(methodBinding.getDescription()); + op.setIdempotent(methodBinding.isIdempotent()); + op.setCode(methodBinding.getName()); + op.setInstance(methodBinding.isInstanceLevel()); + op.addType(methodBinding.getResourceName()); + + for (IParameter nextParamUntyped : methodBinding.getParameters()) { + if (nextParamUntyped instanceof OperationParameter) { + OperationParameter nextParam = (OperationParameter) nextParamUntyped; + OperationDefinitionParameterComponent param = op.addParameter(); + param.setUse(OperationParameterUse.IN); + if (nextParam.getParamType() != null) { + param.setType(nextParam.getParamType().getCode()); + } + param.setMin(nextParam.getMin()); + param.setMax(nextParam.getMax() == -1 ? "*" : Integer.toString(nextParam.getMax())); + param.setName(nextParam.getName()); + } + } + } + + Collections.sort(resource.getInteraction(), new Comparator() { + @Override + public int compare(ResourceInteractionComponent theO1, ResourceInteractionComponent theO2) { + TypeRestfulInteraction o1 = theO1.getCode(); + TypeRestfulInteraction o2 = theO2.getCode(); + if (o1 == null && o2 == null) { + return 0; + } + if (o1 == null) { + return 1; + } + if (o2 == null) { + return -1; + } + return o1.ordinal() - o2.ordinal(); + } + }); + + } + + for (String nextInclude : includes) { + resource.addSearchInclude(nextInclude); + } + } else { + for (BaseMethodBinding nextMethodBinding : nextEntry.getValue()) { + checkBindingForSystemOps(rest, systemOps, nextMethodBinding); + } + } } myConformance = retVal; return retVal; } + private void checkBindingForSystemOps(ConformanceRestComponent rest, Set systemOps, BaseMethodBinding nextMethodBinding) { + if (nextMethodBinding.getSystemOperationType() != null) { + String sysOpCode = nextMethodBinding.getSystemOperationType().getCode(); + if (sysOpCode != null) { + SystemRestfulInteraction sysOp; + try { + sysOp = SystemRestfulInteraction.fromCode(sysOpCode); + assert sysOp != null; + } catch (Exception e) { + throw new InternalErrorException("Unknown system-restful-interaction: " + sysOpCode); + } + if (systemOps.contains(sysOp) == false) { + systemOps.add(sysOp); + rest.addInteraction().setCode(sysOp); + } + } + } + } + private void handleDynamicSearchMethodBinding(ConformanceRestResourceComponent resource, RuntimeResourceDefinition def, TreeSet includes, DynamicSearchMethodBinding searchMethodBinding) { includes.addAll(searchMethodBinding.getIncludes()); @@ -303,7 +378,7 @@ public class ServerConformanceProvider implements IServerConformanceProvider nextTarget : nextParameter.getDeclaredTypes()) { RuntimeResourceDefinition targetDef = myRestfulServer.getFhirContext().getResourceDefinition(nextTarget); if (targetDef != null) { - ResourceType code = ResourceType.valueOf(targetDef.getName()); - if (code != null) { - param.addTarget(code.name()); + if (isNotBlank(targetDef.getName())) { + param.addTarget(targetDef.getName()); } } } @@ -336,8 +410,9 @@ public class ServerConformanceProvider implements IServerConformanceProvider + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + AllergyIntolerance + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/appointment.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/appointment.sch new file mode 100644 index 00000000000..ba1ab117bc7 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/appointment.sch @@ -0,0 +1,90 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Appointment + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/appointmentresponse.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/appointmentresponse.sch new file mode 100644 index 00000000000..241f749aab8 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/appointmentresponse.sch @@ -0,0 +1,75 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + AppointmentResponse + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/auditevent.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/auditevent.sch new file mode 100644 index 00000000000..e318763ddcc --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/auditevent.sch @@ -0,0 +1,115 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + AuditEvent + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + sev-3: Either a userId or a reference, but not both + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + sev-1: Either a name or a query (or both) + sev-2: Either an identifier or a reference, but not both + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/basic.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/basic.sch new file mode 100644 index 00000000000..9f6d3bfa8c3 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/basic.sch @@ -0,0 +1,75 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Basic + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/binary.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/binary.sch new file mode 100644 index 00000000000..cd4277ef70d --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/binary.sch @@ -0,0 +1,28 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Binary + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/bodysite.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/bodysite.sch new file mode 100644 index 00000000000..f939a62f301 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/bodysite.sch @@ -0,0 +1,81 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + BodySite + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + att-1: It the Attachment has data, it SHALL have a contentType + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/bundle.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/bundle.sch new file mode 100644 index 00000000000..06d55c06957 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/bundle.sch @@ -0,0 +1,49 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Bundle + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + bdl-3: entry.transaction when (and only when) a transaction + bdl-4: entry.transactionResponse when (and only when) a transaction-response + bdl-1: total only when a search or history + bdl-2: entry.search only when a search + + + bdl-5: must be a resource unless there's a transaction or transaction response + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/careplan.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/careplan.sch new file mode 100644 index 00000000000..6d4b8d2a220 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/careplan.sch @@ -0,0 +1,171 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + CarePlan + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cpl-3: Only provide a detail reference, or a simple detail summary + cpl-2: Quantity can only be specified if activity category is supply + cpl-1: DailyDose can only be specified if activity category is drug or food + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + tim-6: If there's a periodMax, there must be a period + tim-7: If there's a durationMax, there must be a duration + tim-1: if there's a duration, there needs to be duration units + tim-2: if there's a period, there needs to be duration units + tim-3: Either frequency or when can exist, not both + + + per-1: If present, start SHALL have a lower value than end + + + tim-4: duration SHALL be a non-negative value + + + tim-5: period SHALL be a non-negative value + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/claim.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/claim.sch new file mode 100644 index 00000000000..9ccc50edcd4 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/claim.sch @@ -0,0 +1,219 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Claim + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/claimresponse.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/claimresponse.sch new file mode 100644 index 00000000000..4bbc810820a --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/claimresponse.sch @@ -0,0 +1,180 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + ClaimResponse + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/clinicalimpression.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/clinicalimpression.sch new file mode 100644 index 00000000000..566205e008a --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/clinicalimpression.sch @@ -0,0 +1,105 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + ClinicalImpression + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/communication.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/communication.sch new file mode 100644 index 00000000000..dd6fd27ea7b --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/communication.sch @@ -0,0 +1,99 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Communication + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + att-1: It the Attachment has data, it SHALL have a contentType + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/communicationrequest.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/communicationrequest.sch new file mode 100644 index 00000000000..24a5647abd1 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/communicationrequest.sch @@ -0,0 +1,108 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + CommunicationRequest + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + att-1: It the Attachment has data, it SHALL have a contentType + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/composition.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/composition.sch new file mode 100644 index 00000000000..937fc9ae718 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/composition.sch @@ -0,0 +1,114 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Composition + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cmp-1: A section must have either subsections or content + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/conceptmap.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/conceptmap.sch new file mode 100644 index 00000000000..f3aee73b6c3 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/conceptmap.sch @@ -0,0 +1,84 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + ConceptMap + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + cpt-2: A system is required if a value is provided. + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cmd-1: If the map is narrower or inexact, there SHALL be some comments + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/condition.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/condition.sch new file mode 100644 index 00000000000..d5d79af5503 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/condition.sch @@ -0,0 +1,179 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Condition + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + per-1: If present, start SHALL have a lower value than end + + + rng-2: If present, low SHALL have a lower value than high + rng-3: Quantity values cannot have a comparator when used in a Range + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + per-1: If present, start SHALL have a lower value than end + + + rng-2: If present, low SHALL have a lower value than high + rng-3: Quantity values cannot have a comparator when used in a Range + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + con-1: Stage SHALL have summary or assessment + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + con-2: evidence SHALL have code or details + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + con-4: Relationship SHALL have either a code or a target + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + con-5: Relationship SHALL have either a code or a target + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/conformance.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/conformance.sch new file mode 100644 index 00000000000..5b288bd4d28 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/conformance.sch @@ -0,0 +1,107 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Conformance + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cnf-8: There can only be one REST declaration per mode + cnf-7: The set of documents must be unique by the combination of profile & mode + cnf-4: If there is more than one messaging element, endpoint must be specified for each one + cnf-5: The set of end points listed for messaging must be unique + cnf-2: A Conformance statement SHALL have at least one of description, software, or implementation + cnf-1: A Conformance statement SHALL have at least one of rest, messaging or document + + + cpt-2: A system is required if a value is provided. + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cnf-9: A given resource can only be described once per RESTful mode + cnf-10: A given query can only be described once per RESTful mode + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + cnf-11: Operation codes must be unique in the context of a resource + cnf-12: Search parameter names must be unique in the context of a resource + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cnf-6: The set of events per messaging endpoint must be unique by the combination of code & mode + cnf-3: Messaging end point is required (and is only permitted) when statement is for an implementation + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/contract.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/contract.sch new file mode 100644 index 00000000000..959ade265b4 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/contract.sch @@ -0,0 +1,249 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Contract + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + per-1: If present, start SHALL have a lower value than end + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + att-1: It the Attachment has data, it SHALL have a contentType + + + ref-1: SHALL have a local reference if the resource is provided inline + + + att-1: It the Attachment has data, it SHALL have a contentType + + + ref-1: SHALL have a local reference if the resource is provided inline + + + att-1: It the Attachment has data, it SHALL have a contentType + + + ref-1: SHALL have a local reference if the resource is provided inline + + + att-1: It the Attachment has data, it SHALL have a contentType + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/contraindication.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/contraindication.sch new file mode 100644 index 00000000000..9f464384a2b --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/contraindication.sch @@ -0,0 +1,87 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Contraindication + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/coverage.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/coverage.sch new file mode 100644 index 00000000000..226a9d083de --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/coverage.sch @@ -0,0 +1,114 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Coverage + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + per-1: If present, start SHALL have a lower value than end + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/dataelement.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/dataelement.sch new file mode 100644 index 00000000000..872ee710015 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/dataelement.sch @@ -0,0 +1,109 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + DataElement + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + cpt-2: A system is required if a value is provided. + + + per-1: If present, start SHALL have a lower value than end + + + eld-2: Min <= Max + eld-5: Either a namereference or a fixed value (but not both) is permitted + eld-7: Pattern may only be specified if there is one type + eld-6: Fixed value may only be specified if there is one type + eld-11: Binding can only be present for coded elements, string, and uri + eld-8: Pattern and value are mutually exclusive + eld-14: Constraints must be unique by key + eld-13: Types must be unique by the combination of code and profile + eld-16: default value and meaningWhenMissing are mutually exclusive + eld-15: Constraint names must be unique. + + + cod-1: If a valueSet is provided, a system URI Is required + + + eld-1: If there are no discriminators, there must be a definition + + + eld-3: Max SHALL be a number or "*" + + + eld-4: Aggregation may only be specified if one of the allowed types for the element is a resource + + + eld-10: provide either a reference or a description (or both) + eld-9: Example value sets are always extensible + + + eld-12: uri SHALL start with http:// or https:// + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/device.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/device.sch new file mode 100644 index 00000000000..bfee28cf52a --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/device.sch @@ -0,0 +1,84 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Device + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cpt-2: A system is required if a value is provided. + + + per-1: If present, start SHALL have a lower value than end + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/devicecomponent.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/devicecomponent.sch new file mode 100644 index 00000000000..e6ccc7e8e52 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/devicecomponent.sch @@ -0,0 +1,111 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + DeviceComponent + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/devicemetric.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/devicemetric.sch new file mode 100644 index 00000000000..05c8664f23a --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/devicemetric.sch @@ -0,0 +1,103 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + DeviceMetric + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + tim-6: If there's a periodMax, there must be a period + tim-7: If there's a durationMax, there must be a duration + tim-1: if there's a duration, there needs to be duration units + tim-2: if there's a period, there needs to be duration units + tim-3: Either frequency or when can exist, not both + + + per-1: If present, start SHALL have a lower value than end + + + tim-4: duration SHALL be a non-negative value + + + tim-5: period SHALL be a non-negative value + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/deviceuserequest.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/deviceuserequest.sch new file mode 100644 index 00000000000..44aba9d7e54 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/deviceuserequest.sch @@ -0,0 +1,118 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + DeviceUseRequest + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + tim-6: If there's a periodMax, there must be a period + tim-7: If there's a durationMax, there must be a duration + tim-1: if there's a duration, there needs to be duration units + tim-2: if there's a period, there needs to be duration units + tim-3: Either frequency or when can exist, not both + + + per-1: If present, start SHALL have a lower value than end + + + tim-4: duration SHALL be a non-negative value + + + tim-5: period SHALL be a non-negative value + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/deviceusestatement.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/deviceusestatement.sch new file mode 100644 index 00000000000..4f758157e73 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/deviceusestatement.sch @@ -0,0 +1,112 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + DeviceUseStatement + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + tim-6: If there's a periodMax, there must be a period + tim-7: If there's a durationMax, there must be a duration + tim-1: if there's a duration, there needs to be duration units + tim-2: if there's a period, there needs to be duration units + tim-3: Either frequency or when can exist, not both + + + per-1: If present, start SHALL have a lower value than end + + + tim-4: duration SHALL be a non-negative value + + + tim-5: period SHALL be a non-negative value + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/diagnosticorder.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/diagnosticorder.sch new file mode 100644 index 00000000000..5d48b3fed54 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/diagnosticorder.sch @@ -0,0 +1,105 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + DiagnosticOrder + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/diagnosticreport.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/diagnosticreport.sch new file mode 100644 index 00000000000..0673520f36f --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/diagnosticreport.sch @@ -0,0 +1,111 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + DiagnosticReport + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + att-1: It the Attachment has data, it SHALL have a contentType + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/documentmanifest.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/documentmanifest.sch new file mode 100644 index 00000000000..85521546f3b --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/documentmanifest.sch @@ -0,0 +1,111 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + DocumentManifest + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + att-1: It the Attachment has data, it SHALL have a contentType + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/documentreference.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/documentreference.sch new file mode 100644 index 00000000000..9996fa02098 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/documentreference.sch @@ -0,0 +1,156 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + DocumentReference + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + att-1: It the Attachment has data, it SHALL have a contentType + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/eligibilityrequest.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/eligibilityrequest.sch new file mode 100644 index 00000000000..3138eaae7a3 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/eligibilityrequest.sch @@ -0,0 +1,78 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + EligibilityRequest + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/eligibilityresponse.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/eligibilityresponse.sch new file mode 100644 index 00000000000..5577ab348bd --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/eligibilityresponse.sch @@ -0,0 +1,81 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + EligibilityResponse + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/encounter.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/encounter.sch new file mode 100644 index 00000000000..de79229c26e --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/encounter.sch @@ -0,0 +1,180 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Encounter + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + per-1: If present, start SHALL have a lower value than end + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + per-1: If present, start SHALL have a lower value than end + + + qty-3: If a code for the units is present, the system SHALL also be present + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/enrollmentrequest.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/enrollmentrequest.sch new file mode 100644 index 00000000000..e8cc8956afd --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/enrollmentrequest.sch @@ -0,0 +1,87 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + EnrollmentRequest + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/enrollmentresponse.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/enrollmentresponse.sch new file mode 100644 index 00000000000..138038833e5 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/enrollmentresponse.sch @@ -0,0 +1,81 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + EnrollmentResponse + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/episodeofcare.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/episodeofcare.sch new file mode 100644 index 00000000000..41701c194cd --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/episodeofcare.sch @@ -0,0 +1,102 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + EpisodeOfCare + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + per-1: If present, start SHALL have a lower value than end + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/explanationofbenefit.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/explanationofbenefit.sch new file mode 100644 index 00000000000..40349067cce --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/explanationofbenefit.sch @@ -0,0 +1,81 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + ExplanationOfBenefit + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/familymemberhistory.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/familymemberhistory.sch new file mode 100644 index 00000000000..d4aac66fe75 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/familymemberhistory.sch @@ -0,0 +1,129 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + FamilyMemberHistory + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + fhs-1: Can have age[x] or birth[x], but not both + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + qty-3: If a code for the units is present, the system SHALL also be present + + + rng-2: If present, low SHALL have a lower value than high + rng-3: Quantity values cannot have a comparator when used in a Range + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + rng-2: If present, low SHALL have a lower value than high + rng-3: Quantity values cannot have a comparator when used in a Range + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + rng-2: If present, low SHALL have a lower value than high + rng-3: Quantity values cannot have a comparator when used in a Range + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/fhir-single.xsd b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/fhir-single.xsd new file mode 100644 index 00000000000..83d4fc10b8b --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/fhir-single.xsd @@ -0,0 +1,21341 @@ + + + + + + + + + + + + + + + + + + A date, or partial date (e.g. just year or year + month). There is no time zone. The format is a union of the schema types gYear, gYearMonth and date. Dates SHALL be valid dates. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + + + + + + + A date, date-time or partial date (e.g. just year or year + month). If hours and minutes are specified, a time zone SHALL be populated. The format is a union of the schema types gYear, gYearMonth, date and dateTime. Seconds must be provided due to schema type constraints but may be zero-filled and may be ignored. Dates SHALL be valid dates. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + + + + A string which has at least one character and no leading or trailing whitespace and where there is no whitespace other than single spaces in the contents + If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions + + + + + + + + + + + + + + + A sequence of Unicode characters + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + + A whole number + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + + + + + An oid represented as a URI + If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions + + + + + + + + + + + + + String of characters used to identify a name or a resource + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + + + + + A UUID, represented as a URI + If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions + + + + + + + + + + + + + An instant in time - known at least to the second + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + + Value of "true" or "false" + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + + A stream of bytes + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + + + An integer with a value that is not negative (e.g. >= 0) + If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions + + + + + + + + + + + + + + + A time during the day, with no date specified + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + + + + + Any combination of lowercase letters, numerals, "-" and ".", with a length limit of 36 characters. (This might be an integer, an unprefixed OID, UUID or any other identifier pattern that meets these constraints.) Systems SHALL send ids as lower-case but SHOULD interpret them case-insensitively. + If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions + + + + + + + + + + + + + + An integer with a value that is positive (e.g. >0) + If the element is present, it must have either a @value, an @id referenced from the Narrative, or extensions + + + + + + + + + + + + + A rational number with implicit precision + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Optional Extensions Element - found in all resources. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + + + Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Base definition for all elements that are defined inside a resource - but not those in a data type. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + + + May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. + + + + + + + + + A human-readable formatted text, including images. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + + + The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data. + + + + + The actual narrative content, a stripped down version of XHTML. + + + + + + + + + + + The contents of the narrative are entirely generated from the structured data in the resource. + + + + + The contents of the narrative are entirely generated from the structured data in the resource and some of the content is generated from extensions + + + + + The contents of the narrative contain additional information not found in the structured data + + + + + the contents of the narrative are some equivalent of "No human-readable text provided for this resource" + + + + + + + The status of a resource narrative + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + Base definition for all elements in a resource. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. + + + + + + + + A technical identifier - identifies some entity uniquely and unambiguously. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + + + The purpose of this identifier. + + + + + A coded type for the identifier that can be used to determine which identifier to use for a specific purpose. + + + + + Establishes the namespace in which set of possible id values is unique. + + + + + The portion of the identifier typically displayed to the user and which is unique within the context of the system. + + + + + Time period during which identifier is/was valid for use. + + + + + Organization that issued/manages the identifier. + + + + + + + + + + + the identifier recommended for display and use in real-world interactions + + + + + the identifier considered to be most trusted for the identification of this item + + + + + A temporary identifier + + + + + An identifier that was assigned in secondary use - it serves to identify the object in a relative context, but cannot be consistently assigned to the same object again in a different context + + + + + + + Identifies the purpose for this identifier, if known + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A reference to a code defined by a terminology system. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + + + The identification of the code system that defines the meaning of the symbol in the code. + + + + + The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged. + + + + + A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination). + + + + + A representation of the meaning of the code in the system, following the rules of the system. + + + + + Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays). + + + + + + + + + A reference from one resource to another. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + + + A reference to a location at which the other resource is found. The reference may be a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources. + + + + + Plain text narrative that identifies the resource in addition to the resource reference. + + + + + + + + + An XML digital signature along with supporting context. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + + + An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document. + + + + + When the digital signature was signed. + + + + + A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The base64 encoding of the XML-Signature. + + + + + + + + + A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + + + The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series. + + + + + The length of time between sampling times, measured in milliseconds. + + + + + A correction factor that is applied to the sampled data points before they are added to the origin. + + + + + The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit). + + + + + The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit). + + + + + The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once. + + + + + A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value. + + + + + + + + + + + + + + + + + + + + + + A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + + + The value of the measured amount. The value includes an implicit precision in the presentation of the value. + + + + + How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is "<" , then the real value is < stated value. + + + + + A human-readable form of the units. + + + + + The identification of the system that provides the coded form of the unit. + + + + + A computer processable form of the units in some unit representation system. + + + + + + + + + + + The actual value is less than the given value + + + + + The actual value is less than or equal to the given value + + + + + The actual value is greater than or equal to the given value + + + + + The actual value is greater than the given value + + + + + + + How the Quantity should be understood and represented + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A time period defined by a start and end date and optionally time. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + + + The start of the period. The boundary is inclusive. + + + + + The end of the period. If the end of the period is missing, it means that the period is ongoing. + + + + + + + + + For referring to data content defined in other formats. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + + + Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. + + + + + The human language of the content. The value can be any valid value according to BCP 47. + + + + + The actual data of the attachment - a sequence of bytes. In XML, represented using base64. + + + + + An alternative location where the data can be accessed. + + + + + The number of bytes of data that make up this attachment. + + + + + The calculated hash of the data using SHA-1. Represented using base64. + + + + + A label or set of text to display in place of the data. + + + + + The date that the attachment was first created. + + + + + + + + + A relationship of two Quantity values - expressed as a numerator and a denominator. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + + + The value of the numerator. + + + + + The value of the denominator. + + + + + + + + + A set of ordered Quantities defined by a low and high limit. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + + + The low limit. The boundary is inclusive. + + + + + The high limit. The boundary is inclusive. + + + + + + + + + A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + + + A reference to a code defined by a terminology system. + + + + + A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. + + + + + + + + + + + + + The value of the measured amount. The value includes an implicit precision in the presentation of the value. + + + + + How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is "<" , then the real value is < stated value. + + + + + A human-readable form of the units. + + + + + The identification of the system that provides the coded form of the unit. + + + + + A computer processable form of the units in some unit representation system. + + + + + + + + + + + + + + The value of the measured amount. The value includes an implicit precision in the presentation of the value. + + + + + How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is "<" , then the real value is < stated value. + + + + + A human-readable form of the units. + + + + + The identification of the system that provides the coded form of the unit. + + + + + A computer processable form of the units in some unit representation system. + + + + + + + + + + + + + + The value of the measured amount. The value includes an implicit precision in the presentation of the value. + + + + + How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is "<" , then the real value is < stated value. + + + + + A human-readable form of the units. + + + + + The identification of the system that provides the coded form of the unit. + + + + + A computer processable form of the units in some unit representation system. + + + + + + + + + + + + + + The value of the measured amount. The value includes an implicit precision in the presentation of the value. + + + + + How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is "<" , then the real value is < stated value. + + + + + A human-readable form of the units. + + + + + The identification of the system that provides the coded form of the unit. + + + + + A computer processable form of the units in some unit representation system. + + + + + + + + + + + + + + The value of the measured amount. The value includes an implicit precision in the presentation of the value. + + + + + How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is "<" , then the real value is < stated value. + + + + + A human-readable form of the units. + + + + + The identification of the system that provides the coded form of the unit. + + + + + A computer processable form of the units in some unit representation system. + + + + + + + + + + A human's name with the ability to identify parts and usage. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + + + Identifies the purpose for this name. + + + + + A full text representation of the name. + + + + + The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father. + + + + + Given name. + + + + + Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name. + + + + + Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name. + + + + + Indicates the period of time when this name was valid for the named person. + + + + + + + + + + + Known as/conventional/the one you normally use + + + + + The formal name as registered in an official (government) registry, but which name might not be commonly used. May be called "legal name". + + + + + A temporary name. Name.period can provide more detailed information. This may also be used for temporary names assigned at birth or in emergency situations. + + + + + A name that is used to address the person in an informal manner, but is not part of their formal or usual name + + + + + Anonymous assigned name, alias, or pseudonym (used to protect a person's identity for privacy reasons) + + + + + This name is no longer in use (or was never correct, but retained for records) + + + + + A name used prior to marriage. Marriage naming customs vary greatly around the world. This name use is for use by applications that collect and store "maiden" names. Though the concept of maiden name is often gender specific, the use of this term is not gender specific. The use of this term does not imply any particular history for a person's name, nor should the maiden name be determined algorithmically. + + + + + + + The use of a human name + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + Details for All kinds of technology mediated contact points for a person or organization, including telephone, email, etc. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + + + Telecommunications form for contact point - what communications system is required to make use of the contact. + + + + + The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). + + + + + Identifies the purpose for the contact point. + + + + + Time period when the contact point was/is in use. + + + + + + + + + + + The value is a telephone number used for voice calls. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required. + + + + + The value is a fax machine. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required. + + + + + The value is an email address + + + + + The value is a url. This is intended for various personal contacts including blogs, Twitter, Facebook, etc. Do not use for email addresses + + + + + + + Telecommunications form for contact point + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + A communication contact point at a home; attempted contacts for business purposes might intrude privacy and chances are one will contact family or other household members instead of the person one wishes to call. Typically used with urgent cases, or if no other contacts are available. + + + + + An office contact point. First choice for business related contacts during business hours. + + + + + A temporary contact point. The period can provide more detailed information. + + + + + This contact point is no longer in use (or was never correct, but retained for records) + + + + + A telecommunication device that moves and stays with its owner. May have characteristics of all other use codes, suitable for urgent matters, not the first choice for routine business + + + + + + + Use of contact point + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + + + The version specific identifier, as it appears in the version portion of the url. This values changes when the resource is created, updated, or deleted. + + + + + When the resource last changed - e.g. when the version changed. + + + + + A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]]. + + + + + Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure. + + + + + Tags applied to this resource. Tags are intended to to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource. + + + + + + + + + There is a variety of postal address formats defined around the world. This format defines a superset that is the basis for all addresses around the world. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + + + The purpose of this address. + + + + + A full text representation of the address. + + + + + This component contains the house number, apartment number, street name, street direction, +P.O. Box number, delivery hints, and similar address information. + + + + + The name of the city, town, village or other community or delivery center. + + + + + Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes). + + + + + A postal code designating a region defined by the postal service. + + + + + Country - a nation as commonly understood or generally accepted. + + + + + Time period when address was/is in use. + + + + + + + + + + + A communication address at a home + + + + + An office address. First choice for business related contacts during business hours + + + + + A temporary address. The period can provide more detailed information + + + + + This address is no longer in use (or was never correct, but retained for records) + + + + + + + The use of an address + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + Specifies an event that may occur multiple times. Timing schedules are used to record when things are expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + + + Identifies specific times when the event occurs. + + + + + A set of rules that describe when the event should occur. + + + + + A code for the timing pattern. Some codes such as BID are uniquitious, but many instutions define their own additional codes. + + + + + + + + + Specifies an event that may occur multiple times. Timing schedules are used to record when things are expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + + + Outer bounds for start and/or end limits of the timing schedule. + + + + + A total count of the desired number of repetitions. + + + + + How long this thing happens for when it happens. + + + + + The units of time for the duration, in UCUM units. + + + + + The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided). + + + + + If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range. + + + + + Indicates the duration of time over which repetitions are to occur. E.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period. + + + + + If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days. + + + + + The units of time for the period in UCUM units. + + + + + A real world event that the occurrence of the event should be tied to. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A unit of time (units from UCUM) + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Real world event that the schedule relates to + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + Captures constraints on each element within the resource, profile, or extension. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + + + The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension. + + + + + Codes that define how this element is represented in instances, when the deviation varies from the normal case. + + + + + The name of this element definition (to refer to it from other element definitions using ElementDefinition.nameReference). This is a unique name referring to a specific set of constraints applied to this element. One use of this is to provide a name to different slices of the same element. + + + + + The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form. + + + + + A code that provides the meaning for the element according to a particular terminology. + + + + + Indicates that the element is sliced into a set of alternative definitions (there are multiple definitions on a single element in the base resource). The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set). + + + + + A concise definition that is shown in the generated XML format that summarizes profiles (used throughout the specification). + + + + + Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource. + + + + + Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc. + + + + + This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element. + + + + + Identifies additional names by which this element might also be known. + + + + + The minimum number of times this element SHALL appear in the instance. + + + + + The maximum number of times this element is permitted to appear in the instance. + + + + + The data type or resource that the value of this element is permitted to be. + + + + + Identifies the name of a slice defined elsewhere in the profile whose constraints should be applied to the current element. + + + + + The value that should be used if there is no value stated in the instance. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The Implicit meaning that is to be understood when this element is missing. + + + + + Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-signficant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-senstive, accent-sensitive, etc.). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + A sample value for this element demonstrating the type of information that would typically be captured. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element. + + + + + A reference to an invariant that may make additional statements about the cardinality or value in the instance. + + + + + Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance. + + + + + If true, conformant resource authors SHALL be capable of providing a value for the element and resource consumers SHALL be capable of extracting and doing something useful with the data element. If false, the element may be ignored and not supported. + + + + + If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system. + + + + + Whether the element should be included if a client requests a search with the parameter _summary=true. + + + + + Binds to a value set if this element is coded (code, Coding, CodeableConcept). + + + + + Identifies a concept from an external specification that roughly corresponds to this element. + + + + + + + + + Captures constraints on each element within the resource, profile, or extension. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + + + Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality. + + + + + Used to label the constraint in OCL or in short displays incapable of displaying the full human description. + + + + + Identifies the impact constraint violation has on the conformance of the instance. + + + + + Text that can be used to describe the constraint in messages identifying that the constraint has been violated. + + + + + An XPath expression of constraint that can be executed to see if this constraint is met. + + + + + + + + + Captures constraints on each element within the resource, profile, or extension. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + + + An internal reference to the definition of a mapping. + + + + + Identifies the computable language in which mapping.map is expressed. + + + + + Expresses what part of the target specification corresponds to this element. + + + + + + + + + Captures constraints on each element within the resource, profile, or extension. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + + + Name of Data type or Resource that is a(or the) type used for this element. + + + + + Identifies a profile structure that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile. + + + + + If the type is a reference to another resource, how the resource is or can be aggreated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle. + + + + + + + + + Captures constraints on each element within the resource, profile, or extension. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + + + Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices. + + + + + A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated. + + + + + If the matching elements have to occur in the same order as defined in the profile. + + + + + Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end. + + + + + + + + + Captures constraints on each element within the resource, profile, or extension. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + + + A descriptive name for this - can be useful for generating implementation artifacts. + + + + + Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances. + + + + + Describes the intended use of this particular set of codes. + + + + + Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + In XML, this property is represented as an attribute not an element + + + + + + + How a property is represented on the wire + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + If the constraint is violated, the resource is not conformant + + + + + If the constraint is violated, the resource is conformant, but it is not necessarily following best practice. + + + + + + + SHALL applications comply with this constraint? + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + The reference is a local reference to a contained resource + + + + + The reference to a resource that has to be resolved externally to the resource that includes the reference + + + + + The resource the reference points to will be found in the same bundle as the resource that includes the reference + + + + + + + How resource references can be aggregated + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + No additional content is allowed other than that described by the slices in this profile + + + + + Additional content is allowed anywhere in the list + + + + + Additional content is allowed, but only at the end of the list. Note that using this requires that the slices be ordered, which makes it hard to share uses. This should only be done where absolutely required + + + + + + + How slices are interpreted when evaluating an instance + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + To be conformant, instances of this element SHALL include a code from the specified value set + + + + + To be conformant, instances of this element SHALL include a code from the specified value set if any of the codes within the value set can apply to the concept being communicated. If the valueset does not cover the concept (based on human review), alternate codings (or, data type allowing, text) may be included instead. + + + + + Instances are encouraged to draw from the specified codes for interoperability purposes but are not required to do so to be considered conformant + + + + + Instances are not expected or even encouraged to draw from the specified value set. The value set merely provides examples of the types of concepts intended to be included + + + + + + + Indication of the degree of conformance expectations associated with a binding + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A resource that includes narrative, extensions, and contained resources. + + + + + + + A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety. + + + + + These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope. + + + + + May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. + + + + + May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. + + + + + + + + + This special resource type is used to represent [operation](operations.html] request and response. It has no other use, and there is no RESTful end=point associated with it. + + + + + + + A parameter passed to or received from the operation. + + + + + + + + + This special resource type is used to represent [operation](operations.html] request and response. It has no other use, and there is no RESTful end=point associated with it. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + + + The name of the parameter (reference to the operation definition). + + + + + If the parameter is a data type. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + If the parameter is a whole resource. + + + + + A named part of a parameter. In many implementation context, a set of named parts is known as a "Tuple". + + + + + + + + + This special resource type is used to represent [operation](operations.html] request and response. It has no other use, and there is no RESTful end=point associated with it. + If the element is present, it must have a value for at least one of the defined elements, an @id referenced from the Narrative, or extensions + + + + + + + The name of the parameter (reference to the operation definition). + + + + + The value of the parameter. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + If the parameter is a whole resource. + + + + + + + + + This special resource type is used to represent [operation](operations.html] request and response. It has no other use, and there is no RESTful end=point associated with it. + + + + + Base Resource for everything. + + + + + The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes. + + + + + The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource. + + + + + A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. + + + + + The base language in which the resource is written. + + + + + + + + + This resource is still under development + + + + + This resource is ready for normal use + + + + + This resource has been withdrawn or superceded and should no longer be used + + + + + + + + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + Minute + + + + + Hour + + + + + Day + + + + + Week + + + + + Month + + + + + Year + + + + + + + + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + Search parameter SHALL be a number (a whole number, or a decimal) + + + + + Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported + + + + + Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May match just the start of a string. String parameters may contain spaces + + + + + Search parameter on a coded element or identifier. May be used to search through the text, displayname, code and code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair of namespace and value, separated by a "|", depending on the modifier used + + + + + A reference to another resource + + + + + A composite search parameter that combines a search on two values together + + + + + A search parameter that searches on a quantity + + + + + A search parameter that searches on a URI (RFC 3986) + + + + + + + + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + Male + + + + + Female + + + + + Other + + + + + Unknown + + + + + + + + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + The processing completed without errors. + + + + + The processing identified with errors. + + + + + + + + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + Display the note. + + + + + Print the note on the form. + + + + + Print the note for the operator. + + + + + + + + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + The definitions of the concepts mean the same thing (including when structural implications of meaning are considered) (i.e. extensionally identical) + + + + + The definitions of the concepts are exactly the same (i.e. only grammatical differences) and structural implications of meaning are identifical or irrelevant (i.e. intensionally identical) + + + + + The target mapping is wider in meaning than the source concept + + + + + The target mapping subsumes the meaning of the source concept (e.g. the source is-a target) + + + + + The target mapping is narrower in meaning that the source concept. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when atempting to use these mappings operationally + + + + + The target mapping specialises the meaning of the source concept (e.g. the target is-a source) + + + + + The target mapping overlaps with the source concept, but both source and target cover additional meaning, or the definitions are imprecise and it is uncertain whether they have the same boundaries to their meaning. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when atempting to use these mappings operationally + + + + + There is no match for this concept in the destination concept system + + + + + This is an explicit assertion that there is no mapping between the source and target concept + + + + + + + + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + This is the current reference for this document + + + + + This reference has been superceded by another reference + + + + + This reference was created in error + + + + + + + + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance. + + + + + Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + This records identifiers associated with this allergy/intolerance concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). + + + + + Date when the sensitivity was recorded. + + + + + Individual who recorded the record and takes responsibility for its conten. + + + + + The patient who has the allergy or intolerance. + + + + + The source of the information about the allergy that is recorded. + + + + + Identification of a substance, or a class of substances, that is considered to be responsible for the Adverse reaction risk. + + + + + Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance. + + + + + Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance. + + + + + Identification of the underlying physiological mechanism for the Reaction Risk. + + + + + Category of the identified Substance. + + + + + Represents the date and/or time of the last known occurence of a reaction event. + + + + + Additional narrative about the propensity for the Adverse Reaction, not captured in other fields. + + + + + Details about each Adverse Reaction Event linked to exposure to the identified Substance. + + + + + + + + + Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance. + + + + + + + Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance. + + + + + Statement about the degree of clinical certainty that the Specific Substance was the cause of the Manifestation in this reaction event. + + + + + Clinical symptoms and/or signs that are observed or associated with the Adverse Reaction Event. + + + + + Text description about the Reaction as a whole, including details of the manifestation if required. + + + + + Record of the date and/or time of the onset of the Reaction. + + + + + The amount of time that the Adverse Reaction persisted. + + + + + Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations. + + + + + Identification of the route by which the subject was exposed to the substance. + + + + + Additional text about the Adverse Reaction event not captured in other fields. + + + + + + + + + + + The potential clinical impact of a future reaction is estimated as low risk: exposure to substance is unlikely to result in a life threatening or organ system threatening outcome. Future exposure to the Substance is considered a relative contra-indication. + + + + + The potential clinical impact of a future reaction is estimated as high risk: exposure to substance may result in a life threatening or organ system threatening outcome. Future exposure to the Substance may be considered an absolute contra-indication. + + + + + Unable to assess the potential clinical impact with the information available + + + + + + + Estimate of the potential clinical harm, or seriousness, of a reaction to an identified Substance + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + A low level of certainty about the propensity for a reaction to the identified Substance. + + + + + A high level of certainty about the propensity for a reaction to the identified Substance, which may include clinical evidence by testing or rechallenge. + + + + + A reaction to the identified Substance has been clinically reassessed by testing or rechallenge and considered to be resolved. + + + + + A propensity for a reaction to the identified Substance has been disproven with a high level of clinical certainty, which may include testing or rechallenge, and is refuted. + + + + + The statement was entered in error and Is not valid + + + + + + + Assertion about certainty associated with a propensity, or potential risk, of a reaction to the identified Substance + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + Immune mediated reaction, including allergic reactions and hypersensitivities. + + + + + A non-immune mediated reaction, which can include pseudoallergic reactions, side effects, intolerances, drug toxicities (eg to Gentamicin), drug-drug interactions, food-drug interactions, and drug-disease interactions. + + + + + + + Identification of the underlying physiological mechanism for a Reaction Risk + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + Any substance consumed to provide nutritional support for the body + + + + + Substances administered to achieve a physiological effect + + + + + Substances that are encountered in the environment + + + + + + + Category of an identified Substance + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + There is a low level of clinical certainty that the reaction was caused by the identified Substance. + + + + + There is a high level of clinical certainty that the reaction was caused by the identified Substance. + + + + + There is a very high level of clinical certainty that the reaction was due to the identified Substance, which may include clinical evidence by testing or rechallenge. + + + + + + + Statement about the degree of clinical certainty that a Specific Substance was the cause of the Manifestation in an reaction event + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + Causes mild physiological effects + + + + + Causes moderate physiological effects + + + + + Causes severe physiological effects + + + + + + + Clinical assessment of the severity of a reaction event as a whole, potentially considering multiple different manifestations + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s). + + + + + A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s). + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + This records identifiers associated with this appointment concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). + + + + + The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status. + + + + + The type of appointment that is being booked (This may also be associated with participants for location, and/or a HealthcareService). + + + + + The reason that this appointment is being scheduled, this is more clinical than administrative. + + + + + The priority of the appointment. Can be used to make informed decisions if needing to re-prioritize appointments. (The iCal Standard specifies 0 as undefined, 1 as highest, 9 as lowest priority). + + + + + The brief description of the appointment as would be shown on a subject line in a meeting request, or appointment list. Detailed or expanded information should be put in the comment field. + + + + + Date/Time that the appointment is to take place. + + + + + Date/Time that the appointment is to conclude. + + + + + The slot that this appointment is filling. If provided then the schedule will not be provided as slots are not recursive, and the start/end values MUST be the same as from the slot. + + + + + Additional comments about the appointment. + + + + + An Order that lead to the creation of this appointment. + + + + + List of participants involved in the appointment. + + + + + + + + + A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s). + + + + + + + Role of participant in the appointment. + + + + + A Person, Location/HealthcareService or Device that is participating in the appointment. + + + + + Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet to discuss the results for a specific patient, and the patient is not required to be present. + + + + + Participation status of the Patient. + + + + + + + + + + + The participant is required to attend the appointment + + + + + The participant may optionally attend the appointment + + + + + The participant is excluded from the appointment, and may not be informed of the appointment taking place. (appointment is about them, not for them - such as 2 doctors discussing results about a patient's test) + + + + + + + Is the Participant required to attend the appointment + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + Some or all of the participant(s) have not finalized their acceptance of the appointment request + + + + + All participant(s) have been considered and the appointment is confirmed to go ahead at the date/times specified + + + + + Some of the patients have arrived + + + + + This appointment has completed and may have resulted in an encounter + + + + + The appointment has been cancelled + + + + + Some or all of the participant(s) have not/did not appear for the appointment (usually the patient) + + + + + + + The free/busy status of an appointment + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + The participant has accepted the appointment + + + + + The participant has declined the appointment and will not participate in the appointment + + + + + The participant has tentatively accepted the appointment. This could be automatically created by a system and requires further processing before it can be accepted. There is no commitment that attendance will occur + + + + + The participant needs to indicate if they accept the appointment by changing this status to one of the other statuses + + + + + + + The Participation status of an appointment + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection. + + + + + A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + This records identifiers associated with this appointment response concern that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate. + + + + + Parent appointment that this response is replying to. + + + + + Role of participant in the appointment. + + + + + A Person, Location/HealthcareService or Device that is participating in the appointment. + + + + + Participation status of the Participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty. + + + + + This comment is particularly important when the responder is declining, tentative or requesting another time to indicate the reasons why. + + + + + This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the start time. + + + + + This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time. + + + + + + + + + + + The appointment participant has accepted that they can attend the appointment at the time specified in the AppointmentResponse + + + + + The appointment participant has declined the appointment + + + + + The appointment participant has tentatively accepted the appointment + + + + + The participant has in-process the appointment + + + + + The participant has completed the appointment + + + + + This is the intitial status of an appointment participant until a participant has replied. It implies that there is no commitment for the appointment + + + + + + + The Participation status of an appointment + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. + + + + + A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Identifies the name, action type, time, and disposition of the audited event. + + + + + A person, a hardware device or software process. + + + + + Application systems and processes. + + + + + Specific instances of data or objects that have been accessed. + + + + + + + + + A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. + + + + + + + Identifier for a family of the event. + + + + + Identifier for the category of event. + + + + + Indicator for type of action performed during the event that generated the audit. + + + + + The time when the event occurred on the source. + + + + + Indicates whether the event succeeded or failed. + + + + + A free text description of the outcome of the event. + + + + + The purposeOfUse (reason) that was used during the event being recorded. + + + + + + + + + A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. + + + + + + + Specification of the role(s) the user plays when performing the event. Usually the codes used in this element are local codes defined by the role-based access control security system used in the local context. + + + + + Direct reference to a resource that identifies the participant. + + + + + Unique identifier for the user actively participating in the event. + + + + + Alternative Participant Identifier. For a human, this should be a user identifier text string from authentication system. This identifier would be one known to a common authentication system (e.g., single sign-on), if available. + + + + + Human-meaningful name for the user. + + + + + Indicator that the user is or is not the requestor, or initiator, for the event being audited. + + + + + Where the event occurred. + + + + + The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used. + + + + + Type of media involved. Used when the event is about exporting/importing onto media. + + + + + Logical network location for application activity, if the activity has a network location. + + + + + The purposeOfUse (reason) specific to this participant that was used during the event being recorded. + + + + + + + + + A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. + + + + + + + An identifier for the network access point of the user device for the audit event. + + + + + An identifier for the type of network access point that originated the audit event. + + + + + + + + + A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. + + + + + + + Logical source location within the healthcare enterprise network. + + + + + Identifier of the source where the event originated. + + + + + Code specifying the type of source where event originated. + + + + + + + + + A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. + + + + + + + Identifies a specific instance of the participant object. The reference should always be version specific. + + + + + Identifies a specific instance of the participant object. The reference should always be version specific. + + + + + The type of the object that was involved in this audit event. + + + + + Code representing the functional application role of Participant Object being audited. + + + + + Identifier for the data life-cycle stage for the participant object. + + + + + Denotes policy-defined sensitivity for the Participant Object ID such as VIP, HIV status, mental health status or similar topics. + + + + + An instance-specific descriptor of the Participant Object ID audited, such as a person's name. + + + + + Text that describes the object in more detail. + + + + + The actual query for a query-type participant object. + + + + + Additional Information about the Object. + + + + + + + + + A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion attempts and monitoring for inappropriate usage. + + + + + + + Name of the property. + + + + + Property value. + + + + + + + + + + + This object is the patient that is the subject of care related to this event. It is identifiable by patient ID or equivalent. The patient may be either human or animal + + + + + This is a location identified as related to the event. This is usually the location where the event took place. Note that for shipping, the usual events are arrival at a location or departure from a location. + + + + + This object is any kind of persistent document created as a result of the event. This could be a paper report, film, electronic report, DICOM Study, etc. Issues related to medical records life cycle management are conveyed elsewhere. + + + + + A logical object related to a health record event. This is any healthcare specific resource (object) not restricted to FHIR defined Resources. + + + + + This is any configurable file used to control creation of documents. Examples include the objects maintained by the HL7 Master File transactions, Value Sets, etc. + + + + + A human participant not otherwise identified by some other category + + + + + (deprecated) + + + + + Typically a licensed person who is providing or performing care related to the event, generally a physician. The key distinction between doctor and practitioner is with regards to their role, not the licensing. The doctor is the human who actually performed the work. The practitioner is the human or organization that is responsible for the work. + + + + + A person or system that is being notified as part of the event. This is relevant in situations where automated systems provide notifications to other parties when an event took place. + + + + + Insurance company, or any other organization who accepts responsibility for paying for the healthcare event. + + + + + A person or active system object involved in the event with a security role. + + + + + A person or system object involved in the event with the authority to modify security roles of other objects. + + + + + A passive object, such as a role table, that is relevant to the event. + + + + + (deprecated) Relevant to certain RBAC security methodologies. + + + + + Any person or organization responsible for providing care. This encompasses all forms of care, licensed or otherwise, and all sorts of teams and care groups. Note, the distinction between practitioners and the doctor that actually provided the care to the patient. + + + + + The source or destination for data transfer, when it does not match some other role. + + + + + A source or destination for data transfer, that acts as an archive, database, or similar role. + + + + + An object that holds schedule information. This could be an appointment book, availability information, etc. + + + + + An organization or person that is the recipient of services. This could be an organization that is buying services for a patient, or a person that is buying services for an animal. + + + + + An order, task, work item, procedure step, or other description of work to be performed. E.g., a particular instance of an MPPS. + + + + + A list of jobs or a system that provides lists of jobs. E.g., an MWL SCP. + + + + + (Deprecated) + + + + + An object that specifies or controls the routing or delivery of items. For example, a distribution list is the routing criteria for mail. The items delivered may be documents, jobs, or other objects. + + + + + The contents of a query. This is used to capture the contents of any kind of query. For security surveillance purposes knowing the queries being made is very important. + + + + + + + Code representing the role the Object played in the event + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + The operation completed successfully (whether with warnings or not) + + + + + The action was not successful due to some kind of catered for error (often equivalent to an HTTP 400 response) + + + + + The action was not successful due to some kind of unexpected error (often equivalent to an HTTP 500 response) + + + + + An error of such magnitude occurred that the system is not longer available for use (i.e. the system died) + + + + + + + Indicates whether the event succeeded or failed + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + Create a new database object, such as Placing an Order. + + + + + Display or print data, such as a Doctor Census + + + + + Update data, such as Revise Patient Information + + + + + Delete items, such as a doctor master file record + + + + + Perform a system or application function such as log-on, program execution or use of an object's method, or perform a query/search operation + + + + + + + Indicator for type of action performed during the event that generated the audit. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + Machine Name, including DNS name + + + + + IP Address + + + + + Telephone Number + + + + + Email address + + + + + URI (User directory, HTTP-PUT, ftp, etc.) + + + + + + + The type of network access point of this participant in the audit event + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + Origination / Creation + + + + + Import / Copy from original + + + + + Amendment + + + + + Verification + + + + + Translation + + + + + Access / Use + + + + + De-identification + + + + + Aggregation, summarization, derivation + + + + + Report + + + + + Export / Copy to target + + + + + Disclosure + + + + + Receipt of disclosure + + + + + Archiving + + + + + Logical deletion + + + + + Permanent erasure / Physical destruction + + + + + + + Identifier for the data life-cycle stage for the object + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + Person + + + + + System Object + + + + + Organization + + + + + Other + + + + + + + Code for the object type involved audited + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification. + + + + + Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Identifier assigned to the resource for business purposes, outside the context of FHIR. + + + + + Identifies the 'type' of resource - equivalent to the resource name for other resources. + + + + + Identifies the patient, practitioner, device or any other resource that is the "focus" of this resoruce. + + + + + Indicates who was responsible for creating the resource instance. + + + + + Identifies when the resource was first created. + + + + + + + + + A binary resource can contain any content, whether text, image, pdf, zip archive, etc. + + + + + A binary resource can contain any content, whether text, image, pdf, zip archive, etc. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + MimeType of the binary content represented as a standard MimeType (BCP 13). + + + + + The actual content, base64 encoded. + + + + + + + + + Record details about the anatomical location of a specimen or body part. This resource may be used when a coded concept does not provide the necessary detail needed for the use case. + + + + + Record details about the anatomical location of a specimen or body part. This resource may be used when a coded concept does not provide the necessary detail needed for the use case. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + The person to which the body site belongs. + + + + + Identifier for this instance of the anatomical location. + + + + + Named anatomical location - ideally would be coded where possible. + + + + + Modifier to refine the anatomical location. These include modifiers for laterality, relative location, directionality, number, and plane. + + + + + Description of anatomical location. + + + + + Image or images used to identify a location. + + + + + + + + + A container for a collection of resources. + + + + + A container for a collection of resources. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Indicates the purpose of this bundle- how it was intended to be used. + + + + + The base URL for the service that provided these resources. All relative URLs are relative to this one (equivalent to xml:base). + + + + + If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle). + + + + + A series of links that provide context to this bundle. + + + + + An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only). + + + + + XML Digital Signature - base64 encoded. + + + + + + + + + A container for a collection of resources. + + + + + + + A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]. + + + + + The reference details for the link. + + + + + + + + + A container for a collection of resources. + + + + + + + The Base URL for the resource, if different to the base URL specified for the bundle as a whole. + + + + + A series of links that provide context to this entry. + + + + + The Resources for the entry. + + + + + Information about the search process that lead to the creation of this entry. + + + + + Additional information about how this entry should be processed as part of a transaction. + + + + + Additional information about how this entry should be processed as part of a transaction. + + + + + + + + + A container for a collection of resources. + + + + + + + Why this entry is in the result set - whether it's included as a match or because of an _include requirement. + + + + + When searching, the server's search ranking score for the entry. + + + + + + + + + A container for a collection of resources. + + + + + + + The HTTP verb for this entry in either a update history, or a transaction/ transaction response. + + + + + A search URL for this resource that specifies how the resource is matched to an existing resource when processing a transaction (see transaction documentation). + + + + + If the ETag values match, return a 304 Not modified status. See the read/vread interaction documentation. + + + + + Only perform the operation if the Etag value matches. For more information, see the API section "Managing Resource Contention". + + + + + Only perform the operation if the last updated date matches. For more information, see the API section "Managing Resource Contention". + + + + + Instruct the server not to perform the create if a specified resource already exists. For further information, see "Conditional Create". + + + + + + + + + A container for a collection of resources. + + + + + + + The status code returned by processing this entry. + + + + + The location header created by processing this operation. + + + + + The etag for the resource, it the operation for the entry produced a versioned resource. + + + + + The date/time that the resource was modified on the server. + + + + + + + + + + + HTTP GET + + + + + HTTP POST + + + + + HTTP PUT + + + + + HTTP DELETE + + + + + + + HTTP verbs (in the HTTP command line) + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + The bundle is a document. The first resource is a Composition + + + + + The bundle is a message. The first resource is a MessageHeader + + + + + The bundle is a transaction - intended to be processed by a server as an atomic commit + + + + + The bundle is a transaction response + + + + + The bundle is a list of resources from a _history interaction on a server + + + + + The bundle is a list of resources returned as a result of a search/query interaction, operation, or message + + + + + The bundle is a set of resources collected into a single document for ease of distribution + + + + + + + Indicates the purpose of a bundle- how it was intended to be used + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + This resource matched the search specification + + + + + This resource is returned because it is referred to from another resource in the search set + + + + + + + Why an entry is in the result set - whether it's included as a match or because of an _include requirement + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions. + + + + + Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). + + + + + Identifies the patient/subject whose intended care is described by the plan. + + + + + Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record. + + + + + Indicates when the plan did (or is intended to) come into effect and end. + + + + + Identifies the individual(s) or ogranization who is responsible for the content of the care plan. + + + + + Identifies the most recent date on which the plan has been revised. + + + + + Identifies what "kind" of plan this is to support differentiation between multiple co-existing plans. E.g. "Home health", "psychiatric", "asthma", "disease management", etc. + + + + + Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan. + + + + + Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include co-morbidities, recent procedures, limitations, recent assessments, etc. + + + + + Identifies all people and organizations who are expected to be involved in the care envisioned by this plan. + + + + + Describes the intended objective(s) of carrying out the Care Plan. + + + + + Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc. + + + + + General notes about the care plan not covered elsewhere. + + + + + + + + + Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions. + + + + + + + Indicates specific responsibility of an individual within the care plan. E.g. "Primary physician", "Team coordinator", "Caregiver", etc. + + + + + The specific person or organization who is participating/expected to participate in the care plan. + + + + + + + + + Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions. + + + + + + + Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc. + + + + + Notes about the execution of the activity. + + + + + The details of the proposed activity represented in a specific resource. + + + + + A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc. + + + + + + + + + Describes the intention of how one or more practitioners intend to deliver care for a particular patient for a period of time, possibly limited to care for a specific condition or set of conditions. + + + + + + + High-level categorization of the type of activity in a care plan. + + + + + Detailed description of the type of planned activity. E.g. What lab test, what procedure, what kind of encounter. + + + + + Provides the health condition(s) or other rationale that drove the inclusion of this particular activity as part of the plan. + + + + + + + Internal reference that identifies the goals that this activity is intended to contribute towards meeting. + + + + + Identifies what progress is being made for the specific activity. + + + + + Provides reason why the activity isn't yet started, is on hold, was cancelled, etc. + + + + + If true, indicates that the described activity is one that must NOT be engaged in when following the plan. + + + + + The period, timing or frequency upon which the described activity is to occur. + + + + + + + + Identifies the facility where the activity will occur. E.g. home, hospital, specific clinic, etc. + + + + + Identifies who's expected to be involved in the activity. + + + + + Identifies the food, drug or other product to be consumed or supplied in the activity. + + + + + Identifies the quantity expected to be consumed in a given day. + + + + + Identifies the quantity expected to be supplied, addministered or consumed by the subject. + + + + + This provides a textual description of constraints on the intended activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc. + + + + + + + + + + + The plan is in development or awaiting use but is not yet intended to be acted upon. + + + + + The plan is intended to be followed and used as part of patient care + + + + + The plan is no longer in use and is not expected to be followed or used in patient care + + + + + + + Indicates whether the plan is currently being acted upon, represents future intentions or is now just historical record. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + Activity is planned but no action has yet been taken + + + + + Appointment or other booking has occurred but activity has not yet begun + + + + + Activity has been started but is not yet complete + + + + + Activity was started but has temporarily ceased with an expectation of resumption at a future time. + + + + + The activities have been completed (more or less) as planned + + + + + The activities have been ended prior to completion (perhaps even before they were started) + + + + + + + Indicates where the activity is at in its overall life cycle + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + Plan for the patient to consume food of a specified nature + + + + + Plan for the patient to consume/receive a drug, vaccine or other product + + + + + Plan to meet or communicate with the patient (in-patient, out-patient, phone call, etc.) + + + + + Plan to capture information about a patient (vitals, labs, diagnostic images, etc.) + + + + + Plan to modify the patient in some way (surgery, physiotherapy, education, counseling, etc.) + + + + + Plan to provide something to the patient (medication, medical supply, etc.) + + + + + Some other form of action + + + + + + + High-level categorization of the type of activity in a care plan. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. + + + + + A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + The category of claim this is. + + + + + The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number. + + + + + The version of the specification on which this instance relies. + + + + + The version of the specification from which the original instance was created. + + + + + The date when the enclosed suite of services were performed or completed. + + + + + Insurer Identifier, typical BIN number (6 digit). + + + + + The provider which is responsible for the bill, claim pre-determination, pre-authorization. + + + + + The organization which is responsible for the bill, claim pre-determination, pre-authorization. + + + + + Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + + + + + Immediate (STAT), best effort (NORMAL), deferred (DEFER). + + + + + In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested. + + + + + Person who created the invoice/claim/pre-determination or pre-authorization. + + + + + Facility where the services were provided. + + + + + Prescription to support the dispensing of Pharmacy or Vision products. + + + + + Original prescription to support the dispensing of pharmacy services, medications or products. + + + + + The party to be reimbursed for the services. + + + + + The referral resource which lists the date, practitioner, reason and other supporting information. + + + + + Ordered list of patient diagnosis for which care is sought. + + + + + List of patient conditions for which care is sought. + + + + + Patient Resource. + + + + + Financial instrument by which payment information for health care. + + + + + Factors which may influence the applicability of coverage. + + + + + Name of school for over-aged dependants. + + + + + Date of an accident which these services are addressing. + + + + + Type of accident: work, auto, etc. + + + + + A list of intervention and exception codes which may influence the adjudication of the claim. + + + + + First tier of goods and services. + + + + + Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission. + + + + + A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons. + + + + + + + + + A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. + + + + + + + Party to be reimbursed: Subscriber, provider, other. + + + + + The provider who is to be reimbursed for the claim (the party to whom any benefit is assigned). + + + + + The organization who is to be reimbursed for the claim (the party to whom any benefit is assigned). + + + + + The person other than the subscriber who is to be reimbursed for the claim (the party to whom any benefit is assigned). + + + + + + + + + A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. + + + + + + + Sequence of diagnosis which serves to order and provide a link. + + + + + The diagnosis. + + + + + + + + + A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. + + + + + + + A service line item. + + + + + The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated. + + + + + Reference to the program or plan identification, underwriter or payor. + + + + + The contract number of a business agreement which describes the terms and conditions. + + + + + The relationship of the patient to the subscriber. + + + + + A list of references from the Insurer to which these services pertain. + + + + + The Coverages adjudication details. + + + + + The style (standard) and version of the original material which was converted into this resource. + + + + + + + + + A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. + + + + + + + A service line number. + + + + + The type of product or service. + + + + + The practitioner who is responsible for the services rendered to the patient. + + + + + Diagnosis applicable for this service or product line. + + + + + If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied. + + + + + The date when the enclosed suite of services were performed or completed. + + + + + The number of repetitions of a service or product. + + + + + If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group. + + + + + A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + + + + + An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + + + + + The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. + + + + + List of Unique Device Identifiers associated with this line item. + + + + + Physical service site on the patient (limb, tooth, etc). + + + + + A region or surface of the site, eg. limb region or tooth surface(s). + + + + + Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen. + + + + + Second tier of goods and services. + + + + + The materials and placement date of prior fixed prosthesis. + + + + + + + + + A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. + + + + + + + A service line number. + + + + + The type of product or service. + + + + + If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied. + + + + + The number of repetitions of a service or product. + + + + + If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group. + + + + + A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + + + + + An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + + + + + The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. + + + + + List of Unique Device Identifiers associated with this line item. + + + + + Third tier of goods and services. + + + + + + + + + A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. + + + + + + + A service line number. + + + + + The type of product or service. + + + + + The fee for an addittional service or product or charge. + + + + + The number of repetitions of a service or product. + + + + + The fee for an addittional service or product or charge. + + + + + A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + + + + + An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. + + + + + The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. + + + + + List of Unique Device Identifiers associated with this line item. + + + + + + + + + A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. + + + + + + + Indicates whether this is the initial placement of a fixed prosthesis. + + + + + Date of the initial placement. + + + + + Material of the prior denture or bridge prosthesis. (Oral). + + + + + + + + + A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. + + + + + + + The code identifying which tooth is missing. + + + + + Missing reason may be: E-extraction, O-other. + + + + + The date of the extraction either known from records or patient reported estimate. + + + + + + + + + + + The treatment is complete and this represents a Claim for the services. + + + + + The treatment is proposed and this represents a Pre-authorization for the services. + + + + + The treatment is proposed and this represents a Pre-determination for the services. + + + + + A locally defined or otherwise resolved status. + + + + + + + Complete, proposed, exploratory, other + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + A claim for Institution based, typically in-patient, goods and services. + + + + + A claim for Oral Health (Dentist, Denturist, Hygienist) goods and services. + + + + + A claim for Pharmacy based goods and services. + + + + + A claim for Professional, typically out-patient, goods and services. + + + + + A claim for Vision (Opthamologist, Optometrist and Optician) goods and services. + + + + + + + The type or discipline-style of the claim + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + This resource provides the adjudication details from the processing of a Claim resource. + + + + + This resource provides the adjudication details from the processing of a Claim resource. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + The Response Business Identifier. + + + + + Original request resource referrence. + + + + + The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + + + + + The style (standard) and version of the original material which was converted into this resource. + + + + + The date when the enclosed suite of services were performed or completed. + + + + + The Insurer who produced this adjudicated response. + + + + + The practitioner who is responsible for the services rendered to the patient. + + + + + The organization which is responsible for the services rendered to the patient. + + + + + Transaction status: error, complete. + + + + + A description of the status of the adjudication. + + + + + Party to be reimbursed: Subscriber, provider, other. + + + + + The first tier service adjudications for submitted services. + + + + + The first tier service adjudications for payor added services. + + + + + Mutually exclusive with Services Provided (Item). + + + + + The total cost of the services reported. + + + + + The amount of deductable applied which was not allocated to any particular service line. + + + + + Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable). + + + + + Adjustment to the payment of this transaction which is not related to adjudication of this transaction. + + + + + Reason for the payment adjustment. + + + + + Estimated payment data. + + + + + Payable less any payment adjustment. + + + + + Payment identifer. + + + + + Status of funds reservation (For provider, for Patient, None). + + + + + The form to be used for printing the content. + + + + + Note text. + + + + + Financial instrument by which payment information for health care. + + + + + + + + + This resource provides the adjudication details from the processing of a Claim resource. + + + + + + + A service line number. + + + + + A list of note references to the notes provided below. + + + + + The adjudications results. + + + + + The second tier service adjudications for submitted services. + + + + + + + + + This resource provides the adjudication details from the processing of a Claim resource. + + + + + + + Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. + + + + + Monitory amount associated with the code. + + + + + A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + + + + + + + + + This resource provides the adjudication details from the processing of a Claim resource. + + + + + + + A service line number. + + + + + The adjudications results. + + + + + The third tier service adjudications for submitted services. + + + + + + + + + This resource provides the adjudication details from the processing of a Claim resource. + + + + + + + Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. + + + + + Monitory amount associated with the code. + + + + + A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + + + + + + + + + This resource provides the adjudication details from the processing of a Claim resource. + + + + + + + A service line number. + + + + + The adjudications results. + + + + + + + + + This resource provides the adjudication details from the processing of a Claim resource. + + + + + + + Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. + + + + + Monitory amount associated with the code. + + + + + A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + + + + + + + + + This resource provides the adjudication details from the processing of a Claim resource. + + + + + + + List of input service items which this service line is intended to replace. + + + + + A code to indicate the Professional Service or Product supplied. + + + + + The fee charged for the professional service or product.. + + + + + A list of note references to the notes provided below. + + + + + The adjudications results. + + + + + The second tier service adjudications for payor added services. + + + + + + + + + This resource provides the adjudication details from the processing of a Claim resource. + + + + + + + Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. + + + + + Monitory amount associated with the code. + + + + + A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + + + + + + + + + This resource provides the adjudication details from the processing of a Claim resource. + + + + + + + A code to indicate the Professional Service or Product supplied. + + + + + The fee charged for the professional service or product.. + + + + + The adjudications results. + + + + + + + + + This resource provides the adjudication details from the processing of a Claim resource. + + + + + + + Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. + + + + + Monitory amount associated with the code. + + + + + A non-monetary value for example a percentage. Mutually exclusive to the amount element above. + + + + + + + + + This resource provides the adjudication details from the processing of a Claim resource. + + + + + + + The sequence number of the line item submitted which contains the error. This value is ommitted when the error is elsewhere. + + + + + The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition. + + + + + The sequence number of the addition within the line item submitted which contains the error. This value is ommitted when the error is not related to an Addition. + + + + + An error code,froma specified code system, which details why the claim could not be adjudicated. + + + + + + + + + This resource provides the adjudication details from the processing of a Claim resource. + + + + + + + An integer associated with each note which may be referred to from each service line item. + + + + + The note purpose: Print/Display. + + + + + The note text. + + + + + + + + + This resource provides the adjudication details from the processing of a Claim resource. + + + + + + + A service line item. + + + + + The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated. + + + + + Reference to the program or plan identification, underwriter or payor. + + + + + The contract number of a business agreement which describes the terms and conditions. + + + + + The relationship of the patient to the subscriber. + + + + + A list of references from the Insurer to which these services pertain. + + + + + The Coverages adjudication details. + + + + + The style (standard) and version of the original material which was converted into this resource. + + + + + + + + + A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score. + + + + + A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + The patient being assessed. + + + + + The clinician performing the assessment. + + + + + Identifies the workflow status of the assessment. + + + + + The point in time at which the assessment was concluded (not when it was recorded). + + + + + A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it. + + + + + A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes. + + + + + This a list of the general problems/conditions for a patient. + + + + + The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource. + + + + + + + One or more sets of investigations (signs, symptions, etc). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes. + + + + + Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis. + + + + + A text summary of the investigations and the diagnosis. + + + + + Specific findings or diagnoses that was considered likely or relevant to ongoing treatment. + + + + + Diagnoses/conditions resolved since the last assessment. + + + + + Diagnosis considered not possible. + + + + + Estimate of likely outcome. + + + + + Plan of action after assessment. + + + + + Actions taken during assessment. + + + + + + + + + A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score. + + + + + + + A name/code for the group ("set") of investigations. Typically, this will be something like "signs", "symptoms", "clinical", "diagnostic", but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used. + + + + + A record of a specific investigation that was undertaken. + + + + + + + + + A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score. + + + + + + + Specific text of code for finding or diagnosis. + + + + + Which investigations support finding or diagnosis. + + + + + + + + + A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score. + + + + + + + Specific text of code for diagnosis. + + + + + Grounds for elimination. + + + + + + + + + + + The assessment is still on-going and results are not yet final. + + + + + The assessment is done and the results are final + + + + + This assessment was never actually done and the record is erroneous (e.g. Wrong patient) + + + + + + + The workflow state of a clinical impression + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + An occurrence of information being transmitted. E.g., an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition. + + + + + An occurrence of information being transmitted. E.g., an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Identifiers associated with this Communication that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). + + + + + The type of message conveyed such as alert, notification, reminder, instruction, etc. + + + + + The entity (e.g., person, organization, clinical information system, or device) which was the source of the communication. + + + + + The entity (e.g., person, organization, clinical information system, or device) which was the target of the communication. + + + + + Text, attachment(s), or resource(s) that was communicated to the recipient. + + + + + The communication medium, e.g., email, fax. + + + + + The status of the transmission. + + + + + The encounter within which the communication was sent. + + + + + The time when this communication was sent. + + + + + The time when this communication arrived at the destination. + + + + + The reason or justification for the communication. + + + + + The patient who was the focus of this communication. + + + + + + + + + An occurrence of information being transmitted. E.g., an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition. + + + + + + + An individual message part for multi-part messages. + + + + + + + + + + + + + + The communication transmission is ongoing. + + + + + The message transmission is complete, i.e., delivered to the recipient's destination. + + + + + The communication transmission has been held by originating system/user request. + + + + + The receiving system has declined to accept the message. + + + + + There was a failure in transmitting the message out. + + + + + + + The status of the communication + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A request to convey information. E.g., the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition. + + + + + A request to convey information. E.g., the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be auto-generated, if needed, by CDS system. Does not need to be the actual ID of the source system. + + + + + The type of message to be sent such as alert, notification, reminder, instruction, etc. + + + + + The entity (e.g., person, organization, clinical information system, or device) which is to be the source of the communication. + + + + + The entity (e.g., person, organization, clinical information system, or device) which is the intended target of the communication. + + + + + Text, attachment(s), or resource(s) to be communicated to the recipient. + + + + + The communication medium to be used, e.g., email, fax. + + + + + The responsible person who authorizes this order, e.g., physician. This may be different than the author of the order statement, e.g., clerk, who may have entered the statement into the order entry application. + + + + + The status of the proposal or order. + + + + + The encounter within which the communication request was created. + + + + + The time when this communication is to occur. + + + + + The reason or justification for the communication request. + + + + + The time when the request was made. + + + + + The patient who is the focus of this communication request. + + + + + Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine. + + + + + + + + + A request to convey information. E.g., the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition. + + + + + + + An individual message part for multi-part messages. + + + + + + + + + + + + + + The request has been proposed + + + + + The request has been planned + + + + + The request has been placed + + + + + The receiving system has received the request but not yet decided whether it will be performed + + + + + The receiving system has accepted the order, but work has not yet commenced + + + + + The work to fulfill the order is happening + + + + + The work has been complete, the report(s) released, and no further work is planned + + + + + The request has been held by originating system/user request + + + + + The receiving system has declined to fulfill the request + + + + + The communication was attempted, but due to some procedural error, it could not be completed + + + + + + + The status of the communication + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. + + + + + A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Logical Identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time. + + + + + The composition editing time, when the composition was last logically changed by the author. + + + + + Specifies the particular kind of composition (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the composition. + + + + + A categorization for the type of the composition. This may be implied by or derived from the code specified in the Composition Type. + + + + + Official human-readable label for the composition. + + + + + The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document. + + + + + The code specifying the level of confidentiality of the Composition. + + + + + Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of livestock, or a set of patients that share a common exposure). + + + + + Identifies who is responsible for the information in the composition. (Not necessarily who typed it in.). + + + + + A participant who has attested to the accuracy of the composition/document. + + + + + Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information. + + + + + The clinical service, such as a colonoscopy or an appendectomy, being documented. + + + + + Describes the clinical encounter or type of care this documentation is associated with. + + + + + The root of the sections that make up the composition. + + + + + + + + + A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. + + + + + + + The type of attestation the authenticator offers. + + + + + When composition was attested by the party. + + + + + Who attested the composition in the specified way. + + + + + + + + + A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. + + + + + + + This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act. + + + + + The period of time covered by the documentation. There is no assertion that the documentation is a complete representation for this period, only that it documents events during this time. + + + + + Full details for the event(s) the composition/documentation consents. + + + + + + + + + A set of healthcare-related information that is assembled together into a single logical document that provides a single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is making the statement. + + + + + + + The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents. + + + + + A code identifying the kind of content contained within the section. This must be consistent with the section title. + + + + + The content (narrative and data entries) associated with the section. + + + + + A nested sub-section within this section. + + + + + + + + + + + This is a preliminary composition or document (also known as initial or interim). The content may be incomplete or unverified + + + + + This version of the composition is complete and verified by an appropriate person and no further work is planned. Any subsequent updates would be on a new version of the composition. + + + + + The composition or document has been modified subsequent to being released as "final", and is complete and verified by an authorized person. The modifications added new information to the composition or document, but did not revise existing content + + + + + The composition or document has been modified subsequent to being released as "final", and is complete and verified by an authorized person + + + + + The composition or document was originally created/issued in error, and this is an amendment that marks that the entire series should not be considered as valid + + + + + + + The workflow/clinical status of the composition + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + The person authenticated the content in their personal capacity + + + + + The person authenticated the content in their professional capacity + + + + + The person authenticated the content and accepted legal responsibility for its content + + + + + The organization authenticated the content as consistent with their policies and procedures + + + + + + + The way in which a person authenticated a composition + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models. + + + + + A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + An absolute uri that is used to identify this concept map when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:). + + + + + Formal identifier that is used to identify this concept map when it is represented in other formats, or referenced in a specification, model, design or an instance. + + + + + The identifier that is used to identify this version of the concept map when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + + + + + A free text natural language name describing the concept map. + + + + + The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of concept maps. + + + + + The name of the individual or organization that published the concept map. + + + + + Contacts to assist a user in finding and communicating with the publisher. + + + + + A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc. + + + + + Explains why this concept map is needed and why it's been constrained as it has. + + + + + A copyright statement relating to the concept map and/or its contents. + + + + + The status of the concept map. + + + + + This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + + + + + The date that the concept map status was last changed. + + + + + The source value set that specifies the concepts that are being mapped. + + + + + + + The target value set provides context to the mappings. Note that the mapping is made between concepts, not between value sets, but the value set provides important context about how the concept mapping choices are made. + + + + + + + Mappings for an individual concept in the source to one or more concepts in the target. + + + + + + + + + A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models. + + + + + + + The name of an individual to contact regarding the concept map. + + + + + Contact details for individual (if a name was provided) or the publisher. + + + + + + + + + A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models. + + + + + + + An absolute URI that identifies the Code System (if the source is a value value set that crosses more than one code system). + + + + + Identity (code or path) or the element/item being mapped. + + + + + A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value. + + + + + A concept from the target value set that this concept maps to. + + + + + + + + + A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models. + + + + + + + A reference to a specific concept that holds a coded value. This can be an element in a FHIR resource, or a specific reference to a data element in a different specification (e.g. v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition. + + + + + An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that cross code systems). + + + + + Identity (code or path) or the element/item that the map depends on / refers to. + + + + + + + + + A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models. + + + + + + + An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems). + + + + + Identity (code or path) or the element/item that the map refers to. + + + + + The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from source to target (e.g. the source is 'wider' than the target. + + + + + A description of status/issues in mapping that conveys additional information not represented in the structured data. + + + + + A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element must be mapped to some data element or source that is in context. The mapping may still be useful without a place for the additional data elements, but the equivalence cannot be relied on. + + + + + + + + + Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a Diagnosis during an Encounter; populating a problem List or a Summary Statement, such as a Discharge Summary. + + + + + Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a Diagnosis during an Encounter; populating a problem List or a Summary Statement, such as a Discharge Summary. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + This records identifiers associated with this condition that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). + + + + + Indicates the patient who the condition record is associated with. + + + + + Encounter during which the condition was first asserted. + + + + + Person who takes responsibility for asserting the existence of the condition as part of the electronic record. + + + + + Estimated or actual date the condition/problem/diagnosis was first detected/suspected. + + + + + Identification of the condition, problem or diagnosis. + + + + + A category assigned to the condition. E.g. complaint | symptom | finding | diagnosis. + + + + + The clinical status of the condition. + + + + + A subjective assessment of the severity of the condition as evaluated by the clinician. + + + + + Estimated or actual date or date-time the condition began, in the opinion of the clinician. + + + + + + + + + + The date or estimated date that the condition resolved or went into remission. This is called "abatement" because of the many overloaded connotations associated with "remission" or "resolution" - Conditions are never really resolved, but they can abate. + + + + + + + + + + + Clinical stage or grade of a condition. May include formal severity assessments. + + + + + Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed. + + + + + The anatomical location where this condition manifests itself. + + + + + Further conditions, problems, diagnoses, procedures or events or the substance that caused/triggered this Condition. + + + + + Further conditions, problems, diagnoses, procedures or events or the substance that preceded this Condition. + + + + + Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis. + + + + + + + + + Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a Diagnosis during an Encounter; populating a problem List or a Summary Statement, such as a Discharge Summary. + + + + + + + A simple summary of the stage such as "Stage 3". The determination of the stage is disease-specific. + + + + + Reference to a formal record of the evidence on which the staging assessment is based. + + + + + + + + + Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a Diagnosis during an Encounter; populating a problem List or a Summary Statement, such as a Discharge Summary. + + + + + + + A manifestation or symptom that led to the recording of this condition. + + + + + Links to other relevant information, including pathology reports. + + + + + + + + + Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a Diagnosis during an Encounter; populating a problem List or a Summary Statement, such as a Discharge Summary. + + + + + + + Code that identifies the structural location. + + + + + + + + + + + Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a Diagnosis during an Encounter; populating a problem List or a Summary Statement, such as a Discharge Summary. + + + + + + + Code that identifies the target of this relationship. The code takes the place of a detailed instance target. + + + + + Target of the relationship. + + + + + + + + + Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many uses including: recording a Diagnosis during an Encounter; populating a problem List or a Summary Statement, such as a Discharge Summary. + + + + + + + Code that identifies the target of this relationship. The code takes the place of a detailed instance target. + + + + + Target of the relationship. + + + + + + + + + + + This is a tentative diagnosis - still a candidate that is under consideration + + + + + The patient is being treated on the basis that this is the condition, but it is still not confirmed + + + + + There is sufficient diagnostic and/or clinical evidence to treat this as a confirmed condition + + + + + This condition has been ruled out by diagnostic and clinical evidence + + + + + The statement was entered in error and Is not valid + + + + + The condition status is unknown. Note that "unknown" is a value of last resort and every attempt should be made to provide a meaningful value other than "unknown" + + + + + + + The clinical status of the Condition or diagnosis + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation. + + + + + A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + An absolute uri that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:). + + + + + The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + + + + + A free text natural language name identifying the conformance statement. + + + + + The name of the individual or organization that published the conformance. + + + + + Contacts to assist a user in finding and communicating with the publisher. + + + + + A free text natural language description of the conformance statement and its use. Typically, this is used when the conformance statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP. + + + + + Explains why this conformance statement is needed and why it's been constrained as it has. + + + + + A copyright statement relating to the conformamce statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the system described by the conformance statement. + + + + + The status of this conformance statement. + + + + + A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + + + + + The date (and optionally time) when the conformance statement was published. + + + + + Software that is covered by this conformance statement. It is used when the conformance statement describes the capabilities of a particular software version, independent of an installation. + + + + + Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program. + + + + + The version of the FHIR specification on which this conformance statement is based. + + + + + A flag that indicates whether the application accepts unknown elements as part of a resource. + + + + + A list of the formats supported by this implementation using their content types. + + + + + A list of profiles supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources, conformant to a particular profile, and allows its clients to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. + + + + + A definition of the restful capabilities of the solution, if any. + + + + + A description of the messaging capabilities of the solution. + + + + + A document definition. + + + + + + + + + A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation. + + + + + + + The name of an individual to contact regarding the conformance. + + + + + Contact details for individual (if a name was provided) or the publisher. + + + + + + + + + A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation. + + + + + + + Name software is known by. + + + + + The version identifier for the software covered by this statement. + + + + + Date this version of the software released. + + + + + + + + + A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation. + + + + + + + Information about the specific installation that this conformance statement relates to. + + + + + An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces. + + + + + + + + + A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation. + + + + + + + Identifies whether this portion of the statement is describing ability to initiate or receive restful operations. + + + + + Information about the system's restful capabilities that apply across all applications, such as security. + + + + + Information about security implementation from an interface perspective - what a client needs to know. + + + + + A specification of the restful capabilities of the solution for a specific resource type. + + + + + A specification of restful operations supported by the system. + + + + + Definition of an operation or a named query and with its parameters and their meaning and type. + + + + + A list of absolute URIs that identify profiles that this server implements for accepting documents in the mailbox. If this list is empty, then documents are not accepted. The base specification has the profile identifier "http://hl7.org/fhir/documents/mailbox". Other specifications can declare their own identifier for this purpose. + + + + + An absolute URI which is a reference to the definition of a compartment hosted by the system. + + + + + + + + + A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation. + + + + + + + Server adds CORS headers when responding to requests - this enables javascript applications to use the server. + + + + + Types of security services are supported/required by the system. + + + + + General description of how security works. + + + + + Certificates associated with security profiles. + + + + + + + + + A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation. + + + + + + + Mime type for certificate. + + + + + Actual certificate. + + + + + + + + + A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation. + + + + + + + A type of resource exposed via the restful interface. + + + + + A specification of the profile that describes the solution's support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. + + + + + Identifies a restful operation supported by the solution. + + + + + Thi field is set to true to specify that the system does not support (server) or use (client) versioning for this resource type. If this is not set to true, the server must at least correctly track and populate the versionId meta-property on resources. + + + + + A flag for whether the server is able to return past versions as part of the vRead operation. + + + + + A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server. + + + + + A flag that indicates that the server supports conditional create. + + + + + A flag that indicates that the server supports conditional update. + + + + + A flag that indicates that the server supports conditional delete. + + + + + A list of _include values supported by the server. + + + + + Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation. + + + + + + + + + A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation. + + + + + + + Coded identifier of the operation, supported by the system resource. + + + + + Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'. + + + + + + + + + A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation. + + + + + + + The name of the search parameter used in the interface. + + + + + An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]). + + + + + The type of value a search parameter refers to, and how the content is interpreted. + + + + + This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms. + + + + + Types of resource (if a resource is referenced). + + + + + Chained names supported. + + + + + + + + + A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation. + + + + + + + A coded identifier of the operation, supported by the system. + + + + + Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented. + + + + + + + + + A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation. + + + + + + + The name of a query, which is used in the _query parameter when the query is called. + + + + + Where the formal definition can be found. + + + + + + + + + A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation. + + + + + + + An address to which messages and/or replies are to be sent. + + + + + Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender). + + + + + Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner. + + + + + A description of the solution's support for an event at this end point. + + + + + + + + + A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation. + + + + + + + A coded identifier of a supported messaging event. + + + + + The impact of the content of the message. + + + + + The mode of this event declaration - whether application is sender or receiver. + + + + + A list of the messaging transport protocol(s) identifiers, supported by this endpoint. + + + + + A resource associated with the event. This is the resource that defines the event. + + + + + Information about the request for this event. + + + + + Information about the response for this event. + + + + + Guidance on how this event is handled, such as internal system trigger points, business rules, etc. + + + + + + + + + A conformance statement is a set of requirements for a desired implementation or a description of how a target application fulfills those requirements in a particular implementation. + + + + + + + Mode of this document declaration - whether application is producer or consumer. + + + + + A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc. + + + + + A constraint on a resource used in the document. + + + + + + + + + + + VersionId meta-property is not suppoerted (server) or used (client) + + + + + VersionId meta-property is suppoerted (server) or used (client) + + + + + VersionId is must be correct for updates (server) or will be specified (If-match header) for updates (client) + + + + + + + How the system supports versioning for a resource + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + The message represents/requests a change that should not be processed more than once. E.g. Making a booking for an appointment + + + + + The message represents a response to query for current information. Retrospective processing is wrong and/or wasteful + + + + + The content is not necessarily intended to be current, and it can be reprocessed, though there may be version issues created by processing old notifications + + + + + + + The impact of the content of a message + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + The application produces documents of the specified type + + + + + The application consumes documents of the specified type + + + + + + + Whether the application produces or consumes documents + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Operations supported by REST at the type or instance level + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + The application sends requests and receives responses + + + + + The application receives requests and sends responses + + + + + + + The mode of a message conformance statement + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Operations supported by REST at the system level + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + The application acts as a client for this resource + + + + + The application acts as a server for this resource + + + + + + + The mode of a RESTful conformance statement + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A formal agreement between parties regarding the conduct of business, exchange of information or other matters. + + + + + A formal agreement between parties regarding the conduct of business, exchange of information or other matters. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Unique identifier for this Contract. + + + + + When this Contract was issued. + + + + + Relevant time or time-period when this Contract is applicable. + + + + + Who and/or what this Contract is about: typically a Patient, Organization, or valued items such as goods and services. + + + + + A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies. + + + + + Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources. + + + + + Type of Contract such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc. + + + + + More specific type or specialization of an overarching or more general contract such as auto insurance, home owner insurance, prenupial agreement, Advanced-Directive, or privacy consent. + + + + + Action stipulated by this Contract. + + + + + Reason for action stipulated by this Contract. + + + + + List of Contract actors. + + + + + Contract Valued Item List. + + + + + Party signing this Contract. + + + + + One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups. + + + + + Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract. + + + + + + + The "patient friendly language" versionof the Contract in whole or in parts. "Patient friendly language" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement. + + + + + List of Legal expressions or representations of this Contract. + + + + + List of Computable Policy Rule Language Representations of this Contract. + + + + + + + + + A formal agreement between parties regarding the conduct of business, exchange of information or other matters. + + + + + + + Who or what actors are assigned roles in this Contract. + + + + + Role type of actors assigned roles in this Contract. + + + + + + + + + A formal agreement between parties regarding the conduct of business, exchange of information or other matters. + + + + + + + Specific type of Contract Valued Item that may be priced. + + + + + + + Identifies a Contract Valued Item instance. + + + + + Indicates the time during which this Contract ValuedItem information is effective. + + + + + Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances. + + + + + A Contract Valued Item unit valuation measure. + + + + + A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + + + + + An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point. + + + + + Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. + + + + + + + + + A formal agreement between parties regarding the conduct of business, exchange of information or other matters. + + + + + + + Role of this Contract signer, e.g., notary, grantee. + + + + + Party which is a signator to this Contract. + + + + + Legally binding Contract DSIG signature contents in Base64. + + + + + + + + + A formal agreement between parties regarding the conduct of business, exchange of information or other matters. + + + + + + + Unique identifier for this particular Contract Provision. + + + + + When this Contract Provision was issued. + + + + + Relevant time or time-period when this Contract Provision is applicable. + + + + + Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g., life time maximum benefit. + + + + + Subtype of this Contract Provision, e.g., life time maximum payment for a contract term for specific valued item, e.g., disability payment. + + + + + Who or what this Contract Provision is about. + + + + + Action stipulated by this Contract Provision. + + + + + Reason or purpose for the action stipulated by this Contract Provision. + + + + + List of actors participating in this Contract Provision. + + + + + Human readable form of this Contract Provision. + + + + + Contract Provision Valued Item List. + + + + + Nested group of Contract Provisions. + + + + + + + + + A formal agreement between parties regarding the conduct of business, exchange of information or other matters. + + + + + + + The actor assigned a role in this Contract Provision. + + + + + Role played by the actor assigned this role in this Contract Provision. + + + + + + + + + A formal agreement between parties regarding the conduct of business, exchange of information or other matters. + + + + + + + Specific type of Contract Provision Valued Item that may be priced. + + + + + + + Identifies a Contract Provision Valued Item instance. + + + + + Indicates the time during which this Contract Term ValuedItem information is effective. + + + + + Specifies the units by which the Contract Provision Valued Item is measured or counted, and quantifies the countable or measurable Contract Term Valued Item instances. + + + + + A Contract Provision Valued Item unit valuation measure. + + + + + A real number that represents a multiplier used in determining the overall value of the Contract Provision Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. + + + + + An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point. + + + + + Expresses the product of the Contract Provision Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. + + + + + + + + + A formal agreement between parties regarding the conduct of business, exchange of information or other matters. + + + + + + + Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability. + + + + + + + + + + + A formal agreement between parties regarding the conduct of business, exchange of information or other matters. + + + + + + + Contract legal text in human renderable form. + + + + + + + + + + + A formal agreement between parties regarding the conduct of business, exchange of information or other matters. + + + + + + + Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal). + + + + + + + + + + + Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient. E.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc. + + + + + Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient. E.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Indicates the patient whose record the contraindication is associated with. + + + + + Identifies the general type of issue identified. + + + + + Indicates the degree of importance associated with the identified issue based on the potential impact on the patient. + + + + + Indicates the resource representing the current activity or proposed activity that. + + + + + A textual explanation of the contraindication. + + + + + The date or date-time when the contraindication was initially identified. + + + + + Identifies the provider or software that identified the. + + + + + Business identifier associated with the contraindication record. + + + + + The literature, knowledge-base or similar reference that describes the propensity for the contraindication identified. + + + + + Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the contraindicaiton from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action. + + + + + + + + + Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient. E.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc. + + + + + + + Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified contraindication. + + + + + Indicates when the mitigating action was documented. + + + + + Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring. + + + + + + + + + Financial instrument which may be used to pay for or reimburse for health care products and services. + + + + + Financial instrument which may be used to pay for or reimburse for health care products and services. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + The program or plan underwriter or payor. + + + + + Business Identification Number (BIN number) used to identify the routing of eclaims if the insurer themselves don't have a BIN number for all of their business. + + + + + Time period during which the coverage is in force. A missing start date indicates the start date isn't known, a missing end date means the coverage is continuing to be in force. + + + + + The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health. + + + + + The id issued to the subscriber. + + + + + The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Subscriber Id, Certificate number or Personal Health Number or Case ID. + + + + + Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. + + + + + Identifies a style or collective of coverage issues by the underwriter, for example may be used to identify a class of coverage or employer group. May also be referred to as a Policy or Group ID. + + + + + Identifies a sub-style or sub-collective of coverage issues by the underwriter, for example may be used to identify a specific employer group within a class of employers. May be referred to as a Section or Division ID. + + + + + A unique identifier for a dependent under the coverage. + + + + + An optional counter for a particular instance of the identified coverage which increments upon each renewal. + + + + + The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due. + + + + + The identifier for a community of providers. + + + + + The policy(s) which constitute this insurance coverage. + + + + + + + + + The formal description of a single piece of information that can be gathered and reported. + + + + + The formal description of a single piece of information that can be gathered and reported. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + An absolute uri that is used to identify this element when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:). + + + + + Formal identifier that is used to identify this data element when it is represented in other formats, or referenced in a specification, model, design or an instance. + + + + + The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually. + + + + + The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used. + + + + + The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of data element definitions. + + + + + A flag to indicate that this search data elemnt definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + + + + + The status of the data element. + + + + + The date that the status for this business version of the data element became effective. (I.e. Date the draft was created, date element became active or date element became retired). + + + + + A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element. + + + + + The name of the individual or organization that published the data element. + + + + + Contacts to assist a user in finding and communicating with the publisher. + + + + + Identifies how precise the data element is in its definition. + + + + + Identifies a specification (other than a terminology) that the elements that make up the DataElement hav some correspondance with. + + + + + Defines the structure, type, allowed values and other constraining characteristics of the data element. + + + + + + + + + The formal description of a single piece of information that can be gathered and reported. + + + + + + + The name of an individual to contact regarding the data element. + + + + + Contact details for individual (if a name was provided) or the publisher. + + + + + + + + + The formal description of a single piece of information that can be gathered and reported. + + + + + + + An Internal id that is used to identify this mapping set when specific mappings are made on a per-element basis. + + + + + An absolute URI that identifies the specification that this mapping is expressed to. + + + + + A name for the specification that is being mapped to. + + + + + Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. + + + + + + + + + + + The data element is sufficiently well-constrained that multiple pieces of data captured according to the constraints of the data element will be comparable (though in some cases, a degree of automated conversion/normalization may be required). + + + + + The data element is fully specified down to a single value set, single unit of measure, single data type, etc. Multiple pieces of data associated with this data element are fully compareable + + + + + The data element allows multiple units of measure having equivalent meaning. E.g. "cc" (cubic centimeter) and "mL". + + + + + The data element allows multiple units of measure that are convertable between each other (e.g. Inches and centimeters) and/or allows data to be captured in multiple value sets for which a known mapping exists allowing conversion of meaning + + + + + A convertable data element where unit conversions are different only by a power of 10. E.g. g, mg, kg + + + + + The data element is unconstrained in units, choice of data types and/or choice of vocabulary such that automated comparison of data captured using the data element is not possible. + + + + + + + Indicates the degree of precision of the data element definition + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + This resource identifies an instance of a manufactured thing that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. Medical devices includes durable (reusable) medical equipment, implantable devices, as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health. Non medical devices may includes things such as a machine, a cellphone, a computer, an application, etc. + + + + + This resource identifies an instance of a manufactured thing that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. Medical devices includes durable (reusable) medical equipment, implantable devices, as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health. Non medical devices may includes things such as a machine, a cellphone, a computer, an application, etc. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Unique instance identifiers assigned to a device by organizations like manufacturers or owners . If the identifier identifies the type of device, Device.type should be used. + + + + + Code or identifier to identify a kind of device. + + + + + Status of the Device availability. + + + + + A name of the manufacturer. + + + + + The "model" - an identifier assigned by the manufacturer to identify the product by its type. This number is shared by the all devices sold as the same type. + + + + + The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware. + + + + + The Date and time when the device was manufactured. + + + + + The date and time beyond which this device is no longer valid or should not be used (if applicable). + + + + + United States Food and Drug Administration mandated Unique Device Identifier (UDI). Use the human readable information (the content that the user sees, which is sometimes different to the exact syntax represented in the barcode) - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm. + + + + + Lot number assigned by the manufacturer. + + + + + An organization that is responsible for the provision and ongoing maintenance of the device. + + + + + The resource may be found in a literal location (i.e. GPS coordinates), a logical place (i.e. "in/with the patient"), or a coded location. + + + + + Patient information, if the resource is affixed to a person. + + + + + Contact details for an organization or a particular human that is responsible for the device. + + + + + A network address on which the device may be contacted directly. + + + + + + + + + + + The Device is available for use + + + + + The Device is no longer available for use ( e.g lost, expired, damaged) + + + + + The Device was entered in error and voided + + + + + + + The availability status of the device + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + Describes the characteristics, operational status and capabilities of a medical-related component of a medical device. + + + + + Describes the characteristics, operational status and capabilities of a medical-related component of a medical device. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Describes the specific component type as defined in the object-oriented or metric nomenclature partition. + + + + + Describes the local assigned unique identification by the software. For example: handle ID. + + + + + Describes the timestamp for the most recent system change which includes device configuration or setting change. + + + + + Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc. + + + + + Describes the link to the parent resource. For example: Channel is linked to its VMD parent. + + + + + Indicates current operational status of the device. For example: On, Off, Standby, etc. + + + + + Describes the parameter group supported by the current device component that is based on some nomenclature, e.g., cardiovascular. + + + + + Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc. + + + + + Describes the production specification such as component revision, serial number, etc. + + + + + Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US. + + + + + + + + + Describes the characteristics, operational status and capabilities of a medical-related component of a medical device. + + + + + + + Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc. + + + + + Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of. + + + + + Describes the printable string defining the component. + + + + + + + + + + + Measurement principle isn't in the list + + + + + Measurement is done using chemical + + + + + Measurement is done using electrical + + + + + Measurement is done using impedance + + + + + Measurement is done using nuclear + + + + + Measurement is done using optical + + + + + Measurement is done using thermal + + + + + Measurement is done using biological + + + + + Measurement is done using mechanical + + + + + Measurement is done using acoustical + + + + + Measurement is done using manual + + + + + + + Different measurement principle supported by the device + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + Describes a measurement, calculation or setting capability of a medical device. + + + + + Describes a measurement, calculation or setting capability of a medical device. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc. + + + + + Describes the unique identification of this metric that has been assigned by the device or gateway software. For example: handle ID. +It should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device. + + + + + Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc. + + + + + Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc. + + + + + Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. +An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location. + + + + + Indicates current operational state of the device. For example: On, Off, Standby, etc. + + + + + Describes the typical color of the representation of observations that have been generated for this DeviceMetric. + + + + + Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation. + + + + + Describes the measurement repetition time. This is not +necessarily the same as the update +period. + + + + + Describes the calibrations that have been performed or that are required to be performed. + + + + + + + + + Describes a measurement, calculation or setting capability of a medical device. + + + + + + + Describes the type of the calibration method. + + + + + Describes the state of the calibration. + + + + + Describes the time last calibration has been performed. + + + + + + + + + + + TODO + + + + + TODO + + + + + TODO + + + + + TODO + + + + + + + Describes the type of a metric calibration + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + Color for representation - black + + + + + Color for representation - red + + + + + Color for representation - green + + + + + Color for representation - yellow + + + + + Color for representation - blue + + + + + Color for representation - magenta + + + + + Color for representation - cyan + + + + + Color for representation - white + + + + + + + Describes the typical color of representation + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + The metric has not been calibrated. + + + + + The metric needs to be calibrated. + + + + + The metric has been calibrated. + + + + + The state of calibration of this metric is unspecified. + + + + + + + Describes the state of a metric calibration + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + The DeviceMetric is operating and will generate DeviceObservations + + + + + The DeviceMetric is not operating + + + + + The DeviceMetric is operating, but will not generate any DeviceObservations + + + + + + + Describes the operational status of the DeviceMetric + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + DeviceObservations generated for this DeviceMetric are measured. + + + + + DeviceObservations generated for this DeviceMetric is a setting that will influence the behavior of the Device. + + + + + DeviceObservations generated for this DeviceMetric are calculated. + + + + + The category of this DeviceMetric is unspecified. + + + + + + + Describes the category of the metric + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker. + + + + + Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Indicates the site on the subject's body where the device should be used ( i.e. the target site). + + + + + + + The status of the request. + + + + + The details of the device to be used. + + + + + An encounter that provides additional context in which this request is made. + + + + + Identifiers assigned to this order by the orderer or by the receiver. + + + + + Reason or justification for the use of this device. + + + + + Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement. + + + + + The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%. + + + + + The time when the request was made. + + + + + The time at which the request was made/recorded. + + + + + The patient who will use the device. + + + + + The timing schedule for the use of the device The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". + + + + + + + + Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine. + + + + + + + + + + + The request has a normal priority. + + + + + The request should be done urgently. + + + + + The request is time-critical. + + + + + The request should be acted on as soon as possible. + + + + + + + Codes representing the priority of the request + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + The request has been proposed + + + + + The request has been planned + + + + + The request has been placed + + + + + The receiving system has received the request but not yet decided whether it will be performed + + + + + The receiving system has accepted the request but work has not yet commenced + + + + + The work to fulfill the order is happening + + + + + The work has been complete, the report(s) released, and no further work is planned + + + + + The request has been held by originating system/user request + + + + + The receiving system has declined to fulfill the request + + + + + The request was attempted, but due to some procedural error, it could not be completed + + + + + + + Codes representing the status of the request + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A record of a device being used by a patient where the record is the result of a report from the patient or another clinician. + + + + + A record of a device being used by a patient where the record is the result of a report from the patient or another clinician. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Indicates the site on the subject's body where the device was used ( i.e. the target site). + + + + + + + The time period over which the device was used. + + + + + The details of the device used. + + + + + An external identifier for this statement such as an IRI. + + + + + Reason or justification for the use of the device. + + + + + Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement. + + + + + The time at which the statement was made/recorded. + + + + + The patient who used the device. + + + + + How often the device was used. + + + + + + + + + + + + A record of a request for a diagnostic investigation service to be performed. + + + + + A record of a request for a diagnostic investigation service to be performed. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Who or what the investigation is to be performed on. This is usually a human patient, but diagnostic tests can also be requested on animals, groups of humans or animals, devices such as dialysis machines, or even locations (typically for environmental scans). + + + + + The practitioner that holds legal responsibility for ordering the investigation. + + + + + Identifiers assigned to this order by the orderer and/or the receiver and/or order fulfiller. + + + + + An encounter that provides additional information about the healthcare context in which this request is made. + + + + + An explanation or justification for why this diagnostic investigation is being requested. + + + + + Additional clinical information about the patient or specimen that may influence test interpretations. + + + + + One or more specimens that the diagnostic investigation is about. + + + + + The status of the order. + + + + + The clinical priority associated with this order. + + + + + A summary of the events of interest that have occurred as the request is processed. E.g. when the order was made, various processing steps (specimens received), when it was completed. + + + + + The specific diagnostic investigations that are requested as part of this request. Sometimes, there can only be one item per request, but in most contexts, more than one investigation can be requested. + + + + + + + + + A record of a request for a diagnostic investigation service to be performed. + + + + + + + The status for the event. + + + + + Additional information about the event that occurred - e.g. if the status remained unchanged. + + + + + The date/time at which the event occurred. + + + + + The person who was responsible for performing or recording the action. + + + + + + + + + A record of a request for a diagnostic investigation service to be performed. + + + + + + + A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested. + + + + + If the item is related to a specific specimen. + + + + + Anatomical location where the request test should be performed. This is the target site. + + + + + + + The status of this individual item within the order. + + + + + A summary of the events of interest that have occurred as this item of the request is processed. + + + + + + + + + + + The request has been proposed + + + + + the request is in preliminary form prior to being sent + + + + + The request has been planned + + + + + The request has been placed + + + + + The receiving system has received the order, but not yet decided whether it will be performed + + + + + The receiving system has accepted the order, but work has not yet commenced + + + + + The work to fulfill the order is happening + + + + + The work is complete, and the outcomes are being reviewed for approval + + + + + The work has been complete, the report(s) released, and no further work is planned + + + + + the request has been withdrawn + + + + + The request has been held by originating system/user request + + + + + The receiving system has declined to fulfill the request + + + + + The diagnostic investigation was attempted, but due to some procedural error, it could not be completed + + + + + + + The status of a diagnostic order + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + The order has a normal priority + + + + + The order should be urgently + + + + + The order is time-critical + + + + + The order should be acted on as soon as possible + + + + + + + The clinical priority of a diagnostic order + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + The findings and interpretation of diagnostic tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretation, and formatted representation of diagnostic reports. + + + + + The findings and interpretation of diagnostic tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretation, and formatted representation of diagnostic reports. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + A code or name that describes this diagnostic report. + + + + + The status of the diagnostic report as a whole. + + + + + The date and time that this version of the report was released from the source diagnostic service. + + + + + The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources. + + + + + The diagnostic service that is responsible for issuing the report. + + + + + The link to the health care event (encounter) when the order was made. + + + + + The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider. + + + + + Details concerning a test requested. + + + + + The section of the diagnostic service that performs the examination e.g. biochemistry, hematology, MRI. + + + + + The time or time-period the observed values are related to. When the subject of the report is a patient, this is usually either the time of the procedure or of specimen collection(s), but very often the source of the date/time is not known, only the date/time itself. + + + + + + + Details about the specimens on which this diagnostic report is based. + + + + + Observations that are part of this diagnostic report. Observations can be simple name/value pairs (e.g. "atomic" results), or they can be grouping observations that include references to other members of the group (e.g. "panels"). + + + + + One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images. + + + + + A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest). + + + + + Concise and clinically contextualized narrative interpretation of the diagnostic report. + + + + + Codes for the conclusion. + + + + + Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent. + + + + + + + + + The findings and interpretation of diagnostic tests performed on patients, groups of patients, devices, and locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider information, and some mix of atomic results, images, textual and coded interpretation, and formatted representation of diagnostic reports. + + + + + + + A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features. + + + + + Reference to the image source. + + + + + + + + + + + The existence of the report is registered, but there is nothing yet available + + + + + This is a partial (e.g. initial, interim or preliminary) report: data in the report may be incomplete or unverified + + + + + The report is complete and verified by an authorized person + + + + + The report has been modified subsequent to being Final, and is complete and verified by an authorized person + + + + + The report has been modified subsequent to being Final, and is complete and verified by an authorized person. New content has been added, but existing content hasn't changed + + + + + The report is unavailable because the measurement was not started or not completed (also sometimes called "aborted") + + + + + The report has been withdrawn following previous Final release + + + + + + + The status of the diagnostic report as a whole + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A manifest that defines a set of documents. + + + + + A manifest that defines a set of documents. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts. + + + + + Other identifiers associated with the document manifest, including version independent identifiers. + + + + + Who or what the set of documents is about. The documents can be about a person, (patient or healthcare practitioner), a device (i.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). If the documents cross more than one subject, then more than one subject is allowed here (unusual use case). + + + + + A patient, practitioner, or organization for which this set of documents is intended. + + + + + Specifies the kind of this set of documents (e.g. Patient Summary, Discharge Summary, Prescription, etc.). The type of a set of documents may be the same as one of the documents in it - especially if there is only one - but it may be wider. + + + + + Identifies who is responsible for adding the information to the document. + + + + + When the document manifest was created for submission to the server (not necessarily the same thing as the actual resource last modified time, since it may be modified, replicated etc). + + + + + Identifies the source system, application, or software that produced the document manifest. + + + + + The status of this document manifest. + + + + + Human-readable description of the source document. This is sometimes known as the "title". + + + + + The manifest list. + + + + + Related identifiers or resources associated with the DocumentManifest. + + + + + + + + + A manifest that defines a set of documents. + + + + + + + The list of DocumentReference or Media Resources, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed. + + + + + + + + + + + A manifest that defines a set of documents. + + + + + + + Related identifier to this DocumentManifest. If both id and ref are present they shall refer to the same thing. + + + + + Related Resource to this DocumentManifest. If both id and ref are present they shall refer to the same thing. + + + + + + + + + A reference to a document. + + + + + A reference to a document. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document. + + + + + Other identifiers associated with the document, including version independent identifiers. + + + + + Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (I.e. machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure). + + + + + Specifies the particular kind of document. This usually equates to the purpose of making the document. It is recommended that the value Set be drawn from a coding scheme providing a fine level of granularity such as LOINC. (e.g. Patient Summary, Discharge Summary, Prescription, etc.). + + + + + A categorization for the type of document. The class is an abstraction from the type specifying the high-level kind of document (e.g., Report, Summary, Images, Treatment Plan, Patient Preferences, Workflow) at a macro level. + + + + + An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType. + + + + + Identifies who is responsible for adding the information to the document. + + + + + Identifies the organization or group who is responsible for ongoing maintenance of and access to the document. + + + + + Which person or organization authenticates that this document is valid. + + + + + When the document was created. + + + + + When the document reference was created. + + + + + The status of this document reference. + + + + + The status of the underlying document. + + + + + Relationships that this document has with other document references that already exist. + + + + + Human-readable description of the source document. This is sometimes known as the "title". + + + + + A set of Security-Tag codes specifying the level of privacy/security of the Document. + + + + + The document or url to the document along with critical metadata to prove content has integrity. + + + + + The clinical context in which the document was prepared. + + + + + + + + + A reference to a document. + + + + + + + The type of relationship that this document has with anther document. + + + + + The target document of this relationship. + + + + + + + + + A reference to a document. + + + + + + + This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the typeCode, such as a "History and Physical Report" in which the procedure being documented is necessarily a "History and Physical" act. + + + + + The time period over which the service that is described by the document was provided. + + + + + The kind of facility where the patient was seen. + + + + + This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty. + + + + + The Patient Information as known when the document was published. May be a reference to a version specific, or contained. + + + + + Related identifiers or resources associated with the DocumentReference. + + + + + + + + + A reference to a document. + + + + + + + Related identifier to this DocumentReference. If both id and ref are present they shall refer to the same thing. + + + + + Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing. + + + + + + + + + + + This document logically replaces or supercedes the target document + + + + + This document was generated by transforming the target document (e.g. format or language conversion) + + + + + This document is a signature of the target document + + + + + This document adds additional information to the target document + + + + + + + The type of relationship between documents + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service. + + + + + This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + The Response Business Identifier. + + + + + The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + + + + + The style (standard) and version of the original material which was converted into this resource. + + + + + The date when this resource was created. + + + + + The Insurer who is target of the request. + + + + + The practitioner who is responsible for the services rendered to the patient. + + + + + The organization which is responsible for the services rendered to the patient. + + + + + + + + + This resource provides eligibility and plan details from the processing of an Eligibility resource. + + + + + This resource provides eligibility and plan details from the processing of an Eligibility resource. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + The Response Business Identifier. + + + + + Original request resource reference. + + + + + Transaction status: error, complete. + + + + + A description of the status of the adjudication. + + + + + The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + + + + + The style (standard) and version of the original material which was converted into this resource. + + + + + The date when the enclosed suite of services were performed or completed. + + + + + The Insurer who produced this adjudicated response. + + + + + The practitioner who is responsible for the services rendered to the patient. + + + + + The organization which is responsible for the services rendered to the patient. + + + + + + + + + An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. + + + + + An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Identifier(s) by which this encounter is known. + + + + + planned | arrived | in-progress | onleave | finished | cancelled. + + + + + The current status is always found in the current version of the resource. This status history permits the encounter resource to contain the status history without the needing to read through the historical versions of the resource, or even have the server store them. + + + + + inpatient | outpatient | ambulatory | emergency +. + + + + + Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation). + + + + + The patient present at the encounter. + + + + + Where a specific encounter should be classified as a part of a specific episode of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as govt reporting, or issue tracking. + + + + + The referral request that this encounter is satisfies (incoming referral). + + + + + The main practitioner responsible for providing the service. + + + + + The appointment that scheduled this encounter. + + + + + The start and end time of the encounter. + + + + + Quantity of time the encounter lasted. This excludes the time during leaves of absence. + + + + + Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis. + + + + + Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. +The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure. + + + + + Indicates the urgency of the encounter. + + + + + Details about an admission to a clinic. + + + + + List of locations at which the patient has been. + + + + + An organization that is in charge of maintaining the information of this Encounter (e.g., who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization. + + + + + Another Encounter of which this encounter is a part of (administratively or in time). + + + + + + + + + An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. + + + + + + + planned | arrived | in-progress | onleave | finished | cancelled. + + + + + The time that the episode was in the specified status. + + + + + + + + + An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. + + + + + + + Role of participant in encounter. + + + + + The period of time that the specified participant was present during the encounter. These can overlap or be sub-sets of the overall encounters period. + + + + + Persons involved in the encounter other than the patient. + + + + + + + + + An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. + + + + + + + Pre-admission identifier. + + + + + The location from which the patient came before admission. + + + + + From where patient was admitted (physician referral, transfer). + + + + + Diet preferences reported by the patient. + + + + + Special courtesies (VIP, board member). + + + + + Wheelchair, translator, stretcher, etc. + + + + + Location to which the patient is discharged. + + + + + Category or kind of location after discharge. + + + + + The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete. + + + + + Whether this hospitalization is a readmission. + + + + + + + + + An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or assessing the health status of a patient. + + + + + + + The location where the encounter takes place. + + + + + The status of the participants presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time. + + + + + Time period during which the patient was present at the location. + + + + + + + + + + + An encounter during which the patient is hospitalized and stays overnight + + + + + An encounter during which the patient is not hospitalized overnight + + + + + An encounter where the patient visits the practitioner in his/her office, e.g. a G.P. visit + + + + + An encounter where the patient needs urgent care + + + + + An encounter where the practitioner visits the patient at his/her home + + + + + An encounter taking place outside the regular environment for giving care + + + + + An encounter where the patient needs more prolonged treatment or investigations than outpatients, but who do not need to stay in the hospital overnight + + + + + An encounter that takes place where the patient and practitioner do not physically meet but use electronic means for contact + + + + + Any other encounter type that is not described by one of the other values. Where this is used it is expected that an implementer will include an extension value to define what the actual other type is + + + + + + + Classification of the encounter + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + The patient is planned to be moved to this location at some point in the future + + + + + The patient is currently at this location, or was between the period specified + + + + + This location is held empty for this patient + + + + + + + The status of the location + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + The Encounter has not yet started + + + + + The Patient is present for the encounter, however is not currently meeting with a practitioner + + + + + The Encounter has begun and the patient is present / the practitioner and the patient are meeting + + + + + The Encounter has begun, but the patient is temporarily on leave + + + + + The Encounter has ended + + + + + The Encounter has ended before it has begun + + + + + + + Current state of the encounter + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + This resource provides the insurance Enrollment details to the insurer regarding a specified coverage. + + + + + This resource provides the insurance Enrollment details to the insurer regarding a specified coverage. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + The Response Business Identifier. + + + + + The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + + + + + The style (standard) and version of the original material which was converted into this resource. + + + + + The date when this resource was created. + + + + + The Insurer who is target of the request. + + + + + The practitioner who is responsible for the services rendered to the patient. + + + + + The organization which is responsible for the services rendered to the patient. + + + + + Patient Resource. + + + + + Reference to the program or plan identification, underwriter or payor. + + + + + The relationship of the patient to the subscriber. + + + + + + + + + This resource provides Enrollment and plan details from the processing of an Enrollment resource. + + + + + This resource provides Enrollment and plan details from the processing of an Enrollment resource. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + The Response Business Identifier. + + + + + Original request resource reference. + + + + + Transaction status: error, complete. + + + + + A description of the status of the adjudication. + + + + + The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + + + + + The style (standard) and version of the original material which was converted into this resource. + + + + + The date when the enclosed suite of services were performed or completed. + + + + + The Insurer who produced this adjudicated response. + + + + + The practitioner who is responsible for the services rendered to the patient. + + + + + The organization which is responsible for the services rendered to the patient. + + + + + + + + + An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time. + + + + + An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Identifier(s) by which this EpisodeOfCare is known. + + + + + planned | waitlist | active | onhold | finished | cancelled. + + + + + The status history for the EpisodeOfCare. + + + + + The type can be very important in processing as this could be used in determining if the EpisodeOfCare is relevant to specific government reporting, or other types of classifications. + + + + + The patient that this EpisodeOfCare applies to. + + + + + The organization that has assumed the specific responsibilities for the specified duration. + + + + + The interval during which the managing organization assumes the defined responsibility. + + + + + A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for. + + + + + Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals. + + + + + The practitioner that is the care manager/care co-ordinator for this patient. + + + + + The list of practitioners that may be facilitating this episode of care for specific purposes. + + + + + + + + + An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time. + + + + + + + planned | waitlist | active | onhold | finished | cancelled. + + + + + The period during this EpisodeOfCare that the specific status applied. + + + + + + + + + An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time. + + + + + + + The practitioner (or Organization) within the team. + + + + + The role that this team member is taking within this episode of care. + + + + + The period of time that this practitioner is performing some role within the episode of care. + + + + + + + + + + + This episode of care is planned to start at the date specified in the period.start. During this status an organization may perform assessments to determine if they are eligible to receive services, or be organizing to make resources available to provide care services + + + + + This episode has been placed on a waitlist, pending the episode being made active (or cancelled) + + + + + This episode of care is current + + + + + This episode of care is on hold, the organization has limited responsibility for the patient (such as while on respite) + + + + + This episode of care is finished at the organization is not expecting to be providing care to the patient. Can also be known as "closed", "completed" or other similar terms + + + + + The episode of care was cancelled, or withdrawn from service, often selected during the planned stage as the patient may have gone elsewhere, or the circumstances have changed and the organization is unable to provide the care. It indicates that services terminated outside the planned/expected workflow + + + + + + + The status of the encounter + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. + + + + + This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + The Response Business Identifier. + + + + + Original request resource reference. + + + + + Transaction status: error, complete. + + + + + A description of the status of the adjudication. + + + + + The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + + + + + The style (standard) and version of the original material which was converted into this resource. + + + + + The date when the enclosed suite of services were performed or completed. + + + + + The Insurer who produced this adjudicated response. + + + + + The practitioner who is responsible for the services rendered to the patient. + + + + + The organization which is responsible for the services rendered to the patient. + + + + + + + + + Significant health events and conditions for a person related to the patient relevant in the context of care for the patient. + + + + + Significant health events and conditions for a person related to the patient relevant in the context of care for the patient. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + This records identifiers associated with this family member history record that are defined by business processes and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). + + + + + The person who this history concerns. + + + + + The date (and possibly time) when the family member history was taken. + + + + + This will either be a name or a description. E.g. "Aunt Susan", "my cousin with the red hair". + + + + + The type of relationship this person has to the patient (father, mother, brother etc.). + + + + + Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes. + + + + + The actual or approximate date of birth of the relative. + + + + + + + + The actual or approximate age of the relative at the time the family member history is recorded. + + + + + + + + The actual or approximate age of the relative at the time the family member history is recorded. + + + + + + + + + + This property allows a non condition-specific note to the made about the related person. Ideally, the note would be in the condition property, but this is not always possible. + + + + + The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition. + + + + + + + + + Significant health events and conditions for a person related to the patient relevant in the context of care for the patient. + + + + + + + The actual condition specified. Could be a coded condition (like MI or Diabetes) or a less specific string like 'cancer' depending on how much is known about the condition and the capabilities of the creating system. + + + + + Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation. + + + + + Either the age of onset, range of approximate age or descriptive string can be recorded. For conditions with multiple occurrences, this describes the first known occurrence. + + + + + + + + An area where general notes can be placed about this specific condition. + + + + + + + + + Prospective warnings of potential issues when providing care to the patient. + + + + + Prospective warnings of potential issues when providing care to the patient. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Identifier assigned to the flag for external use (outside the FHIR environment). + + + + + Allows an flag to be divided into different categories like clinical, administrative etc. + + + + + Supports basic workflow. + + + + + The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified. + + + + + The patient record this flag is associated with. + + + + + The person or device that created the flag. + + + + + The coded value or textual component of the flag to display to the user. + + + + + + + + + + + A current flag that should be displayed to a user. A system may use the category to determine which roles should view the flag + + + + + The flag does not need to be displayed any more + + + + + The flag was added in error, and should no longer be displayed + + + + + + + Indicates whether this flag is active and needs to be displayed to a user, or whether it is no longer needed or entered in error + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + Describes the intended objective(s) of patient care, for example, weight loss, restoring an activity of daily living, etc. + + + + + Describes the intended objective(s) of patient care, for example, weight loss, restoring an activity of daily living, etc. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + This records identifiers associated with this care plan that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). + + + + + Identifies the patient/subject whose intended care is described by the plan. + + + + + Indicates when the goal is intended to be reached. + + + + + Human-readable description of a specific desired objective of care. + + + + + Indicates whether the goal has been reached and is still considered relevant. + + + + + Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc. + + + + + Indicates whose goal this is - patient goal, practitioner goal, etc. + + + + + Identifies the level of importance associated with reaching/sustaining the goal. + + + + + The identified conditions and other health record elements that are intended to be addressed by the goal. + + + + + Any comments related to the goal. + + + + + Identifies the change (or lack of change) at the point where the goal was deepmed to be cancelled or achieved. + + + + + + + + + Describes the intended objective(s) of patient care, for example, weight loss, restoring an activity of daily living, etc. + + + + + + + Details of what's changed (or not changed). + + + + + + + + + + + + + A goal is proposed for this patient + + + + + A goal is planned for this patient + + + + + The goal is being sought but has not yet been reached. (Also applies if goal was reached in the past but there has been regression and goal is being sought again) + + + + + The goal has been met and no further action is needed + + + + + The goal has been met, but ongoing activity is needed to sustain the goal objective + + + + + The goal is no longer being sought + + + + + A proposed goal was accepted + + + + + A proposed goal was rejected + + + + + + + Indicates whether the goal has been met and is still being targeted + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively and are not formally or legally recognized. I.e. A collection of entities that isn't an Organization. + + + + + Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively and are not formally or legally recognized. I.e. A collection of entities that isn't an Organization. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + A unique business identifier for this group. + + + + + Identifies the broad classification of the kind of resources the group includes. + + + + + If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals. + + + + + Provides a specific type of resource the group includes. E.g. "cow", "syringe", etc. + + + + + A label assigned to the group for human identification and communication. + + + + + A count of the number of resource instances that are part of the group. + + + + + Identifies the traits shared by members of the group. + + + + + Identifies the resource instances that are members of the group. + + + + + + + + + Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected to act collectively and are not formally or legally recognized. I.e. A collection of entities that isn't an Organization. + + + + + + + A code that identifies the kind of trait being asserted. + + + + + The value of the trait that holds (or does not hold - see 'exclude') for members of the group. + + + + + + + + + If true, indicates the characteristic is one that is NOT held by members of the group. + + + + + + + + + + + Group contains "person" Patient resources + + + + + Group contains "animal" Patient resources + + + + + Group contains healthcare practitioner resources + + + + + Group contains Device resources + + + + + Group contains Medication resources + + + + + Group contains Substance resources + + + + + + + Types of resources that are part of group + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + The details of a Healthcare Service available at a location. + + + + + The details of a Healthcare Service available at a location. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + External Identifiers for this item. + + + + + The organization that provides this Healthcare Service. + + + + + The location where this healthcare service may be provided. + + + + + Identifies the broad category of service being performed or delivered. Selecting a Service Category then determines the list of relevant service types that can be selected in the Primary Service Type. + + + + + A specific type of service that may be delivered or performed. + + + + + Further description of the service as it would be presented to a consumer while searching. + + + + + Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName. + + + + + Extra details about the service that can't be placed in the other fields. + + + + + If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list. + + + + + List of contacts related to this specific healthcare service. If this is empty, then refer to the location's contacts. + + + + + The location(s) that this service is available to (not where the service is provided). + + + + + The code(s) that detail the conditions under which the healthcare service is available/offered. + + + + + Does this service have specific eligibility requirements that need to be met in order to use the service. + + + + + The description of service eligibility should, in general, not exceed one or two paragraphs. It should be sufficient for a prospective consumer to determine if they are likely to be eligible or not. Where eligibility requirements and conditions are complex, it may simply be noted that an eligibility assessment is required. Where eligibility is determined by an outside source, such as an Act of Parliament, this should be noted, preferably with a reference to a commonly available copy of the source document such as a web page. + + + + + Program Names that can be used to categorize the service. + + + + + Collection of Characteristics (attributes). + + + + + Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required. + + + + + The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available. + + + + + Indicates whether or not a prospective consumer will require an appointment for a particular service at a Site to be provided by the Organization. Indicates if an appointment is required for access to this service. + + + + + A Collection of times that the Service Site is available. + + + + + The HealthcareService is not available during this period of time due to the provided reason. + + + + + A description of Site availability exceptions, e.g., public holiday availability. Succinctly describing all possible exceptions to normal Site availability as details in the Available Times and Not Available Times. + + + + + + + + + The details of a Healthcare Service available at a location. + + + + + + + The specific type of service being delivered or performed. + + + + + Collection of Specialties handled by the Service Site. This is more of a Medical Term. + + + + + + + + + The details of a Healthcare Service available at a location. + + + + + + + Indicates which Days of the week are available between the Start and End Times. + + + + + Is this always available? (hence times are irrelevant) e.g. 24 hour service. + + + + + The opening time of day. Note: If the AllDay flag is set, then this time is ignored. + + + + + The closing time of day. Note: If the AllDay flag is set, then this time is ignored. + + + + + + + + + The details of a Healthcare Service available at a location. + + + + + + + The reason that can be presented to the user as to why this time is not available. + + + + + Service is not available (seasonally or for a public holiday) from this date. + + + + + + + + + + + Monday + + + + + Tuesday + + + + + Wednesday + + + + + Thursday + + + + + Friday + + + + + Saturday + + + + + Sunday + + + + + + + The days of the week + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A set of DICOM SOP Instances of a patient, selected for some application purpose, e.g., quality assurance, teaching, conference, consulting, etc. Objects selected can be from different studies, but must be of the same patient. + + + + + A set of DICOM SOP Instances of a patient, selected for some application purpose, e.g., quality assurance, teaching, conference, consulting, etc. Objects selected can be from different studies, but must be of the same patient. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Instance UID of the DICOM KOS SOP Instances represenetd in this resource. + + + + + A patient resource reference which is the patient subject of all DICOM SOP Instances in this key object selection. + + + + + The reason for, or significance of, the selection of objects referenced in the resource. + + + + + Text description of the DICOM SOP instances selected in the key object selection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection. + + + + + Author of key object selection. It can be a human authtor or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attached in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion. + + + + + Date and time when the key object selection was authored. Note that this is the date and time the DICOM SOP instances in the selection were selected (selection decision making). It is different from the creation date and time of the selection resource. + + + + + Study identity and locating information of the DICOM SOP instances in the selection. + + + + + + + + + A set of DICOM SOP Instances of a patient, selected for some application purpose, e.g., quality assurance, teaching, conference, consulting, etc. Objects selected can be from different studies, but must be of the same patient. + + + + + + + Study instance uid of the SOP instances in the selection. + + + + + WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection. + + + + + Series indetity and locating information of the DICOM SOP instances in the selection. + + + + + + + + + A set of DICOM SOP Instances of a patient, selected for some application purpose, e.g., quality assurance, teaching, conference, consulting, etc. Objects selected can be from different studies, but must be of the same patient. + + + + + + + Series instance uid of the SOP instances in the selection. + + + + + WADO-RS URL to retrieve the series Note that this URL retrieves all SOP instances of the series not only those in the selection. + + + + + Identity and locating information of the selected DICOM SOP instances. + + + + + + + + + A set of DICOM SOP Instances of a patient, selected for some application purpose, e.g., quality assurance, teaching, conference, consulting, etc. Objects selected can be from different studies, but must be of the same patient. + + + + + + + SOP class uid of the selected instance. + + + + + SOP Instance uid of the selected instance. + + + + + WADO-RS URL to retrieve the DICOM SOP Instance. + + + + + Identity and location information of the frames in the selected instance. + + + + + + + + + A set of DICOM SOP Instances of a patient, selected for some application purpose, e.g., quality assurance, teaching, conference, consulting, etc. Objects selected can be from different studies, but must be of the same patient. + + + + + + + The frame numbers in the frame set. + + + + + WADO-RS URL to retrieve the DICOM frames. + + + + + + + + + Representation of the content produced in a DICOM imaging study. A study comprises a set of Series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A Series is of only one modality (e.g., X-ray, CT, MR, ultrasound), but a Study may have multiple Series of different modalities. + + + + + Representation of the content produced in a DICOM imaging study. A study comprises a set of Series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A Series is of only one modality (e.g., X-ray, CT, MR, ultrasound), but a Study may have multiple Series of different modalities. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Date and Time the study started. Timezone Offset From UTC. + + + + + The patient imaged in the study. + + + + + Formal identifier for the study. + + + + + Accession Number. + + + + + Other identifiers for the study. + + + + + A list of the diagnostic orders that resulted in this imaging study being performed. + + + + + A list of all the Series.ImageModality values that are actual acquisition modalities, i.e. those in the DICOM Context Group 29 (value set OID 1.2.840.10008.6.1.19). + + + + + The requesting/referring physician. + + + + + Availability of study (online, offline or nearline). + + + + + WADO-RS resource where Study is available. + + + + + Number of Series in Study. + + + + + Number of SOP Instances in Study. + + + + + Diagnoses etc provided with request. + + + + + Type of procedure performed. + + + + + Who read study and interpreted the images. + + + + + Institution-generated description or classification of the Study performed. + + + + + Each study has one or more series of image instances. + + + + + + + + + Representation of the content produced in a DICOM imaging study. A study comprises a set of Series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A Series is of only one modality (e.g., X-ray, CT, MR, ultrasound), but a Study may have multiple Series of different modalities. + + + + + + + The Numeric identifier of this series in the study. + + + + + The modality of this series sequence. + + + + + Formal identifier for this series. + + + + + A description of the series. + + + + + Number of SOP Instances in Series. + + + + + Availability of series (online, offline or nearline). + + + + + WADO-RS resource where the Series is available. + + + + + Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed. + + + + + Laterality if bodySite is paired anatomic structure and laterality is not pre-coordinated in bodySite code, map from (0020, 0060). + + + + + The date and time when the series was started. + + + + + A single SOP Instance within the series, e.g., an image, or presentation state. + + + + + + + + + Representation of the content produced in a DICOM imaging study. A study comprises a set of Series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A Series is of only one modality (e.g., X-ray, CT, MR, ultrasound), but a Study may have multiple Series of different modalities. + + + + + + + The number of this image in the series. + + + + + Formal identifier for this image. + + + + + DICOM Image type. + + + + + A human-friendly SOP Class name. + + + + + The description of the instance. + + + + + Content of the instance or a rendering thereof (e.g., a JPEG of an image, or an XML of a structured report). May be represented by inline encoding, or by a URL reference to a WADO-RS service that makes the instance available. Multiple content attachments may be used for alternate representations of the instance. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Type of acquired image data in the instance + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Availability of the resource + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Type of data in the instance + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + Immunization event information. + + + + + Immunization event information. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + A unique identifier assigned to this immunization record. + + + + + Date vaccine administered or was to be administered. + + + + + Vaccine that was administered or was to be administered. + + + + + The patient who either received or did not receive the immunization. + + + + + Indicates if the vaccination was or was not given. + + + + + True if this administration was reported rather than directly administered. + + + + + Clinician who administered the vaccine. + + + + + Clinician who ordered the vaccination. + + + + + The visit or admission or other contact between patient and health care provider the immunization was performed as part of. + + + + + Name of vaccine manufacturer. + + + + + The service delivery location where the vaccine administration occurred. + + + + + Lot number of the vaccine product. + + + + + Date vaccine batch expires. + + + + + Body site where vaccine was administered. + + + + + The path by which the vaccine product is taken into the body. + + + + + The quantity of vaccine product that was administered. + + + + + Reasons why a vaccine was or was not administered. + + + + + Categorical data indicating that an adverse event is associated in time to an immunization. + + + + + Contains information about the protocol(s) under which the vaccine was administered. + + + + + + + + + Immunization event information. + + + + + + + Reasons why a vaccine was administered. + + + + + Reason why a vaccine was not administered. + + + + + + + + + Immunization event information. + + + + + + + Date of reaction to the immunization. + + + + + Details of the reaction. + + + + + Self-reported indicator. + + + + + + + + + Immunization event information. + + + + + + + Nominal position in a series. + + + + + Contains the description about the protocol under which the vaccine was administered. + + + + + Indicates the authority who published the protocol? E.g. ACIP. + + + + + One possible path to achieve presumed immunity against a disease - within the context of an authority. + + + + + The recommended number of doses to achieve immunity. + + + + + The targeted disease. + + + + + Indicates if the immunization event should "count" against the protocol. + + + + + Provides an explanation as to why a immunization event should or should not count against the protocol. + + + + + + + + + A patient's point-of-time immunization status and recommendation with optional supporting justification. + + + + + A patient's point-of-time immunization status and recommendation with optional supporting justification. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + A unique identifier assigned to this particular recommendation record. + + + + + The patient for whom the recommendations are for. + + + + + Vaccine administration recommendations. + + + + + + + + + A patient's point-of-time immunization status and recommendation with optional supporting justification. + + + + + + + The date the immunization recommendation was created. + + + + + Vaccine that pertains to the recommendation. + + + + + This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose). + + + + + Vaccine administration status. + + + + + Vaccine date recommendations - e.g. earliest date to administer, latest date to administer, etc. + + + + + Contains information about the protocol under which the vaccine was administered. + + + + + Immunization event history that supports the status and recommendation. + + + + + Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information. + + + + + + + + + A patient's point-of-time immunization status and recommendation with optional supporting justification. + + + + + + + Date classification of recommendation - e.g. earliest date to give, latest date to give, etc. + + + + + Date recommendation. + + + + + + + + + A patient's point-of-time immunization status and recommendation with optional supporting justification. + + + + + + + Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol. + + + + + Contains the description about the protocol under which the vaccine was administered. + + + + + Indicates the authority who published the protocol? E.g. ACIP. + + + + + One possible path to achieve presumed immunity against a disease - within the context of an authority. + + + + + + + + + A set of information summarized from a list of other resources. + + + + + A set of information summarized from a list of other resources. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Identifier for the List assigned for business purposes outside the context of FHIR. + + + + + A label for the list assigned by the author. + + + + + This code defines the purpose of the list - why it was created. + + + + + The common subject (or patient) of the resources that are in the list, if there is one. + + + + + The entity responsible for deciding what the contents of the list were. + + + + + Indicates the current state of this list. + + + + + The date that the list was prepared. + + + + + What order applies to the items in the list. + + + + + How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list where items may be marked as added, modified or deleted. + + + + + Comments that apply to the overall list. + + + + + Entries in this list. + + + + + If the list is empty, why the list is empty. + + + + + + + + + A set of information summarized from a list of other resources. + + + + + + + The flag allows the system constructing the list to make one or more statements about the role and significance of the item in the list. + + + + + True if this item is marked as deleted in the list. + + + + + When this item was added to the list. + + + + + A reference to the actual resource from which data was derived. + + + + + + + + + + + The list is considered to be an active part of the patient's record. + + + + + The list is "old" and should no longer be considered accurate or relevant. + + + + + The list was never accurate. It is retained for medico-legal purposes only. + + + + + + + The current state of the list + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + This list is the master list, maintained in an ongoing fashion with regular updates as the real world list it is tracking changes + + + + + This list was prepared as a snapshot. It should not be assumed to be current + + + + + The list is prepared as a statement of changes that have been made or recommended + + + + + + + The processing mode that applies to this list + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained or accommodated. + + + + + Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained or accommodated. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Unique code or number identifying the location to its users. + + + + + Name of the location as used by humans. Does not need to be unique. + + + + + Description of the Location, which helps in finding or referencing the place. + + + + + Indicates whether a resource instance represents a specific location or a class of locations. + + + + + Indicates the type of function performed at the location. + + + + + The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites. + + + + + Physical location. + + + + + Physical form of the location, e.g. building, room, vehicle, road. + + + + + The absolute geographic location of the Location, expressed in with the WGS84 datum (This is the same co-ordinate system used in KML). + + + + + The organization that is responsible for the provisioning and upkeep of the location. + + + + + Another Location which this Location is physically part of. + + + + + active | suspended | inactive. + + + + + + + + + Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained or accommodated. + + + + + + + Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below). + + + + + Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below). + + + + + Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below). + + + + + + + + + + + The Location resource represents a specific instance of a Location (e.g. Operating Theatre 1A) + + + + + The Location represents a class of Locations (e.g. Any Operating Theatre). Although this class of locations could be constrained within a specific boundary (such as organization, or parent location, address etc) + + + + + + + Indicates whether a resource instance represents a specific location or a class of locations + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + The location is operational + + + + + The location is temporarily closed + + + + + The location is no longer used + + + + + + + Indicates whether the location is still in use + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference. + + + + + A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Whether the media is a photo (still image), an audio recording, or a video recording. + + + + + Details of the type of the media - usually, how it was acquired (what type of device). If images sourced from a DICOM system, are wrapped in a Media resource, then this is the modality. + + + + + Identifiers associated with the image - these may include identifiers for the image itself, identifiers for the context of its collection (e.g. series ids) and context ids such as accession numbers or other workflow identifiers. + + + + + Who/What this Media is a record of. + + + + + The person who administered the collection of the image. + + + + + The name of the imaging view e.g Lateral or Antero-posterior (AP). + + + + + The name of the device / manufacturer of the device that was used to make the recording. + + + + + Height of the image in pixels(photo/video). + + + + + Width of the image in pixels (photo/video). + + + + + The number of frames in a photo. This is used with a multi-page fax, or an imaging acquisition context that takes multiple slices in a single image, or an animated gif. If there is more than one frame, this SHALL have a value in order to alert interface software that a multi-frame capable rendering widget is required. + + + + + The duration of the recording in seconds - for audio and video. + + + + + The actual content of the media - inline or by direct reference to the media source file. + + + + + + + + + + + The media consists of one or more unmoving images, including photographs, computer-generated graphs and charts, and scanned documents + + + + + The media consists of a series of frames that capture a moving image + + + + + The media consists of a sound recording + + + + + + + Whether the Media is a photo, video, or audio + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + Primarily used for identification and definition of Medication, but also covers ingredients and packaging. + + + + + Primarily used for identification and definition of Medication, but also covers ingredients and packaging. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + The common/commercial name of the medication absent information such as strength, form, etc. E.g. Acetaminophen, Tylenol 3, etc. The fully coordinated name is communicated as the display of Medication.code. + + + + + A code (or set of codes) that identify this medication. Usage note: This could be a standard drug code such as a drug regulator code, RxNorm code, SNOMED CT code, etc. It could also be a local formulary code, optionally with translations to the standard drug codes. + + + + + Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is). + + + + + Describes the details of the manufacturer. + + + + + Medications are either a single administrable product or a package that contains one or more products. + + + + + Information that only applies to products (not packages). + + + + + Information that only applies to packages (not products). + + + + + + + + + Primarily used for identification and definition of Medication, but also covers ingredients and packaging. + + + + + + + Describes the form of the item. Powder; tables; carton. + + + + + Identifies a particular constituent of interest in the product. + + + + + Information about a group of medication produced or packaged from one production run. + + + + + + + + + Primarily used for identification and definition of Medication, but also covers ingredients and packaging. + + + + + + + The actual ingredient - either a substance (simple ingredient) or another medication. + + + + + Specifies how many (or how much) of the items there are in this Medication. E.g. 250 mg per tablet. + + + + + + + + + Primarily used for identification and definition of Medication, but also covers ingredients and packaging. + + + + + + + The assigned lot number of a batch of the specified product. + + + + + When this specific batch of product will expire. + + + + + + + + + Primarily used for identification and definition of Medication, but also covers ingredients and packaging. + + + + + + + The kind of container that this package comes as. + + + + + A set of components that go to make up the described item. + + + + + + + + + Primarily used for identification and definition of Medication, but also covers ingredients and packaging. + + + + + + + Identifies one of the items in the package. + + + + + The amount of the product that is in the package. + + + + + + + + + + + The medication is a product + + + + + The medication is a package - a contained group of one of more products + + + + + + + Whether the medication is a product or a package + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + Describes the event of a patient consuming or otherwise being administered a medication. This may be as simple as swallowing a tablet or it may be a long running infusion. Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner. + + + + + Describes the event of a patient consuming or otherwise being administered a medication. This may be as simple as swallowing a tablet or it may be a long running infusion. Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated. + + + + + Will generally be set to show that the administration has been completed. For some long running administrations such as infusions it is possible for an administration to be started but not completed or it may be paused while some other process is under way. + + + + + The person or animal to whom the medication was given. + + + + + The individual who was responsible for giving the medication to the patient. + + + + + The visit or admission the or other contact between patient and health care provider the medication administration was performed as part of. + + + + + The original request, instruction or authority to perform the administration. + + + + + Set this to true if the record is saying that the medication was NOT administered. + + + + + A code indicating why the administration was not performed. + + + + + A code indicating why the medication was given. + + + + + An interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate. + + + + + + + Identifies the medication that was administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. + + + + + + + The device used in administering the medication to the patient. E.g. a particular infusion pump. + + + + + Extra information about the medication administration that is not conveyed by the other attributes. + + + + + Indicates how the medication is/was used by the patient. + + + + + + + + + Describes the event of a patient consuming or otherwise being administered a medication. This may be as simple as swallowing a tablet or it may be a long running infusion. Related resources tie this event to the authorizing prescription, and the specific encounter between patient and health care practitioner. + + + + + + + Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. + + + + + A coded specification of the anatomic site where the medication first entered the body. E.g. "left arm". + + + + + A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. E.g. topical, intravenous, etc. + + + + + A coded value indicating the method by which the medication was introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. Terminologies used often pre-coordinate this term with the route and or form of administration. + + + + + The amount of the medication given at one administration event. Use this value when the administration is essentially an instantaneous event such as a swallowing a tablet or giving an injection. + + + + + Identifies the speed with which the medication was introduced into the patient. Typically the rate for an infusion e.g. 200ml in 2 hours. May also expressed as a rate per unit of time such as 100ml per hour - the duration is then not specified, or is specified in the quantity. + + + + + + + + + + + The administration has started but has not yet completed. + + + + + Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called "suspended". + + + + + All actions that are implied by the administration have occurred. + + + + + The administration was entered in error and therefore nullified. + + + + + Actions implied by the administration have been permanently halted, before all of them occurred. + + + + + + + A set of codes indicating the current status of a MedicationAdministration + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + Dispensing a medication to a named patient. This includes a description of the supply provided and the instructions for administering the medication. + + + + + Dispensing a medication to a named patient. This includes a description of the supply provided and the instructions for administering the medication. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR. + + + + + A code specifying the state of the set of dispense events. + + + + + A link to a resource representing the person to whom the medication will be given. + + + + + The individual responsible for dispensing the medication. + + + + + Indicates the medication order that is being dispensed against. + + + + + Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc. + + + + + The amount of medication that has been dispensed. Includes unit of measure. + + + + + The amount of medication expressed as a timing amount. + + + + + Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. + + + + + + + The time when the dispensed product was packaged and reviewed. + + + + + The time the dispensed product was provided to the patient or their representative. + + + + + Identification of the facility/location where the medication was shipped to, as part of the dispense event. + + + + + Identifies the person who picked up the medication. This will usually be a patient or their carer, but some cases exist where it can be a healthcare professional. + + + + + Extra information about the dispense that could not be conveyed in the other attributes. + + + + + Indicates how the medication is to be used by the patient. + + + + + Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but doesn't happen, in other cases substitution is not expected but does happen. This block explains what substitition did or did not happen and why. + + + + + + + + + Dispensing a medication to a named patient. This includes a description of the supply provided and the instructions for administering the medication. + + + + + + + Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. + + + + + Additional instructions such as "Swallow with plenty of water" which may or may not be coded. + + + + + The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". + + + + + + + + If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication. + + + + + + + A coded specification of the anatomic site where the medication first enters the body. + + + + + A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject. + + + + + A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. Terminologies used often pre-coordinate this term with the route and or form of administration. + + + + + The amount of therapeutic or other substance given at one administration event. + + + + + + + Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours. + + + + + The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time, e.g. 1000mg in 24 hours. + + + + + + + + + Dispensing a medication to a named patient. This includes a description of the supply provided and the instructions for administering the medication. + + + + + + + A code signifying whether a different drug was dispensed from what was prescribed. + + + + + Indicates the reason for the substitution of (or lack of substitution) from what was prescribed. + + + + + The person or organization that has primary responsibility for the substitution. + + + + + + + + + + + The dispense has started but has not yet completed. + + + + + Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called "suspended" + + + + + All actions that are implied by the dispense have occurred. + + + + + The dispense was entered in error and therefore nullified. + + + + + Actions implied by the dispense have been permanently halted, before all of them occurred. + + + + + + + A code specifying the state of the dispense event. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + An order for both supply of the medication and the instructions for administration of the medicine to a patient. + + + + + An order for both supply of the medication and the instructions for administration of the medicine to a patient. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + External identifier - one that would be used by another non-FHIR system - for example a re-imbursement system might issue its own id for each prescription that is created. This is particularly important where FHIR only provides part of an erntire workflow process where records have to be tracked through an entire system. + + + + + The date (and perhaps time) when the prescription was written. + + + + + A code specifying the state of the order. Generally this will be active or completed state. + + + + + A link to a resource representing the person to whom the medication will be given. + + + + + The healthcare professional responsible for authorizing the prescription. + + + + + A link to a resource that identifies the particular occurrence of contact between patient and health care provider. + + + + + Can be the reason or the indication for writing the prescription. + + + + + + + Extra information about the prescription that could not be conveyed by the other attributes. + + + + + Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications. + + + + + + + Indicates how the medication is to be used by the patient. + + + + + Deals with details of the dispense part of the order. + + + + + Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. If nothing is specified substitution may be done. + + + + + + + + + An order for both supply of the medication and the instructions for administration of the medicine to a patient. + + + + + + + Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. + + + + + Additional instructions such as "Swallow with plenty of water" which may or may not be coded. + + + + + The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". + + + + + + + + If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the pre-condition for taking the Medication. + + + + + + + A coded specification of the anatomic site where the medication first enters the body. + + + + + A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient. + + + + + A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. Terminologies used often pre-coordinate this term with the route and or form of administration. + + + + + The amount of therapeutic or other substance given at one administration event. + + + + + + + Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours. + + + + + The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours. + + + + + + + + + An order for both supply of the medication and the instructions for administration of the medicine to a patient. + + + + + + + Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications. + + + + + + + Design Comments: This indicates the validity period of a prescription (stale dating the Prescription) It reflects the prescriber perspective for the validity of the prescription. Dispenses must not be made against the prescription outside of this period. The lower-bound of the Dispensing Window signifies the earliest date that the prescription can be filled for the first time. If an upper-bound is not specified then the Prescription is open-ended or will default to a stale-date based on regulations. Rationale: Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription. + + + + + An integer indicating the number of repeats of the Dispense. UsageNotes: For example, the number of times the prescribed quantity is to be supplied including the initial standard fill. + + + + + The amount that is to be dispensed for one fill. + + + + + Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last. In some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued, e.g. 90 days supply of medication (based on an ordered dosage) When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors. + + + + + + + + + An order for both supply of the medication and the instructions for administration of the medicine to a patient. + + + + + + + A code signifying whether a different drug should be dispensed from what was prescribed. + + + + + Indicates the reason for the substitution, or why substitution must or must not be performed. + + + + + + + + + + + The prescription is 'actionable', but not all actions that are implied by it have occurred yet. + + + + + Actions implied by the prescription have been temporarily halted, but are expected to continue later. May also be called "suspended". + + + + + All actions that are implied by the prescription have occurred (this will rarely be made explicit). + + + + + The prescription was entered in error and therefore nullified. + + + + + Actions implied by the prescription have been permanently halted, before all of them occurred. + + + + + The prescription was replaced by a newer one, which encompasses all the information in the previous one. + + + + + The prescription is not yet 'actionable', i.e. it is a work in progress, required sign-off, need to be run through decision support. + + + + + + + A code specifying the state of the prescribing event. Describes the lifecycle of the prescription. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A record of medication being taken by a patient, or that the medication has been given to a patient where the record is the result of a report from the patient or another clinician. + + + + + A record of medication being taken by a patient, or that the medication has been given to a patient where the record is the result of a report from the patient or another clinician. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + External identifier - FHIR will generate its own internal IDs (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated. + + + + + The person or animal who is /was taking the medication. + + + + + The person who provided the information about the taking of this medication. + + + + + The date when the medication statement was asserted by the information source. + + + + + A code specifying the state of the statement. Generally this will be in-progress or completed state. + + + + + Set this to true if the record is saying that the medication was NOT taken. + + + + + A code indicating why the medication was not taken. + + + + + A reason for why the medication is being/was taken. + + + + + + + The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the 'wasNotGiven' attribute is true). + + + + + + + Provides extra information about the medication statement that is not conveyed by the other attributes. + + + + + Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications. + + + + + + + Indicates how the medication is/was used by the patient. + + + + + + + + + A record of medication being taken by a patient, or that the medication has been given to a patient where the record is the result of a report from the patient or another clinician. + + + + + + + Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. + + + + + The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". + + + + + If set to true or if specified as a CodeableConcept, indicates that the medication is only taken when needed within the specified schedule rather than at every scheduled dose. If a CodeableConcept is present, it indicates the precondition for taking the Medication. + + + + + + + A coded specification of the anatomic site where the medication first enters the body. + + + + + A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject. + + + + + A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. Examples: Slow Push; Deep IV. Terminologies used often pre-coordinate this term with the route and or form of administration. + + + + + The amount of therapeutic or other substance given at one administration event. + + + + + Identifies the speed with which the substance is introduced into the subject. Typically the rate for an infusion. 200ml in 2 hours. + + + + + The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. E.g. 1000mg in 24 hours. + + + + + + + + + + + The medication is still being taken. + + + + + All actions that are implied by the statement have occurred. + + + + + The statement was entered in error and therefore nullified. + + + + + + + A set of codes indicating the current status of a MedicationStatement + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + The header for a message exchange that is either requesting or responding to an action. The Reference(s) that are the subject of the action as well as other Information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. + + + + + The header for a message exchange that is either requesting or responding to an action. The Reference(s) that are the subject of the action as well as other Information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + The identifier of this message. + + + + + The time that the message was sent. + + + + + Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value "http://hl7.org/fhir/message-type". + + + + + Information about the message that this message is a response to. Only present if this message is a response. + + + + + The source application from which this message originated. + + + + + The destination application which the message is intended for. + + + + + The person or device that performed the data entry leading to this message. Where there is more than one candidate, pick the most proximal to the message. Can provide other enterers in extensions. + + + + + The logical author of the message - the person or device that decided the described event should happen. Where there is more than one candidate, pick the most proximal to the MessageHeader. Can provide other authors in extensions. + + + + + Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient. + + + + + The person or organization that accepts overall responsibility for the contents of the message. The implication is that the message event happened under the policies of the responsible party. + + + + + Coded indication of the cause for the event - indicates a reason for the occurance of the event that is a focus of this message. + + + + + The actual data of the message - a reference to the root/focus class of the event. + + + + + + + + + The header for a message exchange that is either requesting or responding to an action. The Reference(s) that are the subject of the action as well as other Information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. + + + + + + + The id of the message that this message is a response to. + + + + + Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not. + + + + + Full details of any issues found in the message. + + + + + + + + + The header for a message exchange that is either requesting or responding to an action. The Reference(s) that are the subject of the action as well as other Information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. + + + + + + + Human-readable name for the source system. + + + + + May include configuration or other information useful in debugging. + + + + + Can convey versions of multiple systems in situations where a message passes through multiple hands. + + + + + An e-mail, phone, website or other contact point to use to resolve issues with message communications. + + + + + Identifies the routing target to send acknowledgements to. + + + + + + + + + The header for a message exchange that is either requesting or responding to an action. The Reference(s) that are the subject of the action as well as other Information related to the action are typically transmitted in a bundle in which the MessageHeader resource instance is the first resource in the bundle. + + + + + + + Human-readable name for the target system. + + + + + Identifies the target end system in situations where the initial message transmission is to an intermediary system. + + + + + Indicates where the message should be routed to. + + + + + + + + + + + The message was accepted and processed without error + + + + + Some internal unexpected error occurred - wait and try again. Note - this is usually used for things like database unavailable, which may be expected to resolve, though human intervention may be required + + + + + The message was rejected because of some content in it. There is no point in re-sending without change. The response narrative SHALL describe what the issue is. + + + + + + + The kind of response to a message + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a "System" used within the Identifier and Coding data types. + + + + + A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a "System" used within the Identifier and Coding data types. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Indicates the purpose for the namingsystem - what kinds of things does it make unique? + + + + + The descriptive name of this particular identifier type or code system. + + + + + The date (and optionally time) when the system was registered or published. + + + + + Indicates whether the namingsystem is "ready for use" or not. + + + + + If present, indicates that the identifier or code system is principally intended for use or applies to entities within the specified country. For example, the country associated with a national code system. + + + + + Categorizes a namingsystem for easier search by grouping related namingsystems. + + + + + The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision. + + + + + Details about what the namespace identifies including scope, granularity, version labeling, etc. + + + + + Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc. + + + + + Indicates how the system may be identified when referenced in electronic exchange. + + + + + The name of the individual or organization that published the naming system. + + + + + Contacts to assist a user in finding and communicating with the publisher. + + + + + For namingsystems that are retired, indicates the namingsystem that should be used in their place (if any). + + + + + + + + + A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a "System" used within the Identifier and Coding data types. + + + + + + + Identifies the unique identifier scheme used for this particular identifier. + + + + + The string that should be sent over the wire to identify the code system or identifier system. + + + + + Indicates whether this identifier is the "preferred" identifier of this type. + + + + + Identifies the period of time over which this identifier is considered appropriate to refer to the namingsystem. Outside of this window, the identifier might be non-deterministic. + + + + + + + + + A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a "System" used within the Identifier and Coding data types. + + + + + + + The name of an individual to contact regarding the naming system. + + + + + Contact details for individual (if a name was provided) or the publisher. + + + + + + + + + + + An ISO object identifier. E.g. 1.2.3.4.5 + + + + + A universally unique identifier of the form a5afddf4-e880-459b-876e-e4591b0acc11 + + + + + A uniform resource identifier (ideally a URL - uniform resource locator). E.g. http://unitsofmeasure.org + + + + + Some other type of unique identifier. E.g HL7-assigned reserved string such as LN for LOINC + + + + + + + Identifies the style of unique identifier used to identify a namepace + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + The namingsystem is used to define concepts and symbols to represent those concepts. E.g. UCUM, LOINC, NDC code, local lab codes, etc. + + + + + The namingsystem is used to manage identifiers (e.g. license numbers, order numbers, etc.) + + + + + The namingsystem is used as the root for other identifiers and namingsystems + + + + + + + Identifies the purpose of the namingsystem + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. + + + + + A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding. + + + + + The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings. + + + + + Identifiers assigned to this order by the order sender or by the order receiver. + + + + + An encounter that provides additional information about the healthcare context in which this request is made. + + + + + The date and time that this nutrition order was requested. + + + + + The workflow status of the nutrition order/request. + + + + + A link to a record of allergies or Intolerances which should be included in the nutrition order. + + + + + This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings. + + + + + This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings. + + + + + Diet given orally in contrast to enteral (tube) feeding. + + + + + Oral nutritional products given in order to add further nutritional value to the patient's diet. + + + + + Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity. + + + + + + + + + A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. + + + + + + + The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet. + + + + + The time period and frequency at which the diet should be given. + + + + + Class that defines the quantity and type of nutrient modifications required for the oral diet. + + + + + Class that describes any texture modifications required for the patient to safely consume various types of solid foods. + + + + + The required consistency (e.g., honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient. + + + + + Free text or additional instructions or information pertaining to the oral diet. + + + + + + + + + A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. + + + + + + + The nutrient that is being modified such as carbohydrate or sodium. + + + + + The quantity of the specified nutrient to include in diet. + + + + + + + + + A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. + + + + + + + Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed. + + + + + The food type(s) (e.g., meats, all foods) that the texture modification applies to. This could be all foods types. + + + + + + + + + A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. + + + + + + + The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement. + + + + + The product or brand name of the nutritional supplement such as "Acme Protein Shake". + + + + + The time period and frequency at which the supplement(s) should be given. + + + + + The amount of the nutritional supplement to be given. + + + + + Free text or additional instructions or information pertaining to the oral supplement. + + + + + + + + + A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. + + + + + + + The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula. + + + + + The product or brand name of the enteral or infant formula product such as "ACME Adult Standard Formula". + + + + + Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula. + + + + + The product or brand name of the type of modular component to be added to the formula. + + + + + The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula the provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL. + + + + + The route or physiological path of administration into the patient 's gastrointestinal tract for purposes of providing the formula feeding, e.g., nasogastric tube. + + + + + Formula administration instructions as structured data. This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding. An example of this would be an instruction to increase the rate of continuous feeding every 2 hours. + + + + + The maximum total quantity of formula that may be administered to a subject over the period of time, e.g., 1440 mL over 24 hours. + + + + + Free text formula administration, feeding instructions or additional instructions or information. + + + + + + + + + A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. + + + + + + + The time period and frequency at which the enteral formula should be delivered to the patient. + + + + + The volume of formula to provide to the patient per the specified administration schedule. + + + + + The rate of administration of formula via a feeding pump, e.g., 60 mL per hour, according to the specified schedule. + + + + + + + + + + + + + The request has been proposed + + + + + The request is in preliminary form prior to being sent + + + + + The request has been planned + + + + + The request has been placed + + + + + The request is 'actionable', but not all actions that are implied by it have occurred yet. + + + + + Actions implied by the request have been temporarily halted, but are expected to continue later. May also be called "suspended". + + + + + All actions that are implied by the order have occurred and no continuation is planned (this will rarely be made explicit). + + + + + The request has been withdrawn and is no longer actionable. + + + + + + + Codes specifying the state of the request. Describes the lifecycle of the nutrition order. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + Measurements and simple assertions made about a patient, device or other subject. + + + + + Measurements and simple assertions made about a patient, device or other subject. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Describes what was observed. Sometimes this is called the observation "name". + + + + + Describes the general type of observation being made and is used to group or limit searching of observations. + + + + + The information determined as a result of making the observation, if the information has a simple value. + + + + + + + + + + + + + + + Provides a reason why the expected value in the element Observation.value[x] is missing. + + + + + The assessment made based on the result of the observation. + + + + + May include statements about significant, unexpected or unreliable values, or information about the source of the value where this may be relevant to the interpretation of the result. + + + + + The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself. + + + + + + + The date and time this observation was made available. + + + + + The status of the result value. + + + + + An estimate of the degree to which quality issues have impacted on the value reported. + + + + + Indicates the site on the subject's body where the observation was made ( i.e. the target site). + + + + + + + Indicates the mechanism used to perform the observation. + + + + + A unique identifier for the simple observation. + + + + + The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed. Comments: Indirect characteristics may be those of a specimen, fetus, donor, +other observer (for example a relative or EMT), or any observation made about the subject. + + + + + The specimen that was used when this observation was made. + + + + + Who was responsible for asserting the observed value as "true". + + + + + The device used to generate the observation data. + + + + + The healthcare event ( e.g. a patient and healthcare provider interaction ) during which this observation is made. + + + + + Guidance on how to interpret the value by comparison to a normal or recommended range. + + + + + A reference to a resource from which this observation value is derived. For example an Observation resource for a calculated anion gap or Apgar score Observation or a QuestionnaireAnswer resource for an Assessment Tool Observation.( 5/18/2015 EH: TODO need to get a specific example /use cases for example using something other than Observtion). + + + + + A reference to another observations whose relationship is defined by the relationship type code. + + + + + Some observations have multiple component observations. These component observations are expressed as separate code value pairs that share the same attributes. Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for for genetics observations. + + + + + + + + + Measurements and simple assertions made about a patient, device or other subject. + + + + + + + The value of the low bound of the reference range. If this element is omitted, the low bound of the reference range is assumed to be meaningless. (e.g. reference range is <2.3) If the low.comparator element is missing, it is assumed to be '>'. + + + + + The value of the high bound of the reference range. If this element is omitted, the high bound of the reference range is assumed to be meaningless. (e.g. reference range is > 5) If the low.comparator element is missing , it is assumed to be '<'. + + + + + Code for the meaning of the reference range. + + + + + The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so. + + + + + Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'. + + + + + + + + + Measurements and simple assertions made about a patient, device or other subject. + + + + + + + A code specifying the kind of relationship that exists with the target observation. + + + + + A reference to the observation that is related to this observation. + + + + + + + + + Measurements and simple assertions made about a patient, device or other subject. + + + + + + + Describes what was observed. Sometimes this is called the observation "code". + + + + + The information determined as a result of making the observation, if the information has a simple value. + + + + + + + + + + + + + + + Provides a reason why the expected value in the element Observation.value[x] is missing. + + + + + Guidance on how to interpret the value by comparison to a normal or recommended range. + + + + + + + + + + + The result has no reliability concerns + + + + + An early estimate of value; measurement is still occurring + + + + + An early estimate of value; processing is still occurring + + + + + The observation value should be treated with care + + + + + The result has been generated while calibration is occurring + + + + + The observation could not be completed because of an error + + + + + No observation reliability value was available + + + + + + + Codes that provide an estimate of the degree to which quality issues have impacted on the value of an observation + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group + + + + + This observation follows the target observation (e.g. timed tests such as Glucose Tolerance Test) + + + + + This observation replaces a previous observation (i.e. a revised value). The target observation is now obsolete + + + + + The value of the target observation qualifies (refines) the semantics of the source observation (e.g. a lipaemia measure target from a plasma measure) + + + + + The value of the target observation interferes (degardes quality, or prevents valid observation) with the semantics of the source observation (e.g. a hemolysis measure target from a plasma potassium measure which has no value) + + + + + + + Codes specifying how two observations are related + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + The existence of the observation is registered, but there is no result yet available + + + + + This is an initial or interim observation: data may be incomplete or unverified + + + + + The observation is complete and verified by an authorized person + + + + + The observation has been modified subsequent to being Final, and is complete and verified by an authorized person + + + + + The observation is unavailable because the measurement was not started or not completed (also sometimes called "aborted") + + + + + The observation has been withdrawn following previous Final release + + + + + The observation status is unknown. Note that "unknown" is a value of last resort and every attempt should be made to provide a meaningful value other than "unknown" + + + + + + + Codes providing the status of an observation + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). + + + + + A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + An absolute url that is used to identify this operation definition when it is referenced in a specification, model, design or an instance (should be globally unique uri). + + + + + The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + + + + + A free text natural language name identifying the Profile. + + + + + The name of the individual or organization that published the operation definition. + + + + + Contacts to assist a user in finding and communicating with the publisher. + + + + + A free text natural language description of the profile and its use. + + + + + Explains why this operation definition is needed and why it's been constrained as it has. + + + + + The status of the profile. + + + + + This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + + + + + The date that this version of the profile was published. + + + + + Whether this is operation or named query. + + + + + Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST. + + + + + The name used to invoke the operation. + + + + + Additional information about how to use this operation or named query. + + + + + Indicates that this operation definition is a constraining profile on the base. + + + + + Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context). + + + + + Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a resource type for the context). + + + + + Indicates whether this operation can be invoked on a particular instance of one of the given types. + + + + + The parameters for the operation/query. + + + + + + + + + A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). + + + + + + + The name of an individual to contact regarding the operation definition. + + + + + Contact details for individual (if a name was provided) or the publisher. + + + + + + + + + A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). + + + + + + + The name of used to identify the parameter. + + + + + Whether this is an input or an output parameter. + + + + + The minimum number of times this parameter SHALL appear in the request or response. + + + + + The maximum number of times this element is permitted to appear in the request or response. + + + + + Describes the meaning or use of this parameter. + + + + + The type for this parameter. + + + + + A profile the specifies the rules that this parameter must conform to. + + + + + The parts of a Tuple Parameter. + + + + + + + + + A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). + + + + + + + The name of used to identify the parameter. + + + + + The minimum number of times this parameter SHALL appear in the request or response. + + + + + The maximum number of times this element is permitted to appear in the request or response. + + + + + Describes the meaning or use of this parameter. + + + + + The type for this parameter. + + + + + A profile the specifies the rules that this parameter must conform to. + + + + + + + + + + + This is an input parameter + + + + + This is an output parameter + + + + + + + Whether an operation parameter is an input or an output parameter + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + This operation is invoked as an operation + + + + + This operation is a named query, invoked using the search mechanism + + + + + + + Whether an operation is a normal operation or a query + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A collection of error, warning or information messages that result from a system action. + + + + + A collection of error, warning or information messages that result from a system action. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + An error, warning or information message that results from a system action. + + + + + + + + + A collection of error, warning or information messages that result from a system action. + + + + + + + Indicates whether the issue indicates a variation from successful processing. + + + + + Describes the type of the issue. + + + + + Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stck dump to help trace the issue. + + + + + A simple XPath limited to element names, repetition indicators and the default child access that identifies one of the elements in the resource that caused this issue to be raised. + + + + + + + + + + + The issue caused the action to fail, and no further checking could be performed + + + + + The issue is sufficiently important to cause the action to fail + + + + + The issue is not important enough to cause the action to fail, but may cause it to be performed suboptimally or in a way that is not as desired + + + + + The issue has no relation to the degree of success of the action + + + + + + + How the issue affects the success of the action + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A request to perform an action. + + + + + A request to perform an action. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Identifiers assigned to this order by the orderer or by the receiver. + + + + + When the order was made. + + + + + Patient this order is about. + + + + + Who initiated the order. + + + + + Who is intended to fulfill the order. + + + + + Text - why the order was made. + + + + + + + If required by policy. + + + + + When order should be fulfilled. + + + + + What action is being ordered. + + + + + + + + + A request to perform an action. + + + + + + + Code specifies when request should be done. The code may simply be a priority code. + + + + + A formal schedule. + + + + + + + + + A response to an order. + + + + + A response to an order. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Identifiers assigned to this order. The identifiers are usually assigned by the system responding to the order, but they may be provided or added to by other systems. + + + + + A reference to the order that this is in response to. + + + + + The date and time at which this order response was made (created/posted). + + + + + The person, organization, or device credited with making the response. + + + + + A reference to an authority policy that is the reason for the response. Usually this is used when the order is rejected, to provide a reason for rejection. + + + + + + + What this response says about the status of the original order. + + + + + Additional description about the response - e.g. a text description provided by a human user when making decisions about the order. + + + + + Links to resources that provide details of the outcome of performing the order. E.g. Diagnostic Reports in a response that is made to an order that referenced a diagnostic order. + + + + + + + + + + + The order is known, but no processing has occurred at this time + + + + + The order is undergoing initial processing to determine whether it will be accepted (usually this involves human review) + + + + + The order was rejected because of a workflow/business logic reason + + + + + The order was unable to be processed because of a technical error (i.e. unexpected error) + + + + + The order has been accepted, and work is in progress + + + + + Processing the order was halted at the initiators request + + + + + The order has been cancelled and replaced by another + + + + + Processing the order was stopped because of some workflow/business logic reason + + + + + The order has been completed + + + + + + + The status of the response to an order + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc. + + + + + A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Identifier for the organization that is used to identify the organization across multiple disparate systems. + + + + + A name associated with the organization. + + + + + The kind of organization that this is. + + + + + A contact detail for the organization. + + + + + An address for the organization. + + + + + The organization of which this organization forms a part. + + + + + Contact for the organization for a certain purpose. + + + + + Whether the organization's record is still in active use. + + + + + + + + + A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, etc. + + + + + + + Indicates a purpose for which the contact can be reached. + + + + + A name associated with the contact. + + + + + A contact detail (e.g. a telephone number or an email address) by which the party may be contacted. + + + + + Visiting or postal addresses for the contact. + + + + + + + + + Demographics and other administrative information about an individual or animal receiving care or other health-related services. + + + + + Demographics and other administrative information about an individual or animal receiving care or other health-related services. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + An identifier for this patient. + + + + + A name associated with the individual. + + + + + A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted. + + + + + Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes. + + + + + The date of birth for the individual. + + + + + Indicates if the individual is deceased or not. + + + + + + + Addresses for the individual. + + + + + This field contains a patient's most recent marital (civil) status. + + + + + Indicates whether the patient is part of a multiple or indicates the actual birth order. + + + + + + + Image of the patient. + + + + + A contact party (e.g. guardian, partner, friend) for the patient. + + + + + This element has a value if the patient is an animal. + + + + + Languages which may be used to communicate with the patient about his or her health. + + + + + Patient's nominated care provider. + + + + + Organization that is the custodian of the patient record. + + + + + Link to another patient resource that concerns the same actual patient. + + + + + Whether this patient record is in active use. + + + + + + + + + Demographics and other administrative information about an individual or animal receiving care or other health-related services. + + + + + + + The nature of the relationship between the patient and the contact person. + + + + + A name associated with the contact person. + + + + + A contact detail for the person, e.g. a telephone number or an email address. + + + + + Address for the contact person. + + + + + Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes. + + + + + Organization on behalf of which the contact is acting or for which the contact is working. + + + + + The period during which this contact person or organization is valid to be contacted relating to this patient. + + + + + + + + + Demographics and other administrative information about an individual or animal receiving care or other health-related services. + + + + + + + Identifies the high level taxonomic categorization of the kind of animal. + + + + + Identifies the detailed categorization of the kind of animal. + + + + + Indicates the current state of the animal's reproductive organs. + + + + + + + + + Demographics and other administrative information about an individual or animal receiving care or other health-related services. + + + + + + + The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case. E.g. "en" for English, or "en-US" for American English versus "en-EN" for England English. + + + + + Indicates whether or not the Patient prefers this language (over other languages he masters up a certain level). + + + + + + + + + Demographics and other administrative information about an individual or animal receiving care or other health-related services. + + + + + + + The other patient resource that the link refers to. + + + + + The type of link between this patient resource and another patient resource. + + + + + + + + + + + The patient resource containing this link must no longer be used. The link points forward to another patient resource that must be used in lieu of the patient resource that contains the link. + + + + + The patient resource containing this link is in use and valid but not considered the main source of information about a patient. The link points forward to another patient resource that should be consulted to retrieve additional patient information + + + + + The patient resource containing this link is in use and valid, but points to another patient resource that is known to contain data about the same person. Data in this resource might overlap or contradict information found in the other patient resource. This link does not indicate any relative importance of the resources concerned, and both should be regarded as equally valid. + + + + + + + The type of link between this patient resource and another patient resource. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + This resource provides the status of the payment for goods and services rendered, and the request and response resource references. + + + + + This resource provides the status of the payment for goods and services rendered, and the request and response resource references. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + The Response Business Identifier. + + + + + The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + + + + + The style (standard) and version of the original material which was converted into this resource. + + + + + The date when this resource was created. + + + + + The Insurer who is target of the request. + + + + + The practitioner who is responsible for the services rendered to the patient. + + + + + The organization which is responsible for the services rendered to the patient. + + + + + Reference of resource to reverse. + + + + + Reference of response to resource to reverse. + + + + + The payment status, typically paid: payment sent, cleared: payment received. + + + + + + + + + This resource provides payment details and claim references supporting a bulk payment. + + + + + This resource provides payment details and claim references supporting a bulk payment. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + The Response Business Identifier. + + + + + Original request resource reference. + + + + + Transaction status: error, complete. + + + + + A description of the status of the adjudication. + + + + + The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + + + + + The style (standard) and version of the original material which was converted into this resource. + + + + + The date when the enclosed suite of services were performed or completed. + + + + + The period of time for which payments have been gathered into this bulk payment for settlement. + + + + + The Insurer who produced this adjudicated response. + + + + + The practitioner who is responsible for the services rendered to the patient. + + + + + The organization which is responsible for the services rendered to the patient. + + + + + List of individual settlement amounts and the corresponding transaction. + + + + + The form to be used for printing the content. + + + + + Total payment amount. + + + + + Suite of notes. + + + + + + + + + This resource provides payment details and claim references supporting a bulk payment. + + + + + + + Code to indicate the nature of the payment, adjustment, funds advance, etc. + + + + + The claim or financial resource. + + + + + The claim response resource. + + + + + The Organization which submitted the invoice or financial transaction. + + + + + The organization which is receiving the payment. + + + + + The date of the invoice or financial resource. + + + + + Amount paid for this detail. + + + + + + + + + This resource provides payment details and claim references supporting a bulk payment. + + + + + + + The note purpose: Print/Display. + + + + + The note text. + + + + + + + + + Demographics and administrative information about a person independent of a specific health-related context. + + + + + Demographics and administrative information about a person independent of a specific health-related context. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Identifier for a person within a particular scope. + + + + + A name associated with the person. + + + + + A contact detail for the person, e.g. a telephone number or an email address. + + + + + Administrative Gender. + + + + + The birth date for the person. + + + + + One or more addresses for the person. + + + + + An image that can be displayed as a thumbnail of the person to enhance the identification of the individual. + + + + + The Organization that is the custodian of the person record. + + + + + Whether this person's record is in active use. + + + + + Link to a resource that concerns the same actual person. + + + + + + + + + Demographics and administrative information about a person independent of a specific health-related context. + + + + + + + The resource to which this actual person is associated. + + + + + Level of assurance that this link is actually associated with the target resource. + + + + + + + + + + + Little or no confidence in the asserted identity's accuracy. + + + + + Some confidence in the asserted identity's accuracy. + + + + + High confidence in the asserted identity's accuracy. + + + + + Very high confidence in the asserted identity's accuracy. + + + + + + + The level of confidence that this link represents the same actual person, based on NIST Authentication Levels + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A person who is directly or indirectly involved in the provisioning of healthcare. + + + + + A person who is directly or indirectly involved in the provisioning of healthcare. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + An identifier that applies to this person in this role. + + + + + A name associated with the person. + + + + + A contact detail for the practitioner, e.g. a telephone number or an email address. + + + + + The postal address where the practitioner can be found or visited or to which mail can be delivered. + + + + + Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. + + + + + The date of birth for the practitioner. + + + + + Image of the person. + + + + + The list of Roles/Organizations that the Practitioner is associated with. + + + + + Qualifications obtained by training and certification. + + + + + A language the practitioner is able to use in patient communication. + + + + + + + + + A person who is directly or indirectly involved in the provisioning of healthcare. + + + + + + + The Organization where the Practitioner performs the roles associated. + + + + + Roles which this practitioner is authorized to perform for the organization. + + + + + Specific specialty of the practitioner. + + + + + The period during which the person is authorized to act as a practitioner in these role(s) for the organization. + + + + + The location(s) at which this practitioner provides care. + + + + + The list of healthcare services that this worker provides for this role's Organization/Location(s). + + + + + + + + + A person who is directly or indirectly involved in the provisioning of healthcare. + + + + + + + An identifier that applies to this person's qualification in this role. + + + + + Coded representation of the qualification. + + + + + Period during which the qualification is valid. + + + + + Organization that regulates and issues the qualification. + + + + + + + + + An action that is or was performed on a patient. This can be a physical 'thing' like an operation, or less invasive like counseling or hypnotherapy. + + + + + An action that is or was performed on a patient. This can be a physical 'thing' like an operation, or less invasive like counseling or hypnotherapy. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + This records identifiers associated with this procedure that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). + + + + + The person on whom the procedure was performed. + + + + + A code specifying the state of the procedure record. Generally this will be in-progress or completed state. + + + + + A code that classifies the procedure for searching, sorting and display purposes. + + + + + The specific procedure that is performed. Use text if the exact nature of the procedure can't be coded. + + + + + Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion. + + + + + The reason why the procedure was performed. This may be due to a Condition, may be coded entity of some type, or may simply be present as text. + + + + + Limited to 'real' people rather than equipment. + + + + + The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured. + + + + + + + The encounter during which the procedure was performed. + + + + + The location where the procedure actually happened. e.g. a newborn at home, a tracheostomy at a restaurant. + + + + + What was the outcome of the procedure - did it resolve reasons why the procedure was performed? + + + + + This could be a histology result. There could potentially be multiple reports - e.g. if this was a procedure that made multiple biopsies. + + + + + Any complications that occurred during the procedure, or in the immediate post-operative period. These are generally tracked separately from the notes, which typically will describe the procedure itself rather than any 'post procedure' issues. + + + + + If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or potentially could be more complex in which case the CarePlan resource can be used. + + + + + Procedures may be related to other items such as procedures or medications. For example treating wound dehiscence following a previous procedure. + + + + + Any other notes about the procedure - e.g. the operative notes. + + + + + A device change during the procedure. + + + + + Identifies medications, devices and other substance used as part of the procedure. + + + + + + + + + An action that is or was performed on a patient. This can be a physical 'thing' like an operation, or less invasive like counseling or hypnotherapy. + + + + + + + Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion. + + + + + + + + + + + An action that is or was performed on a patient. This can be a physical 'thing' like an operation, or less invasive like counseling or hypnotherapy. + + + + + + + The practitioner who was involved in the procedure. + + + + + E.g. surgeon, anaethetist, endoscopist. + + + + + + + + + An action that is or was performed on a patient. This can be a physical 'thing' like an operation, or less invasive like counseling or hypnotherapy. + + + + + + + The nature of the relationship. + + + + + The related item - e.g. a procedure. + + + + + + + + + An action that is or was performed on a patient. This can be a physical 'thing' like an operation, or less invasive like counseling or hypnotherapy. + + + + + + + The kind of change that happened to the device during the procedure. + + + + + The device that was manipulated (changed) during the procedure. + + + + + + + + + + + The procedure is still occurring + + + + + The procedure was terminated without completing successfully + + + + + All actions involved in the procedure have taken place + + + + + The statement was entered in error and Is not valid + + + + + + + A code specifying the state of the procedure record + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + This procedure had to be performed because of the related one + + + + + This procedure caused the related one to be performed + + + + + + + The nature of the relationship with this procedure + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A request for a procedure to be performed. May be a proposal or an order. + + + + + A request for a procedure to be performed. May be a proposal or an order. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Identifiers assigned to this order by the order or by the receiver. + + + + + The patient who will receive the procedure. + + + + + The specific procedure that is ordered. Use text if the exact nature of the procedure can't be coded. + + + + + Indicates the sites on the subject's body where the procedure should be performed ( i.e. the target sites). + + + + + The reason why the procedure is proposed or ordered. This procedure request may be motivated by a Condition for instance. + + + + + The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions, for example. "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". + + + + + + + + The encounter within which the procedure proposal or request was created. + + + + + E.g. surgeon, anaethetist, endoscopist. + + + + + The status of the order. + + + + + Any other notes associated with this proposal or order - e.g., provider instructions. + + + + + If a CodeableConcept is present, it indicates the pre-condition for performing the procedure. + + + + + + + The time when the request was made. + + + + + The healthcare professional responsible for proposing or ordering the procedure. + + + + + The clinical priority associated with this order. + + + + + + + + + A request for a procedure to be performed. May be a proposal or an order. + + + + + + + Indicates the site on the subject's body where the procedure should be performed ( i.e. the target sites). + + + + + + + + + + + + + The request has been proposed + + + + + The request is in preliminary form, prior to being requested + + + + + The request has been placed + + + + + The receiving system has received the request but not yet decided whether it will be performed + + + + + The receiving system has accepted the request, but work has not yet commenced + + + + + The work to fulfill the request is happening + + + + + The work has been complete, the report(s) released, and no further work is planned + + + + + The request has been held by originating system/user request + + + + + The receiving system has declined to fulfill the request + + + + + The request was attempted, but due to some procedural error, it could not be completed + + + + + + + The status of the request + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + The request has a normal priority. + + + + + The request should be done urgently. + + + + + The request is time-critical. + + + + + The request should be acted on as soon as possible. + + + + + + + The priority of the request + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + This resource provides the target, request and response, and action details for an action to be performed by the target on or about existing resources. + + + + + This resource provides the target, request and response, and action details for an action to be performed by the target on or about existing resources. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + The type of procesing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest. + + + + + The ProcessRequest Business Identifier. + + + + + The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + + + + + The style (standard) and version of the original material which was converted into this resource. + + + + + The date when this resource was created. + + + + + The organization which is target of the request. + + + + + The practitioner who is responsible for the action specified in thise request. + + + + + The organization which is responsible for the action speccified in thise request. + + + + + Reference of resource which is the target or subject of this action. + + + + + Reference of a prior response to resource which is the target or subject of this action. + + + + + If true remove all history excluding audit. + + + + + A reference to supply which authenticates the process. + + + + + List of top level items to be re-adjudicated, if none specified then the entire submission is re-adjudicated. + + + + + Names of resource types to include. + + + + + Names of resource types to exclude. + + + + + A period of time during which the fulfilling resources would have been created. + + + + + + + + + This resource provides the target, request and response, and action details for an action to be performed by the target on or about existing resources. + + + + + + + A service line number. + + + + + + + + + + + Cancel, Reverse or nullify the target resource. + + + + + Check for previously un-read/ not-retrieved resources + + + + + Re-process the target resource. + + + + + Retrieve the processing status of the target resource. + + + + + + + List of allowable action which this resource can request + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + This resource provides processing status, errors and notes from the processing of a resource. + + + + + This resource provides processing status, errors and notes from the processing of a resource. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + The Response Business Identifier. + + + + + Original request resource reference. + + + + + Transaction status: error, complete, held. + + + + + A description of the status of the adjudication or processing. + + + + + The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. + + + + + The style (standard) and version of the original material which was converted into this resource. + + + + + The date when the enclosed suite of services were performed or completed. + + + + + The organization who produced this adjudicated response. + + + + + The practitioner who is responsible for the services rendered to the patient. + + + + + The organization which is responsible for the services rendered to the patient. + + + + + The form to be used for printing the content. + + + + + Suite of processing note or additional requirements is the processing has been held. + + + + + Processing errors. + + + + + + + + + This resource provides processing status, errors and notes from the processing of a resource. + + + + + + + The note purpose: Print/Display. + + + + + The note text. + + + + + + + + + Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g., Document Completion - has the artifact been legally authenticated), all of which may impact Security, Privacy, and Trust policies. + + + + + Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g., Document Completion - has the artifact been legally authenticated), all of which may impact Security, Privacy, and Trust policies. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + The Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity. + + + + + The period during which the activity occurred. + + + + + The instant of time at which the activity was recorded. + + + + + The reason that the activity was taking place. + + + + + Where the activity occurred, if relevant. + + + + + Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc. + + + + + An agent takes a role in an activity such that the agent can be assigned some degree of responsibility for the activity taking place. An agent can be a person, an organization, software, or other entities that may be ascribed responsibility. + + + + + An entity used in this activity. + + + + + A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated. + + + + + + + + + Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g., Document Completion - has the artifact been legally authenticated), all of which may impact Security, Privacy, and Trust policies. + + + + + + + The function of the agent with respect to the activity. + + + + + The type of participation of the agent. + + + + + Identity of participant as a Resource or uri. + + + + + + + Human-readable description of the participant. + + + + + + + + + Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g., Document Completion - has the artifact been legally authenticated), all of which may impact Security, Privacy, and Trust policies. + + + + + + + How the entity was used during the activity. + + + + + The type of the entity. If the entity is a resource, then this is a resource type. + + + + + Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative. + + + + + Human-readable description of the entity. + + + + + The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity. + + + + + + + + + + + A transformation of an entity into another, an update of an entity resulting in a new one, or the construction of a new entity based on a preexisting entity + + + + + A derivation for which the resulting entity is a revised version of some original. + + + + + The repeat of (some or all of) an entity, such as text or image, by someone who may or may not be its original author + + + + + A primary source for a topic refers to something produced by some agent with direct experience and knowledge about the topic, at the time of the topic's study, without benefit from hindsight. + + + + + + + How an entity was used in an activity + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. + + + + + A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + This records identifiers associated with this question set that are defined by business processed and/ or used to refer to it when a direct URL reference to the resource itself is not appropriate (e.g. in CDA documents, or in written / printed documentation). + + + + + The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated. + + + + + The lifecycle status of the questionnaire as a whole. + + + + + The date that this questionnaire was last changed. + + + + + Organization or person responsible for developing and maintaining the questionnaire. + + + + + Contact details to assist a user in finding and communicating with the publisher. + + + + + A collection of related questions (or further groupings of questions). + + + + + + + + + A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. + + + + + + + An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a QuestionnaireAnswers resource. + + + + + The human-readable name for this section of the questionnaire. + + + + + Identifies a how this group of questions is known in a particular terminology such as LOINC. + + + + + Additional text for the group, used for display purposes. + + + + + If true, indicates that the group must be present and have required questions within it answered. If false, the group may be skipped when answering the questionnaire. + + + + + Whether the group may occur multiple times in the instance, containing multiple sets of answers. + + + + + A sub-group within a group. The ordering of groups within this group is relevant. + + + + + Set of questions within this group. The order of questions within the group is relevant. + + + + + + + + + A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. + + + + + + + An identifier that is unique within the questionnaire allowing linkage to the equivalent group in a [[[QuestionnaireAnswers]]] resource. + + + + + Identifies a how this question is known in a particular terminology such as LOINC. + + + + + The actual question as shown to the user to prompt them for an answer. + + + + + The expected format of the answer, e.g. the type of input (string, integer) or whether a (multiple) choice is expected. + + + + + If true, indicates that the question must be answered and have required groups within it also present. If false, the question and any contained groups may be skipped when answering the questionnaire. + + + + + If true, the question may have more than one answer. + + + + + Reference to a valueset containing the possible options. + + + + + Nested group, containing nested question for this question. The order of groups within the question is relevant. + + + + + + + + + + + This Questionnaire is not ready for official use. + + + + + This Questionnaire is ready for use. + + + + + This Questionnaire should no longer be used to gather data. + + + + + + + Lifecycle status of the questionnaire + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + Answer is a yes/no answer + + + + + Answer is a floating point number + + + + + Answer is an integer + + + + + Answer is a date + + + + + Answer is a date and time + + + + + Answer is a system timestamp + + + + + Answer is a time independent of date + + + + + Answer is a short (few words to short sentence) free-text entry + + + + + Answer is a long (potentially multi-paragram) free-text entry + + + + + Answer is a url (website, FTP site, etc.) + + + + + Answer is a choice from a list of options + + + + + Answer is a choice from a list of options or a free-text entry + + + + + Answer is binary content such as a image, PDF, etc. + + + + + Answer is a reference to another resource (practitioner, organization, etc.) + + + + + Answer is a combination of a numeric value and unit + + + + + + + The expected format of an answer + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. + + + + + A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + A business identifier assigned to a particular completed (or partially completed) questionnaire. + + + + + Indicates the Questionnaire resource that defines the form for which answers are being provided. + + + + + The lifecycle status of the questionnaire answers as a whole. + + + + + The subject of the questionnaire answers. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information. + + + + + Person who received the answers to the questions in the QuestionnaireAnswers and recorded them in the system. + + + + + The date and/or time that this version of the questionnaire answers was authored. + + + + + The person who answered the questions about the subject. + + + + + Encounter during which this set of questionnaire answers were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers. + + + + + A group of questions to a possibly similarly grouped set of questions in the questionnaire answers. + + + + + + + + + A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. + + + + + + + Identifies the group from the Questionnaire that corresponds to this group in the QuestionnaireAnswers resource. + + + + + Text that is displayed above the contents of the group. + + + + + Additional text for the group, used for display purposes. + + + + + More specific subject this section's answers are about, details the subject given in QuestionnaireAnswers. + + + + + A sub-group within a group. The ordering of groups within this group is relevant. + + + + + Set of questions within this group. The order of questions within the group is relevant. + + + + + + + + + A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. + + + + + + + Identifies the question from the Questionnaire that corresponds to this question in the QuestionnaireAnswers resource. + + + + + The actual question as shown to the user to prompt them for an answer. + + + + + The respondent's answer(s) to the question. + + + + + Nested group, containing nested question for this question. The order of groups within the question is relevant. + + + + + + + + + A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. + + + + + + + The answer (or one of the answers) provided by the respondant to the question. + + + + + + + + + + + + + + + + + + + + + + + + This QuestionnaireAnswers has been partially filled out with answers, but changes or additions are still expected to be made to it. + + + + + This QuestionnaireAnswers has been filled out with answers, and the current content is regarded as definitive. + + + + + This QuestionnaireAnswers has been filled out with answers, then marked as complete, yet changes or additions have been made to it afterwards. + + + + + + + Lifecycle status of the questionnaire answers + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organisation. + + + + + Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organisation. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + The workflow status of the referral or transfer of care request. + + + + + Business Id that uniquely identifies the referral/care transfer request instance. + + + + + An indication of the type of referral (or where applicable the type of transfer of care) request. + + + + + Indication of the clinical domain or discipline to which the referral or transfer of care request is sent. + + + + + An indication of the urgency of referral (or where applicable the type of transfer of care) request. + + + + + The patient who is the subject of a referral or transfer of care request. + + + + + The healthcare provider or provider organization who/which initaited the referral/transfer of care request. Can also be Patient (a self referral). + + + + + The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request. + + + + + The encounter at which the request for referral or transfer of care is initiated. + + + + + Date/DateTime the request for referral or transfer of care is sent by the author. + + + + + Description of clinical condition indicating why referral/transfer of care is requested. + + + + + The reason gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary. + + + + + The service(s) that is/are requested to be provided to the patient. + + + + + Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care. + + + + + The period of time within which the services identified in the referral/transfer of care is specified or required to occur. + + + + + + + + + + + A draft referral that has yet to be send + + + + + The referral has been transmitted, but not yet acknowledged by the recipient + + + + + The referral has been acknowledged by the recipient, and is in the process of being actioned + + + + + The referral has been cancelled without being completed. For example it is no longer needed + + + + + The recipient has agreed to deliver the care requested by the referral + + + + + The recipient has declined to accept the referral + + + + + The referral has been completely actioned + + + + + + + The status of the referral + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process. + + + + + Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has a formal responsibility in the care process. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Identifier for a person within a particular scope. + + + + + The patient this person is related to. + + + + + The nature of the relationship between a patient and the related person. + + + + + A name associated with the person. + + + + + A contact detail for the person, e.g. a telephone number or an email address. + + + + + Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. + + + + + Address where the related person can be contacted or visited. + + + + + Image of the person. + + + + + The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown. + + + + + + + + + An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome. + + + + + An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + The patient or group the risk assessment applies to. + + + + + The date (and possibly time) the risk assessment was performed. + + + + + For assessments or prognosis specific to a particular condition, indicates the condition being assessed. + + + + + The provider or software application that performed the assessment. + + + + + Business identifier assigned to the risk assessment. + + + + + The algorithm, processs or mechanism used to evaluate the risk. + + + + + Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.). + + + + + Describes the expected outcome for the subject. + + + + + A description of the steps that might be taken to reduce the identified risk(s). + + + + + + + + + An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome. + + + + + + + One of the potential outcomes for the patient (e.g. remission, death, a particular condition). + + + + + How likely is the outcome (in the specified timeframe). + + + + + + + + Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.). + + + + + Indicates the period of time or age range of the subject to which the specified probability applies. + + + + + + + Additional information explaining the basis for the prediction. + + + + + + + + + A container for slot(s) of time that may be available for booking appointments. + + + + + A container for slot(s) of time that may be available for booking appointments. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + External Ids for this item. + + + + + The schedule type can be used for the categorization of healthcare services or other appointment types. + + + + + The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson. + + + + + The period of time that the slots that are attached to this Schedule resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a "template" for planning outside these dates. + + + + + Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated. + + + + + + + + + A Search Parameter that defines a named search item that can be used to search/filter on a resource. + + + + + A Search Parameter that defines a named search item that can be used to search/filter on a resource. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + An absolute URL at which this search parameter is (or will be) published, and which is used to reference this profile in conformance statements. + + + + + The name of the standard or custom search parameter. + + + + + The name of the individual or organization that published the search parameter. + + + + + Contacts to assist a user in finding and communicating with the publisher. + + + + + The Scope and Usage that this search parameter was created to meet. + + + + + The status of this search parameter definition. + + + + + A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + + + + + The date (and optionally time) when the search parameter definition was published. + + + + + The base resource type that this search parameter refers to. + + + + + The type of value a search parameter refers to, and how the content is interpreted. + + + + + A description of the search parameters and how it used. + + + + + An XPath expression that returns a set of elements for the search parameter. + + + + + Types of resource (if a resource is referenced). + + + + + + + + + A Search Parameter that defines a named search item that can be used to search/filter on a resource. + + + + + + + The name of an individual to contact regarding the search parameter. + + + + + Contact details for individual (if a name was provided) or the publisher. + + + + + + + + + A slot of time on a schedule that may be available for booking appointments. + + + + + A slot of time on a schedule that may be available for booking appointments. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + External Ids for this item. + + + + + The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource. + + + + + The schedule resource that this slot defines an interval of status information. + + + + + BUSY | FREE | BUSY-UNAVAILABLE | BUSY-TENTATIVE. + + + + + Date/Time that the slot is to begin. + + + + + Date/Time that the slot is to conclude. + + + + + This slot has already been overbooked, appointments are unlikely to be accepted for this time. + + + + + Comments on the slot to describe any extended information. Such as custom constraints on the slot. + + + + + + + + + + + Indicates that the time interval is busy because one or more events have been scheduled for that interval. + + + + + Indicates that the time interval is free for scheduling. + + + + + Indicates that the time interval is busy and that the interval can not be scheduled. + + + + + Indicates that the time interval is busy because one or more events have been tentatively scheduled for that interval + + + + + + + The free/busy status of a slot + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + Sample for analysis. + + + + + Sample for analysis. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Id for specimen. + + + + + The kind of material that forms the specimen. + + + + + Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of a another specimen. + + + + + Where the specimen came from. This may be from the patient(s) or from the environment or a device. + + + + + The identifier assigned by the lab when accessioning specimen(s). This is not necessarily the same as the specimen identifier, depending on local lab procedures. + + + + + Time when specimen was received for processing or testing. + + + + + Details concerning the specimen collection. + + + + + Details concerning treatment and processing steps for the specimen. + + + + + The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here. + + + + + + + + + Sample for analysis. + + + + + + + Person who collected the specimen. + + + + + To communicate any details or issues encountered during the specimen collection procedure. + + + + + Time when specimen was collected from subject - the physiologically relevant time. + + + + + + + The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample. + + + + + A coded value specifying the technique that is used to perform the procedure. + + + + + Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens. + + + + + + + + + + + Sample for analysis. + + + + + + + Textual description of procedure. + + + + + A coded value specifying the procedure used to process the specimen. + + + + + Material used in the processing step. + + + + + + + + + Sample for analysis. + + + + + + + Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances. + + + + + Textual description of the container. + + + + + The type of container associated with the specimen (e.g. slide, aliquot, etc). + + + + + The capacity (volume or other measure) the container may contain. + + + + + The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type. + + + + + Introduced substance to preserve, maintain or enhance the specimen. examples: Formalin, Citrate, EDTA. + + + + + + + + + + + A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions, and constraints on resources and data types. + + + + + A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions, and constraints on resources and data types. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + An absolute URL at which this StructureDefinition is (or will be) published, and which is used to reference this StructureDefinition in extension urls and tag values in operational FHIR systems. + + + + + Formal identifier that is used to identify this StructureDefinition when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI). + + + + + The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually. + + + + + A free text natural language name identifying the StructureDefinition. + + + + + The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure definitions. + + + + + Defined so that applications can use this name when displaying the value of the extension to the user. + + + + + The name of the individual or organization that published the structure definition. + + + + + Contacts to assist a user in finding and communicating with the publisher. + + + + + A free text natural language description of the StructureDefinition and its use. + + + + + Explains why this structure definition is needed and why it's been constrained as it has. + + + + + A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. + + + + + A set of terms from external terminologies that may be used to assist with indexing and searching of templates. + + + + + The status of the StructureDefinition. + + + + + This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + + + + + The date that this version of the StructureDefinition was published. + + + + + The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 0.5.0 for this version. + + + + + An external specification that the content is mapped to. + + + + + Defines the type of structure that this definition is describing. + + + + + Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type. + + + + + If this is an extension, Identifies the context within FHIR resources where the extension can be used. + + + + + Identifies the types of resource or data type elements to which the extension can be applied. + + + + + An absolute URI that is the base structure from which this set of constraints is derived. + + + + + A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition. + + + + + A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies. + + + + + + + + + A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions, and constraints on resources and data types. + + + + + + + The name of an individual to contact regarding the structure definition. + + + + + Contact details for individual (if a name was provided) or the publisher. + + + + + + + + + A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions, and constraints on resources and data types. + + + + + + + An Internal id that is used to identify this mapping set when specific mappings are made. + + + + + An absolute URI that identifies the specification that this mapping is expressed to. + + + + + A name for the specification that is being mapped to. + + + + + Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. + + + + + + + + + A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions, and constraints on resources and data types. + + + + + + + Captures constraints on each element within the resource. + + + + + + + + + A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions, and constraints on resources and data types. + + + + + + + Captures constraints on each element within the resource. + + + + + + + + + + + The context is all elements matching a particular resource element path + + + + + The context is all nodes matching a particular data type element path (root or repeating element) or all elements referencing a particular primitive data type (expressed as the datatype name) + + + + + The context is all nodes whose mapping to a specified reference model corresponds to a particular mapping structure. The context identifies the mapping target. The mapping should clearly identify where such an extension could be used + + + + + The context is a particular extension from a particular profile. Expressed as uri#name, where uri identifies the profile and #name identifies the extension code + + + + + + + How an extension context is interpreted + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + A data type - either a primitive or complex structure that defines a set of data elements. These can be used throughout Resource and extension definitions + + + + + A resource defined by the FHIR specification + + + + + A set of constraints on a resource or data type that describe how it is used for a particular use + + + + + A definition of an extension that can be used in a FHIR resource (or a set of constraints on an exsting extension) + + + + + + + Defines the type of structure that a definition is describing + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + The subscription resource is used to define a push based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined "channel" so that another system is able to take an appropriate action. + + + + + The subscription resource is used to define a push based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined "channel" so that another system is able to take an appropriate action. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + The rules that the server should use to determine when to generate notifications for this subscription. + + + + + Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting. + + + + + A description of why this subscription is defined. + + + + + The status of the subscription, which marks the server state for managing the subscription. + + + + + A record of the last error that occurred when the server processed a notification. + + + + + Details where to send notifications when resources are received that meet the criteria. + + + + + The time for the server to turn the subscription off. + + + + + A tag to add to any resource that matches the criteria, after the subscription is processed. + + + + + + + + + The subscription resource is used to define a push based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined "channel" so that another system is able to take an appropriate action. + + + + + + + The type of channel to send notififcations on. + + + + + The uri that describes tha actual end point to send messages to. + + + + + The mime type to send the payload in - either application/xml+fhir, or application/json+fhir. If the mime type is blank, then there is no payload in the notification, just a notification. + + + + + Additional headers / information to send as part of the notification. + + + + + + + + + + + The client has requested the subscription, and the server has not yet set it up + + + + + The subscription is active + + + + + The server has an error executing the notification + + + + + Too many errors have occurred or the subscription has expired + + + + + + + The status of a subscription + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + The channel is executed by making a post to the URI. If a payload is included, the URL is interpreted as the service base, and an update (PUT) is made + + + + + The channel is executed by sending a packet across a web socket connection maintained by the client. The URL identifies the websocket, and the client binds to this URL + + + + + The channel is executed by sending an email to the email addressed in the URI (which must be a mailto:) + + + + + The channel is executed by sending an SMS message to the phone number identified in the URL (tel:) + + + + + The channel Is executed by sending a message (e.g. a Bundle with a MessageHeader resource etc) to the application identified in the URI + + + + + + + The type of method used to execute a subscription + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A homogeneous material with a definite composition. + + + + + A homogeneous material with a definite composition. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + A code (or set of codes) that identify this substance. + + + + + A description of the substance - its appearance, handling requirements, and other usage notes. + + + + + Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance. + + + + + A substance can be composed of other substances. + + + + + + + + + A homogeneous material with a definite composition. + + + + + + + Identifier associated with the package/container (usually a label affixed directly). + + + + + When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. + + + + + The amount of the substance. + + + + + + + + + A homogeneous material with a definite composition. + + + + + + + The amount of the ingredient in the substance - a concentration ratio. + + + + + Another substance that is a component of this substance. + + + + + + + + + A supply - a request for something, and provision of what is supplied. + + + + + A supply - a request for something, and provision of what is supplied. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process. + + + + + Unique identifier for this supply request. + + + + + Status of the supply request. + + + + + The item that is requested to be supplied. + + + + + A link to a resource representing the person whom the ordered item is for. + + + + + Indicates the details of the dispense event such as the days supply and quantity of a supply dispensed. + + + + + + + + + A supply - a request for something, and provision of what is supplied. + + + + + + + Identifier assigned by the dispensing facility when the item(s) is dispensed. + + + + + A code specifying the state of the dispense event. + + + + + Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc. + + + + + The amount of supply that has been dispensed. Includes unit of measure. + + + + + Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list. + + + + + The individual responsible for dispensing the medication, supplier or device. + + + + + The time the dispense event occurred. + + + + + The time the dispensed item was sent or handed to the patient (or agent). + + + + + Identification of the facility/location where the Supply was shipped to, as part of the dispense event. + + + + + Identifies the person who picked up the Supply. + + + + + + + + + + + Supply has been requested, but not dispensed + + + + + Supply is part of a pharmacy order and has been dispensed + + + + + Dispensing was not completed + + + + + + + Status of the dispense + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + Supply has been requested, but not dispensed + + + + + Supply is part of a pharmacy order and has been dispensed + + + + + Supply has been received by the requestor + + + + + The supply will not be completed because the supplier was unable or unwilling to supply the item + + + + + The orderer of the supply cancelled the request + + + + + + + Status of the supply + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + Record of delivery of what is supply. + + + + + Record of delivery of what is supply. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Identifier assigned by the dispensing facility when the item(s) is dispensed. + + + + + A code specifying the state of the dispense event. + + + + + A link to a resource representing the person whom the delivered item is for. + + + + + Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc. + + + + + The amount of supply that has been dispensed. Includes unit of measure. + + + + + Identifies the medication or substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list. + + + + + The individual responsible for dispensing the medication, supplier or device. + + + + + The time the dispense event occurred. + + + + + The time the dispensed item was sent or handed to the patient (or agent). + + + + + Identification of the facility/location where the Supply was shipped to, as part of the dispense event. + + + + + Identifies the person who picked up the Supply. + + + + + + + + + + + Supply has been requested, but not delivered + + + + + Supply has been delivered. ( "completed") + + + + + Dispensing was not completed + + + + + + + Status of the Supply delivery + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A supply - a request for something. + + + + + A supply - a request for something. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process. + + + + + Unique identifier for this supply request. + + + + + Status of the supply request. + + + + + The item that is requested to be supplied. + + + + + A link to a resource representing the person whom the ordered item is for. + + + + + + + + + + + Supply has been requested, but not dispensed + + + + + Supply has been received by the requestor + + + + + The supply will not be completed because the supplier was unable or unwilling to supply the item + + + + + The orderer of the supply cancelled the request + + + + + + + Status of the supply request + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification. + + + + + TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Name of the Test Script. + + + + + Description of the Test Script. + + + + + If the tests apply to more than one FHIR server (e.g. cross-server interoperability tests) then multiserver=true. Defaults or missing values to false. + + + + + Fixture in the test script - either by reference (uri) or embedded (Resource). All fixtures are required for the test script to execute. + + + + + A series of required setup operations before tests are executed. + + + + + A test in this script. + + + + + A series of operations required to clean up after the all the tests are executed (successfully or otherwise). + + + + + + + + + TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification. + + + + + + + The URI of the fixture. Each fixture shall have a "uri" or "resource" but not both. The "uri" shall resolve to a valid Resource. The "uri" may be local or remote, absolute or relative. + + + + + The fixture resource actually embedded in this TestScript. Each fixture should have a "uri" or "resource" but not both. + + + + + Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section. + + + + + Whether or not to implicitly delete the fixture during teardown If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section. + + + + + + + + + TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification. + + + + + + + A setup operation. + + + + + + + + + TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification. + + + + + + + read | vread | update | delete | history | create | search | transaction | conformance | tags | mailbox | document | assertion | assertion_false | assertion_warning. + + + + + The internal id of the fixture used as the body of any operation.type that results in a PUT or POST. + + + + + The id of the fixture used as the target of any operation.type that results in a PUT or POST, or the id of the fixture used to store the results of a GET. + + + + + Which server to perform the operation on. + + + + + Arguments to an operation. + + + + + The fixture id (maybe new) to map to the response. + + + + + The content-type or mime-type to use for RESTful operation. + + + + + + + + + TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification. + + + + + + + The name of this test. + + + + + A short description of the test. + + + + + Metadata about this Test. + + + + + Each test must have at least one operation. Operation and assertion elements can be mixed together. + + + + + + + + + TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification. + + + + + + + A link to the FHIR specification that this test is covering. + + + + + The required capability must exist and is assumed to function correctly on the FHIR server being tested. + + + + + The capability that this test verifies. + + + + + + + + + TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification. + + + + + + + URL to a particular requirement or feature within the FHIR specification. + + + + + Short description of the link. + + + + + + + + + TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification. + + + + + + + The resource type that the FHIR server must support. + + + + + The operations (comma-separated) that the FHIR server must support for the specified resource type. See TestOperationType. + + + + + Which server this requirement applies to. + + + + + + + + + TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification. + + + + + + + The resource type that the FHIR server must support. + + + + + The operations (comma-separated) that the FHIR server must support for the specified resource type. See TestOperationType. + + + + + Which server this validation applies to. + + + + + + + + + TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification. + + + + + + + read | vread | update | delete | history | create | search | transaction | conformance | tags | mailbox | document | assertion | assertion_false | assertion_warning. + + + + + The internal id of the fixture used as the body of any operation.type that results in a PUT or POST. + + + + + The id of the fixture used as the target of any operation.type that results in a PUT or POST, or the id of the fixture used to store the results of a GET. + + + + + Which server to perform the operation on. + + + + + Arguments to an operation. + + + + + The fixture id (maybe new) to map to the response. + + + + + The content-type or mime-type to use for RESTful operation. + + + + + + + + + TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification. + + + + + + + A teardown operation. + + + + + + + + + TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification. + + + + + + + read | vread | update | delete | history | create | search | transaction | conformance | tags | mailbox | document | assertion | assertion_false | assertion_warning. + + + + + The internal id of the fixture used as the body of any operation.type that results in a PUT or POST. + + + + + The id of the fixture used as the target of any operation.type that results in a PUT or POST, or the id of the fixture used to store the results of a GET. + + + + + Which server to perform the operation on. + + + + + Arguments to an operation. + + + + + The fixture id (maybe new) to map to the response. + + + + + The content-type or mime-type to use for RESTful operation. + + + + + + + + + + + XML content-type corresponding to the application/xml+fhir mime-type + + + + + JSON content-type corresponding to the application/json+fhir mime-type + + + + + + + The content or mime type. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + Read the current state of the resource. + + + + + Read the state of a specific version of the resource. + + + + + Update an existing resource by its id (or create it if it is new). + + + + + Delete a resource. + + + + + Retrieve the update history for a particular resource or resource type. + + + + + Create a new resource with a server assigned id. + + + + + Search based on some filter criteria. + + + + + Update, create or delete a set of resources as a single transaction. + + + + + Get a conformance statement for the system. + + + + + Tag operations. + + + + + Not currently supported test operation. + + + + + Not currently supported test operation. + + + + + Make an assertion against the result of the last non-assertion operation. + + + + + Make a negative or false assertion against the result of the last non-assertion operation. + + + + + Run an assertion function as a warning (instead of a failture) against the result of the last non-assertion operation. + + + + + + + The allowable operation types. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + A value set specifies a set of codes drawn from one or more code systems. + + + + + A value set specifies a set of codes drawn from one or more code systems. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + An absolute uri that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique URI, and an be urn:uuid: or urn:oid:). + + + + + Formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance. + + + + + Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. + + + + + A free text natural language name describing the value set. + + + + + The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions. + + + + + If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change. + + + + + The name of the individual or organization that published the value set. + + + + + Contacts to assist a user in finding and communicating with the publisher. + + + + + A free text natural language description of the use of the value set - reason for definition, "the semantic space" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set. + + + + + Explains why this value set is needed and why it's been constrained as it has. + + + + + A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set. + + + + + The status of the value set. + + + + + This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. + + + + + Whether this is intended to be used with an extensible binding or not. + + + + + The date that the value set status was last changed. + + + + + If a Locked Date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value sets as of the Locked Date. + + + + + A definition of an code system, inlined into the value set. + + + + + When value set includes codes from elsewhere. + + + + + A value set can also be "expanded", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed. + + + + + + + + + A value set specifies a set of codes drawn from one or more code systems. + + + + + + + The name of an individual to contact regarding the value set. + + + + + Contact details for individual (if a name was provided) or the publisher. + + + + + + + + + A value set specifies a set of codes drawn from one or more code systems. + + + + + + + An absolute URI that is used to reference this code system, including in [Coding]{datatypes.html#Coding}.system. + + + + + The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked. + + + + + If code comparison is case sensitive when codes within this system are compared to each other. + + + + + Concepts in the code system. + + + + + + + + + A value set specifies a set of codes drawn from one or more code systems. + + + + + + + Code that identifies concept. + + + + + If this code is not for use as a real concept. + + + + + Text to Display to the user. + + + + + The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept. + + + + + Additional representations for the concept - other languages, aliases, specialised purposes, used for particular purposes, etc. + + + + + Child Concepts (is-a / contains). + + + + + + + + + A value set specifies a set of codes drawn from one or more code systems. + + + + + + + The language this designation is defined for. + + + + + A code that details how this designation would be used. + + + + + The text value for this designation. + + + + + + + + + A value set specifies a set of codes drawn from one or more code systems. + + + + + + + Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri. + + + + + Include one or more codes from a code system. + + + + + Exclude one or more codes from the value set. + + + + + + + + + A value set specifies a set of codes drawn from one or more code systems. + + + + + + + An absolute URI which is the code system from which the selected codes come from. + + + + + The version of the code system that the codes are selected from. + + + + + Specifies a concept to be included or excluded. + + + + + Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true. + + + + + + + + + A value set specifies a set of codes drawn from one or more code systems. + + + + + + + Specifies a code for the concept to be included or excluded. + + + + + The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system. + + + + + Additional representations for this concept when used in this value set - other languages, aliases, specialised purposes, used for particular purposes, etc. + + + + + + + + + A value set specifies a set of codes drawn from one or more code systems. + + + + + + + A code that identifies a property defined in the code system. + + + + + The kind of operation to perform as a part of the filter criteria. + + + + + The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value. + + + + + + + + + A value set specifies a set of codes drawn from one or more code systems. + + + + + + + An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so. + + + + + The time at which the expansion was produced by the expanding system. + + + + + A Parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion. + + + + + The codes that are contained in the value set expansion. + + + + + + + + + A value set specifies a set of codes drawn from one or more code systems. + + + + + + + The name of the parameter. + + + + + The value of the parameter. + + + + + + + + + + + + + + + A value set specifies a set of codes drawn from one or more code systems. + + + + + + + An absolute URI which is the code system in which the code for this item in the expansion is defined. + + + + + If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value. + + + + + The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence. + + + + + Code - if blank, this is not a choosable code. + + + + + User display for the concept. + + + + + Codes contained in this concept. + + + + + + + + + + + The specified property of the code equals the provided value + + + + + Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, including the provided concept itself + + + + + The specified property of the code does not have an is-a relationship with the provided value + + + + + The specified property of the code matches the regex specified in the provided value + + + + + The specified property of the code is in the set of codes or concepts specified in the provided value (comma separated list) + + + + + The specified property of the code is not in the set of codes or concepts specified in the provided value (comma separated list) + + + + + + + The kind of operation to perform as a part of a property based filter + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + An authorization for the supply of glasses and/or contact lenses to a patient. + + + + + An authorization for the supply of glasses and/or contact lenses to a patient. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + Business identifier which may be used by other parties to reference or identify the prescription. + + + + + The date (and perhaps time) when the prescription was written. + + + + + A link to a resource representing the person to whom the Vision products will be supplied. + + + + + The healthcare professional responsible for authorizing the prescription. + + + + + A link to a resource that identifies the particular occurrence of contact between patient and health care provider. + + + + + Can be the reason or the indication for writing the prescription. + + + + + + + Deals with details of the dispense part of the supply specification. + + + + + + + + + An authorization for the supply of glasses and/or contact lenses to a patient. + + + + + + + Identifies the type of Vision correction product which is required for the patient. + + + + + The eye for which the lens applies. + + + + + Lens power measured in diopters (0.25 units). + + + + + Power adjustment for astigmatism measured in diopters (0.25 units). + + + + + Adjustment for astigmatism measured in integer degrees. + + + + + Amount of prism to compensate for eye alignment in fractional units. + + + + + The relative base, or reference lens edge, for the prism. + + + + + Power adjustment for multifocal lenses measured in diopters (0.25 units). + + + + + Contact lens power measured in diopters (0.25 units). + + + + + Back Curvature measured in millimeters. + + + + + Contact lens diameter measured in millimeters. + + + + + The recommended maximum wear period for the lens. + + + + + Special color or pattern. + + + + + Brand recommendations or restrictions. + + + + + Notes for special requirements such as coatings and lens materials. + + + + + + + + + + + top + + + + + bottom + + + + + inner edge + + + + + outer edge + + + + + + + A coded concept listing the base codes. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + right eye + + + + + left eye + + + + + + + A coded concept listing the eye codes. + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/fhir-xhtml.xsd b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/fhir-xhtml.xsd new file mode 100644 index 00000000000..6b16b3488dd --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/fhir-xhtml.xsd @@ -0,0 +1,2516 @@ + + + + + + Generated from "XHTML Refactored (no xsd:groups)" under "XHTML" + + This schema is the patched equivalent of the original published as + [xhtml1-strict.xsd,v 1.2 2002/08/28 08:05:44]. + Fixes in this XSD are workarounds for limitations + present in some .NET APIs. + + + + + XHTML 1.0 (Second Edition) Strict in XML Schema + + This is the same as HTML 4 Strict except for + changes due to the differences between XML and SGML. + + Namespace = http://www.w3.org/1999/xhtml + + For further information, see: http://www.w3.org/TR/xhtml1 + + Copyright (c) 1998-2002 W3C (MIT, INRIA, Keio), + All Rights Reserved. + + The DTD version is identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" + + $Id: xhtml1-strict.xsd,v 1.2 2002/08/28 08:05:44 mimasa Exp $ + + + + + ================ Character mnemonic entities ========================= + + XHTML entity sets are identified by the PUBLIC and SYSTEM identifiers: + + PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN" + SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent" + + PUBLIC "-//W3C//ENTITIES Special for XHTML//EN" + SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent" + + PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN" + SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent" + + + + + ================== Imported Names ==================================== + + + + + + media type, as per [RFC2045] + + + + + + + + comma-separated list of media types, as per [RFC2045] + + + + + + + + a character encoding, as per [RFC2045] + + + + + + + + a space separated list of character encodings, as per [RFC2045] + + + + + + + + a language code, as per [RFC3066] + + + + + + + + a single character, as per section 2.2 of [XML] + + + + + + + + + + one or more digits + + + + + + + + + + tabindex attribute specifies the position of the current element + in the tabbing order for the current document. This value must be + a number between 0 and 32767. User agents should ignore leading zeros. + + + + + + + + + + + space-separated list of link types + + + + + + + + single or comma-separated list of media descriptors + + + + + + + + + + a Uniform Resource Identifier, see [RFC2396] + + + + + + + + a space separated list of Uniform Resource Identifiers + + + + + + + + date and time information. ISO date format + + + + + + + + script expression + + + + + + + + style sheet data + + + + + + + + used for titles etc. + + + + + + + + nn for pixels or nn% for percentage length + + + + + + + + + + pixel, percentage, or relative + + + + + + + + + + integer representing length in pixels + + + + + + + these are used for image maps + + + + + + + + + + + + + + comma separated list of lengths + + + + + + + + + =================== Generic Attributes =============================== + + + + + + core attributes common to most elements + id document-wide unique id + class space separated list of classes + style associated style info + title advisory title/amplification + + + + + + + + + + + internationalization attributes + lang language code (backwards compatible) + xml:lang language code (as per XML 1.0 spec) + dir direction for weak/neutral text + + + + + + + + + + + + + + + + + attributes for common UI events + onclick a pointer button was clicked + ondblclick a pointer button was double clicked + onmousedown a pointer button was pressed down + onmouseup a pointer button was released + onmousemove a pointer was moved onto the element + onmouseout a pointer was moved away from the element + onkeypress a key was pressed and released + onkeydown a key was pressed down + onkeyup a key was released + + + + + + + + + + + + + + + + + attributes for elements that can get the focus + accesskey accessibility key character + tabindex position in tabbing order + onfocus the element got the focus + onblur the element lost the focus + + + + + + + + + + + + + + + =================== Text Elements ==================================== + + + + + + "Inline" covers inline or "text-level" elements + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ================== Block level elements ============================== + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "Flow" mixes block and inline and is used for list items etc. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ================== Content models for exclusions ===================== + + + + + + a elements use "Inline" excluding a + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + pre uses "Inline" excluding big, small, sup or sup + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + form uses "Block" excluding form + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + button uses "Flow" but excludes a, form and form controls + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ================ Document Structure ================================== + + + + + + + + + + + + + + + ================ Document Head ======================================= + + + + + + content model is "head.misc" combined with a single + title and an optional base element in any order + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The title element is not considered part of the flow of text. + It should be displayed, for example as the page header or + window title. Exactly one title is required per document. + + + + + + + + + + + document base URI + + + + + + + + + + + generic metainformation + + + + + + + + + + + + + + + Relationship values can be used in principle: + + a) for document specific toolbars/menus when used + with the link element in document head e.g. + start, contents, previous, next, index, end, help + b) to link to a separate style sheet (rel="stylesheet") + c) to make a link to a script (rel="script") + d) by stylesheets to control how collections of + html nodes are rendered into printed documents + e) to make a link to a printable version of this document + e.g. a PostScript or PDF version (rel="alternate" media="print") + + + + + + + + + + + + + + + + + style info, which may include CDATA sections + + + + + + + + + + + + + + + script statements, which may include CDATA sections + + + + + + + + + + + + + + + + + + + + + alternate content container for non script-based rendering + + + + + + + + + + + + + =================== Document Body ==================================== + + + + + + + + + + + + + + + + + generic language/style container + + + + + + + + + + + + + =================== Paragraphs ======================================= + + + + + + + + + + + + + + =================== Headings ========================================= + + There are six levels of headings from h1 (the most important) + to h6 (the least important). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + =================== Lists ============================================ + + + + + + Unordered list + + + + + + + + + + + + + Ordered (numbered) list + + + + + + + + + + + + + list item + + + + + + + + + + + + + definition lists - dt for term, dd for its definition + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + =================== Address ========================================== + + + + + + information on author + + + + + + + + + + + + + =================== Horizontal Rule ================================== + + + + + + + + + + =================== Preformatted Text ================================ + + + + + + content is "Inline" excluding "img|object|big|small|sub|sup" + + + + + + + + + + + + + + =================== Block-like Quotes ================================ + + + + + + + + + + + + + + + =================== Inserted/Deleted Text ============================ + + ins/del are allowed in block and inline content, but its + inappropriate to include block content within an ins element + occurring in inline content. + + + + + + + + + + + + + + + + + + + + + + + + + + + ================== The Anchor Element ================================ + + + + + + content is "Inline" except that anchors shouldn't be nested + + + + + + + + + + + + + + + + + + + + + + + ===================== Inline Elements ================================ + + + + + + generic language/style container + + + + + + + + + + + + + + I18N BiDi over-ride + + + + + + + + + + + + + + + + + + + + + + + + + forced line break + + + + + + + + + + emphasis + + + + + + + + + + + + + + strong emphasis + + + + + + + + + + + + + + definitional + + + + + + + + + + + + + + program code + + + + + + + + + + + + + + sample + + + + + + + + + + + + + + something user would type + + + + + + + + + + + + + + variable + + + + + + + + + + + + + + citation + + + + + + + + + + + + + + abbreviation + + + + + + + + + + + + + + acronym + + + + + + + + + + + + + + inlined quote + + + + + + + + + + + + + + + subscript + + + + + + + + + + + + + + superscript + + + + + + + + + + + + + + fixed pitch font + + + + + + + + + + + + + + italic font + + + + + + + + + + + + + + bold font + + + + + + + + + + + + + + bigger font + + + + + + + + + + + + + + smaller font + + + + + + + + + + + + + ==================== Object ====================================== + + object is used to embed objects as part of HTML pages. + param elements should precede other content. Parameters + can also be expressed as attribute/value pairs on the + object element itself when brevity is desired. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + param is used to supply a named property value. + In XML it would seem natural to follow RDF and support an + abbreviated syntax where the param elements are replaced + by attribute value pairs on the object start tag. + + + + + + + + + + + + + + + + + + + + + =================== Images =========================================== + + To avoid accessibility problems for people who aren't + able to see the image, you should provide a text + description using the alt and longdesc attributes. + In addition, avoid the use of server-side image maps. + Note that in this DTD there is no name attribute. That + is only available in the transitional and frameset DTD. + + + + + + + + + + + + + + usemap points to a map element which may be in this document + or an external document, although the latter is not widely supported + + + + + + + + + + + + + + + ================== Client-side image maps ============================ + + These can be placed in the same document or grouped in a + separate document although this isn't yet widely supported + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ================ Forms =============================================== + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Each label must not contain more than ONE field + Label elements shouldn't be nested. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + form control + + + + + + + + + + the name attribute is required for all but submit & reset + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + option selector + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + option group + + + + + + + + + + + + + + + + + + + + + selectable choice + + + + + + + + + + + + + + + + + + + + + + + + + + multi-line text field + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The fieldset element is used to group form fields. + Only one legend element should occur in the content + and if present should only be preceded by whitespace. + + NOTE: this content model is different from the XHTML 1.0 DTD, + closer to the intended content model in HTML4 DTD + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fieldset label + + + + + + + + + + + + + + + Content is "Flow" excluding a, form and form controls + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ======================= Tables ======================================= + + Derived from IETF HTML table standard, see [RFC1942] + + + + + + The border attribute sets the thickness of the frame around the + table. The default units are screen pixels. + + The frame attribute specifies which parts of the frame around + the table should be rendered. The values are not the same as + CALS to avoid a name clash with the valign attribute. + + + + + + + + + + + + + + + + + + The rules attribute defines which rules to draw between cells: + + If rules is absent then assume: + "none" if border is absent or border="0" otherwise "all" + + + + + + + + + + + + + + horizontal alignment attributes for cell contents + + char alignment char, e.g. char=':' + charoff offset for alignment char + + + + + + + + + + + + + + + + + + + + vertical alignment attributes for cell contents + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Use thead to duplicate headers when breaking table + across page boundaries, or for static headers when + tbody sections are rendered in scrolling panel. + + Use tfoot to duplicate footers when breaking table + across page boundaries, or for static footers when + tbody sections are rendered in scrolling panel. + + Use multiple tbody sections when rules are needed + between groups of table rows. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + colgroup groups a set of col elements. It allows you to group + several semantically related columns together. + + + + + + + + + + + + + + + + + col elements define the alignment properties for cells in + one or more columns. + + The width attribute specifies the width of the columns, e.g. + + width=64 width in screen pixels + width=0.5* relative width of 0.5 + + The span attribute causes the attributes of one + col element to apply to more than one column. + + + + + + + + + + + + + + + + + + + + + + + + + Scope is simpler than headers attribute for common tables + + + + + + + + + + + + th is for headers, td for data and for cells acting as both + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/flag.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/flag.sch new file mode 100644 index 00000000000..c73847b897d --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/flag.sch @@ -0,0 +1,84 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Flag + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/goal.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/goal.sch new file mode 100644 index 00000000000..2f6ee8d7aa6 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/goal.sch @@ -0,0 +1,87 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Goal + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/group.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/group.sch new file mode 100644 index 00000000000..c3316bc501a --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/group.sch @@ -0,0 +1,104 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Group + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + grp-1: Can only have members if group is "actual" + grp-4: Can't have more members associated with the group than the value specified for "quantity" + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + rng-2: If present, low SHALL have a lower value than high + rng-3: Quantity values cannot have a comparator when used in a Range + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + grp-3: Member resource types SHALL agree with group type + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/healthcareservice.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/healthcareservice.sch new file mode 100644 index 00000000000..ad2e21fa765 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/healthcareservice.sch @@ -0,0 +1,126 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + HealthcareService + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + att-1: It the Attachment has data, it SHALL have a contentType + + + cpt-2: A system is required if a value is provided. + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/imagingobjectselection.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/imagingobjectselection.sch new file mode 100644 index 00000000000..482a3c33303 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/imagingobjectselection.sch @@ -0,0 +1,63 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + ImagingObjectSelection + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/imagingstudy.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/imagingstudy.sch new file mode 100644 index 00000000000..02f3337bf25 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/imagingstudy.sch @@ -0,0 +1,99 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + ImagingStudy + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + att-1: It the Attachment has data, it SHALL have a contentType + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/immunization.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/immunization.sch new file mode 100644 index 00000000000..be2a933d141 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/immunization.sch @@ -0,0 +1,142 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Immunization + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + imm-2: If immunization was administered (wasNotGiven=false) then explanation.reasonNotGiven SHALL be absent. + imm-1: If immunization was not administred (wasNotGiven=true) then there SHALL be no reaction nor explanation.reason present + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/immunizationrecommendation.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/immunizationrecommendation.sch new file mode 100644 index 00000000000..09a2141414e --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/immunizationrecommendation.sch @@ -0,0 +1,93 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + ImmunizationRecommendation + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/list.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/list.sch new file mode 100644 index 00000000000..852af2f0afe --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/list.sch @@ -0,0 +1,100 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + List + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + lst-2: The deleted flag can only be used if the mode of the list is "changes" + lst-1: A list can only have an emptyReason if it is empty + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/location.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/location.sch new file mode 100644 index 00000000000..87558cd712b --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/location.sch @@ -0,0 +1,90 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Location + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + cpt-2: A system is required if a value is provided. + + + per-1: If present, start SHALL have a lower value than end + + + per-1: If present, start SHALL have a lower value than end + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/media.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/media.sch new file mode 100644 index 00000000000..5245207ffce --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/media.sch @@ -0,0 +1,90 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Media + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + mda-1: Height can only be used for a photo or video + mda-2: Width can only be used for a photo or video + mda-3: Frames can only be used for a photo + mda-4: Length can only be used for an audio or a video + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + att-1: It the Attachment has data, it SHALL have a contentType + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/medication.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/medication.sch new file mode 100644 index 00000000000..cc0a934cf0e --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/medication.sch @@ -0,0 +1,90 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Medication + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + rat-1: numerator and denominator SHALL both be present, or both be absent. If both are absent, there SHALL be some extension present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + qty-3: If a code for the units is present, the system SHALL also be present + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/medicationadministration.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/medicationadministration.sch new file mode 100644 index 00000000000..db96b4d716e --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/medicationadministration.sch @@ -0,0 +1,141 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + MedicationAdministration + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + mad-2: Reason not given is only permitted if wasNotGiven is true + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + mad-3: Reason given is only permitted if wasNotGiven is false + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + mad-1: SHALL have at least one of dosage.quantity and dosage.rate + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + rat-1: numerator and denominator SHALL both be present, or both be absent. If both are absent, there SHALL be some extension present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/medicationdispense.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/medicationdispense.sch new file mode 100644 index 00000000000..abebb4b90e6 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/medicationdispense.sch @@ -0,0 +1,203 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + MedicationDispense + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + mdd-1: whenHandedOver cannot be before whenPrepared + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + tim-6: If there's a periodMax, there must be a period + tim-7: If there's a durationMax, there must be a duration + tim-1: if there's a duration, there needs to be duration units + tim-2: if there's a period, there needs to be duration units + tim-3: Either frequency or when can exist, not both + + + per-1: If present, start SHALL have a lower value than end + + + tim-4: duration SHALL be a non-negative value + + + tim-5: period SHALL be a non-negative value + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + rng-2: If present, low SHALL have a lower value than high + rng-3: Quantity values cannot have a comparator when used in a Range + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + rat-1: numerator and denominator SHALL both be present, or both be absent. If both are absent, there SHALL be some extension present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + rat-1: numerator and denominator SHALL both be present, or both be absent. If both are absent, there SHALL be some extension present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/medicationprescription.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/medicationprescription.sch new file mode 100644 index 00000000000..082fc5cf641 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/medicationprescription.sch @@ -0,0 +1,206 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + MedicationPrescription + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + tim-6: If there's a periodMax, there must be a period + tim-7: If there's a durationMax, there must be a duration + tim-1: if there's a duration, there needs to be duration units + tim-2: if there's a period, there needs to be duration units + tim-3: Either frequency or when can exist, not both + + + per-1: If present, start SHALL have a lower value than end + + + tim-4: duration SHALL be a non-negative value + + + tim-5: period SHALL be a non-negative value + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + rng-2: If present, low SHALL have a lower value than high + rng-3: Quantity values cannot have a comparator when used in a Range + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + rat-1: numerator and denominator SHALL both be present, or both be absent. If both are absent, there SHALL be some extension present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + rat-1: numerator and denominator SHALL both be present, or both be absent. If both are absent, there SHALL be some extension present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + per-1: If present, start SHALL have a lower value than end + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/medicationstatement.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/medicationstatement.sch new file mode 100644 index 00000000000..12d2cf46874 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/medicationstatement.sch @@ -0,0 +1,172 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + MedicationStatement + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + mst-1: Reason not taken is only permitted if wasNotTaken is true + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + mst-2: Reason for use is only permitted if wasNotTaken is false + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + mst-2: Reason for use is only permitted if wasNotTaken is false + + + ref-1: SHALL have a local reference if the resource is provided inline + + + per-1: If present, start SHALL have a lower value than end + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + tim-6: If there's a periodMax, there must be a period + tim-7: If there's a durationMax, there must be a duration + tim-1: if there's a duration, there needs to be duration units + tim-2: if there's a period, there needs to be duration units + tim-3: Either frequency or when can exist, not both + + + per-1: If present, start SHALL have a lower value than end + + + tim-4: duration SHALL be a non-negative value + + + tim-5: period SHALL be a non-negative value + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + rat-1: numerator and denominator SHALL both be present, or both be absent. If both are absent, there SHALL be some extension present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + rat-1: numerator and denominator SHALL both be present, or both be absent. If both are absent, there SHALL be some extension present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/messageheader.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/messageheader.sch new file mode 100644 index 00000000000..29b80d7539d --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/messageheader.sch @@ -0,0 +1,87 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + MessageHeader + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cpt-2: A system is required if a value is provided. + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/namingsystem.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/namingsystem.sch new file mode 100644 index 00000000000..e0e859c9ff5 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/namingsystem.sch @@ -0,0 +1,74 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + NamingSystem + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + nsd-1: Root systems cannot have uuid or sid identifiers + nsd-3: Can only have replacedBy if namingsystem is retired + nsd-2: Can't have more than one preferred identifier for a type + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + cpt-2: A system is required if a value is provided. + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/nutritionorder.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/nutritionorder.sch new file mode 100644 index 00000000000..005a91e7208 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/nutritionorder.sch @@ -0,0 +1,237 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + NutritionOrder + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + nor-1: Nutrition Order SHALL contain either Oral Diet , Supplement, or Enteral Formula class + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + tim-6: If there's a periodMax, there must be a period + tim-7: If there's a durationMax, there must be a duration + tim-1: if there's a duration, there needs to be duration units + tim-2: if there's a period, there needs to be duration units + tim-3: Either frequency or when can exist, not both + + + per-1: If present, start SHALL have a lower value than end + + + tim-4: duration SHALL be a non-negative value + + + tim-5: period SHALL be a non-negative value + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + tim-6: If there's a periodMax, there must be a period + tim-7: If there's a durationMax, there must be a duration + tim-1: if there's a duration, there needs to be duration units + tim-2: if there's a period, there needs to be duration units + tim-3: Either frequency or when can exist, not both + + + per-1: If present, start SHALL have a lower value than end + + + tim-4: duration SHALL be a non-negative value + + + tim-5: period SHALL be a non-negative value + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + tim-6: If there's a periodMax, there must be a period + tim-7: If there's a durationMax, there must be a duration + tim-1: if there's a duration, there needs to be duration units + tim-2: if there's a period, there needs to be duration units + tim-3: Either frequency or when can exist, not both + + + per-1: If present, start SHALL have a lower value than end + + + tim-4: duration SHALL be a non-negative value + + + tim-5: period SHALL be a non-negative value + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + rat-1: numerator and denominator SHALL both be present, or both be absent. If both are absent, there SHALL be some extension present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/observation.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/observation.sch new file mode 100644 index 00000000000..f6b614c0fc4 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/observation.sch @@ -0,0 +1,247 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Observation + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + obs-7: Component code Shall not be same as observation code + obs-6: Shall only be present if Observation.value[x] is not present + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + rng-2: If present, low SHALL have a lower value than high + rng-3: Quantity values cannot have a comparator when used in a Range + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + rat-1: numerator and denominator SHALL both be present, or both be absent. If both are absent, there SHALL be some extension present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + att-1: It the Attachment has data, it SHALL have a contentType + + + per-1: If present, start SHALL have a lower value than end + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + obs-3: Must have at least a low or a high or text + + + obs-4: Low range comparators can only be '>' or '>=' or empty + + + qty-3: If a code for the units is present, the system SHALL also be present + + + obs-5: High range comparators can only be '<' or '<=' or empty + + + qty-3: If a code for the units is present, the system SHALL also be present + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + rng-2: If present, low SHALL have a lower value than high + rng-3: Quantity values cannot have a comparator when used in a Range + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + rng-2: If present, low SHALL have a lower value than high + rng-3: Quantity values cannot have a comparator when used in a Range + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + rat-1: numerator and denominator SHALL both be present, or both be absent. If both are absent, there SHALL be some extension present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + att-1: It the Attachment has data, it SHALL have a contentType + + + per-1: If present, start SHALL have a lower value than end + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/operationdefinition.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/operationdefinition.sch new file mode 100644 index 00000000000..f1243ad86ac --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/operationdefinition.sch @@ -0,0 +1,69 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + OperationDefinition + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cpt-2: A system is required if a value is provided. + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + opd-1: Either a type must be provided, or parts + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/operationoutcome.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/operationoutcome.sch new file mode 100644 index 00000000000..02169b1eab1 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/operationoutcome.sch @@ -0,0 +1,57 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + OperationOutcome + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/order.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/order.sch new file mode 100644 index 00000000000..d340675422d --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/order.sch @@ -0,0 +1,118 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Order + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ord-1: Provide a code or a schedule, but not both + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + tim-6: If there's a periodMax, there must be a period + tim-7: If there's a durationMax, there must be a duration + tim-1: if there's a duration, there needs to be duration units + tim-2: if there's a period, there needs to be duration units + tim-3: Either frequency or when can exist, not both + + + per-1: If present, start SHALL have a lower value than end + + + tim-4: duration SHALL be a non-negative value + + + tim-5: period SHALL be a non-negative value + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/orderresponse.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/orderresponse.sch new file mode 100644 index 00000000000..23dd5524b35 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/orderresponse.sch @@ -0,0 +1,81 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + OrderResponse + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/organization.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/organization.sch new file mode 100644 index 00000000000..ebc0f9a1e70 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/organization.sch @@ -0,0 +1,108 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Organization + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + org-1: The organization SHALL at least have a name or an id, and possibly more than one + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + org-3: The telecom of an organization can never be of use 'home' + + + cpt-2: A system is required if a value is provided. + + + per-1: If present, start SHALL have a lower value than end + + + org-2: An address of an organization can never be of use 'home' + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + cpt-2: A system is required if a value is provided. + + + per-1: If present, start SHALL have a lower value than end + + + per-1: If present, start SHALL have a lower value than end + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/patient.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/patient.sch new file mode 100644 index 00000000000..3f8d8f3baaa --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/patient.sch @@ -0,0 +1,144 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Patient + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + per-1: If present, start SHALL have a lower value than end + + + cpt-2: A system is required if a value is provided. + + + per-1: If present, start SHALL have a lower value than end + + + per-1: If present, start SHALL have a lower value than end + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + att-1: It the Attachment has data, it SHALL have a contentType + + + pat-1: SHALL at least contain a contact's details or a reference to an organization + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + cpt-2: A system is required if a value is provided. + + + per-1: If present, start SHALL have a lower value than end + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + per-1: If present, start SHALL have a lower value than end + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/paymentnotice.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/paymentnotice.sch new file mode 100644 index 00000000000..6ddf669c263 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/paymentnotice.sch @@ -0,0 +1,87 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + PaymentNotice + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/paymentreconciliation.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/paymentreconciliation.sch new file mode 100644 index 00000000000..c3dd8ec881a --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/paymentreconciliation.sch @@ -0,0 +1,111 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + PaymentReconciliation + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + qty-3: If a code for the units is present, the system SHALL also be present + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + cod-1: If a valueSet is provided, a system URI Is required + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/person.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/person.sch new file mode 100644 index 00000000000..4f5c1954d43 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/person.sch @@ -0,0 +1,84 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Person + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + per-1: If present, start SHALL have a lower value than end + + + cpt-2: A system is required if a value is provided. + + + per-1: If present, start SHALL have a lower value than end + + + per-1: If present, start SHALL have a lower value than end + + + att-1: It the Attachment has data, it SHALL have a contentType + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/practitioner.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/practitioner.sch new file mode 100644 index 00000000000..3090b3e3eeb --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/practitioner.sch @@ -0,0 +1,132 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Practitioner + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + per-1: If present, start SHALL have a lower value than end + + + cpt-2: A system is required if a value is provided. + + + per-1: If present, start SHALL have a lower value than end + + + per-1: If present, start SHALL have a lower value than end + + + att-1: It the Attachment has data, it SHALL have a contentType + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/procedure.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/procedure.sch new file mode 100644 index 00000000000..073931dcdea --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/procedure.sch @@ -0,0 +1,147 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Procedure + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/procedurerequest.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/procedurerequest.sch new file mode 100644 index 00000000000..9be1b90c40f --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/procedurerequest.sch @@ -0,0 +1,127 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + ProcedureRequest + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + tim-6: If there's a periodMax, there must be a period + tim-7: If there's a durationMax, there must be a duration + tim-1: if there's a duration, there needs to be duration units + tim-2: if there's a period, there needs to be duration units + tim-3: Either frequency or when can exist, not both + + + per-1: If present, start SHALL have a lower value than end + + + tim-4: duration SHALL be a non-negative value + + + tim-5: period SHALL be a non-negative value + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/processrequest.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/processrequest.sch new file mode 100644 index 00000000000..2df78de2857 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/processrequest.sch @@ -0,0 +1,87 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + ProcessRequest + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + per-1: If present, start SHALL have a lower value than end + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/processresponse.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/processresponse.sch new file mode 100644 index 00000000000..36d5d023123 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/processresponse.sch @@ -0,0 +1,93 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + ProcessResponse + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/provenance.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/provenance.sch new file mode 100644 index 00000000000..3688f501139 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/provenance.sch @@ -0,0 +1,84 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Provenance + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + per-1: If present, start SHALL have a lower value than end + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/questionnaire.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/questionnaire.sch new file mode 100644 index 00000000000..db8c6b14f7f --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/questionnaire.sch @@ -0,0 +1,84 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Questionnaire + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + que-2: The link ids for groups and questions must be unique within the questionnaire + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cpt-2: A system is required if a value is provided. + + + per-1: If present, start SHALL have a lower value than end + + + que-1: Groups may either contain questions or groups but not both + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/questionnaireanswers.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/questionnaireanswers.sch new file mode 100644 index 00000000000..c1962bb2fee --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/questionnaireanswers.sch @@ -0,0 +1,96 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + QuestionnaireAnswers + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + qan-1: Groups may either contain questions or groups but not both + + + ref-1: SHALL have a local reference if the resource is provided inline + + + att-1: It the Attachment has data, it SHALL have a contentType + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/referralrequest.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/referralrequest.sch new file mode 100644 index 00000000000..913a6227ac7 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/referralrequest.sch @@ -0,0 +1,111 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + ReferralRequest + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + per-1: If present, start SHALL have a lower value than end + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/relatedperson.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/relatedperson.sch new file mode 100644 index 00000000000..2b52664d53f --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/relatedperson.sch @@ -0,0 +1,90 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + RelatedPerson + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + cpt-2: A system is required if a value is provided. + + + per-1: If present, start SHALL have a lower value than end + + + per-1: If present, start SHALL have a lower value than end + + + att-1: It the Attachment has data, it SHALL have a contentType + + + per-1: If present, start SHALL have a lower value than end + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/riskassessment.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/riskassessment.sch new file mode 100644 index 00000000000..811e32073cb --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/riskassessment.sch @@ -0,0 +1,122 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + RiskAssessment + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ras-2: Must be <= 100 + + + ras-1: low and high must be percentages, if present + + + rng-2: If present, low SHALL have a lower value than high + rng-3: Quantity values cannot have a comparator when used in a Range + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + rng-2: If present, low SHALL have a lower value than high + rng-3: Quantity values cannot have a comparator when used in a Range + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/schedule.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/schedule.sch new file mode 100644 index 00000000000..fe52dad773b --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/schedule.sch @@ -0,0 +1,75 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Schedule + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + per-1: If present, start SHALL have a lower value than end + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/searchparameter.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/searchparameter.sch new file mode 100644 index 00000000000..64f67470d84 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/searchparameter.sch @@ -0,0 +1,57 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + SearchParameter + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cpt-2: A system is required if a value is provided. + + + per-1: If present, start SHALL have a lower value than end + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/slot.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/slot.sch new file mode 100644 index 00000000000..232a425d34d --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/slot.sch @@ -0,0 +1,72 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Slot + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/specimen.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/specimen.sch new file mode 100644 index 00000000000..cfcf18aab31 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/specimen.sch @@ -0,0 +1,153 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Specimen + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + per-1: If present, start SHALL have a lower value than end + + + qty-3: If a code for the units is present, the system SHALL also be present + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/structuredefinition.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/structuredefinition.sch new file mode 100644 index 00000000000..1bbd6cfa64a --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/structuredefinition.sch @@ -0,0 +1,160 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + StructureDefinition + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + sdf-8: In any snapshot or differential, all the elements except the first have to have a path that starts with the path of the first + "." + sdf-7: If the type is Resource or Type, the url has to start with "http://hl7.org/fhir/StructureDefinition/" and the tail must match the name + sdf-6: A structure must have either a differential, or a snapshot (or both) + sdf-5: If the type is 'extension' then the structure must have context information + sdf-4: A structure must have a base unless it’s type is 'abstract' + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + cpt-2: A system is required if a value is provided. + + + per-1: If present, start SHALL have a lower value than end + + + cod-1: If a valueSet is provided, a system URI Is required + + + sdf-2: Must have at a name or a uri (or both) + + + sdf-3: If a structure is a snapshot, then each element definition must have a formal definition, and cardinalities + sdf-1: Element paths must be unique - or not (LM) + + + eld-2: Min <= Max + eld-5: Either a namereference or a fixed value (but not both) is permitted + eld-7: Pattern may only be specified if there is one type + eld-6: Fixed value may only be specified if there is one type + eld-11: Binding can only be present for coded elements, string, and uri + eld-8: Pattern and value are mutually exclusive + eld-14: Constraints must be unique by key + eld-13: Types must be unique by the combination of code and profile + eld-16: default value and meaningWhenMissing are mutually exclusive + eld-15: Constraint names must be unique. + + + cod-1: If a valueSet is provided, a system URI Is required + + + eld-1: If there are no discriminators, there must be a definition + + + eld-3: Max SHALL be a number or "*" + + + eld-4: Aggregation may only be specified if one of the allowed types for the element is a resource + + + eld-10: provide either a reference or a description (or both) + eld-9: Example value sets are always extensible + + + eld-12: uri SHALL start with http:// or https:// + + + ref-1: SHALL have a local reference if the resource is provided inline + + + eld-2: Min <= Max + eld-5: Either a namereference or a fixed value (but not both) is permitted + eld-7: Pattern may only be specified if there is one type + eld-6: Fixed value may only be specified if there is one type + eld-11: Binding can only be present for coded elements, string, and uri + eld-8: Pattern and value are mutually exclusive + eld-14: Constraints must be unique by key + eld-13: Types must be unique by the combination of code and profile + eld-16: default value and meaningWhenMissing are mutually exclusive + eld-15: Constraint names must be unique. + + + cod-1: If a valueSet is provided, a system URI Is required + + + eld-1: If there are no discriminators, there must be a definition + + + eld-3: Max SHALL be a number or "*" + + + eld-4: Aggregation may only be specified if one of the allowed types for the element is a resource + + + eld-10: provide either a reference or a description (or both) + eld-9: Example value sets are always extensible + + + eld-12: uri SHALL start with http:// or https:// + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/subscription.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/subscription.sch new file mode 100644 index 00000000000..e317f8504a1 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/subscription.sch @@ -0,0 +1,60 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Subscription + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cpt-2: A system is required if a value is provided. + + + per-1: If present, start SHALL have a lower value than end + + + cod-1: If a valueSet is provided, a system URI Is required + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/substance.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/substance.sch new file mode 100644 index 00000000000..d88f545eb18 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/substance.sch @@ -0,0 +1,84 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Substance + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + qty-3: If a code for the units is present, the system SHALL also be present + + + rat-1: numerator and denominator SHALL both be present, or both be absent. If both are absent, there SHALL be some extension present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + qty-3: If a code for the units is present, the system SHALL also be present + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/supply.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/supply.sch new file mode 100644 index 00000000000..cc0d87a6366 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/supply.sch @@ -0,0 +1,111 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + Supply + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/supplydelivery.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/supplydelivery.sch new file mode 100644 index 00000000000..0425fdc9a12 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/supplydelivery.sch @@ -0,0 +1,90 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + SupplyDelivery + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/supplyrequest.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/supplyrequest.sch new file mode 100644 index 00000000000..31cd9d9c7c5 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/supplyrequest.sch @@ -0,0 +1,75 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + SupplyRequest + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/testscript.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/testscript.sch new file mode 100644 index 00000000000..4f3c197d38e --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/testscript.sch @@ -0,0 +1,66 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + TestScript + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + inv-1: SHALL contain a "uri" or "resource" but not both. + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/valueset.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/valueset.sch new file mode 100644 index 00000000000..ef6f8b161d5 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/valueset.sch @@ -0,0 +1,95 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + ValueSet + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + vsd-7: A defined code system (if present) SHALL have a different identifier to the value set itself + vsd-2: A value set with only one import SHALL also have an include and/or an exclude unless the value set defines its own codes + vsd-5: Value set SHALL contain either a define, a compose, or an expansion element + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + cpt-2: A system is required if a value is provided. + + + per-1: If present, start SHALL have a lower value than end + + + vsd-8: Codes must be unique + vsd-3: Within a code system definition, all the codes SHALL be unique + + + cod-1: If a valueSet is provided, a system URI Is required + + + vsd-1: A value set composition SHALL have an include or an import + + + vsd-6: SHALL have a code or a display + vsd-9: Must have a code if not abstract + vsd-10: Must have a system if a code is present + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/visionprescription.sch b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/visionprescription.sch new file mode 100644 index 00000000000..c01f38e30e5 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/visionprescription.sch @@ -0,0 +1,87 @@ + + + + + + + Global + + global-1: All FHIR elements must have a @value or children + + + + VisionPrescription + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + dom-2: If the resource is contained in another resource, it SHALL not contain nested Resources + dom-1: If the resource is contained in another resource, it SHALL not contain any narrative + dom-4: If a resource is contained in another resource, it SHALL not have a meta.versionId or a meta.lastUpdated + dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + + + txt-3: The narrative SHALL contain only the basic html formatting attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-1: The narrative SHALL contain only the basic html formatting elements described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, <a> elements (either name or href), images and internally contained style attributes + txt-2: The narrative SHALL have some non-whitespace content + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + cod-1: If a valueSet is provided, a system URI Is required + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + per-1: If present, start SHALL have a lower value than end + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ref-1: SHALL have a local reference if the resource is provided inline + + + ccc-2: Only one coding in a set can be chosen directly by the user + + + cod-1: If a valueSet is provided, a system URI Is required + + + ref-1: SHALL have a local reference if the resource is provided inline + + + cod-1: If a valueSet is provided, a system URI Is required + + + qty-3: If a code for the units is present, the system SHALL also be present + + + diff --git a/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/xml.xsd b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/xml.xsd new file mode 100644 index 00000000000..efe005d46d8 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/xml.xsd @@ -0,0 +1,272 @@ + + + + + + +
+

About the XML namespace

+
+

+ This schema document describes the XML namespace, in a form + suitable for import by other schema documents. +

+

+ See + http://www.w3.org/XML/1998/namespace.html and + + http://www.w3.org/TR/REC-xml for information + about this namespace. +

+

+ Note that local names in this namespace are intended to be + defined only by the World Wide Web Consortium or its subgroups. + The names currently defined in this namespace are listed below. + They should not be used with conflicting semantics by any Working + Group, specification, or document instance. +

+

+ See further below in this document for more information about how to refer to this schema document from your own + XSD schema documents and about the + namespace-versioning policy governing this schema document. +

+
+
+
+
+ + + +
+

lang (as an attribute name)

+

+ denotes an attribute whose value + is a language code for the natural language of the content of + any element; its value is inherited. This name is reserved + by virtue of its definition in the XML specification.

+
+
+

Notes

+

+ Attempting to install the relevant ISO 2- and 3-letter + codes as the enumerated possible values is probably never + going to be a realistic possibility. +

+

+ See BCP 47 at + http://www.rfc-editor.org/rfc/bcp/bcp47.txt + and the IANA language subtag registry at + + http://www.iana.org/assignments/language-subtag-registry + for further information. +

+

+ The union allows for the 'un-declaration' of xml:lang with + the empty string. +

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

space (as an attribute name)

+

+ denotes an attribute whose + value is a keyword indicating what whitespace processing + discipline is intended for the content of the element; its + value is inherited. This name is reserved by virtue of its + definition in the XML specification.

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

base (as an attribute name)

+

+ denotes an attribute whose value + provides a URI to be used as the base for interpreting any + relative URIs in the scope of the element on which it + appears; its value is inherited. This name is reserved + by virtue of its definition in the XML Base specification.

+

+ See http://www.w3.org/TR/xmlbase/ + for information about this attribute. +

+
+
+
+
+ + + +
+

id (as an attribute name)

+

+ denotes an attribute whose value + should be interpreted as if declared to be of type ID. + This name is reserved by virtue of its definition in the + xml:id specification.

+

+ See http://www.w3.org/TR/xml-id/ + for information about this attribute. +

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

Father (in any context at all)

+
+

+ denotes Jon Bosak, the chair of + the original XML Working Group. This name is reserved by + the following decision of the W3C XML Plenary and + XML Coordination groups: +

+
+

+ In appreciation for his vision, leadership and + dedication the W3C XML Plenary on this 10th day of + February, 2000, reserves for Jon Bosak in perpetuity + the XML name "xml:Father". +

+
+
+
+
+
+ + +
+

+ About this schema document +

+
+

+ This schema defines attributes and an attribute group suitable + for use by schemas wishing to allow xml:base, + xml:lang, xml:space or + xml:id attributes on elements they define. +

+

+ To enable this, such a schema must import this schema for + the XML namespace, e.g. as follows: +

+
+          <schema . . .>
+           . . .
+           <import namespace="http://www.w3.org/XML/1998/namespace"
+                      schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+     
+

+ or +

+
+           <import namespace="http://www.w3.org/XML/1998/namespace"
+                      schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>
+     
+

+ Subsequently, qualified reference to any of the attributes or the + group defined below will have the desired effect, e.g. +

+
+          <type . . .>
+           . . .
+           <attributeGroup ref="xml:specialAttrs"/>
+     
+

+ will define a type which will schema-validate an instance element + with any of those attributes. +

+
+
+
+
+ + +
+

+ Versioning policy for this schema document +

+
+

+ In keeping with the XML Schema WG's standard versioning + policy, this schema document will persist at + + http://www.w3.org/2009/01/xml.xsd. +

+

+ At the date of issue it can also be found at + + http://www.w3.org/2001/xml.xsd. +

+

+ The schema document at that URI may however change in the future, + in order to remain compatible with the latest version of XML + Schema itself, or with the XML namespace itself. In other words, + if the XML Schema or XML namespaces change, the version of this + document at + http://www.w3.org/2001/xml.xsd + + will change accordingly; the version at + + http://www.w3.org/2009/01/xml.xsd + + will not change. +

+

+ Previous dated (and unchanging) versions of this schema + document are at: +

+ +
+
+
+
+
diff --git a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/BinaryHl7OrgDstu2Test.java b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/BinaryHl7OrgDstu2Test.java new file mode 100644 index 00000000000..a2f4a5741bf --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/BinaryHl7OrgDstu2Test.java @@ -0,0 +1,236 @@ +package ca.uhn.fhir.rest.server; + +import static org.hamcrest.Matchers.*; +import static org.junit.Assert.*; + +import java.util.Collections; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ByteArrayEntity; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.instance.model.Binary; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.model.primitive.IdDt; +import ca.uhn.fhir.rest.annotation.Create; +import ca.uhn.fhir.rest.annotation.IdParam; +import ca.uhn.fhir.rest.annotation.Read; +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.util.PortUtil; + +/** + * Created by dsotnikov on 2/25/2014. + */ +public class BinaryHl7OrgDstu2Test { + + private static CloseableHttpClient ourClient; + private static FhirContext ourCtx = FhirContext.forDstu2Hl7Org(); + private static Binary ourLast; + + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(BinaryHl7OrgDstu2Test.class); + + private static int ourPort; + + private static Server ourServer; + + @Before + public void before() { + ourLast = null; + } + + @Test + public void testReadWithExplicitTypeXml() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Binary/foo?_format=xml"); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent(), "UTF-8"); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info(responseContent); + + assertEquals(200, status.getStatusLine().getStatusCode()); + assertThat(status.getFirstHeader("content-type").getValue(), startsWith(Constants.CT_FHIR_XML + ";")); + + Binary bin = ourCtx.newXmlParser().parseResource(Binary.class, responseContent); + assertEquals("foo", bin.getContentType()); + assertArrayEquals(new byte[] { 1, 2, 3, 4 }, bin.getContent()); + } + + @Test + public void testReadWithExplicitTypeJson() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Binary/foo?_format=json"); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent(), "UTF-8"); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info(responseContent); + + assertEquals(200, status.getStatusLine().getStatusCode()); + assertThat(status.getFirstHeader("content-type").getValue(), startsWith(Constants.CT_FHIR_JSON + ";")); + + Binary bin = ourCtx.newJsonParser().parseResource(Binary.class, responseContent); + assertEquals("foo", bin.getContentType()); + assertArrayEquals(new byte[] { 1, 2, 3, 4 }, bin.getContent()); + } + + + @Test + public void testCreate() throws Exception { + HttpPost http = new HttpPost("http://localhost:" + ourPort + "/Binary"); + http.setEntity(new ByteArrayEntity(new byte[] { 1, 2, 3, 4 }, ContentType.create("foo/bar", "UTF-8"))); + + HttpResponse status = ourClient.execute(http); + assertEquals(201, status.getStatusLine().getStatusCode()); + + assertEquals("foo/bar; charset=UTF-8", ourLast.getContentType()); + assertArrayEquals(new byte[] { 1, 2, 3, 4 }, ourLast.getContent()); + + } + + public void testCreateWrongType() throws Exception { + Binary res = new Binary(); + res.setContent(new byte[] { 1, 2, 3, 4 }); + res.setContentType("text/plain"); + String stringContent = ourCtx.newJsonParser().encodeResourceToString(res); + + HttpPost http = new HttpPost("http://localhost:" + ourPort + "/Binary"); + http.setEntity(new StringEntity(stringContent, ContentType.create(Constants.CT_FHIR_JSON, "UTF-8"))); + + HttpResponse status = ourClient.execute(http); + assertEquals(201, status.getStatusLine().getStatusCode()); + + assertEquals("text/plain", ourLast.getContentType()); + assertArrayEquals(new byte[] { 1, 2, 3, 4 }, ourLast.getContent()); + + } + + @Test + public void testRead() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Binary/foo"); + HttpResponse status = ourClient.execute(httpGet); + byte[] responseContent = IOUtils.toByteArray(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); + assertEquals("foo", status.getFirstHeader("content-type").getValue()); + assertArrayEquals(new byte[] { 1, 2, 3, 4 }, responseContent); + + } + + @Test + public void testSearchJson() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Binary?_pretty=true&_format=json"); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); + assertEquals(Constants.CT_FHIR_JSON + "; charset=UTF-8", status.getFirstHeader("content-type").getValue()); + + ourLog.info(responseContent); + + org.hl7.fhir.instance.model.Bundle bundle = ourCtx.newJsonParser().parseResource(org.hl7.fhir.instance.model.Bundle.class, responseContent); + Binary bin = (Binary) bundle.getEntry().get(0).getResource(); + + assertEquals("text/plain", bin.getContentType()); + assertArrayEquals(new byte[] { 1, 2, 3, 4 }, bin.getContent()); + } + + @Test + public void testSearchXml() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Binary?_pretty=true"); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); + assertEquals(Constants.CT_FHIR_XML + "; charset=UTF-8", status.getFirstHeader("content-type").getValue()); + + ourLog.info(responseContent); + + org.hl7.fhir.instance.model.Bundle bundle = ourCtx.newXmlParser().parseResource(org.hl7.fhir.instance.model.Bundle.class, responseContent); + Binary bin = (Binary) bundle.getEntry().get(0).getResource(); + + assertEquals("text/plain", bin.getContentType()); + assertArrayEquals(new byte[] { 1, 2, 3, 4 }, bin.getContent()); + } + + @AfterClass + public static void afterClass() throws Exception { + ourServer.stop(); + } + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + ResourceProvider patientProvider = new ResourceProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + servlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + /** + * Created by dsotnikov on 2/25/2014. + */ + public static class ResourceProvider implements IResourceProvider { + + @Create + public MethodOutcome create(@ResourceParam Binary theBinary) { + ourLast = theBinary; + return new MethodOutcome(new IdDt("1")); + } + + @Override + public Class getResourceType() { + return Binary.class; + } + + @Read + public Binary read(@IdParam IdDt theId) { + Binary retVal = new Binary(); + retVal.setId("1"); + retVal.setContent(new byte[] { 1, 2, 3, 4 }); + retVal.setContentType(theId.getIdPart()); + return retVal; + } + + @Search + public List search() { + Binary retVal = new Binary(); + retVal.setId("1"); + retVal.setContent(new byte[] { 1, 2, 3, 4 }); + retVal.setContentType("text/plain"); + return Collections.singletonList(retVal); + } + + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/BundleTypeInResponseHl7OrgTest.java b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/BundleTypeInResponseHl7OrgTest.java new file mode 100644 index 00000000000..5b3ae2c394e --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/BundleTypeInResponseHl7OrgTest.java @@ -0,0 +1,105 @@ +package ca.uhn.fhir.rest.server; + +import static org.junit.Assert.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.instance.model.Bundle.BundleType; +import org.hl7.fhir.instance.model.Patient; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.narrative.DefaultThymeleafNarrativeGenerator; +import ca.uhn.fhir.rest.annotation.Search; +import ca.uhn.fhir.util.PortUtil; + +/** + * Created by dsotnikov on 2/25/2014. + */ +public class BundleTypeInResponseHl7OrgTest { + + private static CloseableHttpClient ourClient; + private static FhirContext ourCtx = FhirContext.forDstu2Hl7Org(); + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(BundleTypeInResponseHl7OrgTest.class); + private static int ourPort; + private static Server ourServer; + + @Test + public void testSearch() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient"); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); + + ourLog.info(responseContent); + + org.hl7.fhir.instance.model.Bundle bundle = ourCtx.newXmlParser().parseResource(org.hl7.fhir.instance.model.Bundle.class, responseContent); + assertEquals(1, bundle.getEntry().size()); + assertEquals(BundleType.SEARCHSET, bundle.getType()); + } + + + @AfterClass + public static void afterClass() throws Exception { + ourServer.stop(); + } + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + DummyPatientResourceProvider patientProvider = new DummyPatientResourceProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + servlet.getFhirContext().setNarrativeGenerator(new DefaultThymeleafNarrativeGenerator()); + + servlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + public static class DummyPatientResourceProvider implements IResourceProvider { + + @Search + public List findPatient() { + ArrayList retVal = new ArrayList(); + + Patient patient = new Patient(); + patient.setId("1"); + patient.addIdentifier().setSystem("system").setValue("identifier123"); + retVal.add(patient); + return retVal; + } + + @Override + public Class getResourceType() { + return Patient.class; + } + + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/CreateConditionalHl7OrgTest.java b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/CreateConditionalHl7OrgTest.java new file mode 100644 index 00000000000..af9f58cd3b8 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/CreateConditionalHl7OrgTest.java @@ -0,0 +1,192 @@ +package ca.uhn.fhir.rest.server; + +import static org.junit.Assert.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.instance.model.IdType; +import org.hl7.fhir.instance.model.Patient; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.model.api.IResource; +import ca.uhn.fhir.model.primitive.StringDt; +import ca.uhn.fhir.rest.annotation.ConditionalUrlParam; +import ca.uhn.fhir.rest.annotation.Create; +import ca.uhn.fhir.rest.annotation.IdParam; +import ca.uhn.fhir.rest.annotation.OptionalParam; +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.util.PortUtil; + +/** + * Created by dsotnikov on 2/25/2014. + */ +public class CreateConditionalHl7OrgTest { + private static CloseableHttpClient ourClient; + + private static String ourLastConditionalUrl; + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(CreateConditionalHl7OrgTest.class); + private static int ourPort; + private static Server ourServer; + private static IdType ourLastId; + private static IdType ourLastIdParam; + private static boolean ourLastRequestWasSearch; + private static FhirContext ourCtx = FhirContext.forDstu2Hl7Org(); + + + + @Before + public void before() { + ourLastId = null; + ourLastConditionalUrl = null; + ourLastIdParam = null; + ourLastRequestWasSearch = false; + } + + @Test + public void testCreateWithConditionalUrl() throws Exception { + + Patient patient = new Patient(); + patient.addIdentifier().setValue("002"); + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient"); + httpPost.addHeader(Constants.HEADER_IF_NONE_EXIST, "Patient?identifier=system%7C001"); + httpPost.setEntity(new StringEntity(ourCtx.newXmlParser().encodeResourceToString(patient), ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + + HttpResponse status = ourClient.execute(httpPost); + + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info("Response was:\n{}", responseContent); + + assertEquals(201, status.getStatusLine().getStatusCode()); + assertEquals("http://localhost:" + ourPort + "/Patient/001/_history/002", status.getFirstHeader("location").getValue()); + assertEquals("http://localhost:" + ourPort + "/Patient/001/_history/002", status.getFirstHeader("content-location").getValue()); + + assertNull(ourLastId.getValue()); + assertNull(ourLastIdParam); + assertEquals("Patient?identifier=system%7C001", ourLastConditionalUrl); + + } + + @Test + public void testCreateWithoutConditionalUrl() throws Exception { + + Patient patient = new Patient(); + patient.addIdentifier().setValue("002"); + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient/2?_format=true&_pretty=true"); + httpPost.setEntity(new StringEntity(ourCtx.newXmlParser().encodeResourceToString(patient), ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + + HttpResponse status = ourClient.execute(httpPost); + + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info("Response was:\n{}", responseContent); + + assertEquals(201, status.getStatusLine().getStatusCode()); + assertEquals("http://localhost:" + ourPort + "/Patient/001/_history/002", status.getFirstHeader("location").getValue()); + assertEquals("http://localhost:" + ourPort + "/Patient/001/_history/002", status.getFirstHeader("content-location").getValue()); + + assertEquals("Patient/2", ourLastId.toUnqualified().getValue()); + assertEquals("Patient/2", ourLastIdParam.toUnqualified().getValue()); + assertNull(ourLastConditionalUrl); + + } + + @Test + public void testSearchStillWorks() throws Exception { + + Patient patient = new Patient(); + patient.addIdentifier().setValue("002"); + + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_pretty=true"); + + HttpResponse status = ourClient.execute(httpGet); + + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info("Response was:\n{}", responseContent); + + assertTrue(ourLastRequestWasSearch); + assertNull(ourLastId); + assertNull(ourLastIdParam); + assertNull(ourLastConditionalUrl); + + } + + + @AfterClass + public static void afterClass() throws Exception { + ourServer.stop(); + } + + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + PatientProvider patientProvider = new PatientProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + servlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + public static class PatientProvider implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + @Search + public List search(@OptionalParam(name="foo") StringDt theString) { + ourLastRequestWasSearch = true; + return new ArrayList(); + } + + @Create() + public MethodOutcome createPatient(@ResourceParam Patient thePatient, @ConditionalUrlParam String theConditional, @IdParam IdType theIdParam) { + ourLastConditionalUrl = theConditional; + ourLastId = thePatient.getIdElement(); + ourLastIdParam = theIdParam; + return new MethodOutcome(new IdType("Patient/001/_history/002")); + } + + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/DeleteConditionalHl7OrgTest.java b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/DeleteConditionalHl7OrgTest.java new file mode 100644 index 00000000000..e053b78fdc1 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/DeleteConditionalHl7OrgTest.java @@ -0,0 +1,124 @@ +package ca.uhn.fhir.rest.server; + +import static org.junit.Assert.*; + +import java.util.concurrent.TimeUnit; + +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpDelete; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.instance.model.Patient; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.model.primitive.IdDt; +import ca.uhn.fhir.rest.annotation.ConditionalUrlParam; +import ca.uhn.fhir.rest.annotation.Delete; +import ca.uhn.fhir.rest.annotation.IdParam; +import ca.uhn.fhir.rest.api.MethodOutcome; +import ca.uhn.fhir.util.PortUtil; + +/** + * Created by dsotnikov on 2/25/2014. + */ +public class DeleteConditionalHl7OrgTest { + private static CloseableHttpClient ourClient; + private static String ourLastConditionalUrl; + private static int ourPort; + private static final FhirContext ourCtx = FhirContext.forDstu2Hl7Org(); + private static Server ourServer; + private static IdDt ourLastIdParam; + + + + @Before + public void before() { + ourLastConditionalUrl = null; + ourLastIdParam = null; + } + + @Test + public void testUpdateWithConditionalUrl() throws Exception { + Patient patient = new Patient(); + patient.addIdentifier().setValue("002"); + + HttpDelete httpPost = new HttpDelete("http://localhost:" + ourPort + "/Patient?identifier=system%7C001"); + + HttpResponse status = ourClient.execute(httpPost); + + assertEquals(204, status.getStatusLine().getStatusCode()); + + assertNull(ourLastIdParam); + assertEquals("Patient?identifier=system%7C001", ourLastConditionalUrl); + } + + + @Test + public void testUpdateWithoutConditionalUrl() throws Exception { + Patient patient = new Patient(); + patient.addIdentifier().setValue("002"); + + HttpDelete httpPost = new HttpDelete("http://localhost:" + ourPort + "/Patient/2"); + + HttpResponse status = ourClient.execute(httpPost); + + assertEquals(204, status.getStatusLine().getStatusCode()); + + assertEquals("Patient/2", ourLastIdParam.toUnqualified().getValue()); + assertNull(ourLastConditionalUrl); + } + + @AfterClass + public static void afterClass() throws Exception { + ourServer.stop(); + } + + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + PatientProvider patientProvider = new PatientProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + servlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + public static class PatientProvider implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + + @Delete() + public MethodOutcome updatePatient(@ConditionalUrlParam String theConditional, @IdParam IdDt theIdParam) { + ourLastConditionalUrl = theConditional; + ourLastIdParam = theIdParam; + return new MethodOutcome(new IdDt("Patient/001/_history/002")); + } + + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/ETagServerHl7OrgTest.java b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/ETagServerHl7OrgTest.java new file mode 100644 index 00000000000..be1c37d0ee7 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/ETagServerHl7OrgTest.java @@ -0,0 +1,216 @@ +package ca.uhn.fhir.rest.server; + +import static org.junit.Assert.*; + +import java.io.IOException; +import java.util.Date; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.Header; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPut; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.instance.model.Identifier; +import org.hl7.fhir.instance.model.Patient; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.model.primitive.IdDt; +import ca.uhn.fhir.model.primitive.InstantDt; +import ca.uhn.fhir.rest.annotation.IdParam; +import ca.uhn.fhir.rest.annotation.Read; +import ca.uhn.fhir.rest.annotation.ResourceParam; +import ca.uhn.fhir.rest.annotation.Update; +import ca.uhn.fhir.rest.api.MethodOutcome; +import ca.uhn.fhir.rest.server.exceptions.PreconditionFailedException; +import ca.uhn.fhir.util.PortUtil; + +/** + * Created by dsotnikov on 2/25/2014. + */ +public class ETagServerHl7OrgTest { + + private static CloseableHttpClient ourClient; + private static FhirContext ourCtx; + private static Date ourLastModifiedDate; + private static int ourPort; + private static Server ourServer; + private static PoolingHttpClientConnectionManager ourConnectionManager; + + @Test + public void testETagHeader() throws Exception { + ourLastModifiedDate = new InstantDt("2012-11-25T02:34:45.2222Z").getValue(); + + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/2/_history/3"); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals(200, status.getStatusLine().getStatusCode()); + Identifier dt = ourCtx.newXmlParser().parseResource(Patient.class, responseContent).getIdentifier().get(0); + assertEquals("2", dt.getSystemElement().getValueAsString()); + assertEquals("3", dt.getValue()); + + Header cl = status.getFirstHeader(Constants.HEADER_ETAG_LC); + assertNotNull(cl); + assertEquals("W/\"222\"", cl.getValue()); + } + + + @Test + public void testAutomaticNotModified() throws Exception { + ourLastModifiedDate = new InstantDt("2012-11-25T02:34:45.2222Z").getValue(); + + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/2"); + httpGet.addHeader(Constants.HEADER_IF_NONE_MATCH, "\"222\""); + HttpResponse status = ourClient.execute(httpGet); + assertEquals(Constants.STATUS_HTTP_304_NOT_MODIFIED, status.getStatusLine().getStatusCode()); + } + + + @Test + public void testLastModifiedHeader() throws Exception { + ourLastModifiedDate = new InstantDt("2012-11-25T02:34:45.2222Z").getValue(); + + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/2/_history/3"); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals(200, status.getStatusLine().getStatusCode()); + Identifier dt = ourCtx.newXmlParser().parseResource(Patient.class, responseContent).getIdentifier().get(0); + assertEquals("2", dt.getSystemElement().getValueAsString()); + assertEquals("3", dt.getValue()); + + Header cl = status.getFirstHeader(Constants.HEADER_LAST_MODIFIED_LOWERCASE); + assertNotNull(cl); + assertEquals("Sun, 25 Nov 2012 02:34:47 GMT", cl.getValue()); + } + + @Before + public void before() throws IOException { + ourLastId=null; + } + + @Test + public void testUpdateWithNoVersion() throws Exception { + Patient p = new Patient(); + p.addIdentifier().setSystem("urn:system").setValue("001"); + String resBody = ourCtx.newXmlParser().encodeResourceToString(p); + + HttpPut http; + http = new HttpPut("http://localhost:" + ourPort + "/Patient/2"); + http.setEntity(new StringEntity(resBody, ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + HttpResponse status = ourClient.execute(http); + IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); + + } + + @Test + public void testUpdateWithIfMatch() throws Exception { + Patient p = new Patient(); + p.addIdentifier().setSystem("urn:system").setValue("001"); + String resBody = ourCtx.newXmlParser().encodeResourceToString(p); + + HttpPut http; + http = new HttpPut("http://localhost:" + ourPort + "/Patient/2"); + http.setEntity(new StringEntity(resBody, ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + http.addHeader(Constants.HEADER_IF_MATCH, "\"221\""); + CloseableHttpResponse status = ourClient.execute(http); + IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(200, status.getStatusLine().getStatusCode()); + assertEquals("Patient/2/_history/221", ourLastId.toUnqualified().getValue()); + + } + + @Test + public void testUpdateWithIfMatchPreconditionFailed() throws Exception { + Patient p = new Patient(); + p.addIdentifier().setSystem("urn:system").setValue("001"); + String resBody = ourCtx.newXmlParser().encodeResourceToString(p); + + HttpPut http; + http = new HttpPut("http://localhost:" + ourPort + "/Patient/2"); + http.setEntity(new StringEntity(resBody, ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + http.addHeader(Constants.HEADER_IF_MATCH, "\"222\""); + CloseableHttpResponse status = ourClient.execute(http); + IOUtils.closeQuietly(status.getEntity().getContent()); + assertEquals(Constants.STATUS_HTTP_412_PRECONDITION_FAILED, status.getStatusLine().getStatusCode()); + assertEquals("Patient/2/_history/222", ourLastId.toUnqualified().getValue()); + } + + + @AfterClass + public static void afterClass() throws Exception { + ourServer.stop(); + } + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + PatientProvider patientProvider = new PatientProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + ourCtx = servlet.getFhirContext(); + servlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + ourConnectionManager = new PoolingHttpClientConnectionManager(50000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(ourConnectionManager); + ourClient = builder.build(); + + } + + private static IdDt ourLastId; + + public static class PatientProvider implements IResourceProvider { + + @Read(version = true) + public Patient findPatient(@IdParam IdDt theId) { + Patient patient = new Patient(); + patient.getMeta().setLastUpdated(ourLastModifiedDate); + patient.addIdentifier().setSystem(theId.getIdPart()).setValue(theId.getVersionIdPart()); + patient.setId(theId.withVersion("222")); + return patient; + } + + @Update + public MethodOutcome updatePatient(@IdParam IdDt theId, @ResourceParam Patient theResource) { + ourLastId = theId; + + if ("222".equals(theId.getVersionIdPart())) { + throw new PreconditionFailedException("Bad version"); + } + + return new MethodOutcome(theId.withVersion(theId.getVersionIdPart() + "0")); + } + + @Override + public Class getResourceType() { + return Patient.class; + } + + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/IncludeAndRevincludeParameterHl7OrgTest.java b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/IncludeAndRevincludeParameterHl7OrgTest.java new file mode 100644 index 00000000000..c78cc33164a --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/IncludeAndRevincludeParameterHl7OrgTest.java @@ -0,0 +1,120 @@ +package ca.uhn.fhir.rest.server; + +import static org.hamcrest.Matchers.*; +import static org.junit.Assert.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.instance.model.Patient; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.model.api.Include; +import ca.uhn.fhir.rest.annotation.IncludeParam; +import ca.uhn.fhir.rest.annotation.Search; +import ca.uhn.fhir.util.PortUtil; + +public class IncludeAndRevincludeParameterHl7OrgTest { + + private static CloseableHttpClient ourClient; + private static int ourPort; + private static Server ourServer; + private static FhirContext ourCtx; + private static Set ourIncludes; + private static Set ourReverseIncludes; + + @Before + public void before() { + ourIncludes = null; + ourReverseIncludes = null; + } + + @Test + public void testNoIncludes() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_query=normalInclude"); + HttpResponse status = ourClient.execute(httpGet); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals(200, status.getStatusLine().getStatusCode()); + + assertThat(ourIncludes, hasSize(0)); + assertThat(ourReverseIncludes, hasSize(0)); + } + + @Test + public void testWithBoth() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_query=normalInclude&_include=A.a&_include=B.b&_revinclude=C.c&_revinclude=D.d"); + HttpResponse status = ourClient.execute(httpGet); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals(200, status.getStatusLine().getStatusCode()); + + assertThat(ourIncludes, hasSize(2)); + assertThat(ourReverseIncludes, hasSize(2)); + assertThat(ourIncludes, containsInAnyOrder(new Include("A.a"), new Include("B.b"))); + assertThat(ourReverseIncludes, containsInAnyOrder(new Include("C.c"), new Include("D.d"))); + } + + @AfterClass + public static void afterClass() throws Exception { + ourServer.stop(); + } + + @BeforeClass + public static void beforeClass() throws Exception { + + ourCtx = FhirContext.forDstu2Hl7Org(); + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + servlet.setResourceProviders(new DummyPatientResourceProvider()); + servlet.setBundleInclusionRule(BundleInclusionRule.BASED_ON_RESOURCE_PRESENCE); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + public static class DummyPatientResourceProvider implements IResourceProvider { + + @Search(queryName = "normalInclude") + public List normalInclude( + @IncludeParam() Set theIncludes, + @IncludeParam(reverse=true) Set theRevincludes + ) { + ourIncludes = theIncludes; + ourReverseIncludes = theRevincludes; + return new ArrayList(); + } + + @Override + public Class getResourceType() { + return Patient.class; + } + + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/IncludeHl7OrgDstu2Test.java b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/IncludeHl7OrgDstu2Test.java new file mode 100644 index 00000000000..d8d6e46a7e9 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/IncludeHl7OrgDstu2Test.java @@ -0,0 +1,478 @@ +package ca.uhn.fhir.rest.server; + +import static org.hamcrest.Matchers.*; +import static org.junit.Assert.*; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.instance.model.Bundle; +import org.hl7.fhir.instance.model.Bundle.SearchEntryMode; +import org.hl7.fhir.instance.model.DiagnosticReport; +import org.hl7.fhir.instance.model.IdType; +import org.hl7.fhir.instance.model.Observation; +import org.hl7.fhir.instance.model.Organization; +import org.hl7.fhir.instance.model.Patient; +import org.hl7.fhir.instance.model.Practitioner; +import org.hl7.fhir.instance.model.Reference; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.model.api.Include; +import ca.uhn.fhir.model.api.annotation.Child; +import ca.uhn.fhir.model.api.annotation.Extension; +import ca.uhn.fhir.model.api.annotation.ResourceDef; +import ca.uhn.fhir.model.primitive.StringDt; +import ca.uhn.fhir.rest.annotation.IncludeParam; +import ca.uhn.fhir.rest.annotation.RequiredParam; +import ca.uhn.fhir.rest.annotation.Search; +import ca.uhn.fhir.util.ElementUtil; +import ca.uhn.fhir.util.PortUtil; + +public class IncludeHl7OrgDstu2Test { + + private static CloseableHttpClient ourClient; + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(IncludeHl7OrgDstu2Test.class); + private static int ourPort; + private static Server ourServer; + private static FhirContext ourCtx; + + @Test + public void testNoIncludes() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?name=Hello"); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals(200, status.getStatusLine().getStatusCode()); + Bundle bundle = ourCtx.newXmlParser().parseResource(Bundle.class, responseContent); + assertEquals(1, bundle.getEntry().size()); + + Patient p = (Patient) bundle.getEntry().get(0).getResource(); + assertEquals(0, p.getName().size()); + assertEquals("Hello", p.getIdElement().getIdPart()); + } + + @Test + public void testOneIncludeXml() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?name=Hello&_include=foo"); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals(200, status.getStatusLine().getStatusCode()); + + ourLog.info(responseContent); + + Bundle bundle = ourCtx.newXmlParser().parseResource(Bundle.class, responseContent); + assertEquals(1, bundle.getEntry().size()); + + Patient p = (Patient) bundle.getEntry().get(0).getResource(); + assertEquals(1, p.getName().size()); + assertEquals("Hello", p.getIdElement().getIdPart()); + assertEquals("foo", p.getName().get(0).getFamily().get(0).getValue()); + } + + @Test + public void testOneIncludeJson() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?name=Hello&_include=foo&_format=json"); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals(200, status.getStatusLine().getStatusCode()); + + ourLog.info(responseContent); + + Bundle bundle = ourCtx.newJsonParser().parseResource(Bundle.class, responseContent); + assertEquals(1, bundle.getEntry().size()); + + Patient p = (Patient) bundle.getEntry().get(0).getResource(); + assertEquals(1, p.getName().size()); + assertEquals("Hello", p.getIdElement().getIdPart()); + assertEquals("foo", p.getName().get(0).getFamily().get(0).getValue()); + } + + // @Test + public void testMixedContainedAndNonContained() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/DiagnosticReport?_query=stitchedInclude&_pretty=true"); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info(responseContent); + + assertEquals(200, status.getStatusLine().getStatusCode()); + Bundle bundle = ourCtx.newXmlParser().parseResource(Bundle.class, responseContent); + assertEquals(4, bundle.getEntry().size()); + } + + @Test + public void testIIncludedResourcesNonContained() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_query=normalInclude&_pretty=true"); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals(200, status.getStatusLine().getStatusCode()); + Bundle bundle = ourCtx.newXmlParser().parseResource(Bundle.class, responseContent); + + ourLog.info(responseContent); + + assertEquals(3, bundle.getEntry().size()); + assertEquals(new IdType("Patient/p1"), bundle.getEntry().get(0).getResource().getIdElement().toUnqualifiedVersionless()); + assertEquals(new IdType("Patient/p2"), bundle.getEntry().get(1).getResource().getIdElement().toUnqualifiedVersionless()); + assertEquals(new IdType("Organization/o1"), bundle.getEntry().get(2).getResource().getIdElement().toUnqualifiedVersionless()); + assertEquals(SearchEntryMode.INCLUDE, bundle.getEntry().get(2).getSearch().getMode()); + + Patient p1 = (Patient) bundle.getEntry().get(0).getResource(); + assertEquals(0, p1.getContained().size()); + + Patient p2 = (Patient) bundle.getEntry().get(1).getResource(); + assertEquals(0, p2.getContained().size()); + + } + + @Test + public void testIIncludedResourcesNonContainedInExtension() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_query=extInclude&_pretty=true"); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals(200, status.getStatusLine().getStatusCode()); + Bundle bundle = ourCtx.newXmlParser().parseResource(Bundle.class, responseContent); + + ourLog.info(responseContent); + + assertEquals(3, bundle.getEntry().size()); + assertEquals(new IdType("Patient/p1"), bundle.getEntry().get(0).getResource().getIdElement().toUnqualifiedVersionless()); + assertEquals(new IdType("Patient/p2"), bundle.getEntry().get(1).getResource().getIdElement().toUnqualifiedVersionless()); + assertEquals(new IdType("Organization/o1"), bundle.getEntry().get(2).getResource().getIdElement().toUnqualifiedVersionless()); + assertEquals(SearchEntryMode.INCLUDE, bundle.getEntry().get(2).getSearch().getMode()); + + Patient p1 = (Patient) bundle.getEntry().get(0).getResource(); + assertEquals(0, p1.getContained().size()); + + Patient p2 = (Patient) bundle.getEntry().get(1).getResource(); + assertEquals(0, p2.getContained().size()); + + } + + @Test + public void testIIncludedResourcesNonContainedInExtensionJson() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_query=extInclude&_pretty=true&_format=json"); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals(200, status.getStatusLine().getStatusCode()); + Bundle bundle = ourCtx.newJsonParser().parseResource(Bundle.class, responseContent); + + ourLog.info(responseContent); + + assertEquals(3, bundle.getEntry().size()); + assertEquals(new IdType("Patient/p1"), bundle.getEntry().get(0).getResource().getIdElement().toUnqualifiedVersionless()); + assertEquals(new IdType("Patient/p2"), bundle.getEntry().get(1).getResource().getIdElement().toUnqualifiedVersionless()); + assertEquals(new IdType("Organization/o1"), bundle.getEntry().get(2).getResource().getIdElement().toUnqualifiedVersionless()); + assertEquals(SearchEntryMode.INCLUDE, bundle.getEntry().get(2).getSearch().getMode()); + + Patient p1 = (Patient) bundle.getEntry().get(0).getResource(); + assertEquals(0, p1.getContained().size()); + + Patient p2 = (Patient) bundle.getEntry().get(1).getResource(); + assertEquals(0, p2.getContained().size()); + + } + + @Test + public void testIIncludedResourcesNonContainedInDeclaredExtension() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_query=declaredExtInclude&_pretty=true"); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals(200, status.getStatusLine().getStatusCode()); + Bundle bundle = ourCtx.newXmlParser().parseResource(Bundle.class, responseContent); + + ourLog.info(responseContent); + + assertEquals(4, bundle.getEntry().size()); + assertEquals(new IdType("Patient/p1"), bundle.getEntry().get(0).getResource().getIdElement().toUnqualifiedVersionless()); + assertEquals(new IdType("Patient/p2"), bundle.getEntry().get(1).getResource().getIdElement().toUnqualifiedVersionless()); + assertEquals(new IdType("Organization/o1"), bundle.getEntry().get(2).getResource().getIdElement().toUnqualifiedVersionless()); + assertEquals(new IdType("Organization/o2"), bundle.getEntry().get(3).getResource().getIdElement().toUnqualifiedVersionless()); + assertEquals(SearchEntryMode.INCLUDE, bundle.getEntry().get(2).getSearch().getMode()); + assertEquals(SearchEntryMode.INCLUDE, bundle.getEntry().get(3).getSearch().getMode()); + + Patient p1 = (Patient) bundle.getEntry().get(0).getResource(); + assertEquals(0, p1.getContained().size()); + + Patient p2 = (Patient) bundle.getEntry().get(1).getResource(); + assertEquals(0, p2.getContained().size()); + + } + + @Test + public void testTwoInclude() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?name=Hello&_include=foo&_include=bar&_pretty=true"); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info(responseContent); + + assertEquals(200, status.getStatusLine().getStatusCode()); + Bundle bundle = ourCtx.newXmlParser().parseResource(Bundle.class, responseContent); + assertEquals(1, bundle.getEntry().size()); + + Patient p = (Patient) bundle.getEntry().get(0).getResource(); + assertEquals(2, p.getName().size()); + assertEquals("Hello", p.getIdElement().getIdPart()); + + Set values = new HashSet(); + values.add(p.getName().get(0).getFamily().get(0).getValue()); + values.add(p.getName().get(1).getFamily().get(0).getValue()); + assertThat(values, containsInAnyOrder("foo", "bar")); + + } + + @Test + public void testBadInclude() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?name=Hello&_include=foo&_include=baz"); + HttpResponse status = ourClient.execute(httpGet); + assertEquals(400, status.getStatusLine().getStatusCode()); + } + + @AfterClass + public static void afterClass() throws Exception { + ourServer.stop(); + } + + @BeforeClass + public static void beforeClass() throws Exception { + + ourCtx = FhirContext.forDstu2Hl7Org(); + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + DummyPatientResourceProvider patientProvider = new DummyPatientResourceProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + servlet.setResourceProviders(patientProvider, new DummyDiagnosticReportResourceProvider()); + servlet.setBundleInclusionRule(BundleInclusionRule.BASED_ON_RESOURCE_PRESENCE); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + @ResourceDef(name = "Patient") + public static class ExtPatient extends Patient { + private static final long serialVersionUID = 1L; + + @Child(name = "secondOrg") + @Extension(url = "http://foo#secondOrg", definedLocally = false, isModifier = false) + private Reference mySecondOrg; + + @Override + public boolean isEmpty() { + return super.isEmpty() && ElementUtil.isEmpty(mySecondOrg); + } + + public Reference getSecondOrg() { + if (mySecondOrg == null) { + mySecondOrg = new Reference(); + } + return mySecondOrg; + } + + public void setSecondOrg(Reference theSecondOrg) { + mySecondOrg = theSecondOrg; + } + + } + + /** + * Created by dsotnikov on 2/25/2014. + */ + public static class DummyDiagnosticReportResourceProvider implements IResourceProvider { + + @Override + public Class getResourceType() { + return DiagnosticReport.class; + } + + @Search(queryName = "stitchedInclude") + public List stitchedInclude() { + Practitioner pr1 = new Practitioner(); + pr1.setId("Practitioner/001"); + pr1.getName().addFamily("Pract1"); + + Practitioner pr2 = new Practitioner(); + pr2.setId("Practitioner/002"); + pr2.getName().addFamily("Pract2"); + + Practitioner pr3 = new Practitioner(); + pr3.setId("Practitioner/003"); + pr3.getName().addFamily("Pract3"); + + Observation o1 = new Observation(); + o1.getCode().setText("Obs1"); + o1.addPerformer().setResource(pr1); + + Observation o2 = new Observation(); + o2.getCode().setText("Obs2"); + o2.addPerformer().setResource(pr2); + + Observation o3 = new Observation(); + o3.getCode().setText("Obs3"); + o3.addPerformer().setResource(pr3); + + DiagnosticReport rep = new DiagnosticReport(); + rep.setId("DiagnosticReport/999"); + rep.getName().setText("Rep"); + rep.addResult().setResource(o1); + rep.addResult().setResource(o2); + rep.addResult().setResource(o3); + + return Collections.singletonList(rep); + } + + } + + /** + * Created by dsotnikov on 2/25/2014. + */ + public static class DummyPatientResourceProvider implements IResourceProvider { + + @Search(queryName = "normalInclude") + public List normalInclude() { + Organization o1 = new Organization(); + o1.getNameElement().setValue("o1"); + o1.setId("o1"); + + Patient p1 = new Patient(); + p1.setId("p1"); + p1.addIdentifier().setValue("p1"); + p1.getManagingOrganization().setResource(o1); + + Patient p2 = new Patient(); + p2.setId("p2"); + p2.addIdentifier().setValue("p2"); + p2.getManagingOrganization().setResource(o1); + + return Arrays.asList(p1, p2); + } + + @Search(queryName = "extInclude") + public List extInclude() { + Organization o1 = new Organization(); + o1.getNameElement().setValue("o1"); + o1.setId("o1"); + + Patient p1 = new Patient(); + p1.setId("p1"); + p1.addIdentifier().setValue("p1"); + p1.addExtension().setUrl("http://foo").setValue(new Reference(o1)); + + Patient p2 = new Patient(); + p2.setId("p2"); + p2.addIdentifier().setValue("p2"); + p2.addExtension().setUrl("http://foo").setValue( new Reference(o1)); + + return Arrays.asList(p1, p2); + } + + @Search(queryName = "declaredExtInclude") + public List declaredExtInclude() { + Organization o1 = new Organization(); + o1.getNameElement().setValue("o1"); + o1.setId("o1"); + + Organization o2 = new Organization(); + o2.getNameElement().setValue("o2"); + o2.setId("o2"); + o1.getPartOf().setResource(o2); + + ExtPatient p1 = new ExtPatient(); + p1.setId("p1"); + p1.addIdentifier().setValue("p1"); + p1.getSecondOrg().setResource(o1); + + ExtPatient p2 = new ExtPatient(); + p2.setId("p2"); + p2.addIdentifier().setValue("p2"); + p2.getSecondOrg().setResource(o1); + + return Arrays.asList(p1, p2); + } + + @Search(queryName = "containedInclude") + public List containedInclude() { + Organization o1 = new Organization(); + o1.getNameElement().setValue("o1"); + + Patient p1 = new Patient(); + p1.setId("p1"); + p1.addIdentifier().setValue("p1"); + p1.getManagingOrganization().setResource(o1); + + Patient p2 = new Patient(); + p2.setId("p2"); + p2.addIdentifier().setValue("p2"); + p2.getManagingOrganization().setResource(o1); + + return Arrays.asList(p1, p2); + } + + @Search + public List findPatient(@RequiredParam(name = Patient.SP_NAME) StringDt theName, @IncludeParam(allow = { "foo", "bar" }) Set theIncludes) { + ArrayList retVal = new ArrayList(); + + Patient p = new Patient(); + p.addIdentifier().setSystem("foo").setValue("bar"); + + p.setId(theName.getValue()); + + if (theIncludes != null) { + for (Include next : theIncludes) { + p.addName().addFamily(next.getValue()); + } + } + retVal.add(p); + + return retVal; + } + + @Override + public Class getResourceType() { + return Patient.class; + } + + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/OperationServerHl7OrgTest.java b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/OperationServerHl7OrgTest.java new file mode 100644 index 00000000000..10bd2c58ada --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/OperationServerHl7OrgTest.java @@ -0,0 +1,503 @@ +package ca.uhn.fhir.rest.server; + +import static org.hamcrest.Matchers.*; +import static org.junit.Assert.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.instance.model.Bundle; +import org.hl7.fhir.instance.model.IntegerType; +import org.hl7.fhir.instance.model.Parameters; +import org.hl7.fhir.instance.model.Patient; +import org.hl7.fhir.instance.model.StringType; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.model.primitive.IdDt; +import ca.uhn.fhir.rest.annotation.IdParam; +import ca.uhn.fhir.rest.annotation.Operation; +import ca.uhn.fhir.rest.annotation.OperationParam; +import ca.uhn.fhir.rest.annotation.Read; +import ca.uhn.fhir.util.PortUtil; + +/** + * Created by dsotnikov on 2/25/2014. + */ +public class OperationServerHl7OrgTest { + private static CloseableHttpClient ourClient; + private static FhirContext ourCtx; + + private static StringType ourLastParam1; + private static Patient ourLastParam2; + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(OperationServerHl7OrgTest.class); + private static int ourPort; + private static IdDt ourLastId; + private static Server ourServer; + private static String ourLastMethod; + private static List ourLastParam3; + + @Before + public void before() { + ourLastParam1 = null; + ourLastParam2 = null; + ourLastParam3 = null; + ourLastId = null; + ourLastMethod = ""; + } + + @Test + public void testOperationOnType() throws Exception { + Parameters p = new Parameters(); + p.addParameter().setName("PARAM1").setValue(new StringType("PARAM1val")); + p.addParameter().setName("PARAM2").setResource(new Patient().setActive(true)); + String inParamsStr = ourCtx.newXmlParser().encodeResourceToString(p); + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient/$OP_TYPE"); + httpPost.setEntity(new StringEntity(inParamsStr, ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + HttpResponse status = ourClient.execute(httpPost); + + assertEquals(200, status.getStatusLine().getStatusCode()); + String response = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals("PARAM1val", ourLastParam1.getValue()); + assertEquals(true, ourLastParam2.getActive()); + assertEquals("$OP_TYPE", ourLastMethod); + + Parameters resp = ourCtx.newXmlParser().parseResource(Parameters.class, response); + assertEquals("RET1", resp.getParameter().get(0).getName()); + } + + @Test + public void testOperationWithGetUsingParams() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/$OP_TYPE?PARAM1=PARAM1val"); + HttpResponse status = ourClient.execute(httpGet); + + assertEquals(200, status.getStatusLine().getStatusCode()); + String response = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals("PARAM1val", ourLastParam1.getValue()); + assertNull(ourLastParam2); + assertEquals("$OP_TYPE", ourLastMethod); + + Parameters resp = ourCtx.newXmlParser().parseResource(Parameters.class, response); + assertEquals("RET1", resp.getParameter().get(0).getName()); + } + + @Test + public void testOperationWithGetUsingParamsFailsWithNonPrimitive() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/$OP_TYPE?PARAM1=PARAM1val&PARAM2=foo"); + HttpResponse status = ourClient.execute(httpGet); + + assertEquals(405, status.getStatusLine().getStatusCode()); + String response = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals("POST", status.getFirstHeader(Constants.HEADER_ALLOW).getValue()); + assertThat(response, containsString("Can not invoke operation $OP_TYPE using HTTP GET because parameter PARAM2 is not a primitive datatype")); + } + + @Test + public void testOperationOnTypeReturnBundle() throws Exception { + Parameters p = new Parameters(); + p.addParameter().setName("PARAM1").setValue(new StringType("PARAM1val")); + p.addParameter().setName("PARAM2").setResource(new Patient().setActive(true)); + String inParamsStr = ourCtx.newXmlParser().encodeResourceToString(p); + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient/$OP_TYPE_RET_BUNDLE"); + httpPost.setEntity(new StringEntity(inParamsStr, ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + HttpResponse status = ourClient.execute(httpPost); + + assertEquals(200, status.getStatusLine().getStatusCode()); + String response = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals("PARAM1val", ourLastParam1.getValue()); + assertEquals(true, ourLastParam2.getActive()); + assertEquals("$OP_TYPE_RET_BUNDLE", ourLastMethod); + + Bundle resp = ourCtx.newXmlParser().parseResource(Bundle.class, response); + assertEquals("100", resp.getEntry().get(0).getTransactionResponse().getStatus()); + } + + @Test + public void testOperationOnServer() throws Exception { + Parameters p = new Parameters(); + p.addParameter().setName("PARAM1").setValue(new StringType("PARAM1val")); + p.addParameter().setName("PARAM2").setResource(new Patient().setActive(true)); + String inParamsStr = ourCtx.newXmlParser().encodeResourceToString(p); + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/$OP_SERVER"); + httpPost.setEntity(new StringEntity(inParamsStr, ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + HttpResponse status = ourClient.execute(httpPost); + + assertEquals(200, status.getStatusLine().getStatusCode()); + String response = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals("PARAM1val", ourLastParam1.getValue()); + assertEquals(true, ourLastParam2.getActive()); + assertEquals("$OP_SERVER", ourLastMethod); + + Parameters resp = ourCtx.newXmlParser().parseResource(Parameters.class, response); + assertEquals("RET1", resp.getParameter().get(0).getName()); + } + + @Test + public void testOperationWithBundleProviderResponse() throws Exception { + HttpGet httpPost = new HttpGet("http://localhost:" + ourPort + "/$OP_INSTANCE_BUNDLE_PROVIDER?_pretty=true"); + HttpResponse status = ourClient.execute(httpPost); + + assertEquals(200, status.getStatusLine().getStatusCode()); + String response = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info(response); + + Bundle resp = ourCtx.newXmlParser().parseResource(Bundle.class, response); + assertNotNull(resp); + } + + @Test + public void testOperationWithListParam() throws Exception { + Parameters p = new Parameters(); + p.addParameter().setName("PARAM2").setResource(new Patient().setActive(true)); + p.addParameter().setName("PARAM3").setValue(new StringType("PARAM3val1")); + p.addParameter().setName("PARAM3").setValue(new StringType("PARAM3val2")); + String inParamsStr = ourCtx.newXmlParser().encodeResourceToString(p); + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/$OP_SERVER_LIST_PARAM"); + httpPost.setEntity(new StringEntity(inParamsStr, ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + HttpResponse status = ourClient.execute(httpPost); + + assertEquals(200, status.getStatusLine().getStatusCode()); + String response = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals("$OP_SERVER_LIST_PARAM", ourLastMethod); + assertEquals(true, ourLastParam2.getActive()); + assertEquals(null, ourLastParam1); + assertEquals(2, ourLastParam3.size()); + assertEquals("PARAM3val1", ourLastParam3.get(0).getValue()); + assertEquals("PARAM3val2", ourLastParam3.get(1).getValue()); + + Parameters resp = ourCtx.newXmlParser().parseResource(Parameters.class, response); + assertEquals("RET1", resp.getParameter().get(0).getName()); + } + + @Test + public void testOperationOnInstance() throws Exception { + Parameters p = new Parameters(); + p.addParameter().setName("PARAM1").setValue(new StringType("PARAM1val")); + p.addParameter().setName("PARAM2").setResource(new Patient().setActive(true)); + String inParamsStr = ourCtx.newXmlParser().encodeResourceToString(p); + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient/123/$OP_INSTANCE"); + httpPost.setEntity(new StringEntity(inParamsStr, ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + HttpResponse status = ourClient.execute(httpPost); + + assertEquals(200, status.getStatusLine().getStatusCode()); + String response = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals("PARAM1val", ourLastParam1.getValue()); + assertEquals(true, ourLastParam2.getActive()); + assertEquals("123", ourLastId.getIdPart()); + assertEquals("$OP_INSTANCE", ourLastMethod); + + Parameters resp = ourCtx.newXmlParser().parseResource(Parameters.class, response); + assertEquals("RET1", resp.getParameter().get(0).getName()); + } + + @Test + public void testOperationCantUseGetIfItIsntIdempotent() throws Exception { + HttpGet httpPost = new HttpGet("http://localhost:" + ourPort + "/Patient/123/$OP_INSTANCE"); + HttpResponse status = ourClient.execute(httpPost); + + assertEquals(Constants.STATUS_HTTP_405_METHOD_NOT_ALLOWED, status.getStatusLine().getStatusCode()); + String response = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals("POST", status.getFirstHeader(Constants.HEADER_ALLOW).getValue()); + assertThat(response, containsString("HTTP Method GET is not allowed")); + } + + @Test + public void testOperationWrongParamType() throws Exception { + Parameters p = new Parameters(); + p.addParameter().setName("PARAM1").setValue(new IntegerType("123")); + p.addParameter().setName("PARAM2").setResource(new Patient().setActive(true)); + String inParamsStr = ourCtx.newXmlParser().encodeResourceToString(p); + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient/$OP_TYPE"); + httpPost.setEntity(new StringEntity(inParamsStr, ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + HttpResponse status = ourClient.execute(httpPost); + + assertEquals(400, status.getStatusLine().getStatusCode()); + String response = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info(status.getStatusLine().toString()); + ourLog.info(response); + + assertThat(response, containsString("Request has parameter PARAM1 of type IntegerType but method expects type StringType")); + } + + @Test + public void testReadWithOperations() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/123"); + HttpResponse status = ourClient.execute(httpGet); + + assertEquals(200, status.getStatusLine().getStatusCode()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals("read", ourLastMethod); + } + + @Test + public void testInstanceEverythingPost() throws Exception { + String inParamsStr = ourCtx.newXmlParser().encodeResourceToString(new Parameters()); + + // Try with a POST + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient/123/$everything"); + httpPost.setEntity(new StringEntity(inParamsStr, ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + HttpResponse status = ourClient.execute(httpPost); + + assertEquals(200, status.getStatusLine().getStatusCode()); + String response = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals("instance $everything", ourLastMethod); + assertThat(response, startsWith(" resources = new ArrayList(); + for (int i =0; i < 100;i++) { + Patient p = new Patient(); + p.setId("Patient/" + i); + p.addName().addFamily("Patient " + i); + resources.add(p); + } + + return new SimpleBundleProvider(resources); + } + + //@formatter:off + @Operation(name="$OP_SERVER") + public Parameters opServer( + @OperationParam(name="PARAM1") StringType theParam1, + @OperationParam(name="PARAM2") Patient theParam2 + ) { + //@formatter:on + + ourLastMethod = "$OP_SERVER"; + ourLastParam1 = theParam1; + ourLastParam2 = theParam2; + + Parameters retVal = new Parameters(); + retVal.addParameter().setName("RET1").setValue(new StringType("RETVAL1")); + return retVal; + } + + //@formatter:off + @Operation(name="$OP_SERVER_LIST_PARAM") + public Parameters opServerListParam( + @OperationParam(name="PARAM2") Patient theParam2, + @OperationParam(name="PARAM3") List theParam3 + ) { + //@formatter:on + + ourLastMethod = "$OP_SERVER_LIST_PARAM"; + ourLastParam2 = theParam2; + ourLastParam3 = theParam3; + + Parameters retVal = new Parameters(); + retVal.addParameter().setName("RET1").setValue(new StringType("RETVAL1")); + return retVal; + } + + } + + public static class PatientProvider implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + /** + * Just to make sure this method doesn't "steal" calls + */ + @Read + public Patient read(@IdParam IdDt theId) { + ourLastMethod = "read"; + Patient retVal = new Patient(); + retVal.setId(theId); + return retVal; + } + + @Operation(name = "$everything", idempotent=true) + public Bundle patientEverything(@IdParam IdDt thePatientId) { + ourLastMethod = "instance $everything"; + ourLastId = thePatientId; + return new Bundle(); + } + + //@formatter:off + @Operation(name="$OP_TYPE", idempotent=true) + public Parameters opType( + @OperationParam(name="PARAM1") StringType theParam1, + @OperationParam(name="PARAM2") Patient theParam2 + ) { + //@formatter:on + + ourLastMethod = "$OP_TYPE"; + ourLastParam1 = theParam1; + ourLastParam2 = theParam2; + + Parameters retVal = new Parameters(); + retVal.addParameter().setName("RET1").setValue(new StringType("RETVAL1")); + return retVal; + } + + //@formatter:off + @Operation(name="$OP_TYPE_ONLY_STRING", idempotent=true) + public Parameters opTypeOnlyString( + @OperationParam(name="PARAM1") StringType theParam1 + ) { + //@formatter:on + + ourLastMethod = "$OP_TYPE"; + ourLastParam1 = theParam1; + + Parameters retVal = new Parameters(); + retVal.addParameter().setName("RET1").setValue(new StringType("RETVAL1")); + return retVal; + } + + //@formatter:off + @Operation(name="$OP_TYPE_RET_BUNDLE") + public Bundle opTypeRetBundle( + @OperationParam(name="PARAM1") StringType theParam1, + @OperationParam(name="PARAM2") Patient theParam2 + ) { + //@formatter:on + + ourLastMethod = "$OP_TYPE_RET_BUNDLE"; + ourLastParam1 = theParam1; + ourLastParam2 = theParam2; + + Bundle retVal = new Bundle(); + retVal.addEntry().getTransactionResponse().setStatus("100"); + return retVal; + } + + //@formatter:off + @Operation(name="$OP_INSTANCE") + public Parameters opInstance( + @IdParam IdDt theId, + @OperationParam(name="PARAM1") StringType theParam1, + @OperationParam(name="PARAM2") Patient theParam2 + ) { + //@formatter:on + + ourLastMethod = "$OP_INSTANCE"; + ourLastId = theId; + ourLastParam1 = theParam1; + ourLastParam2 = theParam2; + + Parameters retVal = new Parameters(); + retVal.addParameter().setName("RET1").setValue(new StringType("RETVAL1")); + return retVal; + } + + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/PreferHl7OrgDstu2Test.java b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/PreferHl7OrgDstu2Test.java new file mode 100644 index 00000000000..2ab8115f74b --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/PreferHl7OrgDstu2Test.java @@ -0,0 +1,117 @@ +package ca.uhn.fhir.rest.server; + +import static org.junit.Assert.*; + +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.instance.model.Patient; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.model.primitive.IdDt; +import ca.uhn.fhir.rest.annotation.Create; +import ca.uhn.fhir.rest.annotation.IdParam; +import ca.uhn.fhir.rest.annotation.ResourceParam; +import ca.uhn.fhir.rest.annotation.Update; +import ca.uhn.fhir.rest.api.MethodOutcome; +import ca.uhn.fhir.util.PortUtil; + +/** + * Created by dsotnikov on 2/25/2014. + */ +public class PreferHl7OrgDstu2Test { + private static CloseableHttpClient ourClient; + + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(PreferHl7OrgDstu2Test.class); + private static int ourPort; + private static Server ourServer; + private static FhirContext ourCtx = FhirContext.forDstu2Hl7Org(); + + + @Test + public void testCreateWithNoPrefer() throws Exception { + + Patient patient = new Patient(); + patient.addIdentifier().setValue("002"); + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient"); + httpPost.setEntity(new StringEntity(ourCtx.newXmlParser().encodeResourceToString(patient), ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + + HttpResponse status = ourClient.execute(httpPost); + + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info("Response was:\n{}", responseContent); + + assertEquals(201, status.getStatusLine().getStatusCode()); + assertEquals("http://localhost:" + ourPort + "/Patient/001/_history/002", status.getFirstHeader("location").getValue()); + assertEquals("http://localhost:" + ourPort + "/Patient/001/_history/002", status.getFirstHeader("content-location").getValue()); + + } + + + + + @AfterClass + public static void afterClass() throws Exception { + ourServer.stop(); + } + + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + PatientProvider patientProvider = new PatientProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + servlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + public static class PatientProvider implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + @Create() + public MethodOutcome createPatient(@ResourceParam Patient thePatient) { + MethodOutcome retVal = new MethodOutcome(new IdDt("Patient/001/_history/002")); + return retVal; + } + + @Update() + public MethodOutcome updatePatient(@ResourceParam Patient thePatient, @IdParam IdDt theIdParam) { + return new MethodOutcome(new IdDt("Patient/001/_history/002")); + } + + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/ReadHl7OrgDstu2Test.java b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/ReadHl7OrgDstu2Test.java new file mode 100644 index 00000000000..18e1cea8606 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/ReadHl7OrgDstu2Test.java @@ -0,0 +1,114 @@ +package ca.uhn.fhir.rest.server; + +import static org.hamcrest.Matchers.*; +import static org.junit.Assert.*; + +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.instance.model.Patient; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.model.api.IResource; +import ca.uhn.fhir.rest.annotation.IdParam; +import ca.uhn.fhir.rest.annotation.Read; +import ca.uhn.fhir.util.PortUtil; + +public class ReadHl7OrgDstu2Test { + + private static CloseableHttpClient ourClient; + private static int ourPort; + private static Server ourServer; + private static FhirContext ourCtx = FhirContext.forDstu2Hl7Org(); + + /** + * In DSTU2+ the resource ID appears in the resource body + */ + @Test + public void testReadXml() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/123&_format=xml"); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals(200, status.getStatusLine().getStatusCode()); + assertThat(responseContent, containsString("p1ReadValue")); + assertThat(responseContent, containsString("p1ReadId")); + } + + /** + * In DSTU2+ the resource ID appears in the resource body + */ + @Test + public void testReadJson() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient/123&_format=json"); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals(200, status.getStatusLine().getStatusCode()); + assertThat(responseContent, containsString("p1ReadValue")); + assertThat(responseContent, containsString("p1ReadId")); + } + + @AfterClass + public static void afterClass() throws Exception { + ourServer.stop(); + } + + @BeforeClass + public static void beforeClass() throws Exception { + + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + DummyPatientResourceProvider patientProvider = new DummyPatientResourceProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + servlet.setFhirContext(ourCtx); + servlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + /** + * Created by dsotnikov on 2/25/2014. + */ + public static class DummyPatientResourceProvider implements IResourceProvider { + + @Read + public Patient read(@IdParam org.hl7.fhir.instance.model.IdType theId) { + Patient p1 = new Patient(); + p1.setId("p1ReadId"); + p1.addIdentifier().setValue("p1ReadValue"); + return p1; + } + + @Override + public Class getResourceType() { + return Patient.class; + } + + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/SearchHl7OrgDstu2Test.java b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/SearchHl7OrgDstu2Test.java new file mode 100644 index 00000000000..0e208d42a37 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/SearchHl7OrgDstu2Test.java @@ -0,0 +1,179 @@ +package ca.uhn.fhir.rest.server; + +import static org.hamcrest.Matchers.*; +import static org.junit.Assert.*; + +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.instance.model.Bundle; +import org.hl7.fhir.instance.model.Patient; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.model.primitive.InstantDt; +import ca.uhn.fhir.rest.annotation.Search; +import ca.uhn.fhir.util.PatternMatcher; +import ca.uhn.fhir.util.PortUtil; + +/** + * Created by dsotnikov on 2/25/2014. + */ +public class SearchHl7OrgDstu2Test { + + private static CloseableHttpClient ourClient; + private static FhirContext ourCtx = FhirContext.forDstu2Hl7Org(); + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(SearchHl7OrgDstu2Test.class); + private static int ourPort; + + private static InstantDt ourReturnPublished; + + private static Server ourServer; + + @Test + public void testEncodeConvertsReferencesToRelative() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_query=searchWithRef"); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info(responseContent); + + assertThat(responseContent, not(containsString("text"))); + + assertEquals(200, status.getStatusLine().getStatusCode()); + Patient patient = (Patient) ourCtx.newXmlParser().parseResource(Bundle.class, responseContent).getEntry().get(0).getResource(); + String ref = patient.getManagingOrganization().getReference(); + assertEquals("Organization/555", ref); + assertNull(status.getFirstHeader(Constants.HEADER_CONTENT_LOCATION)); + } + + @Test + public void testEncodeConvertsReferencesToRelativeJson() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_query=searchWithRef&_format=json"); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info(responseContent); + + assertThat(responseContent, not(containsString("text"))); + + assertEquals(200, status.getStatusLine().getStatusCode()); + Patient patient = (Patient) ourCtx.newJsonParser().parseResource(Bundle.class, responseContent).getEntry().get(0).getResource(); + String ref = patient.getManagingOrganization().getReference(); + assertEquals("Organization/555", ref); + assertNull(status.getFirstHeader(Constants.HEADER_CONTENT_LOCATION)); + } + + @Test + public void testResultBundleHasUuid() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_query=searchWithRef"); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info(responseContent); + + assertEquals(200, status.getStatusLine().getStatusCode()); + assertThat(responseContent, PatternMatcher.pattern("id value..[0-9a-f-]+\\\"")); + } + + @Test + public void testResultBundleHasUpdateTime() throws Exception { + ourReturnPublished = new InstantDt("2011-02-03T11:22:33Z"); + + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_query=searchWithBundleProvider&_pretty=true"); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info(responseContent); + + assertThat(responseContent, stringContainsInOrder("")); + } + + @AfterClass + public static void afterClass() throws Exception { + ourServer.stop(); + } + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + DummyPatientResourceProvider patientProvider = new DummyPatientResourceProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + + servlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + /** + * Created by dsotnikov on 2/25/2014. + */ + public static class DummyPatientResourceProvider implements IResourceProvider { + + + @Override + public Class getResourceType() { + return Patient.class; + } + + @Search(queryName="searchWithBundleProvider") + public IBundleProvider searchWithBundleProvider() { + return new IBundleProvider() { + + @Override + public InstantDt getPublished() { + return ourReturnPublished; + } + + @Override + public List getResources(int theFromIndex, int theToIndex) { + throw new IllegalStateException(); + } + + @Override + public Integer preferredPageSize() { + return null; + } + + @Override + public int size() { + return 0; + } + }; + } + + @Search(queryName="searchWithRef") + public Patient searchWithRef() { + Patient patient = new Patient(); + patient.setId("Patient/1/_history/1"); + patient.getManagingOrganization().setReference("http://localhost:" + ourPort + "/Organization/555/_history/666"); + return patient; + } + + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/SearchWithHl7OrgDstu2BundleTest.java b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/SearchWithHl7OrgDstu2BundleTest.java new file mode 100644 index 00000000000..3e226a66470 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/SearchWithHl7OrgDstu2BundleTest.java @@ -0,0 +1,117 @@ +package ca.uhn.fhir.rest.server; + +import static org.hamcrest.Matchers.*; +import static org.junit.Assert.*; + +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.instance.model.Bundle; +import org.hl7.fhir.instance.model.Patient; +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.rest.annotation.Search; +import ca.uhn.fhir.util.PortUtil; + +public class SearchWithHl7OrgDstu2BundleTest { + + private static CloseableHttpClient ourClient; + private static int ourPort; + private static Server ourServer; + private static FhirContext ourCtx = FhirContext.forDstu2Hl7Org(); + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(SearchWithHl7OrgDstu2BundleTest.class); + + @Test + public void testSearch() throws Exception { + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_format=xml&_pretty=true"); + HttpResponse status = ourClient.execute(httpGet); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals(200, status.getStatusLine().getStatusCode()); + + responseContent = responseContent.replace("_pretty=true&_format=xml", "_format=xml&_pretty=true"); + + ourLog.info(responseContent); + + //@formatter:off + assertThat(responseContent, stringContainsInOrder("", + "", + "" , + "" , + "", + "", + "" , + "" , + "" , + "")); + // @formatter:off + } + + + @AfterClass + public static void afterClass() throws Exception { + ourServer.stop(); + } + + @BeforeClass + public static void beforeClass() throws Exception { + + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + DummyPatientResourceProvider patientProvider = new DummyPatientResourceProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + servlet.setFhirContext(ourCtx); + servlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + /** + * Created by dsotnikov on 2/25/2014. + */ + public static class DummyPatientResourceProvider implements IResourceProvider { + + @Search + public Bundle search() { + Bundle retVal = new Bundle(); + + Patient p1 = new Patient(); + p1.setId("Patient/123/_history/456"); + p1.addIdentifier().setValue("p1ReadValue"); + + retVal.addEntry().setResource(p1); + + return retVal; + } + + @Override + public Class getResourceType() { + return Patient.class; + } + + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/ServerConformanceProviderHl7OrgDstu2Test.java b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/ServerConformanceProviderHl7OrgDstu2Test.java new file mode 100644 index 00000000000..dae875df60f --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/ServerConformanceProviderHl7OrgDstu2Test.java @@ -0,0 +1,546 @@ +package ca.uhn.fhir.rest.server; + +import static org.hamcrest.Matchers.*; +import static org.junit.Assert.*; +import static org.mockito.Mockito.*; + +import java.util.Collection; +import java.util.List; +import java.util.Set; + +import javax.servlet.ServletConfig; +import javax.servlet.http.HttpServletRequest; + +import org.hl7.fhir.instance.conf.ServerConformanceProvider; +import org.hl7.fhir.instance.model.Conformance; +import org.hl7.fhir.instance.model.Conformance.ConformanceRestComponent; +import org.hl7.fhir.instance.model.Conformance.ConformanceRestResourceComponent; +import org.hl7.fhir.instance.model.Conformance.SystemRestfulInteraction; +import org.hl7.fhir.instance.model.Conformance.TypeRestfulInteraction; +import org.hl7.fhir.instance.model.DiagnosticReport; +import org.hl7.fhir.instance.model.Patient; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.model.api.Include; +import ca.uhn.fhir.model.api.annotation.Description; +import ca.uhn.fhir.model.primitive.DateDt; +import ca.uhn.fhir.model.primitive.IdDt; +import ca.uhn.fhir.model.primitive.StringDt; +import ca.uhn.fhir.rest.annotation.ConditionalUrlParam; +import ca.uhn.fhir.rest.annotation.Create; +import ca.uhn.fhir.rest.annotation.Delete; +import ca.uhn.fhir.rest.annotation.History; +import ca.uhn.fhir.rest.annotation.IdParam; +import ca.uhn.fhir.rest.annotation.IncludeParam; +import ca.uhn.fhir.rest.annotation.Operation; +import ca.uhn.fhir.rest.annotation.OperationParam; +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.api.MethodOutcome; +import ca.uhn.fhir.rest.method.BaseMethodBinding; +import ca.uhn.fhir.rest.method.SearchMethodBinding; +import ca.uhn.fhir.rest.method.SearchParameter; +import ca.uhn.fhir.rest.param.DateRangeParam; +import ca.uhn.fhir.rest.param.TokenOrListParam; +import ca.uhn.fhir.rest.param.TokenParam; + +public class ServerConformanceProviderHl7OrgDstu2Test { + + private static FhirContext ourCtx = FhirContext.forDstu2Hl7Org(); + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ServerConformanceProviderHl7OrgDstu2Test.class); + + private HttpServletRequest createHttpServletRequest() { + HttpServletRequest req = mock(HttpServletRequest.class); + when(req.getRequestURI()).thenReturn("/FhirStorm/fhir/Patient/_search"); + when(req.getServletPath()).thenReturn("/fhir"); + when(req.getRequestURL()).thenReturn(new StringBuffer().append("http://fhirstorm.dyndns.org:8080/FhirStorm/fhir/Patient/_search")); + when(req.getContextPath()).thenReturn("/FhirStorm"); + return req; + } + + private ServletConfig createServletConfig() { + ServletConfig sc = mock(ServletConfig.class); + when(sc.getServletContext()).thenReturn(null); + return sc; + } + + @Test + public void testExtendedOperationReturningBundle() throws Exception { + + RestfulServer rs = new RestfulServer(ourCtx); + rs.setProviders(new ProviderWithExtendedOperationReturningBundle()); + + ServerConformanceProvider sc = new ServerConformanceProvider(rs); + rs.setServerConformanceProvider(sc); + + rs.init(createServletConfig()); + + Conformance conformance = sc.getServerConformance(createHttpServletRequest()); + + String conf = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(conformance); + ourLog.info(conf); + + } + + @Test + public void testInstanceHistorySupported() throws Exception { + + RestfulServer rs = new RestfulServer(ourCtx); + rs.setProviders(new InstanceHistoryProvider()); + + ServerConformanceProvider sc = new ServerConformanceProvider(rs); + rs.setServerConformanceProvider(sc); + + rs.init(createServletConfig()); + + Conformance conformance = sc.getServerConformance(createHttpServletRequest()); + String conf = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(conformance); + ourLog.info(conf); + + conf = ourCtx.newXmlParser().setPrettyPrint(false).encodeResourceToString(conformance); + assertThat(conf, containsString("")); + } + + @Test + public void testMultiOptionalDocumentation() throws Exception { + + RestfulServer rs = new RestfulServer(ourCtx); + rs.setProviders(new MultiOptionalProvider()); + + ServerConformanceProvider sc = new ServerConformanceProvider(rs); + rs.setServerConformanceProvider(sc); + + rs.init(createServletConfig()); + + boolean found = false; + Collection resourceBindings = rs.getResourceBindings(); + for (ResourceBinding resourceBinding : resourceBindings) { + if (resourceBinding.getResourceName().equals("Patient")) { + List> methodBindings = resourceBinding.getMethodBindings(); + SearchMethodBinding binding = (SearchMethodBinding) methodBindings.get(0); + SearchParameter param = (SearchParameter) binding.getParameters().iterator().next(); + assertEquals("The patient's identifier", param.getDescription()); + found = true; + } + } + + assertTrue(found); + Conformance conformance = sc.getServerConformance(createHttpServletRequest()); + String conf = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(conformance); + ourLog.info(conf); + + assertThat(conf, containsString("")); + assertThat(conf, containsString("")); + assertThat(conf, containsString("")); + } + + @Test + public void testOperationDocumentation() throws Exception { + + RestfulServer rs = new RestfulServer(ourCtx); + rs.setProviders(new SearchProvider()); + + ServerConformanceProvider sc = new ServerConformanceProvider(rs); + rs.setServerConformanceProvider(sc); + + rs.init(createServletConfig()); + + boolean found = false; + Collection resourceBindings = rs.getResourceBindings(); + for (ResourceBinding resourceBinding : resourceBindings) { + if (resourceBinding.getResourceName().equals("Patient")) { + List> methodBindings = resourceBinding.getMethodBindings(); + SearchMethodBinding binding = (SearchMethodBinding) methodBindings.get(0); + SearchParameter param = (SearchParameter) binding.getParameters().iterator().next(); + assertEquals("The patient's identifier (MRN or other card number)", param.getDescription()); + found = true; + } + } + assertTrue(found); + Conformance conformance = sc.getServerConformance(createHttpServletRequest()); + + String conf = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(conformance); + ourLog.info(conf); + + assertThat(conf, containsString("")); + assertThat(conf, containsString("")); + + } + + @Test + public void testProviderWithRequiredAndOptional() throws Exception { + + RestfulServer rs = new RestfulServer(ourCtx); + rs.setProviders(new ProviderWithRequiredAndOptional()); + + ServerConformanceProvider sc = new ServerConformanceProvider(rs); + rs.setServerConformanceProvider(sc); + + rs.init(createServletConfig()); + + Conformance conformance = sc.getServerConformance(createHttpServletRequest()); + String conf = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(conformance); + ourLog.info(conf); + + ConformanceRestComponent rest = conformance.getRest().get(0); + ConformanceRestResourceComponent res = rest.getResource().get(0); + assertEquals("DiagnosticReport", res.getType()); + + assertEquals(DiagnosticReport.SP_SUBJECT, res.getSearchParam().get(0).getName()); + assertEquals("identifier", res.getSearchParam().get(0).getChain().get(0).getValue()); + + assertEquals(DiagnosticReport.SP_NAME, res.getSearchParam().get(2).getName()); + + assertEquals(DiagnosticReport.SP_DATE, res.getSearchParam().get(1).getName()); + + assertEquals(1, res.getSearchInclude().size()); + assertEquals("DiagnosticReport.result", res.getSearchInclude().get(0).getValue()); + } + + @Test + public void testReadAndVReadSupported() throws Exception { + + RestfulServer rs = new RestfulServer(ourCtx); + rs.setProviders(new VreadProvider()); + + ServerConformanceProvider sc = new ServerConformanceProvider(rs); + rs.setServerConformanceProvider(sc); + + rs.init(createServletConfig()); + + Conformance conformance = sc.getServerConformance(createHttpServletRequest()); + String conf = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(conformance); + ourLog.info(conf); + + conf = ourCtx.newXmlParser().setPrettyPrint(false).encodeResourceToString(conformance); + assertThat(conf, containsString("")); + assertThat(conf, containsString("")); + } + + @Test + public void testReadSupported() throws Exception { + + RestfulServer rs = new RestfulServer(ourCtx); + rs.setProviders(new ReadProvider()); + + ServerConformanceProvider sc = new ServerConformanceProvider(rs); + rs.setServerConformanceProvider(sc); + + rs.init(createServletConfig()); + + Conformance conformance = sc.getServerConformance(createHttpServletRequest()); + String conf = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(conformance); + ourLog.info(conf); + + conf = ourCtx.newXmlParser().setPrettyPrint(false).encodeResourceToString(conformance); + assertThat(conf, not(containsString(""))); + assertThat(conf, containsString("")); + } + + @Test + public void testConditionalOperations() throws Exception { + + RestfulServer rs = new RestfulServer(ourCtx); + rs.setProviders(new ConditionalProvider()); + + ServerConformanceProvider sc = new ServerConformanceProvider(rs); + rs.setServerConformanceProvider(sc); + + rs.init(createServletConfig()); + + Conformance conformance = sc.getServerConformance(createHttpServletRequest()); + String conf = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(conformance); + ourLog.info(conf); + + ConformanceRestResourceComponent res = conformance.getRest().get(0).getResource().get(0); + assertEquals("Patient", res.getType()); + + assertTrue(res.getConditionalCreate()); + assertTrue(res.getConditionalDelete()); + assertTrue(res.getConditionalUpdate()); + } + + @Test + public void testNonConditionalOperations() throws Exception { + + RestfulServer rs = new RestfulServer(ourCtx); + rs.setProviders(new NonConditionalProvider()); + + ServerConformanceProvider sc = new ServerConformanceProvider(rs); + rs.setServerConformanceProvider(sc); + + rs.init(createServletConfig()); + + Conformance conformance = sc.getServerConformance(createHttpServletRequest()); + String conf = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(conformance); + ourLog.info(conf); + + ConformanceRestResourceComponent res = conformance.getRest().get(0).getResource().get(0); + assertEquals("Patient", res.getType()); + + assertNull(res.getConditionalCreateElement().getValue()); + assertNull(res.getConditionalDeleteElement().getValue()); + assertNull(res.getConditionalUpdateElement().getValue()); + } + + @Test + public void testSearchParameterDocumentation() throws Exception { + + RestfulServer rs = new RestfulServer(ourCtx); + rs.setProviders(new SearchProvider()); + + ServerConformanceProvider sc = new ServerConformanceProvider(rs); + rs.setServerConformanceProvider(sc); + + rs.init(createServletConfig()); + + boolean found = false; + Collection resourceBindings = rs.getResourceBindings(); + for (ResourceBinding resourceBinding : resourceBindings) { + if (resourceBinding.getResourceName().equals("Patient")) { + List> methodBindings = resourceBinding.getMethodBindings(); + SearchMethodBinding binding = (SearchMethodBinding) methodBindings.get(0); + SearchParameter param = (SearchParameter) binding.getParameters().iterator().next(); + assertEquals("The patient's identifier (MRN or other card number)", param.getDescription()); + found = true; + } + } + assertTrue(found); + Conformance conformance = sc.getServerConformance(createHttpServletRequest()); + + String conf = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(conformance); + ourLog.info(conf); + + assertThat(conf, containsString("")); + assertThat(conf, containsString("")); + + } + + @Test + public void testSystemHistorySupported() throws Exception { + + RestfulServer rs = new RestfulServer(ourCtx); + rs.setProviders(new SystemHistoryProvider()); + + ServerConformanceProvider sc = new ServerConformanceProvider(rs); + rs.setServerConformanceProvider(sc); + + rs.init(createServletConfig()); + + Conformance conformance = sc.getServerConformance(createHttpServletRequest()); + String conf = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(conformance); + ourLog.info(conf); + + conf = ourCtx.newXmlParser().setPrettyPrint(false).encodeResourceToString(conformance); + assertThat(conf, containsString("")); + } + + @Test + public void testTypeHistorySupported() throws Exception { + + RestfulServer rs = new RestfulServer(ourCtx); + rs.setProviders(new TypeHistoryProvider()); + + ServerConformanceProvider sc = new ServerConformanceProvider(rs); + rs.setServerConformanceProvider(sc); + + rs.init(createServletConfig()); + + Conformance conformance = sc.getServerConformance(createHttpServletRequest()); + String conf = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(conformance); + ourLog.info(conf); + + conf = ourCtx.newXmlParser().setPrettyPrint(false).encodeResourceToString(conformance); + assertThat(conf, containsString("")); + } + + @Test + public void testValidateGeneratedStatement() throws Exception { + + RestfulServer rs = new RestfulServer(ourCtx); + rs.setProviders(new MultiOptionalProvider()); + + ServerConformanceProvider sc = new ServerConformanceProvider(rs); + rs.setServerConformanceProvider(sc); + + rs.init(createServletConfig()); + + Conformance conformance = sc.getServerConformance(createHttpServletRequest()); + + assertTrue(ourCtx.newValidator().validateWithResult(conformance).isSuccessful()); + } + + public static class InstanceHistoryProvider implements IResourceProvider { + @Override + public Class getResourceType() { + return Patient.class; + } + + @History + public List history(@IdParam IdDt theId) { + return null; + } + + } + + /** + * Created by dsotnikov on 2/25/2014. + */ + public static class MultiOptionalProvider { + + @Search(type = Patient.class) + public Patient findPatient(@Description(shortDefinition = "The patient's identifier") @OptionalParam(name = Patient.SP_IDENTIFIER) TokenParam theIdentifier, @Description(shortDefinition = "The patient's name") @OptionalParam(name = Patient.SP_NAME) StringDt theName) { + return null; + } + + } + + public static class ProviderWithExtendedOperationReturningBundle implements IResourceProvider { + + @Operation(name = "everything", idempotent = true) + public ca.uhn.fhir.rest.server.IBundleProvider everything(javax.servlet.http.HttpServletRequest theServletRequest, @IdParam ca.uhn.fhir.model.primitive.IdDt theId, @OperationParam(name = "start") DateDt theStart, @OperationParam(name = "end") DateDt theEnd) { + return null; + } + + @Override + public Class getResourceType() { + return Patient.class; + } + + } + + public static class ProviderWithRequiredAndOptional { + + @Description(shortDefinition = "This is a search for stuff!") + @Search + public List findDiagnosticReportsByPatient(@RequiredParam(name = DiagnosticReport.SP_SUBJECT + '.' + Patient.SP_IDENTIFIER) TokenParam thePatientId, @OptionalParam(name = DiagnosticReport.SP_NAME) TokenOrListParam theNames, + @OptionalParam(name = DiagnosticReport.SP_DATE) DateRangeParam theDateRange, @IncludeParam(allow = { "DiagnosticReport.result" }) Set theIncludes) throws Exception { + return null; + } + + } + + /** + * Created by dsotnikov on 2/25/2014. + */ + public static class ReadProvider { + + @Search(type = Patient.class) + public Patient findPatient(@Description(shortDefinition = "The patient's identifier (MRN or other card number)") @RequiredParam(name = Patient.SP_IDENTIFIER) TokenParam theIdentifier) { + return null; + } + + @Read(version = false) + public Patient readPatient(@IdParam IdDt theId) { + return null; + } + + } + + /** + * Created by dsotnikov on 2/25/2014. + */ + public static class SearchProvider { + + @Search(type = Patient.class) + public Patient findPatient(@Description(shortDefinition = "The patient's identifier (MRN or other card number)") @RequiredParam(name = Patient.SP_IDENTIFIER) TokenParam theIdentifier) { + return null; + } + + } + + public static class SystemHistoryProvider { + + @History + public List history() { + return null; + } + + } + + public static class TypeHistoryProvider implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + @History + public List history() { + return null; + } + + } + + public static class ConditionalProvider implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + @Create + public MethodOutcome create(@ResourceParam Patient thePatient, @ConditionalUrlParam String theConditionalUrl) { + return null; + } + + @Update + public MethodOutcome update(@IdParam IdDt theId, @ResourceParam Patient thePatient, @ConditionalUrlParam String theConditionalUrl) { + return null; + } + + @Delete + public MethodOutcome delete(@IdParam IdDt theId, @ConditionalUrlParam String theConditionalUrl) { + return null; + } + + } + + public static class NonConditionalProvider implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + @Create + public MethodOutcome create(@ResourceParam Patient thePatient) { + return null; + } + + @Update + public MethodOutcome update(@IdParam IdDt theId, @ResourceParam Patient thePatient) { + return null; + } + + @Delete + public MethodOutcome delete(@IdParam IdDt theId) { + return null; + } + + } + + /** + * Created by dsotnikov on 2/25/2014. + */ + public static class VreadProvider { + + @Search(type = Patient.class) + public Patient findPatient(@Description(shortDefinition = "The patient's identifier (MRN or other card number)") @RequiredParam(name = Patient.SP_IDENTIFIER) TokenParam theIdentifier) { + return null; + } + + @Read(version = true) + public Patient readPatient(@IdParam IdDt theId) { + return null; + } + + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/ServerInvalidDefinitionHl7OrgDstu2Test.java b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/ServerInvalidDefinitionHl7OrgDstu2Test.java new file mode 100644 index 00000000000..a6824773b08 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/ServerInvalidDefinitionHl7OrgDstu2Test.java @@ -0,0 +1,50 @@ +package ca.uhn.fhir.rest.server; + +import static org.junit.Assert.*; + +import javax.servlet.ServletException; + +import org.hamcrest.core.StringContains; +import org.hl7.fhir.instance.model.Patient; +import org.hl7.fhir.instance.model.api.IBaseResource; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.model.primitive.StringDt; +import ca.uhn.fhir.rest.annotation.Operation; +import ca.uhn.fhir.rest.annotation.OperationParam; + +public class ServerInvalidDefinitionHl7OrgDstu2Test { + + private static FhirContext ourCtx = FhirContext.forDstu2Hl7Org(); + + @Test + public void testOperationReturningOldBundleProvider() { + RestfulServer srv = new RestfulServer(ourCtx); + srv.setFhirContext(ourCtx); + srv.setResourceProviders(new OperationReturningOldBundleProvider()); + + try { + srv.init(); + fail(); + } catch (ServletException e) { + assertThat(e.getCause().toString(), StringContains.containsString("ConfigurationException")); + assertThat(e.getCause().toString(), StringContains.containsString("Can not return a DSTU1 bundle")); + } + } + + public static class OperationReturningOldBundleProvider implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + @Operation(name = "$OP_TYPE_RET_OLD_BUNDLE") + public ca.uhn.fhir.model.api.Bundle opTypeRetOldBundle(@OperationParam(name = "PARAM1") StringDt theParam1, @OperationParam(name = "PARAM2") Patient theParam2) { + return null; + } + + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/TransactionWithBundleResourceParamHl7OrgDstu2Test.java b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/TransactionWithBundleResourceParamHl7OrgDstu2Test.java new file mode 100644 index 00000000000..f02764b2227 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/TransactionWithBundleResourceParamHl7OrgDstu2Test.java @@ -0,0 +1,289 @@ +package ca.uhn.fhir.rest.server; + +import static org.junit.Assert.*; + +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.instance.model.Bundle; +import org.hl7.fhir.instance.model.Bundle.BundleEntryComponent; +import org.hl7.fhir.instance.model.Bundle.HTTPVerb; +import org.hl7.fhir.instance.model.Conformance; +import org.hl7.fhir.instance.model.Conformance.SystemInteractionComponent; +import org.hl7.fhir.instance.model.Conformance.SystemRestfulInteraction; +import org.hl7.fhir.instance.model.IdType; +import org.hl7.fhir.instance.model.InstantType; +import org.hl7.fhir.instance.model.OperationOutcome; +import org.hl7.fhir.instance.model.Patient; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.rest.annotation.Transaction; +import ca.uhn.fhir.rest.annotation.TransactionParam; +import ca.uhn.fhir.rest.client.IGenericClient; +import ca.uhn.fhir.rest.client.interceptor.LoggingInterceptor; +import ca.uhn.fhir.util.PortUtil; + +/** + * Created by dsotnikov on 2/25/2014. + */ +public class TransactionWithBundleResourceParamHl7OrgDstu2Test { + + @Test + public void testIt() { + + } + + private static CloseableHttpClient ourClient; + private static FhirContext ourCtx = FhirContext.forDstu2Hl7Org(); + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(TransactionWithBundleResourceParamHl7OrgDstu2Test.class); + private static int ourPort; + private static boolean ourReturnOperationOutcome; + + private static Server ourServer; + + @Before + public void before() { + ourReturnOperationOutcome = false; + } + + @Test + public void testConformance() { + ourCtx.getRestfulClientFactory().setSocketTimeout(500000); + IGenericClient client = ourCtx.newRestfulGenericClient("http://localhost:" + ourPort + "/"); + client.registerInterceptor(new LoggingInterceptor(true)); + Conformance rest = client.fetchConformance().ofType(Conformance.class).prettyPrint().execute(); + boolean supportsTransaction = false; + for (SystemInteractionComponent next : rest.getRest().get(0).getInteraction()) { + ourLog.info("Supports interaction: {}"); + if (next.getCodeElement().getValue() == SystemRestfulInteraction.TRANSACTION) { + supportsTransaction = true; + } + } + + assertTrue(supportsTransaction); + } + + @Test + public void testTransactionWithXmlRequest() throws Exception { + Bundle b = new Bundle(); + InstantType nowInstant = InstantType.withCurrentTime(); + + Patient p1 = new Patient(); + p1.addName().addFamily("Family1"); + BundleEntryComponent entry = b.addEntry(); + p1.getIdElement().setValue("1"); + entry.setResource(p1); + + Patient p2 = new Patient(); + p2.addName().addFamily("Family2"); + entry = b.addEntry(); + p2.getIdElement().setValue("2"); + entry.setResource(p2); + + BundleEntryComponent deletedEntry = b.addEntry(); + deletedEntry.getTransaction().setMethod(HTTPVerb.DELETE); + deletedEntry.getTransaction().setUrl("http://base.com/Patient/123"); + + String bundleString = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(b); + ourLog.info(bundleString); + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/"); + httpPost.setEntity(new StringEntity(bundleString, ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + HttpResponse status = ourClient.execute(httpPost); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals(200, status.getStatusLine().getStatusCode()); + + ourLog.info(responseContent); + + Bundle bundle = ourCtx.newXmlParser().parseResource(Bundle.class, responseContent); + assertEquals(3, bundle.getEntry().size()); + + BundleEntryComponent entry0 = bundle.getEntry().get(0); + assertEquals("Patient/81/_history/91", entry0.getTransactionResponse().getLocation()); + + BundleEntryComponent entry1 = bundle.getEntry().get(1); + assertEquals( "Patient/82/_history/92", entry1.getTransactionResponse().getLocation()); + + BundleEntryComponent entry2 = bundle.getEntry().get(2); + assertEquals("Patient/123/_history/93", entry2.getTransactionResponse().getLocation()); + } + + @Test + public void testTransactionWithJsonRequest() throws Exception { + Bundle b = new Bundle(); + InstantType nowInstant = InstantType.withCurrentTime(); + + Patient p1 = new Patient(); + p1.addName().addFamily("Family1"); + BundleEntryComponent entry = b.addEntry(); + p1.getIdElement().setValue("1"); + entry.setResource(p1); + + Patient p2 = new Patient(); + p2.addName().addFamily("Family2"); + entry = b.addEntry(); + p2.getIdElement().setValue("2"); + entry.setResource(p2); + + BundleEntryComponent deletedEntry = b.addEntry(); + deletedEntry.getTransaction().setMethod(HTTPVerb.DELETE); + deletedEntry.getTransaction().setUrl("http://base.com/Patient/123"); + + String bundleString = ourCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(b); + ourLog.info(bundleString); + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/"); +// httpPost.addHeader("Accept", Constants.CT_ATOM_XML + "; pretty=true"); + httpPost.setEntity(new StringEntity(bundleString, ContentType.create(Constants.CT_FHIR_JSON, "UTF-8"))); + HttpResponse status = ourClient.execute(httpPost); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals(200, status.getStatusLine().getStatusCode()); + + ourLog.info(responseContent); + + Bundle bundle = ourCtx.newXmlParser().parseResource(Bundle.class, responseContent); + assertEquals(3, bundle.getEntry().size()); + + BundleEntryComponent entry0 = bundle.getEntry().get(0); + assertEquals("Patient/81/_history/91", entry0.getTransactionResponse().getLocation()); + + BundleEntryComponent entry1 = bundle.getEntry().get(1); + assertEquals( "Patient/82/_history/92", entry1.getTransactionResponse().getLocation()); + + BundleEntryComponent entry2 = bundle.getEntry().get(2); + assertEquals("Patient/123/_history/93", entry2.getTransactionResponse().getLocation()); + } + + @Test + public void testTransactionWithOperationOutcome() throws Exception { + ourReturnOperationOutcome = true; + + Bundle b = new Bundle(); + InstantType nowInstant = InstantType.withCurrentTime(); + + Patient p1 = new Patient(); + p1.addName().addFamily("Family1"); + BundleEntryComponent entry = b.addEntry(); + p1.getIdElement().setValue("1"); + entry.setResource(p1); + + Patient p2 = new Patient(); + p2.addName().addFamily("Family2"); + entry = b.addEntry(); + p2.getIdElement().setValue("2"); + entry.setResource(p2); + + BundleEntryComponent deletedEntry = b.addEntry(); + deletedEntry.getTransaction().setMethod(HTTPVerb.DELETE); + deletedEntry.getTransaction().setUrl(("Patient/3")); + + String bundleString = ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(b); + ourLog.info(bundleString); + + String base = "http://localhost:" + ourPort + "/"; + HttpPost httpPost = new HttpPost(base); + httpPost.addHeader("Accept", Constants.CT_ATOM_XML + "; pretty=true"); + httpPost.setEntity(new StringEntity(bundleString, ContentType.create(Constants.CT_ATOM_XML, "UTF-8"))); + HttpResponse status = ourClient.execute(httpPost); + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals(200, status.getStatusLine().getStatusCode()); + + ourLog.info(responseContent); + + Bundle bundle = ourCtx.newXmlParser().parseResource(Bundle.class, responseContent); + assertEquals(4, bundle.getEntry().size()); + + assertEquals(OperationOutcome.class, bundle.getEntry().get(0).getResource().getClass()); + + BundleEntryComponent entry0 = bundle.getEntry().get(1); + assertEquals("Patient/81/_history/91", entry0.getTransactionResponse().getLocation()); + + BundleEntryComponent entry1 = bundle.getEntry().get(2); + assertEquals("Patient/82/_history/92", entry1.getTransactionResponse().getLocation()); + + BundleEntryComponent entry2 = bundle.getEntry().get(3); + assertEquals( "Patient/3/_history/93", entry2.getTransactionResponse().getLocation()); + } + + @AfterClass + public static void afterClass() throws Exception { + ourServer.stop(); + } + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + DummyProvider patientProvider = new DummyProvider(); + RestfulServer server = new RestfulServer(ourCtx); + server.setProviders(patientProvider); + + org.eclipse.jetty.servlet.ServletContextHandler proxyHandler = new org.eclipse.jetty.servlet.ServletContextHandler(); + proxyHandler.setContextPath("/"); + + ServletHolder handler = new ServletHolder(); + handler.setServlet(server); + proxyHandler.addServlet(handler, "/*"); + + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(500000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + /** + * Created by dsotnikov on 2/25/2014. + */ + public static class DummyProvider { + + @Transaction + public Bundle transaction(@TransactionParam Bundle theResources) { + Bundle retVal = new Bundle(); + + if (ourReturnOperationOutcome) { + OperationOutcome oo = new OperationOutcome(); + oo.addIssue().setDetails("AAAAA"); + retVal.addEntry().setResource(oo); + } + + int index = 1; + for (BundleEntryComponent nextEntry : theResources.getEntry()) { + String newId = "8" + Integer.toString(index); + if (nextEntry.getTransaction().getMethodElement().getValue() == HTTPVerb.DELETE) { + newId = new IdType(nextEntry.getTransaction().getUrlElement()).getIdPart(); + } + String newIdDt = new IdType("Patient", newId, "9" + Integer.toString(index)).getValue(); + retVal.addEntry().getTransactionResponse().setLocation(newIdDt); + index++; + } + + return retVal; + } + + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/UpdateConditionalTest.java b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/UpdateConditionalTest.java new file mode 100644 index 00000000000..da62fac8c39 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/UpdateConditionalTest.java @@ -0,0 +1,191 @@ +package ca.uhn.fhir.rest.server; + +import static org.junit.Assert.*; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPut; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.instance.model.IdType; +import org.hl7.fhir.instance.model.Patient; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.model.api.IResource; +import ca.uhn.fhir.model.primitive.IdDt; +import ca.uhn.fhir.model.primitive.StringDt; +import ca.uhn.fhir.rest.annotation.ConditionalUrlParam; +import ca.uhn.fhir.rest.annotation.IdParam; +import ca.uhn.fhir.rest.annotation.OptionalParam; +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.api.MethodOutcome; +import ca.uhn.fhir.util.PortUtil; + +/** + * Created by dsotnikov on 2/25/2014. + */ +public class UpdateConditionalTest { + private static CloseableHttpClient ourClient; + private static String ourLastConditionalUrl; + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(UpdateConditionalTest.class); + private static int ourPort; + private static FhirContext ourCtx = FhirContext.forDstu2Hl7Org(); + private static Server ourServer; + private static String ourLastId; + private static IdDt ourLastIdParam; + private static boolean ourLastRequestWasSearch; + + + + @Before + public void before() { + ourLastId = null; + ourLastConditionalUrl = null; + ourLastIdParam = null; + ourLastRequestWasSearch = false; + } + + @Test + public void testUpdateWithConditionalUrl() throws Exception { + + Patient patient = new Patient(); + patient.addIdentifier().setValue("002"); + + HttpPut httpPost = new HttpPut("http://localhost:" + ourPort + "/Patient?identifier=system%7C001"); + httpPost.setEntity(new StringEntity(ourCtx.newXmlParser().encodeResourceToString(patient), ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + + HttpResponse status = ourClient.execute(httpPost); + + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info("Response was:\n{}", responseContent); + + assertEquals(200, status.getStatusLine().getStatusCode()); + assertEquals("http://localhost:" + ourPort + "/Patient/001/_history/002", status.getFirstHeader("location").getValue()); + assertEquals("http://localhost:" + ourPort + "/Patient/001/_history/002", status.getFirstHeader("content-location").getValue()); + + assertNull(ourLastId); + assertNull(ourLastIdParam); + assertEquals("Patient?identifier=system%7C001", ourLastConditionalUrl); + + } + + @Test + public void testUpdateWithoutConditionalUrl() throws Exception { + + Patient patient = new Patient(); + patient.addIdentifier().setValue("002"); + + HttpPut httpPost = new HttpPut("http://localhost:" + ourPort + "/Patient/2"); + httpPost.setEntity(new StringEntity(ourCtx.newXmlParser().encodeResourceToString(patient), ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + + HttpResponse status = ourClient.execute(httpPost); + + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info("Response was:\n{}", responseContent); + + assertEquals(200, status.getStatusLine().getStatusCode()); + assertEquals("http://localhost:" + ourPort + "/Patient/001/_history/002", status.getFirstHeader("location").getValue()); + assertEquals("http://localhost:" + ourPort + "/Patient/001/_history/002", status.getFirstHeader("content-location").getValue()); + + assertEquals("Patient/2", new IdType(ourLastId).toUnqualified().getValue()); + assertEquals("Patient/2", ourLastIdParam.toUnqualified().getValue()); + assertNull(ourLastConditionalUrl); + + } + + @Test + public void testSearchStillWorks() throws Exception { + + Patient patient = new Patient(); + patient.addIdentifier().setValue("002"); + + HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?_pretty=true"); + + HttpResponse status = ourClient.execute(httpGet); + + String responseContent = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + ourLog.info("Response was:\n{}", responseContent); + + assertTrue(ourLastRequestWasSearch); + assertNull(ourLastId); + assertNull(ourLastIdParam); + assertNull(ourLastConditionalUrl); + + } + + + @AfterClass + public static void afterClass() throws Exception { + ourServer.stop(); + } + + + @BeforeClass + public static void beforeClass() throws Exception { + ourPort = PortUtil.findFreePort(); + ourServer = new Server(ourPort); + + PatientProvider patientProvider = new PatientProvider(); + + ServletHandler proxyHandler = new ServletHandler(); + RestfulServer servlet = new RestfulServer(ourCtx); + servlet.setResourceProviders(patientProvider); + ServletHolder servletHolder = new ServletHolder(servlet); + proxyHandler.addServletWithMapping(servletHolder, "/*"); + ourServer.setHandler(proxyHandler); + ourServer.start(); + + PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS); + HttpClientBuilder builder = HttpClientBuilder.create(); + builder.setConnectionManager(connectionManager); + ourClient = builder.build(); + + } + + public static class PatientProvider implements IResourceProvider { + + @Override + public Class getResourceType() { + return Patient.class; + } + + @Search + public List search(@OptionalParam(name="foo") StringDt theString) { + ourLastRequestWasSearch = true; + return new ArrayList(); + } + + @Update() + public MethodOutcome updatePatient(@ResourceParam Patient thePatient, @ConditionalUrlParam String theConditional, @IdParam IdDt theIdParam) { + ourLastConditionalUrl = theConditional; + ourLastId = thePatient.getId(); + ourLastIdParam = theIdParam; + return new MethodOutcome(new IdDt("Patient/001/_history/002")); + } + + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/ValidateDstu2Test.java b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/ValidateDstu2Test.java new file mode 100644 index 00000000000..409f0b482fb --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/rest/server/ValidateDstu2Test.java @@ -0,0 +1,225 @@ +package ca.uhn.fhir.rest.server; + +import static org.hamcrest.Matchers.*; +import static org.junit.Assert.*; + +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.servlet.ServletHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.hl7.fhir.instance.model.IdType; +import org.hl7.fhir.instance.model.OperationOutcome; +import org.hl7.fhir.instance.model.Organization; +import org.hl7.fhir.instance.model.Parameters; +import org.hl7.fhir.instance.model.Patient; +import org.hl7.fhir.instance.model.StringType; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.model.api.IResource; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; +import ca.uhn.fhir.model.primitive.IdDt; +import ca.uhn.fhir.rest.annotation.ResourceParam; +import ca.uhn.fhir.rest.annotation.Validate; +import ca.uhn.fhir.rest.api.MethodOutcome; +import ca.uhn.fhir.rest.api.ValidationModeEnum; +import ca.uhn.fhir.util.PortUtil; + +/** + * Created by dsotnikov on 2/25/2014. + */ +public class ValidateDstu2Test { + private static CloseableHttpClient ourClient; + private static EncodingEnum ourLastEncoding; + private static String ourLastResourceBody; + private static int ourPort; + private static Server ourServer; + private static OperationOutcome ourOutcomeToReturn; + private static ValidationModeEnum ourLastMode; + private static String ourLastProfile; + private static FhirContext ourCtx = FhirContext.forDstu2Hl7Org(); + + @Before() + public void before() { + ourLastResourceBody = null; + ourLastEncoding = null; + ourOutcomeToReturn = null; + ourLastMode = null; + ourLastProfile = null; + } + + @Test + public void testValidateWithOptions() throws Exception { + + Patient patient = new Patient(); + patient.addIdentifier().setValue("001"); + patient.addIdentifier().setValue("002"); + + Parameters params = new Parameters(); + params.addParameter().setName("resource").setResource(patient); + params.addParameter().setName("profile").setValue(new StringType("http://foo")); + params.addParameter().setName("mode").setValue(new StringType(ValidationModeEnum.CREATE.name())); + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient/$validate"); + httpPost.setEntity(new StringEntity(ourCtx.newXmlParser().encodeResourceToString(params), ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + + HttpResponse status = ourClient.execute(httpPost); + String resp = IOUtils.toString(status.getEntity().getContent()); + IOUtils.closeQuietly(status.getEntity().getContent()); + + assertEquals(200, status.getStatusLine().getStatusCode()); + + assertThat(resp, stringContainsInOrder(" getResourceType() { + return Patient.class; + } + + } + + public static class OrganizationProvider implements IResourceProvider { + + @Validate() + public MethodOutcome validate(@ResourceParam String theResourceBody, @ResourceParam EncodingEnum theEncoding) { + ourLastResourceBody = theResourceBody; + ourLastEncoding = theEncoding; + + return new MethodOutcome(new IdDt("001")); + } + + @Override + public Class getResourceType() { + return Organization.class; + } + + } + +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/util/PatternMatcher.java b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/util/PatternMatcher.java new file mode 100644 index 00000000000..cf126c64ee7 --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/test/java/ca/uhn/fhir/util/PatternMatcher.java @@ -0,0 +1,68 @@ +package ca.uhn.fhir.util; + +import java.util.regex.Pattern; + +import org.hamcrest.Factory; +import org.hamcrest.Matcher; +import org.hamcrest.TypeSafeMatcher; + +/** + * Tests if the argument is a {@link CharSequence} that matches a regular expression. + */ +public class PatternMatcher extends TypeSafeMatcher { + + /** + * Creates a matcher that matches if the examined {@link CharSequence} matches the specified regular expression. + *

+ * For example: + * + *

+	 * assertThat("myStringOfNote", pattern("[0-9]+"))
+	 * 
+ * + * @param regex + * the regular expression that the returned matcher will use to match any examined {@link CharSequence} + */ + @Factory + public static Matcher pattern(String regex) { + return pattern(Pattern.compile(regex)); + } + + /** + * Creates a matcher that matches if the examined {@link CharSequence} matches the specified {@link Pattern}. + *

+ * For example: + * + *

+	 * assertThat("myStringOfNote", Pattern.compile("[0-9]+"))
+	 * 
+ * + * @param pattern + * the pattern that the returned matcher will use to match any examined {@link CharSequence} + */ + @Factory + public static Matcher pattern(Pattern pattern) { + return new PatternMatcher(pattern); + } + + private final Pattern pattern; + + public PatternMatcher(Pattern pattern) { + this.pattern = pattern; + } + + @Override + public boolean matchesSafely(CharSequence item) { + return pattern.matcher(item).find(); + } + + @Override + public void describeMismatchSafely(CharSequence item, org.hamcrest.Description mismatchDescription) { + mismatchDescription.appendText("was \"").appendText(String.valueOf(item)).appendText("\""); + } + + @Override + public void describeTo(org.hamcrest.Description description) { + description.appendText("a string with pattern \"").appendText(String.valueOf(pattern)).appendText("\""); + } +} diff --git a/hapi-fhir-structures-hl7org-dstu2/src/test/resources/logback-test.xml b/hapi-fhir-structures-hl7org-dstu2/src/test/resources/logback-test.xml new file mode 100644 index 00000000000..e5cbbb9c22e --- /dev/null +++ b/hapi-fhir-structures-hl7org-dstu2/src/test/resources/logback-test.xml @@ -0,0 +1,30 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} [%file:%line] - %msg%n + + + + + + + + + + + + + + + + + + + + + diff --git a/hapi-tinder-plugin/src/main/resources/vm/dt_composite.vm b/hapi-tinder-plugin/src/main/resources/vm/dt_composite.vm index cca01cea66f..dbfccf4a351 100644 --- a/hapi-tinder-plugin/src/main/resources/vm/dt_composite.vm +++ b/hapi-tinder-plugin/src/main/resources/vm/dt_composite.vm @@ -203,7 +203,7 @@ public class ${className} * @param theId * The reference itself */ - public ResourceReferenceDt(IdDt theResourceId) { + public ResourceReferenceDt(org.hl7.fhir.instance.model.api.IIdType theResourceId) { setReference(theResourceId); } #end diff --git a/hapi-tinder-plugin/src/main/resources/vm/dt_composite_dstu.vm b/hapi-tinder-plugin/src/main/resources/vm/dt_composite_dstu.vm index 9ef7af81674..6a7aaad6c6e 100644 --- a/hapi-tinder-plugin/src/main/resources/vm/dt_composite_dstu.vm +++ b/hapi-tinder-plugin/src/main/resources/vm/dt_composite_dstu.vm @@ -213,7 +213,7 @@ public class ${className} * @param theId * The reference itself */ - public ResourceReferenceDt(IdDt theResourceId) { + public ResourceReferenceDt(org.hl7.fhir.instance.model.api.IIdType theResourceId) { setReference(theResourceId); } #end diff --git a/pom.xml b/pom.xml index 7fc3b9dbeca..a3c083084f4 100644 --- a/pom.xml +++ b/pom.xml @@ -278,6 +278,11 @@ -Dfile.encoding=UTF-8
+ + org.codehaus.mojo + animal-sniffer-maven-plugin + 1.14 + org.apache.maven.plugins maven-deploy-plugin @@ -691,7 +696,7 @@ org.codehaus.mojo animal-sniffer-maven-plugin - 1.12 + 1.11 true diff --git a/sync_ri.sh b/sync_ri.sh index f6b18076a2a..56969290685 100755 --- a/sync_ri.sh +++ b/sync_ri.sh @@ -1,5 +1,13 @@ #!/bin/sh + +# Model cp -v ~/workspace/fhir/trunk/build/implementations/java/org.hl7.fhir.instance/src/org/hl7/fhir/instance/model/*.java hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/ cp -v ~/workspace/fhir/trunk/build/implementations/java/org.hl7.fhir.instance/src/org/hl7/fhir/instance/formats/FormatUtilities.java ~/workspace/hapi-fhir/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/formats/FormatUtilities.java cp -v ~/workspace/fhir/trunk/build/implementations/java/org.hl7.fhir.instance/src/org/hl7/fhir/instance/validation/InstanceValidator.java ~/workspace/hapi-fhir/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/validation/InstanceValidator.java cp -v ~/workspace/fhir/trunk/build/implementations/java/org.hl7.fhir.instance/src/org/hl7/fhir/instance/validation/ValidationMessage.java ~/workspace/hapi-fhir/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/validation/ValidationMessage.java + +# Schemas +cp ~/workspace/fhir/trunk/build/publish/fhir-single.xsd ~/workspace/hapi-fhir/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/ +cp ~/workspace/fhir/trunk/build/publish/fhir-xhtml.xsd ~/workspace/hapi-fhir/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/ +cp ~/workspace/fhir/trunk/build/publish/xml.xsd ~/workspace/hapi-fhir/hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema/ +for i in $( ls ~/workspace/fhir/trunk/build/publish/*.sch | grep -v - ); do cp $i hapi-fhir-structures-hl7org-dstu2/src/main/resources/org/hl7/fhir/instance/model/schema; done