From 5600ba67637461aba27aa395dc069e098dac55d7 Mon Sep 17 00:00:00 2001 From: jamesagnew Date: Sun, 8 Feb 2015 19:21:29 -0500 Subject: [PATCH] Implement DSTU2 transaction semantics in JPA --- .../java/ca/uhn/fhir/model/api/Bundle.java | 12 +- .../ca/uhn/fhir/model/api/BundleEntry.java | 42 +- .../model/api/ResourceMetadataKeyEnum.java | 51 +- ...um.java => BundleEntrySearchModeEnum.java} | 34 +- .../BundleEntryTransactionOperationEnum.java | 128 + .../java/ca/uhn/fhir/parser/JsonParser.java | 18 +- .../java/ca/uhn/fhir/parser/ParserState.java | 70 +- .../java/ca/uhn/fhir/parser/XmlParser.java | 545 +- .../ca/uhn/fhir/rest/method/IParamBinder.java | 4 +- .../ca/uhn/fhir/rest/method/MethodUtil.java | 40 + .../rest/method/QueryParameterAndBinder.java | 4 +- .../rest/method/QueryParameterOrBinder.java | 4 +- .../rest/method/QueryParameterTypeBinder.java | 4 +- .../ca/uhn/fhir/rest/method/StringBinder.java | 4 +- .../uhn/fhir/rest/server/RestfulServer.java | 103 +- .../main/java/ca/uhn/fhir/util/XmlUtil.java | 9 +- .../uhn/fhir/validation/ValidationResult.java | 4 +- .../ca/uhn/fhir/i18n/hapi-messages.properties | 11 +- hapi-fhir-jpaserver-base/.classpath | 2 +- .../.settings/org.eclipse.jdt.core.prefs | 6 +- .../ca/uhn/fhir/jpa/dao/FhirResourceDao.java | 26 +- .../ca/uhn/fhir/jpa/dao/FhirSystemDao.java | 219 +- .../ca/uhn/fhir/jpa/dao/IFhirResourceDao.java | 7 + .../uhn/fhir/jpa/dao/FhirResourceDaoTest.java | 2 + .../uhn/fhir/jpa/dao/FhirSystemDaoTest.java | 859 +- .../provider/ResourceProviderDstu1Test.java | 10 +- .../provider/ResourceProviderDstu2Test.java | 17 +- .../ca/uhn/fhir/jpa/demo/JpaServerDemo.java | 25 +- hapi-fhir-structures-dstu2/.classpath | 14 +- hapi-fhir-structures-dstu2/.project | 4 +- .../uhn/fhir/model/dstu2/schema/fhir-all.xsd | 3 +- .../model/dstu2/schema/fhir-atom-single.xsd | 2 +- .../uhn/fhir/model/dstu2/schema/fhir-atom.sch | 8845 +++++++++++++++++ .../uhn/fhir/model/dstu2/schema/fhir-atom.xsd | 2 +- .../uhn/fhir/model/dstu2/schema/fhir-base.xsd | 1154 +-- .../fhir/model/dstu2/schema/fhir-single.xsd | 1777 ++-- .../ca/uhn/fhir/parser/JsonParserTest.java | 25 +- .../ca/uhn/fhir/parser/XmlParserTest.java | 36 +- ...a => ClientServerValidationTestDstu2.java} | 19 +- .../ca/uhn/fhir/rest/server/IncludeTest.java | 17 +- .../validation/ResourceValidatorTest.java | 7 +- .../resources/bundle-example(example).xml | 85 - .../src/test/resources/bundle-example.json | 68 +- .../src/test/resources/bundle-example.xml | 83 +- pom.xml | 35 +- src/site/site.xml.orig | 124 - 46 files changed, 12170 insertions(+), 2390 deletions(-) rename hapi-fhir-base/src/main/java/ca/uhn/fhir/model/valueset/{BundleEntryStatusEnum.java => BundleEntrySearchModeEnum.java} (62%) create mode 100644 hapi-fhir-base/src/main/java/ca/uhn/fhir/model/valueset/BundleEntryTransactionOperationEnum.java create mode 100644 hapi-fhir-structures-dstu2/src/main/resources/ca/uhn/fhir/model/dstu2/schema/fhir-atom.sch rename hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/client/{ClientServerValidationTestDev.java => ClientServerValidationTestDstu2.java} (81%) delete mode 100644 hapi-fhir-structures-dstu2/src/test/resources/bundle-example(example).xml delete mode 100644 src/site/site.xml.orig diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/Bundle.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/Bundle.java index cfbd9feb29e..169467d3b8b 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/Bundle.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/Bundle.java @@ -41,7 +41,8 @@ import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.model.primitive.InstantDt; import ca.uhn.fhir.model.primitive.IntegerDt; import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.valueset.BundleEntryStatusEnum; +import ca.uhn.fhir.model.valueset.BundleEntrySearchModeEnum; +import ca.uhn.fhir.model.valueset.BundleEntryTransactionOperationEnum; import ca.uhn.fhir.model.valueset.BundleTypeEnum; import ca.uhn.fhir.rest.server.Constants; import ca.uhn.fhir.util.UrlUtil; @@ -210,9 +211,14 @@ public class Bundle extends BaseBundle /* implements IElement */{ entry.getLinkAlternate().setValue(linkSearch); } - BundleEntryStatusEnum entryStatus = ResourceMetadataKeyEnum.ENTRY_STATUS.get(theResource); + BundleEntrySearchModeEnum entryStatus = ResourceMetadataKeyEnum.ENTRY_SEARCH_MODE.get(theResource); if (entryStatus != null) { - entry.getStatus().setValueAsEnum(entryStatus); + entry.getSearchMode().setValueAsEnum(entryStatus); + } + + BundleEntryTransactionOperationEnum entryTransactionOperation = ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.get(theResource); + if (entryTransactionOperation != null) { + entry.getTransactionOperation().setValueAsEnum(entryTransactionOperation); } DecimalDt entryScore = ResourceMetadataKeyEnum.ENTRY_SCORE.get(theResource); diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/BundleEntry.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/BundleEntry.java index 81456d41175..02bed18a2ae 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/BundleEntry.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/BundleEntry.java @@ -31,7 +31,8 @@ import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.model.primitive.InstantDt; import ca.uhn.fhir.model.primitive.StringDt; import ca.uhn.fhir.model.primitive.XhtmlDt; -import ca.uhn.fhir.model.valueset.BundleEntryStatusEnum; +import ca.uhn.fhir.model.valueset.BundleEntrySearchModeEnum; +import ca.uhn.fhir.model.valueset.BundleEntryTransactionOperationEnum; import ca.uhn.fhir.util.ElementUtil; public class BundleEntry extends BaseBundle { @@ -56,7 +57,8 @@ public class BundleEntry extends BaseBundle { private InstantDt myPublished; private IResource myResource; private DecimalDt myScore; - private BoundCodeDt myStatus; + private BoundCodeDt mySearchMode; + private BoundCodeDt myTransactionOperation; private XhtmlDt mySummary; private StringDt myTitle; private InstantDt myUpdated; @@ -197,12 +199,6 @@ public class BundleEntry extends BaseBundle { return myScore; } - public BoundCodeDt getStatus() { - if (myStatus == null) { - myStatus = new BoundCodeDt(BundleEntryStatusEnum.VALUESET_BINDER); - } - return myStatus; - } public XhtmlDt getSummary() { if (mySummary == null) { @@ -243,7 +239,7 @@ public class BundleEntry extends BaseBundle { return super.isEmpty() && ElementUtil.isEmpty( myDeletedResourceId, myDeletedResourceType, myDeletedResourceVersion, myDeletedAt, - myScore, myStatus, myCategories, + myScore, mySearchMode, myTransactionOperation, myCategories, myLinkAlternate, myLinkSelf, myPublished, myResource, mySummary, myTitle, myUpdated, myDeletedByEmail, myDeletedByName, myDeletedComment); //@formatter:on @@ -326,9 +322,6 @@ public class BundleEntry extends BaseBundle { myScore = theScore; } - public void setStatus(BoundCodeDt theStatus) { - myStatus = theStatus; - } /** * @deprecated DSTU2 Note: As of DSTU2, bundle entries no longer have an updated time (this bit of metadata @@ -353,4 +346,29 @@ public class BundleEntry extends BaseBundle { return b.toString(); } + public BoundCodeDt getSearchMode() { + if (mySearchMode == null) { + mySearchMode = new BoundCodeDt(BundleEntrySearchModeEnum.VALUESET_BINDER); + } + return mySearchMode; + } + + public void setSearchMode(BoundCodeDt theSearchMode) { + mySearchMode = theSearchMode; + } + + public BoundCodeDt getTransactionOperation() { + if (myTransactionOperation == null) { + myTransactionOperation = new BoundCodeDt(BundleEntryTransactionOperationEnum.VALUESET_BINDER); + } + return myTransactionOperation; + } + + public void setTransactionOperation(BoundCodeDt theTransactionOperation) { + myTransactionOperation = theTransactionOperation; + } + + + + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/ResourceMetadataKeyEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/ResourceMetadataKeyEnum.java index 5c791c7b114..0cf0e4389b1 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/ResourceMetadataKeyEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/ResourceMetadataKeyEnum.java @@ -34,8 +34,8 @@ import ca.uhn.fhir.model.primitive.DecimalDt; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.model.primitive.InstantDt; import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.primitive.UriDt; -import ca.uhn.fhir.model.valueset.BundleEntryStatusEnum; +import ca.uhn.fhir.model.valueset.BundleEntrySearchModeEnum; +import ca.uhn.fhir.model.valueset.BundleEntryTransactionOperationEnum; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; /** @@ -294,26 +294,55 @@ public abstract class ResourceMetadataKeyEnum { }; /** - * If present and populated with a {@link BundleEntryStatusEnum}, contains the "bundle entry status", - * which is the value of the status field in the Bundle.entry containing this resource. This value can be + * If present and populated with a {@link BundleEntrySearchModeEnum}, contains the "bundle entry search mode", + * which is the value of the status field in the Bundle entry containing this resource. The value for this key + * corresponds to field Bundle.entry.search.mode. + * This value can be * set to provide a status value of "include" for included resources being returned by a server, or to - * set the value on a transaction, etc. + * "match" to indicate that the resource was returned because it matched the given search criteria. *

* Note that status is only used in FHIR DSTU2 and later. *

*

- * Values for this key are of type {@link BundleEntryStatusEnum} + * Values for this key are of type {@link BundleEntrySearchModeEnum} *

*/ - public static final ResourceMetadataKeyEnum ENTRY_STATUS = new ResourceMetadataKeyEnum("ENTRY_STATUS") { + public static final ResourceMetadataKeyEnum ENTRY_SEARCH_MODE = new ResourceMetadataKeyEnum("ENTRY_SEARCH_MODE") { @Override - public BundleEntryStatusEnum get(IResource theResource) { - return getEnumFromMetadataOrNullIfNone(theResource.getResourceMetadata(), ENTRY_STATUS, BundleEntryStatusEnum.class, BundleEntryStatusEnum.VALUESET_BINDER); + public BundleEntrySearchModeEnum get(IResource theResource) { + return getEnumFromMetadataOrNullIfNone(theResource.getResourceMetadata(), ENTRY_SEARCH_MODE, BundleEntrySearchModeEnum.class, BundleEntrySearchModeEnum.VALUESET_BINDER); } @Override - public void put(IResource theResource, BundleEntryStatusEnum theObject) { - theResource.getResourceMetadata().put(ENTRY_STATUS, theObject); + public void put(IResource theResource, BundleEntrySearchModeEnum theObject) { + theResource.getResourceMetadata().put(ENTRY_SEARCH_MODE, theObject); + } + }; + + /** + * If present and populated with a {@link BundleEntryTransactionOperationEnum}, contains the "bundle entry transaction operation", + * which is the value of the status field in the Bundle entry containing this resource. The value for this key + * corresponds to field Bundle.entry.transaction.operation. + * This value can be + * set in resources being transmitted to a server to provide a status value of "create" or "update" to indicate behaviour the + * server should observe. It may also be set to similar values (or to "noop") in resources being returned by + * a server as a result of a transaction to indicate to the client what operation was actually performed. + *

+ * Note that status is only used in FHIR DSTU2 and later. + *

+ *

+ * Values for this key are of type {@link BundleEntryTransactionOperationEnum} + *

+ */ + public static final ResourceMetadataKeyEnum ENTRY_TRANSACTION_OPERATION = new ResourceMetadataKeyEnum("ENTRY_TRANSACTION_OPERATION") { + @Override + public BundleEntryTransactionOperationEnum get(IResource theResource) { + return getEnumFromMetadataOrNullIfNone(theResource.getResourceMetadata(), ENTRY_TRANSACTION_OPERATION, BundleEntryTransactionOperationEnum.class, BundleEntryTransactionOperationEnum.VALUESET_BINDER); + } + + @Override + public void put(IResource theResource, BundleEntryTransactionOperationEnum theObject) { + theResource.getResourceMetadata().put(ENTRY_TRANSACTION_OPERATION, theObject); } }; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/valueset/BundleEntryStatusEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/valueset/BundleEntrySearchModeEnum.java similarity index 62% rename from hapi-fhir-base/src/main/java/ca/uhn/fhir/model/valueset/BundleEntryStatusEnum.java rename to hapi-fhir-base/src/main/java/ca/uhn/fhir/model/valueset/BundleEntrySearchModeEnum.java index e9cf5b601f1..3930f2b443b 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/valueset/BundleEntryStatusEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/valueset/BundleEntrySearchModeEnum.java @@ -26,12 +26,10 @@ import java.util.Map; import ca.uhn.fhir.model.api.IValueSetEnumBinder; -public enum BundleEntryStatusEnum { +public enum BundleEntrySearchModeEnum { - CREATE("create", "http://hl7.org/fhir/bundle-entry-status"), - UPDATE("update", "http://hl7.org/fhir/bundle-entry-status"), - MATCH("match", "http://hl7.org/fhir/bundle-entry-status"), - INCLUDE("include", "http://hl7.org/fhir/bundle-entry-status"), + MATCH("match", "http://hl7.org/fhir/search-entry-mode"), + INCLUDE("include", "http://hl7.org/fhir/search-entry-mode"), ; @@ -47,18 +45,18 @@ public enum BundleEntryStatusEnum { */ public static final String VALUESET_NAME = "BundleEntryStatus"; - private static Map CODE_TO_ENUM = new HashMap(); - private static Map> SYSTEM_TO_CODE_TO_ENUM = new HashMap>(); + private static Map CODE_TO_ENUM = new HashMap(); + private static Map> SYSTEM_TO_CODE_TO_ENUM = new HashMap>(); private final String myCode; private final String mySystem; static { - for (BundleEntryStatusEnum next : BundleEntryStatusEnum.values()) { + for (BundleEntrySearchModeEnum next : BundleEntrySearchModeEnum.values()) { CODE_TO_ENUM.put(next.getCode(), next); if (!SYSTEM_TO_CODE_TO_ENUM.containsKey(next.getSystem())) { - SYSTEM_TO_CODE_TO_ENUM.put(next.getSystem(), new HashMap()); + SYSTEM_TO_CODE_TO_ENUM.put(next.getSystem(), new HashMap()); } SYSTEM_TO_CODE_TO_ENUM.get(next.getSystem()).put(next.getCode(), next); } @@ -81,33 +79,33 @@ public enum BundleEntryStatusEnum { /** * Returns the enumerated value associated with this code */ - public BundleEntryStatusEnum forCode(String theCode) { - BundleEntryStatusEnum retVal = CODE_TO_ENUM.get(theCode); + public BundleEntrySearchModeEnum forCode(String theCode) { + BundleEntrySearchModeEnum retVal = CODE_TO_ENUM.get(theCode); return retVal; } /** * Converts codes to their respective enumerated values */ - public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { @Override - public String toCodeString(BundleEntryStatusEnum theEnum) { + public String toCodeString(BundleEntrySearchModeEnum theEnum) { return theEnum.getCode(); } @Override - public String toSystemString(BundleEntryStatusEnum theEnum) { + public String toSystemString(BundleEntrySearchModeEnum theEnum) { return theEnum.getSystem(); } @Override - public BundleEntryStatusEnum fromCodeString(String theCodeString) { + public BundleEntrySearchModeEnum fromCodeString(String theCodeString) { return CODE_TO_ENUM.get(theCodeString); } @Override - public BundleEntryStatusEnum fromCodeString(String theCodeString, String theSystemString) { - Map map = SYSTEM_TO_CODE_TO_ENUM.get(theSystemString); + public BundleEntrySearchModeEnum fromCodeString(String theCodeString, String theSystemString) { + Map map = SYSTEM_TO_CODE_TO_ENUM.get(theSystemString); if (map == null) { return null; } @@ -119,7 +117,7 @@ public enum BundleEntryStatusEnum { /** * Constructor */ - BundleEntryStatusEnum(String theCode, String theSystem) { + BundleEntrySearchModeEnum(String theCode, String theSystem) { myCode = theCode; mySystem = theSystem; } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/valueset/BundleEntryTransactionOperationEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/valueset/BundleEntryTransactionOperationEnum.java new file mode 100644 index 00000000000..4e3e9dfd42d --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/valueset/BundleEntryTransactionOperationEnum.java @@ -0,0 +1,128 @@ + +package ca.uhn.fhir.model.valueset; + +/* + * #%L + * HAPI FHIR - Core Library + * %% + * Copyright (C) 2014 - 2015 University Health Network + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + +import java.util.HashMap; +import java.util.Map; + +import ca.uhn.fhir.model.api.IValueSetEnumBinder; + +public enum BundleEntryTransactionOperationEnum { + + CREATE("create", "http://hl7.org/fhir/restful-interaction"), + UPDATE("update", "http://hl7.org/fhir/restful-interaction"), + DELETE("delete", "http://hl7.org/fhir/restful-interaction"), + NOOP("noop", "http://hl7.org/fhir/transaction-operation"), + + ; + + /** + * Identifier for this Value Set: + * http://hl7.org/fhir/vs/address-use + */ + public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/bundle-entry-status"; + + /** + * Name for this Value Set: + * AddressUse + */ + public static final String VALUESET_NAME = "BundleEntryStatus"; + + private static Map CODE_TO_ENUM = new HashMap(); + private static Map> SYSTEM_TO_CODE_TO_ENUM = new HashMap>(); + + private final String myCode; + private final String mySystem; + + static { + for (BundleEntryTransactionOperationEnum next : BundleEntryTransactionOperationEnum.values()) { + CODE_TO_ENUM.put(next.getCode(), next); + + if (!SYSTEM_TO_CODE_TO_ENUM.containsKey(next.getSystem())) { + SYSTEM_TO_CODE_TO_ENUM.put(next.getSystem(), new HashMap()); + } + SYSTEM_TO_CODE_TO_ENUM.get(next.getSystem()).put(next.getCode(), next); + } + } + + /** + * Returns the code associated with this enumerated value + */ + public String getCode() { + return myCode; + } + + /** + * Returns the code system associated with this enumerated value + */ + public String getSystem() { + return mySystem; + } + + /** + * Returns the enumerated value associated with this code + */ + public BundleEntryTransactionOperationEnum forCode(String theCode) { + BundleEntryTransactionOperationEnum retVal = CODE_TO_ENUM.get(theCode); + return retVal; + } + + /** + * Converts codes to their respective enumerated values + */ + public static final IValueSetEnumBinder VALUESET_BINDER = new IValueSetEnumBinder() { + @Override + public String toCodeString(BundleEntryTransactionOperationEnum theEnum) { + return theEnum.getCode(); + } + + @Override + public String toSystemString(BundleEntryTransactionOperationEnum theEnum) { + return theEnum.getSystem(); + } + + @Override + public BundleEntryTransactionOperationEnum fromCodeString(String theCodeString) { + return CODE_TO_ENUM.get(theCodeString); + } + + @Override + public BundleEntryTransactionOperationEnum fromCodeString(String theCodeString, String theSystemString) { + Map map = SYSTEM_TO_CODE_TO_ENUM.get(theSystemString); + if (map == null) { + return null; + } + return map.get(theCodeString); + } + + }; + + /** + * Constructor + */ + BundleEntryTransactionOperationEnum(String theCode, String theSystem) { + myCode = theCode; + mySystem = theSystem; + } + + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/JsonParser.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/JsonParser.java index 5508a3db643..fc76183488f 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/JsonParser.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/JsonParser.java @@ -273,9 +273,21 @@ public class JsonParser extends BaseParser implements IParser { theEventWriter.writeStartObject(); writeOptionalTagWithTextNode(theEventWriter, "base", determineResourceBaseUrl(theBundle.getLinkBase().getValue(), nextEntry)); - writeOptionalTagWithTextNode(theEventWriter, "status", nextEntry.getStatus()); - writeOptionalTagWithTextNode(theEventWriter, "search", nextEntry.getLinkSearch()); - writeOptionalTagWithDecimalNode(theEventWriter, "score", nextEntry.getScore()); + + if (nextEntry.getSearchMode().isEmpty() == false || nextEntry.getScore().isEmpty() == false) { + theEventWriter.writeStartObject("search"); + writeOptionalTagWithTextNode(theEventWriter, "mode", nextEntry.getSearchMode().getValueAsString()); + writeOptionalTagWithDecimalNode(theEventWriter, "score", nextEntry.getScore()); + theEventWriter.writeEnd(); + // IResource nextResource = nextEntry.getResource(); + } + + if (nextEntry.getTransactionOperation().isEmpty() == false || nextEntry.getLinkSearch().isEmpty() == false) { + theEventWriter.writeStartObject("transaction"); + writeOptionalTagWithTextNode(theEventWriter, "operation", nextEntry.getTransactionOperation().getValue()); + writeOptionalTagWithTextNode(theEventWriter, "match", nextEntry.getLinkSearch().getValue()); + theEventWriter.writeEnd(); + } boolean deleted = nextEntry.getDeletedAt() != null && nextEntry.getDeletedAt().isEmpty() == false; if (deleted) { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/ParserState.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/ParserState.java index fa54920a7a8..a6007ffd88f 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/ParserState.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/ParserState.java @@ -950,10 +950,10 @@ class ParserState { public void enteringNewElement(String theNamespaceURI, String theLocalPart) throws DataFormatException { if ("base".equals(theLocalPart)) { push(new PrimitiveState(getPreResourceState(), myEntry.getLinkBase())); - } else if ("status".equals(theLocalPart)) { - push(new PrimitiveState(getPreResourceState(), myEntry.getStatus())); + } else if ("transaction".equals(theLocalPart)) { + push(new BundleEntryTransactionState(myEntry)); } else if ("search".equals(theLocalPart)) { - push(new PrimitiveState(getPreResourceState(), myEntry.getLinkSearch())); + push(new BundleEntrySearchState(myEntry)); } else if ("score".equals(theLocalPart)) { push(new PrimitiveState(getPreResourceState(), myEntry.getScore())); } else if ("resource".equals(theLocalPart)) { @@ -1013,16 +1013,74 @@ class ParserState { if (!myEntry.getLinkSearch().isEmpty()) { ResourceMetadataKeyEnum.LINK_SEARCH.put(myEntry.getResource(), myEntry.getLinkSearch().getValue()); } - if (!myEntry.getStatus().isEmpty()) { - ResourceMetadataKeyEnum.ENTRY_STATUS.put(myEntry.getResource(), myEntry.getStatus().getValueAsEnum()); + if (!myEntry.getSearchMode().isEmpty()) { + ResourceMetadataKeyEnum.ENTRY_SEARCH_MODE.put(myEntry.getResource(), myEntry.getSearchMode().getValueAsEnum()); } - if (!myEntry.getStatus().isEmpty()) { + if (!myEntry.getTransactionOperation().isEmpty()) { + ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.put(myEntry.getResource(), myEntry.getTransactionOperation().getValueAsEnum()); + } + if (!myEntry.getScore().isEmpty()) { ResourceMetadataKeyEnum.ENTRY_SCORE.put(myEntry.getResource(), myEntry.getScore()); } } } + + public class BundleEntrySearchState extends BaseState { + + private BundleEntry myEntry; + + public BundleEntrySearchState(BundleEntry theEntry) { + super(null); + myEntry = theEntry; + } + + @Override + public void endingElement() throws DataFormatException { + pop(); + } + + @Override + public void enteringNewElement(String theNamespaceURI, String theLocalPart) throws DataFormatException { + if ("mode".equals(theLocalPart)) { + push(new PrimitiveState(getPreResourceState(), myEntry.getSearchMode())); + } else if ("score".equals(theLocalPart)) { + push(new PrimitiveState(getPreResourceState(), myEntry.getScore())); + } else { + throw new DataFormatException("Unexpected element in Bundle.entry.search: " + theLocalPart); + } + } + + } + + public class BundleEntryTransactionState extends BaseState { + + private BundleEntry myEntry; + + public BundleEntryTransactionState(BundleEntry theEntry) { + super(null); + myEntry = theEntry; + } + + @Override + public void endingElement() throws DataFormatException { + pop(); + } + + @Override + public void enteringNewElement(String theNamespaceURI, String theLocalPart) throws DataFormatException { + if ("operation".equals(theLocalPart)) { + push(new PrimitiveState(getPreResourceState(), myEntry.getTransactionOperation())); + } else if ("match".equals(theLocalPart)) { + push(new PrimitiveState(getPreResourceState(), myEntry.getLinkSearch())); + } else { + throw new DataFormatException("Unexpected element in Bundle.entry.search: " + theLocalPart); + } + } + + } + private class BundleLinkState extends BaseState { private BundleEntry myEntry; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/XmlParser.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/XmlParser.java index 95ae6f94db6..75a5f4b9c46 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/XmlParser.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/XmlParser.java @@ -86,12 +86,12 @@ import ca.uhn.fhir.util.PrettyPrintWriterWrapper; import ca.uhn.fhir.util.XmlUtil; public class XmlParser extends BaseParser implements IParser { - static final String RESREF_DISPLAY = "display"; - static final String RESREF_REFERENCE = "reference"; - private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(XmlParser.class); static final String ATOM_NS = "http://www.w3.org/2005/Atom"; static final String FHIR_NS = "http://hl7.org/fhir"; static final String OPENSEARCH_NS = "http://a9.com/-/spec/opensearch/1.1/"; + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(XmlParser.class); + static final String RESREF_DISPLAY = "display"; + static final String RESREF_REFERENCE = "reference"; static final String TOMBSTONES_NS = "http://purl.org/atompub/tombstones/1.0"; static final String XHTML_NS = "http://www.w3.org/1999/xhtml"; @@ -109,6 +109,109 @@ public class XmlParser extends BaseParser implements IParser { myContext = theContext; } + private XMLEventReader createStreamReader(Reader theReader) { + try { + return XmlUtil.createXmlReader(theReader); + } catch (FactoryConfigurationError e1) { + throw new ConfigurationException("Failed to initialize STaX event factory", e1); + } catch (XMLStreamException e1) { + throw new DataFormatException(e1); + } + + // XMLEventReader streamReader; + // try { + // streamReader = myXmlInputFactory.createXMLEventReader(theReader); + // } catch (XMLStreamException e) { + // throw new DataFormatException(e); + // } catch (FactoryConfigurationError e) { + // throw new ConfigurationException("Failed to initialize STaX event factory", e); + // } + // return streamReader; + } + + private XMLStreamWriter createXmlWriter(Writer theWriter) throws XMLStreamException { + XMLStreamWriter eventWriter; + eventWriter = XmlUtil.createXmlStreamWriter(theWriter); + eventWriter = decorateStreamWriter(eventWriter); + return eventWriter; + } + + private XMLStreamWriter decorateStreamWriter(XMLStreamWriter eventWriter) { + if (myPrettyPrint) { + PrettyPrintWriterWrapper retVal = new PrettyPrintWriterWrapper(eventWriter); + return retVal; + } else { + NonPrettyPrintWriterWrapper retVal = new NonPrettyPrintWriterWrapper(eventWriter); + return retVal; + } + } + + private T doXmlLoop(XMLEventReader streamReader, ParserState parserState) { + ourLog.trace("Entering XML parsing loop with state: {}", parserState); + + try { + while (streamReader.hasNext()) { + XMLEvent nextEvent = streamReader.nextEvent(); + try { + if (nextEvent.isStartElement()) { + StartElement elem = nextEvent.asStartElement(); + + String namespaceURI = elem.getName().getNamespaceURI(); + + if ("extension".equals(elem.getName().getLocalPart())) { + Attribute urlAttr = elem.getAttributeByName(new QName("url")); + if (urlAttr == null || isBlank(urlAttr.getValue())) { + throw new DataFormatException("Extension element has no 'url' attribute"); + } + parserState.enteringNewElementExtension(elem, urlAttr.getValue(), false); + } else if ("modifierExtension".equals(elem.getName().getLocalPart())) { + Attribute urlAttr = elem.getAttributeByName(new QName("url")); + if (urlAttr == null || isBlank(urlAttr.getValue())) { + throw new DataFormatException("Extension element has no 'url' attribute"); + } + parserState.enteringNewElementExtension(elem, urlAttr.getValue(), true); + + } else { + + String elementName = elem.getName().getLocalPart(); + parserState.enteringNewElement(namespaceURI, elementName); + + } + + for (@SuppressWarnings("unchecked") + Iterator iter = elem.getAttributes(); iter.hasNext();) { + Attribute next = iter.next(); + // if + // (next.getName().getLocalPart().equals("value")) { + parserState.attributeValue(next.getName().getLocalPart(), next.getValue()); + // } + } + + } else if (nextEvent.isAttribute()) { + Attribute elem = (Attribute) nextEvent; + String name = (elem.getName().getLocalPart()); + parserState.attributeValue(name, elem.getValue()); + } else if (nextEvent.isEndElement()) { + parserState.endingElement(); + if (parserState.isComplete()) { + return parserState.getObject(); + } + } else if (nextEvent.isCharacters()) { + parserState.string(nextEvent.asCharacters().getData()); + } + + parserState.xmlEvent(nextEvent); + + } catch (DataFormatException e) { + throw new DataFormatException("DataFormatException at [" + nextEvent.getLocation().toString() + "]: " + e.getMessage(), e); + } + } + return null; + } catch (XMLStreamException e) { + throw new DataFormatException(e); + } + } + @Override public String encodeBundleToString(Bundle theBundle) throws DataFormatException { StringWriter stringWriter = new StringWriter(); @@ -122,16 +225,16 @@ public class XmlParser extends BaseParser implements IParser { try { XMLStreamWriter eventWriter = createXmlWriter(theWriter); if (myContext.getVersion().getVersion().isNewerThan(FhirVersionEnum.DSTU1)) { - encodeBundleToWriterUsingBundleResource(theBundle, eventWriter); + encodeBundleToWriterDstu2(theBundle, eventWriter); } else { - encodeBundleToWriterUsingAtom(theBundle, eventWriter); + encodeBundleToWriterDstu1(theBundle, eventWriter); } } catch (XMLStreamException e) { throw new ConfigurationException("Failed to initialize STaX event factory", e); } } - private void encodeBundleToWriterUsingAtom(Bundle theBundle, XMLStreamWriter eventWriter) throws XMLStreamException { + private void encodeBundleToWriterDstu1(Bundle theBundle, XMLStreamWriter eventWriter) throws XMLStreamException { eventWriter.writeStartElement("feed"); eventWriter.writeDefaultNamespace(ATOM_NS); @@ -250,13 +353,7 @@ public class XmlParser extends BaseParser implements IParser { eventWriter.close(); } - private void writeOptionalAttribute(XMLStreamWriter theEventWriter, String theName, String theValue) throws XMLStreamException { - if (StringUtils.isNotBlank(theValue)) { - theEventWriter.writeAttribute(theName, theValue); - } - } - - private void encodeBundleToWriterUsingBundleResource(Bundle theBundle, XMLStreamWriter theEventWriter) throws XMLStreamException { + private void encodeBundleToWriterDstu2(Bundle theBundle, XMLStreamWriter theEventWriter) throws XMLStreamException { theEventWriter.writeStartElement("Bundle"); theEventWriter.writeDefaultNamespace(FHIR_NS); @@ -288,12 +385,22 @@ public class XmlParser extends BaseParser implements IParser { for (BundleEntry nextEntry : theBundle.getEntries()) { theEventWriter.writeStartElement("entry"); - IResource nextResource = nextEntry.getResource(); writeOptionalTagWithValue(theEventWriter, "base", determineResourceBaseUrl(bundleBaseUrl, nextEntry)); - writeOptionalTagWithValue(theEventWriter, "status", nextEntry.getStatus().getValue()); - writeOptionalTagWithValue(theEventWriter, "search", nextEntry.getLinkSearch().getValue()); - writeOptionalTagWithValue(theEventWriter, "score", nextEntry.getScore().getValueAsString()); + if (nextEntry.getSearchMode().isEmpty() == false || nextEntry.getScore().isEmpty() == false) { + theEventWriter.writeStartElement("search"); + writeOptionalTagWithValue(theEventWriter, "mode", nextEntry.getSearchMode().getValueAsString()); + writeOptionalTagWithValue(theEventWriter, "score", nextEntry.getScore().getValueAsString()); + theEventWriter.writeEndElement(); + // IResource nextResource = nextEntry.getResource(); + } + + if (nextEntry.getTransactionOperation().isEmpty() == false || nextEntry.getLinkSearch().isEmpty() == false) { + theEventWriter.writeStartElement("transaction"); + writeOptionalTagWithValue(theEventWriter, "operation", nextEntry.getTransactionOperation().getValue()); + writeOptionalTagWithValue(theEventWriter, "match", nextEntry.getLinkSearch().getValue()); + theEventWriter.writeEndElement(); + } boolean deleted = false; if (nextEntry.getDeletedAt() != null && nextEntry.getDeletedAt().isEmpty() == false) { @@ -322,225 +429,6 @@ public class XmlParser extends BaseParser implements IParser { theEventWriter.close(); } - private void writeBundleResourceLink(XMLStreamWriter theEventWriter, String theRel, StringDt theUrl) throws XMLStreamException { - if (theUrl.isEmpty() == false) { - theEventWriter.writeStartElement("link"); - theEventWriter.writeStartElement("relation"); - theEventWriter.writeAttribute("value", theRel); - theEventWriter.writeEndElement(); - theEventWriter.writeStartElement("url"); - theEventWriter.writeAttribute("value", theUrl.getValue()); - theEventWriter.writeEndElement(); - theEventWriter.writeEndElement(); - } - } - - private void writeOptionalTagWithValue(XMLStreamWriter theEventWriter, String theName, String theValue) throws XMLStreamException { - if (StringUtils.isNotBlank(theValue)) { - theEventWriter.writeStartElement(theName); - theEventWriter.writeAttribute("value", theValue); - theEventWriter.writeEndElement(); - } - } - - private void writeCategories(XMLStreamWriter eventWriter, TagList categories) throws XMLStreamException { - if (categories != null) { - for (Tag next : categories) { - eventWriter.writeStartElement("category"); - eventWriter.writeAttribute("term", defaultString(next.getTerm())); - eventWriter.writeAttribute("label", defaultString(next.getLabel())); - eventWriter.writeAttribute("scheme", defaultString(next.getScheme())); - eventWriter.writeEndElement(); - } - } - } - - @Override - public String encodeResourceToString(IBaseResource theResource) throws DataFormatException { - if (theResource == null) { - throw new NullPointerException("Resource can not be null"); - } - - Writer stringWriter = new StringWriter(); - encodeResourceToWriter(theResource, stringWriter); - return stringWriter.toString(); - } - - @Override - public void encodeResourceToWriter(IBaseResource theResource, Writer theWriter) throws DataFormatException { - XMLStreamWriter eventWriter; - try { - eventWriter = createXmlWriter(theWriter); - - encodeResourceToXmlStreamWriter(theResource, eventWriter, false); - eventWriter.flush(); - } catch (XMLStreamException e) { - throw new ConfigurationException("Failed to initialize STaX event factory", e); - } - } - - private XMLStreamWriter createXmlWriter(Writer theWriter) throws XMLStreamException { - XMLStreamWriter eventWriter; - eventWriter = XmlUtil.createXmlStreamWriter(theWriter); - eventWriter = decorateStreamWriter(eventWriter); - return eventWriter; - } - - @Override - public void encodeTagListToWriter(TagList theTagList, Writer theWriter) throws IOException { - try { - XMLStreamWriter eventWriter = createXmlWriter(theWriter); - - eventWriter.writeStartElement(TagList.ELEMENT_NAME_LC); - eventWriter.writeDefaultNamespace(FHIR_NS); - - for (Tag next : theTagList) { - eventWriter.writeStartElement(TagList.ATTR_CATEGORY); - - if (isNotBlank(next.getTerm())) { - eventWriter.writeAttribute(Tag.ATTR_TERM, next.getTerm()); - } - if (isNotBlank(next.getLabel())) { - eventWriter.writeAttribute(Tag.ATTR_LABEL, next.getLabel()); - } - if (isNotBlank(next.getScheme())) { - eventWriter.writeAttribute(Tag.ATTR_SCHEME, next.getScheme()); - } - - eventWriter.writeEndElement(); - } - - eventWriter.writeEndElement(); - eventWriter.close(); - } catch (XMLStreamException e) { - throw new ConfigurationException("Failed to initialize STaX event factory", e); - } - } - - @Override - public Bundle parseBundle(Class theResourceType, Reader theReader) { - XMLEventReader streamReader = createStreamReader(theReader); - - return parseBundle(streamReader, theResourceType); - } - - @Override - public T parseResource(Class theResourceType, Reader theReader) { - XMLEventReader streamReader = createStreamReader(theReader); - - return parseResource(theResourceType, streamReader); - } - - @Override - public TagList parseTagList(Reader theReader) { - XMLEventReader streamReader = createStreamReader(theReader); - - ParserState parserState = ParserState.getPreTagListInstance(myContext, false); - return doXmlLoop(streamReader, parserState); - } - - @Override - public IParser setPrettyPrint(boolean thePrettyPrint) { - myPrettyPrint = thePrettyPrint; - return this; - } - - private XMLEventReader createStreamReader(Reader theReader) { - try { - return XmlUtil.createXmlReader(theReader); - } catch (FactoryConfigurationError e1) { - throw new ConfigurationException("Failed to initialize STaX event factory", e1); - } catch (XMLStreamException e1) { - throw new DataFormatException(e1); - } - - // XMLEventReader streamReader; - // try { - // streamReader = myXmlInputFactory.createXMLEventReader(theReader); - // } catch (XMLStreamException e) { - // throw new DataFormatException(e); - // } catch (FactoryConfigurationError e) { - // throw new ConfigurationException("Failed to initialize STaX event factory", e); - // } - // return streamReader; - } - - private XMLStreamWriter decorateStreamWriter(XMLStreamWriter eventWriter) { - if (myPrettyPrint) { - PrettyPrintWriterWrapper retVal = new PrettyPrintWriterWrapper(eventWriter); - return retVal; - } else { - NonPrettyPrintWriterWrapper retVal = new NonPrettyPrintWriterWrapper(eventWriter); - return retVal; - } - } - - private T doXmlLoop(XMLEventReader streamReader, ParserState parserState) { - ourLog.trace("Entering XML parsing loop with state: {}", parserState); - - try { - while (streamReader.hasNext()) { - XMLEvent nextEvent = streamReader.nextEvent(); - try { - if (nextEvent.isStartElement()) { - StartElement elem = nextEvent.asStartElement(); - - String namespaceURI = elem.getName().getNamespaceURI(); - - if ("extension".equals(elem.getName().getLocalPart())) { - Attribute urlAttr = elem.getAttributeByName(new QName("url")); - if (urlAttr == null || isBlank(urlAttr.getValue())) { - throw new DataFormatException("Extension element has no 'url' attribute"); - } - parserState.enteringNewElementExtension(elem, urlAttr.getValue(), false); - } else if ("modifierExtension".equals(elem.getName().getLocalPart())) { - Attribute urlAttr = elem.getAttributeByName(new QName("url")); - if (urlAttr == null || isBlank(urlAttr.getValue())) { - throw new DataFormatException("Extension element has no 'url' attribute"); - } - parserState.enteringNewElementExtension(elem, urlAttr.getValue(), true); - - } else { - - String elementName = elem.getName().getLocalPart(); - parserState.enteringNewElement(namespaceURI, elementName); - - } - - for (@SuppressWarnings("unchecked") - Iterator iter = elem.getAttributes(); iter.hasNext();) { - Attribute next = iter.next(); - // if - // (next.getName().getLocalPart().equals("value")) { - parserState.attributeValue(next.getName().getLocalPart(), next.getValue()); - // } - } - - } else if (nextEvent.isAttribute()) { - Attribute elem = (Attribute) nextEvent; - String name = (elem.getName().getLocalPart()); - parserState.attributeValue(name, elem.getValue()); - } else if (nextEvent.isEndElement()) { - parserState.endingElement(); - if (parserState.isComplete()) { - return parserState.getObject(); - } - } else if (nextEvent.isCharacters()) { - parserState.string(nextEvent.asCharacters().getData()); - } - - parserState.xmlEvent(nextEvent); - - } catch (DataFormatException e) { - throw new DataFormatException("DataFormatException at [" + nextEvent.getLocation().toString() + "]: " + e.getMessage(), e); - } - } - return null; - } catch (XMLStreamException e) { - throw new DataFormatException(e); - } - } - private void encodeChildElementToStreamWriter(RuntimeResourceDefinition theResDef, IBaseResource theResource, XMLStreamWriter theEventWriter, IBase nextValue, String childName, BaseRuntimeElementDefinition childDef, String theExtensionUrl, boolean theIncludedResource) throws XMLStreamException, DataFormatException { if (nextValue.isEmpty()) { @@ -586,16 +474,11 @@ public class XmlParser extends BaseParser implements IParser { case CONTAINED_RESOURCES: { ContainedDt value = (ContainedDt) nextValue; /* - * Disable per #103 - for (IResource next : value.getContainedResources()) { - if (getContainedResources().getResourceId(next) != null) { - continue; - } - theEventWriter.writeStartElement("contained"); - encodeResourceToXmlStreamWriter(next, theEventWriter, true, fixContainedResourceId(next.getId().getValue())); - theEventWriter.writeEndElement(); - } - */ + * Disable per #103 for (IResource next : value.getContainedResources()) { if + * (getContainedResources().getResourceId(next) != null) { continue; } + * theEventWriter.writeStartElement("contained"); encodeResourceToXmlStreamWriter(next, theEventWriter, + * true, fixContainedResourceId(next.getId().getValue())); theEventWriter.writeEndElement(); } + */ for (IBaseResource next : getContainedResources().getContainedResources()) { IdDt resourceId = getContainedResources().getResourceId(next); theEventWriter.writeStartElement("contained"); @@ -697,6 +580,35 @@ public class XmlParser extends BaseParser implements IParser { } } + private void encodeCompositeElementToStreamWriter(RuntimeResourceDefinition theResDef, IBaseResource theResource, IBase theElement, XMLStreamWriter theEventWriter, BaseRuntimeElementCompositeDefinition resDef, boolean theIncludedResource) throws XMLStreamException, DataFormatException { + encodeExtensionsIfPresent(theResDef, theResource, theEventWriter, theElement, theIncludedResource); + encodeCompositeElementChildrenToStreamWriter(theResDef, theResource, theElement, theEventWriter, resDef.getExtensions(), theIncludedResource); + encodeCompositeElementChildrenToStreamWriter(theResDef, theResource, theElement, theEventWriter, resDef.getChildren(), theIncludedResource); + } + + private void encodeExtensionsIfPresent(RuntimeResourceDefinition theResDef, IBaseResource theResource, XMLStreamWriter theWriter, IBase theElement, boolean theIncludedResource) throws XMLStreamException, DataFormatException { + if (theElement instanceof ISupportsUndeclaredExtensions) { + ISupportsUndeclaredExtensions res = (ISupportsUndeclaredExtensions) theElement; + encodeUndeclaredExtensions(theResDef, theResource, theWriter, res.getUndeclaredExtensions(), "extension", theIncludedResource); + encodeUndeclaredExtensions(theResDef, theResource, theWriter, res.getUndeclaredModifierExtensions(), "modifierExtension", theIncludedResource); + } + } + + private void encodeResourceReferenceToStreamWriter(XMLStreamWriter theEventWriter, ResourceReferenceDt theRef) throws XMLStreamException { + String reference = determineReferenceText(theRef); + + if (StringUtils.isNotBlank(reference)) { + theEventWriter.writeStartElement(RESREF_REFERENCE); + theEventWriter.writeAttribute("value", reference); + theEventWriter.writeEndElement(); + } + if (!(theRef.getDisplay().isEmpty())) { + theEventWriter.writeStartElement(RESREF_DISPLAY); + theEventWriter.writeAttribute("value", theRef.getDisplay().getValue()); + theEventWriter.writeEndElement(); + } + } + private void encodeResourceToStreamWriterInDstu2Format(RuntimeResourceDefinition theResDef, IBaseResource theResource, IBase theElement, XMLStreamWriter theEventWriter, BaseRuntimeElementCompositeDefinition resDef, boolean theIncludedResource) throws XMLStreamException, DataFormatException { /* * DSTU2 requires extensions to come in a specific spot within the encoded content - This is a bit of a messy @@ -724,32 +636,27 @@ public class XmlParser extends BaseParser implements IParser { } - private void encodeCompositeElementToStreamWriter(RuntimeResourceDefinition theResDef, IBaseResource theResource, IBase theElement, XMLStreamWriter theEventWriter, BaseRuntimeElementCompositeDefinition resDef, boolean theIncludedResource) throws XMLStreamException, DataFormatException { - encodeExtensionsIfPresent(theResDef, theResource, theEventWriter, theElement, theIncludedResource); - encodeCompositeElementChildrenToStreamWriter(theResDef, theResource, theElement, theEventWriter, resDef.getExtensions(), theIncludedResource); - encodeCompositeElementChildrenToStreamWriter(theResDef, theResource, theElement, theEventWriter, resDef.getChildren(), theIncludedResource); + @Override + public String encodeResourceToString(IBaseResource theResource) throws DataFormatException { + if (theResource == null) { + throw new NullPointerException("Resource can not be null"); + } + + Writer stringWriter = new StringWriter(); + encodeResourceToWriter(theResource, stringWriter); + return stringWriter.toString(); } - private void encodeExtensionsIfPresent(RuntimeResourceDefinition theResDef, IBaseResource theResource, XMLStreamWriter theWriter, IBase theElement, boolean theIncludedResource) throws XMLStreamException, DataFormatException { - if (theElement instanceof ISupportsUndeclaredExtensions) { - ISupportsUndeclaredExtensions res = (ISupportsUndeclaredExtensions) theElement; - encodeUndeclaredExtensions(theResDef, theResource, theWriter, res.getUndeclaredExtensions(), "extension", theIncludedResource); - encodeUndeclaredExtensions(theResDef, theResource, theWriter, res.getUndeclaredModifierExtensions(), "modifierExtension", theIncludedResource); - } - } + @Override + public void encodeResourceToWriter(IBaseResource theResource, Writer theWriter) throws DataFormatException { + XMLStreamWriter eventWriter; + try { + eventWriter = createXmlWriter(theWriter); - private void encodeResourceReferenceToStreamWriter(XMLStreamWriter theEventWriter, ResourceReferenceDt theRef) throws XMLStreamException { - String reference = determineReferenceText(theRef); - - if (StringUtils.isNotBlank(reference)) { - theEventWriter.writeStartElement(RESREF_REFERENCE); - theEventWriter.writeAttribute("value", reference); - theEventWriter.writeEndElement(); - } - if (!(theRef.getDisplay().isEmpty())) { - theEventWriter.writeStartElement(RESREF_DISPLAY); - theEventWriter.writeAttribute("value", theRef.getDisplay().getValue()); - theEventWriter.writeEndElement(); + encodeResourceToXmlStreamWriter(theResource, eventWriter, false); + eventWriter.flush(); + } catch (XMLStreamException e) { + throw new ConfigurationException("Failed to initialize STaX event factory", e); } } @@ -808,7 +715,7 @@ public class XmlParser extends BaseParser implements IParser { if (theResourceId != null && theContainedResource) { theEventWriter.writeAttribute("id", theResourceId); } - + } if (theResource instanceof Binary) { @@ -836,6 +743,37 @@ public class XmlParser extends BaseParser implements IParser { theEventWriter.writeEndElement(); } + @Override + public void encodeTagListToWriter(TagList theTagList, Writer theWriter) throws IOException { + try { + XMLStreamWriter eventWriter = createXmlWriter(theWriter); + + eventWriter.writeStartElement(TagList.ELEMENT_NAME_LC); + eventWriter.writeDefaultNamespace(FHIR_NS); + + for (Tag next : theTagList) { + eventWriter.writeStartElement(TagList.ATTR_CATEGORY); + + if (isNotBlank(next.getTerm())) { + eventWriter.writeAttribute(Tag.ATTR_TERM, next.getTerm()); + } + if (isNotBlank(next.getLabel())) { + eventWriter.writeAttribute(Tag.ATTR_LABEL, next.getLabel()); + } + if (isNotBlank(next.getScheme())) { + eventWriter.writeAttribute(Tag.ATTR_SCHEME, next.getScheme()); + } + + eventWriter.writeEndElement(); + } + + eventWriter.writeEndElement(); + eventWriter.close(); + } catch (XMLStreamException e) { + throw new ConfigurationException("Failed to initialize STaX event factory", e); + } + } + private void encodeUndeclaredExtensions(RuntimeResourceDefinition theResDef, IBaseResource theResource, XMLStreamWriter theWriter, List theExtensions, String tagName, boolean theIncludedResource) throws XMLStreamException, DataFormatException { for (ExtensionDt next : theExtensions) { theWriter.writeStartElement(tagName); @@ -970,16 +908,44 @@ public class XmlParser extends BaseParser implements IParser { } } + @Override + public Bundle parseBundle(Class theResourceType, Reader theReader) { + XMLEventReader streamReader = createStreamReader(theReader); + + return parseBundle(streamReader, theResourceType); + } + private Bundle parseBundle(XMLEventReader theStreamReader, Class theResourceType) { ParserState parserState = ParserState.getPreAtomInstance(myContext, theResourceType, false); return doXmlLoop(theStreamReader, parserState); } + @Override + public T parseResource(Class theResourceType, Reader theReader) { + XMLEventReader streamReader = createStreamReader(theReader); + + return parseResource(theResourceType, streamReader); + } + private T parseResource(Class theResourceType, XMLEventReader theStreamReader) { ParserState parserState = ParserState.getPreResourceInstance(theResourceType, myContext, false); return doXmlLoop(theStreamReader, parserState); } + @Override + public TagList parseTagList(Reader theReader) { + XMLEventReader streamReader = createStreamReader(theReader); + + ParserState parserState = ParserState.getPreTagListInstance(myContext, false); + return doXmlLoop(streamReader, parserState); + } + + @Override + public IParser setPrettyPrint(boolean thePrettyPrint) { + myPrettyPrint = thePrettyPrint; + return this; + } + private void writeAtomLink(XMLStreamWriter theEventWriter, String theRel, StringDt theStringDt) throws XMLStreamException { if (StringUtils.isNotBlank(theStringDt.getValue())) { theEventWriter.writeStartElement("link"); @@ -989,6 +955,37 @@ public class XmlParser extends BaseParser implements IParser { } } + private void writeBundleResourceLink(XMLStreamWriter theEventWriter, String theRel, StringDt theUrl) throws XMLStreamException { + if (theUrl.isEmpty() == false) { + theEventWriter.writeStartElement("link"); + theEventWriter.writeStartElement("relation"); + theEventWriter.writeAttribute("value", theRel); + theEventWriter.writeEndElement(); + theEventWriter.writeStartElement("url"); + theEventWriter.writeAttribute("value", theUrl.getValue()); + theEventWriter.writeEndElement(); + theEventWriter.writeEndElement(); + } + } + + private void writeCategories(XMLStreamWriter eventWriter, TagList categories) throws XMLStreamException { + if (categories != null) { + for (Tag next : categories) { + eventWriter.writeStartElement("category"); + eventWriter.writeAttribute("term", defaultString(next.getTerm())); + eventWriter.writeAttribute("label", defaultString(next.getLabel())); + eventWriter.writeAttribute("scheme", defaultString(next.getScheme())); + eventWriter.writeEndElement(); + } + } + } + + private void writeOptionalAttribute(XMLStreamWriter theEventWriter, String theName, String theValue) throws XMLStreamException { + if (StringUtils.isNotBlank(theValue)) { + theEventWriter.writeAttribute(theName, theValue); + } + } + private void writeOptionalTagWithTextNode(XMLStreamWriter theEventWriter, String theTagName, InstantDt theInstantDt) throws XMLStreamException { if (theInstantDt.getValue() != null) { theEventWriter.writeStartElement(theTagName); @@ -1005,6 +1002,14 @@ public class XmlParser extends BaseParser implements IParser { } } + private void writeOptionalTagWithValue(XMLStreamWriter theEventWriter, String theName, String theValue) throws XMLStreamException { + if (StringUtils.isNotBlank(theValue)) { + theEventWriter.writeStartElement(theName); + theEventWriter.writeAttribute("value", theValue); + theEventWriter.writeEndElement(); + } + } + private void writeTagWithTextNode(XMLStreamWriter theEventWriter, String theElementName, IdDt theIdDt) throws XMLStreamException { theEventWriter.writeStartElement(theElementName); if (StringUtils.isNotBlank(theIdDt.getValue())) { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/IParamBinder.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/IParamBinder.java index f3372da898a..88ec91a1f3b 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/IParamBinder.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/IParamBinder.java @@ -27,10 +27,10 @@ import ca.uhn.fhir.model.api.IQueryParameterOr; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; -interface IParamBinder { +interface IParamBinder { List> encode(FhirContext theContext, Object theString) throws InternalErrorException; - Object parse(String theName, List theList) throws InternalErrorException, InvalidRequestException; + T parse(String theName, List theList) throws InternalErrorException, InvalidRequestException; } 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 ccce7c37437..982aaa3ee96 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 @@ -29,6 +29,8 @@ import ca.uhn.fhir.context.ConfigurationException; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.FhirVersionEnum; import ca.uhn.fhir.context.RuntimeResourceDefinition; +import ca.uhn.fhir.context.RuntimeSearchParam; +import ca.uhn.fhir.model.api.IQueryParameterAnd; import ca.uhn.fhir.model.api.IQueryParameterOr; import ca.uhn.fhir.model.api.IQueryParameterType; import ca.uhn.fhir.model.api.IResource; @@ -58,7 +60,13 @@ import ca.uhn.fhir.rest.annotation.VersionIdParam; import ca.uhn.fhir.rest.api.MethodOutcome; import ca.uhn.fhir.rest.client.BaseHttpClientInvocation; import ca.uhn.fhir.rest.param.CollectionBinder; +import ca.uhn.fhir.rest.param.DateAndListParam; +import ca.uhn.fhir.rest.param.NumberAndListParam; +import ca.uhn.fhir.rest.param.QuantityAndListParam; +import ca.uhn.fhir.rest.param.ReferenceAndListParam; import ca.uhn.fhir.rest.param.ResourceParameter; +import ca.uhn.fhir.rest.param.StringAndListParam; +import ca.uhn.fhir.rest.param.TokenAndListParam; import ca.uhn.fhir.rest.server.Constants; import ca.uhn.fhir.rest.server.EncodingEnum; import ca.uhn.fhir.rest.server.IDynamicSearchResourceProvider; @@ -455,6 +463,38 @@ public class MethodUtil { return MethodUtil.findParamAnnotationIndex(theMethod, TagListParam.class); } + /** + * This is a utility method intended provided to help the JPA module. + */ + public static IQueryParameterAnd parseQueryParams(RuntimeSearchParam theParamDef, String theUnqualifiedParamName, List theParameters) { + QueryParameterAndBinder binder = null; + switch (theParamDef.getParamType()) { + case COMPOSITE: + throw new UnsupportedOperationException(); + case DATE: + binder = new QueryParameterAndBinder(DateAndListParam.class, Collections.>emptyList()); + break; + case NUMBER: + binder = new QueryParameterAndBinder(NumberAndListParam.class, Collections.>emptyList()); + break; + case QUANTITY: + binder = new QueryParameterAndBinder(QuantityAndListParam.class, Collections.>emptyList()); + break; + case REFERENCE: + binder = new QueryParameterAndBinder(ReferenceAndListParam.class, Collections.>emptyList()); + break; + case STRING: + binder = new QueryParameterAndBinder(StringAndListParam.class, Collections.>emptyList()); + break; + case TOKEN: + binder = new QueryParameterAndBinder(TokenAndListParam.class, Collections.>emptyList()); + break; + } + + return binder.parse(theUnqualifiedParamName, theParameters); + } + + @SuppressWarnings("unchecked") public static List getResourceParameters(Method theMethod, Object theProvider) { List parameters = new ArrayList(); diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/QueryParameterAndBinder.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/QueryParameterAndBinder.java index e5111b8d245..9d4f7720360 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/QueryParameterAndBinder.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/QueryParameterAndBinder.java @@ -29,7 +29,7 @@ import ca.uhn.fhir.model.api.IQueryParameterType; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; -final class QueryParameterAndBinder extends BaseBinder> implements IParamBinder { +final class QueryParameterAndBinder extends BaseBinder> implements IParamBinder> { QueryParameterAndBinder(Class> theType, List> theCompositeTypes) { super(theType, theCompositeTypes); @@ -43,7 +43,7 @@ final class QueryParameterAndBinder extends BaseBinder> im } @Override - public Object parse(String theName, List theString) throws InternalErrorException, InvalidRequestException { + public IQueryParameterAnd parse(String theName, List theString) throws InternalErrorException, InvalidRequestException { IQueryParameterAnd dt; try { dt = newInstance(); diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/QueryParameterOrBinder.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/QueryParameterOrBinder.java index ef8e5edb9b3..5d803a844e2 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/QueryParameterOrBinder.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/QueryParameterOrBinder.java @@ -29,7 +29,7 @@ import ca.uhn.fhir.model.api.IQueryParameterType; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; -final class QueryParameterOrBinder extends BaseBinder> implements IParamBinder { +final class QueryParameterOrBinder extends BaseBinder> implements IParamBinder> { QueryParameterOrBinder(Class> theType, List> theCompositeTypes) { super(theType, theCompositeTypes); @@ -44,7 +44,7 @@ final class QueryParameterOrBinder extends BaseBinder> impl } @Override - public Object parse(String theName, List theString) throws InternalErrorException, InvalidRequestException { + public IQueryParameterOr parse(String theName, List theString) throws InternalErrorException, InvalidRequestException { IQueryParameterOr dt; try { dt = newInstance(); diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/QueryParameterTypeBinder.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/QueryParameterTypeBinder.java index b12af1d2941..3a41bbcc74b 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/QueryParameterTypeBinder.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/QueryParameterTypeBinder.java @@ -31,7 +31,7 @@ import ca.uhn.fhir.model.api.IQueryParameterType; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; -final class QueryParameterTypeBinder extends BaseBinder implements IParamBinder { +final class QueryParameterTypeBinder extends BaseBinder implements IParamBinder { QueryParameterTypeBinder(Class theType, List> theCompositeTypes) { super(theType, theCompositeTypes); @@ -46,7 +46,7 @@ final class QueryParameterTypeBinder extends BaseBinder imp } @Override - public Object parse(String theName, List theParams) throws InternalErrorException, InvalidRequestException { + public IQueryParameterType parse(String theName, List theParams) throws InternalErrorException, InvalidRequestException { String value = theParams.get(0).get(0); if (StringUtils.isBlank(value)) { return null; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/StringBinder.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/StringBinder.java index b9dc8a8771a..3092ac274a2 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/StringBinder.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/StringBinder.java @@ -29,7 +29,7 @@ import ca.uhn.fhir.rest.param.StringParam; import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; -final class StringBinder implements IParamBinder { +final class StringBinder implements IParamBinder { StringBinder() { } @@ -42,7 +42,7 @@ final class StringBinder implements IParamBinder { } @Override - public Object parse(String theName, List theParams) throws InternalErrorException, InvalidRequestException { + public String parse(String theName, List theParams) throws InternalErrorException, InvalidRequestException { if (theParams.size() == 0 || theParams.get(0).size() == 0) { return ""; } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java index fd050459ee4..c4d9084c856 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java @@ -20,43 +20,7 @@ package ca.uhn.fhir.rest.server; * #L% */ -import ca.uhn.fhir.context.FhirContext; -import ca.uhn.fhir.context.FhirVersionEnum; -import ca.uhn.fhir.context.ProvidedResourceScanner; -import ca.uhn.fhir.context.RuntimeResourceDefinition; -import ca.uhn.fhir.model.api.*; -import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; -import ca.uhn.fhir.model.base.resource.BaseOperationOutcome.BaseIssue; -import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; -import ca.uhn.fhir.model.dstu.resource.Binary; -import ca.uhn.fhir.model.primitive.IdDt; -import ca.uhn.fhir.model.primitive.InstantDt; -import ca.uhn.fhir.model.valueset.BundleEntryStatusEnum; -import ca.uhn.fhir.model.valueset.BundleTypeEnum; -import ca.uhn.fhir.parser.IParser; -import ca.uhn.fhir.rest.annotation.Destroy; -import ca.uhn.fhir.rest.annotation.IdParam; -import ca.uhn.fhir.rest.method.*; -import ca.uhn.fhir.rest.method.SearchMethodBinding.RequestType; -import ca.uhn.fhir.rest.server.exceptions.AuthenticationException; -import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException; -import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; -import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; -import ca.uhn.fhir.rest.server.exceptions.NotModifiedException; -import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor; -import ca.uhn.fhir.util.ReflectionUtil; -import ca.uhn.fhir.util.VersionUtil; - -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.Validate; -import org.apache.commons.lang3.exception.ExceptionUtils; -import org.apache.http.client.utils.DateUtils; - -import javax.servlet.ServletException; -import javax.servlet.ServletOutputStream; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import static org.apache.commons.lang3.StringUtils.*; import java.io.IOException; import java.io.OutputStreamWriter; @@ -67,10 +31,67 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.net.URLEncoder; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.StringTokenizer; +import java.util.UUID; import java.util.zip.GZIPOutputStream; -import static org.apache.commons.lang3.StringUtils.isNotBlank; +import javax.servlet.ServletException; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.Validate; +import org.apache.commons.lang3.exception.ExceptionUtils; +import org.apache.http.client.utils.DateUtils; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.context.FhirVersionEnum; +import ca.uhn.fhir.context.ProvidedResourceScanner; +import ca.uhn.fhir.context.RuntimeResourceDefinition; +import ca.uhn.fhir.model.api.Bundle; +import ca.uhn.fhir.model.api.BundleEntry; +import ca.uhn.fhir.model.api.IResource; +import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum; +import ca.uhn.fhir.model.api.Tag; +import ca.uhn.fhir.model.api.TagList; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; +import ca.uhn.fhir.model.base.resource.BaseOperationOutcome.BaseIssue; +import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; +import ca.uhn.fhir.model.dstu.resource.Binary; +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.parser.IParser; +import ca.uhn.fhir.rest.annotation.Destroy; +import ca.uhn.fhir.rest.annotation.IdParam; +import ca.uhn.fhir.rest.method.BaseMethodBinding; +import ca.uhn.fhir.rest.method.ConformanceMethodBinding; +import ca.uhn.fhir.rest.method.OtherOperationTypeEnum; +import ca.uhn.fhir.rest.method.Request; +import ca.uhn.fhir.rest.method.RequestDetails; +import ca.uhn.fhir.rest.method.SearchMethodBinding; +import ca.uhn.fhir.rest.method.SearchMethodBinding.RequestType; +import ca.uhn.fhir.rest.server.exceptions.AuthenticationException; +import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException; +import ca.uhn.fhir.rest.server.exceptions.InternalErrorException; +import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; +import ca.uhn.fhir.rest.server.exceptions.NotModifiedException; +import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor; +import ca.uhn.fhir.util.ReflectionUtil; +import ca.uhn.fhir.util.VersionUtil; public class RestfulServer extends HttpServlet { @@ -1202,8 +1223,8 @@ public class RestfulServer extends HttpServlet { for (IResource next : includedResources) { BundleEntry entry = bundle.addResource(next, theContext, theServerBase); if (theContext.getVersion().getVersion().isNewerThan(FhirVersionEnum.DSTU1)) { - if (entry.getStatus().isEmpty()) { - entry.getStatus().setValueAsEnum(BundleEntryStatusEnum.INCLUDE); + if (entry.getSearchMode().isEmpty()) { + entry.getSearchMode().setValueAsEnum(BundleEntrySearchModeEnum.INCLUDE); } } } 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 d73563343f2..6b4a164448c 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 @@ -63,17 +63,11 @@ public class XmlUtil { private static volatile boolean ourHaveLoggedStaxImplementation; private static final Map VALID_ENTITY_NAMES; private static final ExtendedEntityReplacingXmlResolver XML_RESOLVER = new ExtendedEntityReplacingXmlResolver(); - private static final Attributes.Name IMPLEMENTATION_TITLE = new Attributes.Name("Implementation-Title"); - private static final Attributes.Name IMPLEMENTATION_VENDOR = new Attributes.Name("Implementation-Vendor"); - private static final Attributes.Name IMPLEMENTATION_VERSION = new Attributes.Name("Implementation-Version"); - private static final Attributes.Name BUNDLE_SYMBOLIC_NAME = new Attributes.Name("Bundle-SymbolicName"); - private static final Attributes.Name BUNDLE_VENDOR = new Attributes.Name("Bundle-Vendor"); - private static final Attributes.Name BUNDLE_VERSION = new Attributes.Name("Bundle-Version"); static { @@ -211,7 +205,7 @@ public class XmlUtil { * being used (e.g. glassfish) so we don't set them there. */ try { - Class.forName("com.ctc.wstx.stax.WstxOutputFactory"); + Class.forName("com.ctc.wstx.stax.WstxInputFactory"); if (inputFactory instanceof com.ctc.wstx.stax.WstxInputFactory) { // inputFactory.setProperty(WstxInputFactory.IS_REPLACING_ENTITY_REFERENCES, false); inputFactory.setProperty(WstxInputProperties.P_UNDECLARED_ENTITY_RESOLVER, XML_RESOLVER); @@ -366,6 +360,7 @@ public class XmlUtil { case '"': case '&': hasEscapable = true; + break; default: break; } 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 7a62d1c352c..b3bc4d8db52 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 @@ -57,11 +57,13 @@ public class ValidationResult { private String toDescription() { StringBuilder b = new StringBuilder(100); - if (myOperationOutcome != null) { + 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(); } diff --git a/hapi-fhir-base/src/main/resources/ca/uhn/fhir/i18n/hapi-messages.properties b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/i18n/hapi-messages.properties index 487487f8fd4..90208a804d8 100644 --- a/hapi-fhir-base/src/main/resources/ca/uhn/fhir/i18n/hapi-messages.properties +++ b/hapi-fhir-base/src/main/resources/ca/uhn/fhir/i18n/hapi-messages.properties @@ -1,4 +1,6 @@ +# Core Library Messages + ca.uhn.fhir.context.FhirContext.noStructures=Could not find any HAPI-FHIR structure JARs on the classpath. Note that as of HAPI-FHIR v0.8, a separate FHIR strcture JAR must be added to your classpath (or project pom.xml if you are using Maven) ca.uhn.fhir.context.FhirContext.noStructuresForSpecifiedVersion=Could not find the HAPI-FHIR structure JAR on the classpath for version {0}. Note that as of HAPI-FHIR v0.8, a separate FHIR strcture JAR must be added to your classpath (or project pom.xml if you are using Maven) @@ -10,7 +12,7 @@ ca.uhn.fhir.rest.client.GenericClient.cannotDetermineResourceTypeFromUri=Unable ca.uhn.fhir.rest.client.RestfulClientFactory.failedToRetrieveConformance=Failed to retrieve the server's metadata statement during client initialization. URL used was: {0} ca.uhn.fhir.rest.client.RestfulClientFactory.wrongVersionInConformance=The server at base URL "{0}" returned a conformance statement indicating that it supports FHIR version "{1}" which corresponds to {2}, but this client is configured to use {3} (via the FhirContext). -ca.uhn.fhir.rest.method.IncludeParameter.invalidIncludeNameInRequest=Invalid _include parameter value: '{0}'. Valid values are: {1} +ca.uhn.fhir.rest.method.IncludeParameter.invalidIncludeNameInRequest=Invalid _include parameter value: "{0}". Valid values are: {1} ca.uhn.fhir.rest.method.IncludeParameter.orIncludeInRequest='OR' query parameters (values containing ',') are not supported in _include parameters ca.uhn.fhir.rest.method.SearchMethodBinding.invalidSpecialParamName=Method [{0}] in provider [{1}] contains search parameter annotated to use name [{2}] - This name is reserved according to the FHIR specification and can not be used as a search parameter name. @@ -19,3 +21,10 @@ ca.uhn.fhir.rest.method.SearchMethodBinding.idNullForCompartmentSearch=ID parame ca.uhn.fhir.validation.FhirValidator.noPhlocWarningOnStartup=Phloc-schematron library not found on classpath, will not attempt to perform schematron validation ca.uhn.fhir.validation.FhirValidator.noPhlocError=Phloc-schematron library not found on classpath, can not enable perform schematron validation + +# JPA Messages + +ca.uhn.fhir.jpa.dao.FhirSystemDao.incomingNoopInTransaction=Transaction contains resource with operation NOOP. This is only valid as a response operation, not in a request. +ca.uhn.fhir.jpa.dao.FhirSystemDao.transactionOperationWithMultipleMatchFailure=Failed to {0} resource with match URL "{1}" because this search matched {2} resources +ca.uhn.fhir.jpa.dao.FhirSystemDao.transactionOperationFailedNoId=Failed to {0} resource in transaction because no ID was provided +ca.uhn.fhir.jpa.dao.FhirSystemDao.transactionOperationFailedUnknownId=Failed to {0} resource in transaction because no resource could be found with ID {1} diff --git a/hapi-fhir-jpaserver-base/.classpath b/hapi-fhir-jpaserver-base/.classpath index efb0e370ed4..fbd656e3325 100644 --- a/hapi-fhir-jpaserver-base/.classpath +++ b/hapi-fhir-jpaserver-base/.classpath @@ -27,7 +27,7 @@ - + diff --git a/hapi-fhir-jpaserver-base/.settings/org.eclipse.jdt.core.prefs b/hapi-fhir-jpaserver-base/.settings/org.eclipse.jdt.core.prefs index 42246e57dab..d535869bf65 100644 --- a/hapi-fhir-jpaserver-base/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-fhir-jpaserver-base/.settings/org.eclipse.jdt.core.prefs @@ -7,9 +7,9 @@ org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nul org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.compliance=1.7 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -97,4 +97,4 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.6 +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirResourceDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirResourceDao.java index c37b943b1cb..0867bbe42eb 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirResourceDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirResourceDao.java @@ -20,8 +20,7 @@ package ca.uhn.fhir.jpa.dao; * #L% */ -import static org.apache.commons.lang3.StringUtils.isBlank; -import static org.apache.commons.lang3.StringUtils.isNotBlank; +import static org.apache.commons.lang3.StringUtils.*; import java.math.BigDecimal; import java.util.ArrayList; @@ -96,7 +95,7 @@ import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum; import ca.uhn.fhir.model.dstu.valueset.SearchParamTypeEnum; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.model.primitive.InstantDt; -import ca.uhn.fhir.model.valueset.BundleEntryStatusEnum; +import ca.uhn.fhir.model.valueset.BundleEntrySearchModeEnum; import ca.uhn.fhir.rest.api.MethodOutcome; import ca.uhn.fhir.rest.api.SortSpec; import ca.uhn.fhir.rest.param.CompositeParam; @@ -372,6 +371,15 @@ public class FhirResourceDao extends BaseFhirDao implements @Override public BaseHasResource readEntity(IdDt theId) { + boolean checkForForcedId = true; + + BaseHasResource entity = readEntity(theId, checkForForcedId); + + return entity; + } + + @Override + public BaseHasResource readEntity(IdDt theId, boolean theCheckForForcedId) { validateResourceTypeAndThrowIllegalArgumentException(theId); Long pid = translateForcedIdToPid(theId); @@ -396,10 +404,12 @@ public class FhirResourceDao extends BaseFhirDao implements } } - validateGivenIdIsAppropriateToRetrieveResource(theId, entity); validateResourceType(entity); + if (theCheckForForcedId) { + validateGivenIdIsAppropriateToRetrieveResource(theId, entity); + } return entity; } @@ -508,7 +518,7 @@ public class FhirResourceDao extends BaseFhirDao implements // Execute the query and make sure we return distinct results List retVal = new ArrayList(); - loadResourcesByPid(pidsSubList, retVal, BundleEntryStatusEnum.MATCH); + loadResourcesByPid(pidsSubList, retVal, BundleEntrySearchModeEnum.MATCH); // Load _include resources if (theParams.getIncludes() != null && theParams.getIncludes().isEmpty() == false) { @@ -561,7 +571,7 @@ public class FhirResourceDao extends BaseFhirDao implements ourLog.info("Loading {} included resources", includePids.size()); resources = loadResourcesById(includePids); for (IResource next : resources) { - ResourceMetadataKeyEnum.ENTRY_STATUS.put(next, BundleEntryStatusEnum.INCLUDE); + ResourceMetadataKeyEnum.ENTRY_SEARCH_MODE.put(next, BundleEntrySearchModeEnum.INCLUDE); } retVal.addAll(resources); } @@ -1441,7 +1451,7 @@ public class FhirResourceDao extends BaseFhirDao implements createSort(theBuilder, theFrom, theSort.getChain(), theOrders, thePredicates); } - private void loadResourcesByPid(Collection theIncludePids, List theResourceListToPopulate, BundleEntryStatusEnum theBundleEntryStatus) { + private void loadResourcesByPid(Collection theIncludePids, List theResourceListToPopulate, BundleEntrySearchModeEnum theBundleEntryStatus) { if (theIncludePids.isEmpty()) { return; } @@ -1469,7 +1479,7 @@ public class FhirResourceDao extends BaseFhirDao implements continue; } - ResourceMetadataKeyEnum.ENTRY_STATUS.put(resource, theBundleEntryStatus); + ResourceMetadataKeyEnum.ENTRY_SEARCH_MODE.put(resource, theBundleEntryStatus); theResourceListToPopulate.set(index, resource); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirSystemDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirSystemDao.java index ede151b32f3..45eb430740d 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirSystemDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirSystemDao.java @@ -20,6 +20,8 @@ package ca.uhn.fhir.jpa.dao; * #L% */ +import java.net.URI; +import java.net.URISyntaxException; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; @@ -36,11 +38,19 @@ import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Root; +import org.apache.commons.lang3.StringUtils; +import org.apache.http.NameValuePair; +import org.apache.http.client.utils.URLEncodedUtils; +import org.hl7.fhir.instance.model.IBaseResource; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; +import ca.uhn.fhir.context.RuntimeResourceDefinition; +import ca.uhn.fhir.context.RuntimeSearchParam; +import ca.uhn.fhir.jpa.entity.BaseHasResource; import ca.uhn.fhir.jpa.entity.ResourceTable; import ca.uhn.fhir.jpa.util.StopWatch; +import ca.uhn.fhir.model.api.IQueryParameterAnd; import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum; import ca.uhn.fhir.model.api.TagList; @@ -49,11 +59,16 @@ 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.model.primitive.InstantDt; +import ca.uhn.fhir.model.valueset.BundleEntryTransactionOperationEnum; +import ca.uhn.fhir.rest.method.MethodUtil; +import ca.uhn.fhir.rest.method.QualifiedParamList; import ca.uhn.fhir.rest.server.IBundleProvider; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; import ca.uhn.fhir.util.FhirTerser; +import com.google.common.collect.ArrayListMultimap; + public class FhirSystemDao extends BaseFhirDao implements IFhirSystemDao { private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirSystemDao.class); @@ -67,16 +82,15 @@ public class FhirSystemDao extends BaseFhirDao implements IFhirSystemDao { long start = System.currentTimeMillis(); Set allIds = new HashSet(); - - for (int i =0; i persistedResources = new ArrayList(); - for (IResource nextResource : theResources) { + List retVal = new ArrayList(); + OperationOutcome oo = new OperationOutcome(); + retVal.add(oo); + + for (int resourceIdx = 0; resourceIdx < theResources.size(); resourceIdx++) { + IResource nextResource = theResources.get(resourceIdx); + IdDt nextId = nextResource.getId(); if (nextId == null) { nextId = new IdDt(); } String resourceName = toResourceName(nextResource); - - ResourceTable entity; - if (nextId.isEmpty()) { - entity = null; - } else { - try { - Long pid = translateForcedIdToPid(nextId); - entity = myEntityManager.find(ResourceTable.class, pid); - } catch (ResourceNotFoundException e) { - entity = null; - } + BundleEntryTransactionOperationEnum nextResouceOperationIn = ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.get(nextResource); + if (nextResouceOperationIn == null && hasValue(ResourceMetadataKeyEnum.DELETED_AT.get(nextResource))) { + nextResouceOperationIn = BundleEntryTransactionOperationEnum.DELETE; } + String matchUrl = ResourceMetadataKeyEnum.LINK_SEARCH.get(nextResource); + Set candidateMatches = null; + if (StringUtils.isNotBlank(matchUrl)) { + candidateMatches = processMatchUrl(matchUrl, nextResource.getClass()); + } + + ResourceTable entity; + if (nextResouceOperationIn == BundleEntryTransactionOperationEnum.CREATE) { + entity = null; + } else if (nextResouceOperationIn == BundleEntryTransactionOperationEnum.UPDATE || nextResouceOperationIn == BundleEntryTransactionOperationEnum.DELETE) { + if (candidateMatches == null || candidateMatches.size() == 0) { + if (nextId == null || StringUtils.isBlank(nextId.getIdPart())) { + throw new InvalidRequestException(getContext().getLocalizer().getMessage(FhirSystemDao.class, "transactionOperationFailedNoId", nextResouceOperationIn.name())); + } + entity = tryToLoadEntity(nextId); + if (entity == null) { + if (nextResouceOperationIn == BundleEntryTransactionOperationEnum.UPDATE) { + ourLog.debug("Attempting to UPDATE resource with unknown ID '{}', will CREATE instead", nextId); + } else if (candidateMatches == null) { + throw new InvalidRequestException(getContext().getLocalizer().getMessage(FhirSystemDao.class, "transactionOperationFailedUnknownId", nextResouceOperationIn.name(), nextId)); + } else { + ourLog.debug("Resource with match URL [{}] already exists, will be NOOP", matchUrl); + ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.put(nextResource, BundleEntryTransactionOperationEnum.NOOP); + persistedResources.add(null); + retVal.add(nextResource); + continue; + } + } + } else if (candidateMatches.size() == 1) { + entity = loadFirstEntityFromCandidateMatches(candidateMatches); + } else { + throw new InvalidRequestException(getContext().getLocalizer().getMessage(FhirSystemDao.class, "transactionOperationWithMultipleMatchFailure", nextResouceOperationIn.name(), matchUrl, candidateMatches.size())); + } + } else if (nextResouceOperationIn == BundleEntryTransactionOperationEnum.NOOP) { + throw new InvalidRequestException(getContext().getLocalizer().getMessage(FhirSystemDao.class, "incomingNoopInTransaction")); + } else if (nextId.isEmpty()) { + entity = null; + } else { + entity = tryToLoadEntity(nextId); + } + + BundleEntryTransactionOperationEnum nextResouceOperationOut; if (entity == null) { + nextResouceOperationOut = BundleEntryTransactionOperationEnum.CREATE; entity = toEntity(nextResource); - if (!nextId.isEmpty() && nextId.getIdPart().startsWith("cid:")) { + if (nextId.isEmpty() == false && nextId.getIdPart().startsWith("cid:")) { ourLog.debug("Resource in transaction has ID[{}], will replace with server assigned ID", nextId.getIdPart()); + } else if (nextResouceOperationIn == BundleEntryTransactionOperationEnum.CREATE) { + if (nextId.isEmpty() == false) { + ourLog.debug("Resource in transaction has ID[{}] but is marked for CREATE, will ignore ID", nextId.getIdPart()); + } + if (candidateMatches != null) { + if (candidateMatches.size() == 1) { + ourLog.debug("Resource with match URL [{}] already exists, will be NOOP", matchUrl); + BaseHasResource existingEntity = loadFirstEntityFromCandidateMatches(candidateMatches); + IResource existing = (IResource) toResource(existingEntity); + ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.put(existing, BundleEntryTransactionOperationEnum.NOOP); + persistedResources.add(null); + retVal.add(existing); + continue; + } + if (candidateMatches.size() > 1) { + throw new InvalidRequestException(getContext().getLocalizer().getMessage(FhirSystemDao.class, "transactionOperationWithMultipleMatchFailure", BundleEntryTransactionOperationEnum.CREATE.name(), matchUrl, candidateMatches.size())); + } + } } else { createForcedIdIfNeeded(entity, nextId); } @@ -126,16 +199,20 @@ public class FhirSystemDao extends BaseFhirDao implements IFhirSystemDao { if (entity.getForcedId() != null) { myEntityManager.persist(entity.getForcedId()); } - // myEntityManager.flush(); creations++; ourLog.info("Resource Type[{}] with ID[{}] does not exist, creating it", resourceName, nextId); } else { + nextResouceOperationOut = nextResouceOperationIn; + if (nextResouceOperationOut == null) { + nextResouceOperationOut = BundleEntryTransactionOperationEnum.UPDATE; + } updates++; ourLog.info("Resource Type[{}] with ID[{}] exists, updating it", resourceName, nextId); } persistedResources.add(entity); - + retVal.add(nextResource); + ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.put(nextResource, nextResouceOperationOut); } ourLog.info("Flushing transaction to database"); @@ -143,14 +220,22 @@ public class FhirSystemDao extends BaseFhirDao implements IFhirSystemDao { for (int i = 0; i < persistedResources.size(); i++) { ResourceTable entity = persistedResources.get(i); + String resourceName = toResourceName(theResources.get(i)); IdDt nextId = theResources.get(i).getId(); - IdDt newId = entity.getIdDt().toUnqualifiedVersionless(); + IdDt newId; + + if (entity == null) { + newId = retVal.get(i + 1).getId().toUnqualifiedVersionless(); + } else { + newId = entity.getIdDt().toUnqualifiedVersionless(); + } + if (nextId == null || nextId.isEmpty()) { ourLog.info("Transaction resource (with no preexisting ID) has been assigned new ID[{}]", nextId, newId); } else { - if (nextId.toUnqualifiedVersionless().equals(entity.getIdDt().toUnqualifiedVersionless())) { + if (nextId.toUnqualifiedVersionless().equals(newId)) { ourLog.info("Transaction resource ID[{}] is being updated", newId); } else { if (!nextId.getIdPart().startsWith("#")) { @@ -182,26 +267,96 @@ public class FhirSystemDao extends BaseFhirDao implements IFhirSystemDao { for (int i = 0; i < theResources.size(); i++) { IResource resource = theResources.get(i); ResourceTable table = persistedResources.get(i); + if (table == null) { + continue; + } + InstantDt deletedInstantOrNull = ResourceMetadataKeyEnum.DELETED_AT.get(resource); Date deletedTimestampOrNull = deletedInstantOrNull != null ? deletedInstantOrNull.getValue() : null; + if (deletedInstantOrNull == null && ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.get(resource) == BundleEntryTransactionOperationEnum.DELETE) { + deletedTimestampOrNull = new Date(); + ResourceMetadataKeyEnum.DELETED_AT.put(resource, new InstantDt(deletedTimestampOrNull)); + } + updateEntity(resource, table, table.getId() != null, deletedTimestampOrNull); } long delay = System.currentTimeMillis() - start; ourLog.info("Transaction completed in {}ms with {} creations and {} updates", new Object[] { delay, creations, updates }); - OperationOutcome oo = new OperationOutcome(); - oo.addIssue().setSeverity(IssueSeverityEnum.INFORMATION).setDetails("Transaction completed in "+delay+"ms with "+creations+" creations and "+updates+" updates"); - - ArrayList retVal = new ArrayList(); - retVal.add(oo); - retVal.addAll(theResources); - + oo.addIssue().setSeverity(IssueSeverityEnum.INFORMATION).setDetails("Transaction completed in " + delay + "ms with " + creations + " creations and " + updates + " updates"); + notifyWriteCompleted(); - + return retVal; } + private boolean hasValue(InstantDt theInstantDt) { + return theInstantDt != null && theInstantDt.isEmpty() == false; + } + + private ResourceTable tryToLoadEntity(IdDt nextId) { + ResourceTable entity; + try { + Long pid = translateForcedIdToPid(nextId); + entity = myEntityManager.find(ResourceTable.class, pid); + } catch (ResourceNotFoundException e) { + entity = null; + } + return entity; + } + + private ResourceTable loadFirstEntityFromCandidateMatches(Set candidateMatches) { + return myEntityManager.find(ResourceTable.class, candidateMatches.iterator().next()); + } + + private Set processMatchUrl(String theMatchUrl, Class theResourceType) { + RuntimeResourceDefinition resourceDef = getContext().getResourceDefinition(theResourceType); + + SearchParameterMap paramMap = new SearchParameterMap(); + List parameters; + try { + parameters = URLEncodedUtils.parse(new URI(theMatchUrl), "UTF-8"); + } catch (URISyntaxException e) { + throw new InvalidRequestException("Failed to parse match URL[" + theMatchUrl + "] - Error was: " + e.toString()); + } + + ArrayListMultimap nameToParamLists = ArrayListMultimap.create(); + for (NameValuePair next : parameters) { + String paramName = next.getName(); + String qualifier = null; + for (int i = 0; i < paramMap.size(); i++) { + switch (paramName.charAt(i)) { + case '.': + case ':': + qualifier = paramName.substring(i); + paramName = paramName.substring(0, i); + i = Integer.MAX_VALUE; + break; + } + } + + QualifiedParamList paramList = QualifiedParamList.splitQueryStringByCommasIgnoreEscape(qualifier, next.getValue()); + nameToParamLists.put(paramName, paramList); + } + + for (String nextParamName : nameToParamLists.keySet()) { + RuntimeSearchParam paramDef = resourceDef.getSearchParam(nextParamName); + if (paramDef == null) { + throw new InvalidRequestException("Failed to parse match URL[" + theMatchUrl + "] - Resource type " + resourceDef.getName() + " does not have a parameter with name: " + nextParamName); + } + + List paramList = nameToParamLists.get(nextParamName); + IQueryParameterAnd param = MethodUtil.parseQueryParams(paramDef, nextParamName, paramList); + paramMap.add(nextParamName, param); + } + + IFhirResourceDao dao = getDao(theResourceType); + Set ids = dao.searchForIdsWithAndOr(paramMap); + + return ids; + } + @Override public IBundleProvider history(Date theSince) { StopWatch w = new StopWatch(); 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 fdb6352967d..0e8c3de52dd 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 @@ -78,5 +78,12 @@ public interface IFhirResourceDao extends IDao { MethodOutcome update(T theResource, IdDt theId); Set searchForIdsWithAndOr(SearchParameterMap theParams); + + /** + * @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); } diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirResourceDaoTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirResourceDaoTest.java index f22513e5294..cb3f267ee86 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirResourceDaoTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirResourceDaoTest.java @@ -641,6 +641,7 @@ public class FhirResourceDaoTest { assertTrue(patients.size() >= 2); } + @Test public void testHistoryByForcedId() { IdDt idv1; @@ -661,6 +662,7 @@ public class FhirResourceDaoTest { // Newest first assertEquals("Patient/testHistoryByForcedId/_history/2", patients.get(0).getId().toUnqualified().getValue()); assertEquals("Patient/testHistoryByForcedId/_history/1", patients.get(1).getId().toUnqualified().getValue()); + assertNotEquals(idv1, idv2); } @Test diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoTest.java index 0ef1b1f6a68..877ae3cf750 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoTest.java @@ -1,19 +1,11 @@ package ca.uhn.fhir.jpa.dao; -import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.endsWith; -import static org.hamcrest.Matchers.equalToIgnoringCase; -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.hamcrest.Matchers.*; +import static org.junit.Assert.*; import java.io.InputStream; import java.io.InputStreamReader; +import java.lang.instrument.UnmodifiableClassException; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; @@ -33,31 +25,53 @@ import ca.uhn.fhir.model.api.TagList; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu2.composite.IdentifierDt; import ca.uhn.fhir.model.dstu2.composite.QuantityDt; -import ca.uhn.fhir.model.dstu2.resource.Device; -import ca.uhn.fhir.model.dstu2.resource.DiagnosticReport; import ca.uhn.fhir.model.dstu2.resource.Location; import ca.uhn.fhir.model.dstu2.resource.Observation; -import ca.uhn.fhir.model.dstu2.resource.Organization; import ca.uhn.fhir.model.dstu2.resource.Patient; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.model.primitive.InstantDt; +import ca.uhn.fhir.model.valueset.BundleEntryTransactionOperationEnum; +import ca.uhn.fhir.rest.api.MethodOutcome; import ca.uhn.fhir.rest.param.TokenParam; import ca.uhn.fhir.rest.server.IBundleProvider; import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException; +import ca.uhn.fhir.rest.server.exceptions.ResourceGoneException; +import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException; public class FhirSystemDaoTest { private static ClassPathXmlApplicationContext ourCtx; + private static FhirContext ourFhirContext; + private static IFhirResourceDao ourLocationDao; private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirSystemDaoTest.class); private static IFhirResourceDao ourObservationDao; private static IFhirResourceDao ourPatientDao; - private static IFhirResourceDao ourDeviceDao; - private static IFhirResourceDao ourDiagnosticReportDao; - private static IFhirResourceDao ourOrganizationDao; - private static IFhirResourceDao ourLocationDao; - private static Date ourTestStarted; private static IFhirSystemDao ourSystemDao; - private static FhirContext ourFhirContext; + + @Test + public void testGetResourceCounts() { + Observation obs = new Observation(); + obs.getName().addCoding().setSystem("urn:system").setCode("testGetResourceCountsO01"); + ourObservationDao.create(obs); + + Map oldCounts = ourSystemDao.getResourceCounts(); + + Patient patient = new Patient(); + patient.addIdentifier().setSystem("urn:system").setValue("testGetResourceCountsP01"); + patient.addName().addFamily("Tester").addGiven("Joe"); + ourPatientDao.create(patient); + + Map newCounts = ourSystemDao.getResourceCounts(); + + if (oldCounts.containsKey("Patient")) { + assertEquals(oldCounts.get("Patient") + 1, (long) newCounts.get("Patient")); + } else { + assertEquals(1L, (long) newCounts.get("Patient")); + } + + assertEquals((long) oldCounts.get("Observation"), (long) newCounts.get("Observation")); + + } @Test public void testHistory() throws Exception { @@ -65,7 +79,7 @@ public class FhirSystemDaoTest { Thread.sleep(10); Patient patient = new Patient(); - patient.addIdentifier().setSystem("urn:system").setValue( "testHistory"); + patient.addIdentifier().setSystem("urn:system").setValue("testHistory"); patient.addName().addFamily("Tester").addGiven("Joe"); IdDt pid = ourPatientDao.create(patient).getId().toVersionless(); @@ -96,7 +110,7 @@ public class FhirSystemDaoTest { ourLocationDao.create(loc2).getId(); Thread.sleep(2000); - + values = ourLocationDao.history(start); assertEquals(2, values.size()); @@ -105,6 +119,84 @@ public class FhirSystemDaoTest { } + @Test + public void testPersistWithSimpleLink() { + Patient patient = new Patient(); + patient.setId(new IdDt("Patient/testPersistWithSimpleLinkP01")); + patient.addIdentifier().setSystem("urn:system").setValue("testPersistWithSimpleLinkP01"); + patient.addName().addFamily("Tester").addGiven("Joe"); + + Observation obs = new Observation(); + obs.getName().addCoding().setSystem("urn:system").setCode("testPersistWithSimpleLinkO01"); + obs.setSubject(new ResourceReferenceDt("Patient/testPersistWithSimpleLinkP01")); + + ourSystemDao.transaction(Arrays.asList((IResource) patient, obs)); + + String patientId = (patient.getId().getIdPart()); + String obsId = (obs.getId().getIdPart()); + + // assertThat(patientId, greaterThan(0L)); + // assertEquals(patientVersion, 1L); + // assertThat(obsId, greaterThan(patientId)); + // assertEquals(obsVersion, 1L); + + // Try to search + + IBundleProvider obsResults = ourObservationDao.search(Observation.SP_NAME, new IdentifierDt("urn:system", "testPersistWithSimpleLinkO01")); + assertEquals(1, obsResults.size()); + + IBundleProvider patResults = ourPatientDao.search(Patient.SP_IDENTIFIER, new IdentifierDt("urn:system", "testPersistWithSimpleLinkP01")); + assertEquals(1, obsResults.size()); + + IdDt foundPatientId = patResults.getResources(0, 1).get(0).getId(); + ResourceReferenceDt subject = obs.getSubject(); + assertEquals(foundPatientId.getIdPart(), subject.getReference().getIdPart()); + + // Update + + patient = (Patient) patResults.getResources(0, 1).get(0); + obs = (Observation) obsResults.getResources(0, 1).get(0); + patient.addIdentifier().setSystem("urn:system").setValue("testPersistWithSimpleLinkP02"); + obs.getName().addCoding().setSystem("urn:system").setCode("testPersistWithSimpleLinkO02"); + + ourSystemDao.transaction(Arrays.asList((IResource) patient, obs)); + + String patientId2 = (patient.getId().getIdPart()); + String patientVersion2 = (patient.getId().getVersionIdPart()); + String obsId2 = (obs.getId().getIdPart()); + String obsVersion2 = (obs.getId().getVersionIdPart()); + + assertEquals(patientId, patientId2); + assertEquals(patientVersion2, "2"); + assertEquals(obsId, obsId2); + assertEquals(obsVersion2, "2"); + + } + + @Test + public void testPersistWithUnknownId() { + Observation obs = new Observation(); + obs.getName().addCoding().setSystem("urn:system").setCode("testPersistWithSimpleLinkO01"); + obs.setSubject(new ResourceReferenceDt("Patient/999998888888")); + + try { + ourSystemDao.transaction(Arrays.asList((IResource) obs)); + } catch (InvalidRequestException e) { + assertThat(e.getMessage(), containsString("Resource Patient/999998888888 not found, specified in path: Observation.subject")); + } + + obs = new Observation(); + obs.getName().addCoding().setSystem("urn:system").setCode("testPersistWithSimpleLinkO01"); + obs.setSubject(new ResourceReferenceDt("Patient/1.2.3.4")); + + try { + ourSystemDao.transaction(Arrays.asList((IResource) obs)); + } catch (InvalidRequestException e) { + assertThat(e.getMessage(), containsString("Resource Patient/1.2.3.4 not found, specified in path: Observation.subject")); + } + + } + @Test public void testTagOperationss() throws Exception { @@ -179,7 +271,465 @@ public class FhirSystemDaoTest { } @Test - public void testTransactionWithUpdate() throws Exception { + public void testTransactionCreateMatchUrlWithOneMatch() { + String methodName = "testTransactionCreateMatchUrlWithOneMatch"; + + Patient p = new Patient(); + p.addIdentifier().setSystem("urn:system").setValue(methodName); + p.setId("Patient/" + methodName); + IdDt id = ourPatientDao.create(p).getId(); + ourLog.info("Created patient, got it: {}", id); + + p = new Patient(); + p.addIdentifier().setSystem("urn:system").setValue(methodName); + p.addName().addFamily("Hello"); + p.setId("Patient/" + methodName); + ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.put(p, BundleEntryTransactionOperationEnum.CREATE); + ResourceMetadataKeyEnum.LINK_SEARCH.put(p, "Patient?identifier=urn%3Asystem%7C" + methodName); + + Observation o = new Observation(); + o.getName().setText("Some Observation"); + o.getSubject().setReference("Patient/" + methodName); + + List resp = ourSystemDao.transaction(Arrays.asList((IResource) p, o)); + assertEquals(3, resp.size()); + + p = (Patient) resp.get(1); + assertEquals(BundleEntryTransactionOperationEnum.NOOP, ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.get(p)); + assertEquals(id, p.getId()); + + o = (Observation) resp.get(2); + assertEquals(BundleEntryTransactionOperationEnum.CREATE, ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.get(o)); + assertEquals(id.toVersionless(), o.getSubject().getReference()); + + } + + @Test + public void testTransactionCreateMatchUrlWithTwoMatch() { + String methodName = "testTransactionCreateMatchUrlWithTwoMatch"; + + Patient p = new Patient(); + p.addIdentifier().setSystem("urn:system").setValue(methodName); + IdDt id = ourPatientDao.create(p).getId(); + ourLog.info("Created patient, got it: {}", id); + + p = new Patient(); + p.addIdentifier().setSystem("urn:system").setValue(methodName); + id = ourPatientDao.create(p).getId(); + ourLog.info("Created patient, got it: {}", id); + + p = new Patient(); + p.addIdentifier().setSystem("urn:system").setValue(methodName); + p.addName().addFamily("Hello"); + p.setId("Patient/" + methodName); + ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.put(p, BundleEntryTransactionOperationEnum.CREATE); + ResourceMetadataKeyEnum.LINK_SEARCH.put(p, "Patient?identifier=urn%3Asystem%7C" + methodName); + + Observation o = new Observation(); + o.getName().setText("Some Observation"); + o.getSubject().setReference("Patient/" + methodName); + + try { + ourSystemDao.transaction(Arrays.asList((IResource) p, o)); + fail(); + } catch (InvalidRequestException e) { + assertThat(e.getMessage(), containsString("with match URL \"Patient")); + } + } + + @Test + public void testTransactionCreateMatchUrlWithZeroMatch() { + String methodName = "testTransactionCreateMatchUrlWithZeroMatch"; + + Patient p = new Patient(); + p.addIdentifier().setSystem("urn:system").setValue(methodName); + p.addName().addFamily("Hello"); + p.setId("Patient/" + methodName); + ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.put(p, BundleEntryTransactionOperationEnum.CREATE); + ResourceMetadataKeyEnum.LINK_SEARCH.put(p, "Patient?identifier=urn%3Asystem%7C" + methodName); + + Observation o = new Observation(); + o.getName().setText("Some Observation"); + o.getSubject().setReference("Patient/" + methodName); + + List resp = ourSystemDao.transaction(Arrays.asList((IResource) p, o)); + assertEquals(3, resp.size()); + + p = (Patient) resp.get(1); + assertEquals(BundleEntryTransactionOperationEnum.CREATE, ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.get(p)); + assertThat(p.getId().getIdPart(), not(containsString("test"))); + + o = (Observation) resp.get(2); + assertEquals(BundleEntryTransactionOperationEnum.CREATE, ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.get(o)); + assertEquals(p.getId().toVersionless(), o.getSubject().getReference()); + + } + + @Test + public void testTransactionCreateNoMatchUrl() { + String methodName = "testTransactionCreateNoMatchUrl"; + + Patient p = new Patient(); + p.addIdentifier().setSystem("urn:system").setValue(methodName); + p.setId("Patient/" + methodName); + ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.put(p, BundleEntryTransactionOperationEnum.CREATE); + + List resp = ourSystemDao.transaction(Arrays.asList((IResource) p)); + assertEquals(2, resp.size()); + p = (Patient) resp.get(1); + + assertEquals(BundleEntryTransactionOperationEnum.CREATE, ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.get(p)); + assertThat(p.getId().getIdPart(), not(containsString("test"))); + } + + @Test + public void testTransactionDeleteMatchUrlWithOneMatch() { + String methodName = "testTransactionDeleteMatchUrlWithOneMatch"; + + Patient p = new Patient(); + p.addIdentifier().setSystem("urn:system").setValue(methodName); + IdDt id = ourPatientDao.create(p).getId(); + ourLog.info("Created patient, got it: {}", id); + + p = new Patient(); + p.addIdentifier().setSystem("urn:system").setValue(methodName); + p.addName().addFamily("Hello"); + p.setId("Patient/" + methodName); + ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.put(p, BundleEntryTransactionOperationEnum.DELETE); + ResourceMetadataKeyEnum.LINK_SEARCH.put(p, "Patient?identifier=urn%3Asystem%7C" + methodName); + + List resp = ourSystemDao.transaction(Arrays.asList((IResource) p)); + assertEquals(2, resp.size()); + + p = (Patient) resp.get(1); + assertEquals(BundleEntryTransactionOperationEnum.DELETE, ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.get(p)); + assertThat(p.getId().toVersionless().toString(), not(containsString("test"))); + assertEquals(id.toVersionless(), p.getId().toVersionless()); + assertNotEquals(id, p.getId()); + assertThat(p.getId().toString(), endsWith("/_history/2")); + + try { + ourPatientDao.read(id.toVersionless()); + fail(); + } catch (ResourceGoneException e) { + // ok + } + + try { + ourPatientDao.read(new IdDt("Patient/" + methodName)); + fail(); + } catch (ResourceNotFoundException e) { + // ok + } + + } + + @Test + public void testTransactionDeleteMatchUrlWithTwoMatch() { + String methodName = "testTransactionDeleteMatchUrlWithTwoMatch"; + + Patient p = new Patient(); + p.addIdentifier().setSystem("urn:system").setValue(methodName); + IdDt id = ourPatientDao.create(p).getId(); + ourLog.info("Created patient, got it: {}", id); + + p = new Patient(); + p.addIdentifier().setSystem("urn:system").setValue(methodName); + id = ourPatientDao.create(p).getId(); + ourLog.info("Created patient, got it: {}", id); + + p = new Patient(); + p.addIdentifier().setSystem("urn:system").setValue(methodName); + p.addName().addFamily("Hello"); + p.setId("Patient/" + methodName); + ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.put(p, BundleEntryTransactionOperationEnum.DELETE); + ResourceMetadataKeyEnum.LINK_SEARCH.put(p, "Patient?identifier=urn%3Asystem%7C" + methodName); + + Observation o = new Observation(); + o.getName().setText("Some Observation"); + o.getSubject().setReference("Patient/" + methodName); + + try { + ourSystemDao.transaction(Arrays.asList((IResource) p, o)); + fail(); + } catch (InvalidRequestException e) { + assertThat(e.getMessage(), containsString("with match URL \"Patient")); + } + } + + @Test + public void testTransactionDeleteMatchUrlWithZeroMatch() { + String methodName = "testTransactionDeleteMatchUrlWithZeroMatch"; + + Patient p = new Patient(); + p.addIdentifier().setSystem("urn:system").setValue(methodName + "ZZZ"); + p.addName().addFamily("Hello"); + IdDt id = ourPatientDao.create(p).getId(); + + p = new Patient(); + p.addName().addFamily("Hello"); + p.setId("Patient/" + methodName); + IdDt id2 = ourPatientDao.create(p).getId(); + + p = new Patient(); + p.addIdentifier().setSystem("urn:system").setValue(methodName); + p.addName().addFamily("Hello"); + p.setId("Patient/" + methodName); + ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.put(p, BundleEntryTransactionOperationEnum.DELETE); + ResourceMetadataKeyEnum.LINK_SEARCH.put(p, "Patient?identifier=urn%3Asystem%7C" + methodName); + + List resp = ourSystemDao.transaction(Arrays.asList((IResource) p)); + assertEquals(2, resp.size()); + + p = (Patient) resp.get(1); + assertEquals(BundleEntryTransactionOperationEnum.DELETE, ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.get(p)); + assertThat(p.getId().toVersionless().toString(), (containsString("test"))); + assertThat(p.getId().toString(), endsWith("/_history/2")); + assertEquals(id2.toVersionless(), p.getId().toVersionless()); + assertNotEquals(id2, p.getId()); + + try { + ourPatientDao.read(id2.toVersionless()); + fail(); + } catch (ResourceGoneException e) { + // ok + } + + Patient found = ourPatientDao.read(id); + assertEquals(id, found.getId()); + + } + + @Test + public void testTransactionDeleteNoMatchUrl() { + String methodName = "testTransactionDeleteNoMatchUrl"; + + Patient p = new Patient(); + p.addIdentifier().setSystem("urn:system").setValue(methodName); + p.setId("Patient/" + methodName); + IdDt id = ourPatientDao.create(p).getId(); + ourLog.info("Created patient, got it: {}", id); + + p = new Patient(); + p.addIdentifier().setSystem("urn:system").setValue(methodName); + p.addName().addFamily("Hello"); + p.setId("Patient/" + methodName); + ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.put(p, BundleEntryTransactionOperationEnum.DELETE); + + List resp = ourSystemDao.transaction(Arrays.asList((IResource) p)); + assertEquals(2, resp.size()); + + p = (Patient) resp.get(1); + assertEquals(BundleEntryTransactionOperationEnum.DELETE, ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.get(p)); + assertNotNull(ResourceMetadataKeyEnum.DELETED_AT.get(p).getValue()); + + try { + ourPatientDao.read(id.toVersionless()); + fail(); + } catch (ResourceGoneException e) { + // ok + } + } + + @Test(expected = InvalidRequestException.class) + public void testTransactionFailsWithDuplicateIds() { + Patient patient1 = new Patient(); + patient1.setId(new IdDt("Patient/testTransactionFailsWithDusplicateIds")); + patient1.addIdentifier().setSystem("urn:system").setValue("testPersistWithSimpleLinkP01"); + + Patient patient2 = new Patient(); + patient2.setId(new IdDt("Patient/testTransactionFailsWithDusplicateIds")); + patient2.addIdentifier().setSystem("urn:system").setValue("testPersistWithSimpleLinkP02"); + + ourSystemDao.transaction(Arrays.asList((IResource) patient1, patient2)); + } + + @Test + public void testTransactionFromBundle() throws Exception { + + InputStream bundleRes = FhirSystemDaoTest.class.getResourceAsStream("/bundle.json"); + Bundle bundle = ourFhirContext.newJsonParser().parseBundle(new InputStreamReader(bundleRes)); + List res = bundle.toListOfResources(); + + ourSystemDao.transaction(res); + + Patient p1 = (Patient) res.get(0); + String id = p1.getId().getValue(); + ourLog.info("ID: {}", id); + assertThat(id, not(containsString("5556918"))); + assertThat(id, not(equalToIgnoringCase(""))); + } + + @Test + public void testTransactionUpdateMatchUrlWithOneMatch() { + String methodName = "testTransactionUpdateMatchUrlWithOneMatch"; + + Patient p = new Patient(); + p.addIdentifier().setSystem("urn:system").setValue(methodName); + IdDt id = ourPatientDao.create(p).getId(); + ourLog.info("Created patient, got it: {}", id); + + p = new Patient(); + p.addIdentifier().setSystem("urn:system").setValue(methodName); + p.addName().addFamily("Hello"); + p.setId("Patient/" + methodName); + ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.put(p, BundleEntryTransactionOperationEnum.UPDATE); + ResourceMetadataKeyEnum.LINK_SEARCH.put(p, "Patient?identifier=urn%3Asystem%7C" + methodName); + + Observation o = new Observation(); + o.getName().setText("Some Observation"); + o.getSubject().setReference("Patient/" + methodName); + + List resp = ourSystemDao.transaction(Arrays.asList((IResource) p, o)); + assertEquals(3, resp.size()); + + p = (Patient) resp.get(1); + assertEquals(BundleEntryTransactionOperationEnum.UPDATE, ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.get(p)); + assertThat(p.getId().toVersionless().toString(), not(containsString("test"))); + assertEquals(id.toVersionless(), p.getId().toVersionless()); + assertNotEquals(id, p.getId()); + assertThat(p.getId().toString(), endsWith("/_history/2")); + + o = (Observation) resp.get(2); + assertEquals(BundleEntryTransactionOperationEnum.CREATE, ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.get(o)); + assertEquals(id.toVersionless(), o.getSubject().getReference()); + + } + + @Test + public void testTransactionUpdateMatchUrlWithTwoMatch() { + String methodName = "testTransactionUpdateMatchUrlWithTwoMatch"; + + Patient p = new Patient(); + p.addIdentifier().setSystem("urn:system").setValue(methodName); + IdDt id = ourPatientDao.create(p).getId(); + ourLog.info("Created patient, got it: {}", id); + + p = new Patient(); + p.addIdentifier().setSystem("urn:system").setValue(methodName); + id = ourPatientDao.create(p).getId(); + ourLog.info("Created patient, got it: {}", id); + + p = new Patient(); + p.addIdentifier().setSystem("urn:system").setValue(methodName); + p.addName().addFamily("Hello"); + p.setId("Patient/" + methodName); + ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.put(p, BundleEntryTransactionOperationEnum.UPDATE); + ResourceMetadataKeyEnum.LINK_SEARCH.put(p, "Patient?identifier=urn%3Asystem%7C" + methodName); + + Observation o = new Observation(); + o.getName().setText("Some Observation"); + o.getSubject().setReference("Patient/" + methodName); + + try { + ourSystemDao.transaction(Arrays.asList((IResource) p, o)); + fail(); + } catch (InvalidRequestException e) { + assertThat(e.getMessage(), containsString("with match URL \"Patient")); + } + } + + @Test + public void testTransactionUpdateMatchUrlWithZeroMatch() { + String methodName = "testTransactionUpdateMatchUrlWithZeroMatch"; + + Patient p = new Patient(); + p.addName().addFamily("Hello"); + IdDt id = ourPatientDao.create(p).getId(); + + p = new Patient(); + p.addIdentifier().setSystem("urn:system").setValue(methodName); + p.addName().addFamily("Hello"); + p.setId(id); + ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.put(p, BundleEntryTransactionOperationEnum.UPDATE); + ResourceMetadataKeyEnum.LINK_SEARCH.put(p, "Patient?identifier=urn%3Asystem%7C" + methodName); + + Observation o = new Observation(); + o.getName().setText("Some Observation"); + o.getSubject().setReference(id); + + List resp = ourSystemDao.transaction(Arrays.asList((IResource) p, o)); + assertEquals(3, resp.size()); + + p = (Patient) resp.get(1); + assertEquals(BundleEntryTransactionOperationEnum.UPDATE, ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.get(p)); + assertEquals(id.toVersionless(), p.getId().toVersionless()); + assertNotEquals(id, p.getId()); + assertThat(p.getId().toString(), endsWith("/_history/2")); + + o = (Observation) resp.get(2); + assertEquals(BundleEntryTransactionOperationEnum.CREATE, ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.get(o)); + assertEquals(p.getId().toVersionless(), o.getSubject().getReference()); + + } + + @Test + public void testTransactionUpdateMatchUrlWithZeroMatchAndNotPreExisting() { + String methodName = "testTransactionUpdateMatchUrlWithZeroMatchAndNotPreExisting"; + + Patient p = new Patient(); + p.addIdentifier().setSystem("urn:system").setValue(methodName); + p.addName().addFamily("Hello"); + p.setId("Patient/" + methodName); + ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.put(p, BundleEntryTransactionOperationEnum.UPDATE); + ResourceMetadataKeyEnum.LINK_SEARCH.put(p, "Patient?identifier=urn%3Asystem%7C" + methodName); + + Observation o = new Observation(); + o.getName().setText("Some Observation"); + o.getSubject().setReference("Patient/" + methodName); + + List resp = ourSystemDao.transaction(Arrays.asList((IResource) p, o)); + assertEquals(3, resp.size()); + + p = (Patient) resp.get(1); + assertEquals(BundleEntryTransactionOperationEnum.CREATE, ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.get(p)); + assertThat(p.getId().toVersionless().toString(), containsString("test")); + assertThat(p.getId().toString(), endsWith("/_history/1")); + + o = (Observation) resp.get(2); + assertEquals(BundleEntryTransactionOperationEnum.CREATE, ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.get(o)); + assertEquals(p.getId().toVersionless(), o.getSubject().getReference()); + + } + + @Test + public void testTransactionUpdateNoMatchUrl() { + String methodName = "testTransactionUpdateNoMatchUrl"; + + Patient p = new Patient(); + p.addIdentifier().setSystem("urn:system").setValue(methodName); + p.setId("Patient/" + methodName); + IdDt id = ourPatientDao.create(p).getId(); + ourLog.info("Created patient, got it: {}", id); + + p = new Patient(); + p.addIdentifier().setSystem("urn:system").setValue(methodName); + p.addName().addFamily("Hello"); + p.setId("Patient/" + methodName); + ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.put(p, BundleEntryTransactionOperationEnum.UPDATE); + + Observation o = new Observation(); + o.getName().setText("Some Observation"); + o.getSubject().setReference("Patient/" + methodName); + + List resp = ourSystemDao.transaction(Arrays.asList((IResource) p, o)); + assertEquals(3, resp.size()); + + p = (Patient) resp.get(1); + assertEquals(BundleEntryTransactionOperationEnum.UPDATE, ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.get(p)); + assertThat(p.getId().toVersionless().toString(), containsString("test")); + assertEquals(id.toVersionless(), p.getId().toVersionless()); + assertNotEquals(id, p.getId()); + assertThat(p.getId().toString(), endsWith("/_history/2")); + + o = (Observation) resp.get(2); + assertEquals(BundleEntryTransactionOperationEnum.CREATE, ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.get(o)); + assertEquals(id.toVersionless(), o.getSubject().getReference()); + + } + + @Test + public void testTransactionUpdateNoOperationSpecified() throws Exception { List res = new ArrayList(); Patient p1 = new Patient(); @@ -196,8 +746,10 @@ public class FhirSystemDaoTest { ourSystemDao.transaction(res); assertFalse(p1.getId().isEmpty()); - assertNotEquals("testTransactionWithUpdateXXX01", p1.getId().getVersionIdPart()); assertFalse(p2.getId().isEmpty()); + assertEquals("testTransactionWithUpdateXXX01", p1.getId().getIdPart()); + assertEquals("testTransactionWithUpdateXXX02", p2.getId().getIdPart()); + assertNotEquals("testTransactionWithUpdateXXX01", p1.getId().getVersionIdPart()); assertNotEquals("testTransactionWithUpdateXXX02", p2.getId().getVersionIdPart()); assertEquals(p1.getId().toUnqualified().toVersionless(), p2.getSubject().getReference()); @@ -206,80 +758,32 @@ public class FhirSystemDaoTest { IdDt p2id = p2.getId().toUnqualified().toVersionless(); IdDt p2idWithVer = p2.getId().toUnqualified(); - p1.addName().addFamily("Name1"); - p1.setId(p1.getId().toUnqualified().toVersionless()); - - p2.addReferenceRange().setHigh(new QuantityDt(123L)); - p2.setId(p2.getId().toUnqualified().toVersionless()); - - ourSystemDao.transaction(res); - - assertEquals(p1id, p1.getId().toUnqualified().toVersionless()); - assertEquals(p2id, p2.getId().toUnqualified().toVersionless()); - assertNotEquals(p1idWithVer, p1.getId().toUnqualified()); - assertNotEquals(p2idWithVer, p2.getId().toUnqualified()); - - } - - @Test - public void testTransactionWithDelete() throws Exception { - /* - * Create 3 - */ - - List res; - res = new ArrayList(); - - Patient p1 = new Patient(); - p1.addIdentifier().setSystem("urn:system").setValue("testTransactionWithDelete"); - res.add(p1); - - Patient p2 = new Patient(); - p2.addIdentifier().setSystem("urn:system").setValue("testTransactionWithDelete"); - res.add(p2); - - Patient p3 = new Patient(); - p3.addIdentifier().setSystem("urn:system").setValue("testTransactionWithDelete"); - res.add(p3); - - ourSystemDao.transaction(res); - - /* - * Verify - */ - - IBundleProvider results = ourPatientDao.search(Patient.SP_IDENTIFIER, new TokenParam("urn:system", "testTransactionWithDelete")); - assertEquals(3, results.size()); - - /* - * Now delete 2 + * Make some changes */ res = new ArrayList(); - List existing = results.getResources(0, 3); p1 = new Patient(); - p1.setId(existing.get(0).getId()); - ResourceMetadataKeyEnum.DELETED_AT.put(p1, InstantDt.withCurrentTime()); + p1.getId().setValue("testTransactionWithUpdateXXX01"); + p1.addIdentifier().setSystem("system").setValue("testTransactionWithUpdate01"); + p1.addName().addFamily("Name1"); res.add(p1); - - p2 = new Patient(); - p2.setId(existing.get(1).getId()); - ResourceMetadataKeyEnum.DELETED_AT.put(p2, InstantDt.withCurrentTime()); + + p2 = new Observation(); + p2.getId().setValue("testTransactionWithUpdateXXX02"); + p2.getIdentifier().setSystem("system").setValue("testTransactionWithUpdate02"); + p2.setSubject(new ResourceReferenceDt("Patient/testTransactionWithUpdateXXX01")); + p2.addReferenceRange().setHigh(new QuantityDt(123L)); res.add(p2); - ourSystemDao.transaction(res); - - /* - * Verify - */ - - IBundleProvider results2 = ourPatientDao.search(Patient.SP_IDENTIFIER, new TokenParam("urn:system", "testTransactionWithDelete")); - assertEquals(1, results2.size()); - List existing2 = results2.getResources(0, 1); - assertEquals(existing2.get(0).getId(), existing.get(2).getId()); - + List results = ourSystemDao.transaction(res); + + assertEquals(p1id, results.get(1).getId().toUnqualified().toVersionless()); + assertEquals(p2id, results.get(2).getId().toUnqualified().toVersionless()); + assertNotEquals(p1idWithVer, results.get(1).getId().toUnqualified()); + assertNotEquals(p2idWithVer, results.get(2).getId().toUnqualified()); + } /** @@ -311,143 +815,70 @@ public class FhirSystemDaoTest { assertTrue(p1.getId().getValue(), p1.getId().getIdPart().matches("^[0-9]+$")); assertTrue(o1.getId().getValue(), o1.getId().getIdPart().matches("^[0-9]+$")); assertTrue(o2.getId().getValue(), o2.getId().getIdPart().matches("^[0-9]+$")); - + assertThat(o1.getSubject().getReference().getValue(), endsWith("Patient/" + p1.getId().getIdPart())); assertThat(o2.getSubject().getReference().getValue(), endsWith("Patient/" + p1.getId().getIdPart())); - - } - - @Test - public void testTransactionFromBundle() throws Exception { - InputStream bundleRes = FhirSystemDaoTest.class.getResourceAsStream("/bundle.json"); - Bundle bundle = ourFhirContext.newJsonParser().parseBundle(new InputStreamReader(bundleRes)); - List res = bundle.toListOfResources(); + } + + @Test + public void testTransactionWithDelete() throws Exception { + + /* + * Create 3 + */ + + List res; + res = new ArrayList(); + + Patient p1 = new Patient(); + p1.addIdentifier().setSystem("urn:system").setValue("testTransactionWithDelete"); + res.add(p1); + + Patient p2 = new Patient(); + p2.addIdentifier().setSystem("urn:system").setValue("testTransactionWithDelete"); + res.add(p2); + + Patient p3 = new Patient(); + p3.addIdentifier().setSystem("urn:system").setValue("testTransactionWithDelete"); + res.add(p3); ourSystemDao.transaction(res); - Patient p1 = (Patient) res.get(0); - String id = p1.getId().getValue(); - ourLog.info("ID: {}", id); - assertThat(id, not(containsString("5556918"))); - assertThat(id, not(equalToIgnoringCase(""))); - } + /* + * Verify + */ - @Test - public void testPersistWithSimpleLink() { - Patient patient = new Patient(); - patient.setId(new IdDt("Patient/testPersistWithSimpleLinkP01")); - patient.addIdentifier().setSystem("urn:system").setValue( "testPersistWithSimpleLinkP01"); - patient.addName().addFamily("Tester").addGiven("Joe"); + IBundleProvider results = ourPatientDao.search(Patient.SP_IDENTIFIER, new TokenParam("urn:system", "testTransactionWithDelete")); + assertEquals(3, results.size()); - Observation obs = new Observation(); - obs.getName().addCoding().setSystem("urn:system").setCode("testPersistWithSimpleLinkO01"); - obs.setSubject(new ResourceReferenceDt("Patient/testPersistWithSimpleLinkP01")); + /* + * Now delete 2 + */ - ourSystemDao.transaction(Arrays.asList((IResource) patient, obs)); + res = new ArrayList(); + List existing = results.getResources(0, 3); - String patientId = (patient.getId().getIdPart()); - String patientVersion = (patient.getId().getVersionIdPart()); - String obsId = (obs.getId().getIdPart()); - String obsVersion = (obs.getId().getVersionIdPart()); + p1 = new Patient(); + p1.setId(existing.get(0).getId()); + ResourceMetadataKeyEnum.DELETED_AT.put(p1, InstantDt.withCurrentTime()); + res.add(p1); -// assertThat(patientId, greaterThan(0L)); -// assertEquals(patientVersion, 1L); -// assertThat(obsId, greaterThan(patientId)); -// assertEquals(obsVersion, 1L); + p2 = new Patient(); + p2.setId(existing.get(1).getId()); + ResourceMetadataKeyEnum.DELETED_AT.put(p2, InstantDt.withCurrentTime()); + res.add(p2); - // Try to search + ourSystemDao.transaction(res); - IBundleProvider obsResults = ourObservationDao.search(Observation.SP_NAME, new IdentifierDt("urn:system", "testPersistWithSimpleLinkO01")); - assertEquals(1, obsResults.size()); + /* + * Verify + */ - IBundleProvider patResults = ourPatientDao.search(Patient.SP_IDENTIFIER, new IdentifierDt("urn:system", "testPersistWithSimpleLinkP01")); - assertEquals(1, obsResults.size()); - - IdDt foundPatientId = patResults.getResources(0, 1).get(0).getId(); - ResourceReferenceDt subject = obs.getSubject(); - assertEquals(foundPatientId.getIdPart(), subject.getReference().getIdPart()); - - // Update - - patient = (Patient) patResults.getResources(0,1).get(0); - obs = (Observation) obsResults.getResources(0, 1).get(0); - patient.addIdentifier().setSystem("urn:system").setValue( "testPersistWithSimpleLinkP02"); - obs.getName().addCoding().setSystem("urn:system").setCode("testPersistWithSimpleLinkO02"); - - ourSystemDao.transaction(Arrays.asList((IResource) patient, obs)); - - String patientId2 = (patient.getId().getIdPart()); - String patientVersion2 = (patient.getId().getVersionIdPart()); - String obsId2 = (obs.getId().getIdPart()); - String obsVersion2 = (obs.getId().getVersionIdPart()); - - assertEquals(patientId, patientId2); - assertEquals(patientVersion2, "2"); - assertEquals(obsId, obsId2); - assertEquals(obsVersion2, "2"); - - } - - @Test(expected=InvalidRequestException.class) - public void testTransactionFailsWithDuplicateIds() { - Patient patient1 = new Patient(); - patient1.setId(new IdDt("Patient/testTransactionFailsWithDusplicateIds")); - patient1.addIdentifier().setSystem("urn:system").setValue( "testPersistWithSimpleLinkP01"); - - Patient patient2 = new Patient(); - patient2.setId(new IdDt("Patient/testTransactionFailsWithDusplicateIds")); - patient2.addIdentifier().setSystem("urn:system").setValue( "testPersistWithSimpleLinkP02"); - - ourSystemDao.transaction(Arrays.asList((IResource) patient1, patient2)); - } - - @Test - public void testGetResourceCounts() { - Observation obs = new Observation(); - obs.getName().addCoding().setSystem("urn:system").setCode("testGetResourceCountsO01"); - ourObservationDao.create(obs); - - Map oldCounts = ourSystemDao.getResourceCounts(); - - Patient patient = new Patient(); - patient.addIdentifier().setSystem("urn:system").setValue( "testGetResourceCountsP01"); - patient.addName().addFamily("Tester").addGiven("Joe"); - ourPatientDao.create(patient); - - Map newCounts = ourSystemDao.getResourceCounts(); - - if (oldCounts.containsKey("Patient")) { - assertEquals(oldCounts.get("Patient") + 1, (long) newCounts.get("Patient")); - } else { - assertEquals(1L, (long) newCounts.get("Patient")); - } - - assertEquals((long) oldCounts.get("Observation"), (long) newCounts.get("Observation")); - - } - - @Test - public void testPersistWithUnknownId() { - Observation obs = new Observation(); - obs.getName().addCoding().setSystem("urn:system").setCode("testPersistWithSimpleLinkO01"); - obs.setSubject(new ResourceReferenceDt("Patient/999998888888")); - - try { - ourSystemDao.transaction(Arrays.asList((IResource) obs)); - } catch (InvalidRequestException e) { - assertThat(e.getMessage(), containsString("Resource Patient/999998888888 not found, specified in path: Observation.subject")); - } - - obs = new Observation(); - obs.getName().addCoding().setSystem("urn:system").setCode("testPersistWithSimpleLinkO01"); - obs.setSubject(new ResourceReferenceDt("Patient/1.2.3.4")); - - try { - ourSystemDao.transaction(Arrays.asList((IResource) obs)); - } catch (InvalidRequestException e) { - assertThat(e.getMessage(), containsString("Resource Patient/1.2.3.4 not found, specified in path: Observation.subject")); - } + IBundleProvider results2 = ourPatientDao.search(Patient.SP_IDENTIFIER, new TokenParam("urn:system", "testTransactionWithDelete")); + assertEquals(1, results2.size()); + List existing2 = results2.getResources(0, 1); + assertEquals(existing2.get(0).getId(), existing.get(2).getId()); } @@ -459,14 +890,10 @@ public class FhirSystemDaoTest { @SuppressWarnings("unchecked") @BeforeClass public static void beforeClass() { - ourTestStarted = new Date(); ourCtx = new ClassPathXmlApplicationContext("fhir-jpabase-spring-test-config.xml"); ourFhirContext = ourCtx.getBean(FhirContext.class); ourPatientDao = ourCtx.getBean("myPatientDao", IFhirResourceDao.class); ourObservationDao = ourCtx.getBean("myObservationDao", IFhirResourceDao.class); - ourDiagnosticReportDao = ourCtx.getBean("myDiagnosticReportDao", IFhirResourceDao.class); - ourDeviceDao = ourCtx.getBean("myDeviceDao", IFhirResourceDao.class); - ourOrganizationDao = ourCtx.getBean("myOrganizationDao", IFhirResourceDao.class); ourLocationDao = ourCtx.getBean("myLocationDao", IFhirResourceDao.class); ourSystemDao = ourCtx.getBean("mySystemDao", IFhirSystemDao.class); } 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 a3fae87d34c..92963319c02 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 @@ -20,7 +20,6 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.jpa.dao.DaoConfig; import ca.uhn.fhir.jpa.dao.IFhirResourceDao; import ca.uhn.fhir.jpa.dao.IFhirSystemDao; -import ca.uhn.fhir.jpa.provider.JpaSystemProvider; import ca.uhn.fhir.jpa.testutil.RandomServerPortProvider; import ca.uhn.fhir.model.api.Bundle; import ca.uhn.fhir.model.api.IResource; @@ -39,7 +38,6 @@ import ca.uhn.fhir.model.dstu.valueset.EncounterClassEnum; import ca.uhn.fhir.model.dstu.valueset.EncounterStateEnum; import ca.uhn.fhir.model.dstu.valueset.NarrativeStatusEnum; import ca.uhn.fhir.model.primitive.IdDt; -import ca.uhn.fhir.model.valueset.BundleEntryStatusEnum; import ca.uhn.fhir.narrative.DefaultThymeleafNarrativeGenerator; import ca.uhn.fhir.rest.api.MethodOutcome; import ca.uhn.fhir.rest.client.IGenericClient; @@ -115,11 +113,11 @@ public class ResourceProviderDstu1Test { assertEquals(2, found.size()); assertEquals(Patient.class, found.getEntries().get(0).getResource().getClass()); - assertEquals(null, found.getEntries().get(0).getStatus().getValueAsEnum()); - assertEquals(null, found.getEntries().get(0).getResource().getResourceMetadata().get(ResourceMetadataKeyEnum.ENTRY_STATUS)); + assertEquals(null, found.getEntries().get(0).getSearchMode().getValueAsEnum()); + assertEquals(null, found.getEntries().get(0).getResource().getResourceMetadata().get(ResourceMetadataKeyEnum.ENTRY_SEARCH_MODE)); assertEquals(Organization.class, found.getEntries().get(1).getResource().getClass()); - assertEquals(null, found.getEntries().get(1).getStatus().getValueAsEnum()); - assertEquals(null, found.getEntries().get(1).getResource().getResourceMetadata().get(ResourceMetadataKeyEnum.ENTRY_STATUS)); + assertEquals(null, found.getEntries().get(1).getSearchMode().getValueAsEnum()); + assertEquals(null, found.getEntries().get(1).getResource().getResourceMetadata().get(ResourceMetadataKeyEnum.ENTRY_SEARCH_MODE)); } 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 4c4acb974f4..9f5a409bd38 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 @@ -20,13 +20,13 @@ import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.jpa.dao.DaoConfig; import ca.uhn.fhir.jpa.dao.IFhirResourceDao; import ca.uhn.fhir.jpa.dao.IFhirSystemDao; -import ca.uhn.fhir.jpa.provider.JpaSystemProvider; import ca.uhn.fhir.jpa.testutil.RandomServerPortProvider; import ca.uhn.fhir.model.api.Bundle; import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum; -import ca.uhn.fhir.model.dstu2.composite.PeriodDt; import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt; +import ca.uhn.fhir.model.dstu.valueset.NarrativeStatusEnum; +import ca.uhn.fhir.model.dstu2.composite.PeriodDt; import ca.uhn.fhir.model.dstu2.resource.DiagnosticOrder; import ca.uhn.fhir.model.dstu2.resource.DocumentManifest; import ca.uhn.fhir.model.dstu2.resource.DocumentReference; @@ -37,9 +37,8 @@ import ca.uhn.fhir.model.dstu2.resource.Organization; import ca.uhn.fhir.model.dstu2.resource.Patient; import ca.uhn.fhir.model.dstu2.valueset.EncounterClassEnum; import ca.uhn.fhir.model.dstu2.valueset.EncounterStateEnum; -import ca.uhn.fhir.model.dstu.valueset.NarrativeStatusEnum; import ca.uhn.fhir.model.primitive.IdDt; -import ca.uhn.fhir.model.valueset.BundleEntryStatusEnum; +import ca.uhn.fhir.model.valueset.BundleEntrySearchModeEnum; import ca.uhn.fhir.model.valueset.BundleTypeEnum; import ca.uhn.fhir.narrative.DefaultThymeleafNarrativeGenerator; import ca.uhn.fhir.rest.api.MethodOutcome; @@ -143,11 +142,11 @@ public class ResourceProviderDstu2Test { assertEquals(2, found.size()); assertEquals(Patient.class, found.getEntries().get(0).getResource().getClass()); - assertEquals(BundleEntryStatusEnum.MATCH, found.getEntries().get(0).getStatus().getValueAsEnum()); - assertEquals(BundleEntryStatusEnum.MATCH, found.getEntries().get(0).getResource().getResourceMetadata().get(ResourceMetadataKeyEnum.ENTRY_STATUS)); + assertEquals(BundleEntrySearchModeEnum.MATCH, found.getEntries().get(0).getSearchMode().getValueAsEnum()); + assertEquals(BundleEntrySearchModeEnum.MATCH, found.getEntries().get(0).getResource().getResourceMetadata().get(ResourceMetadataKeyEnum.ENTRY_SEARCH_MODE)); assertEquals(Organization.class, found.getEntries().get(1).getResource().getClass()); - assertEquals(BundleEntryStatusEnum.INCLUDE, found.getEntries().get(1).getStatus().getValueAsEnum()); - assertEquals(BundleEntryStatusEnum.INCLUDE, found.getEntries().get(1).getResource().getResourceMetadata().get(ResourceMetadataKeyEnum.ENTRY_STATUS)); + assertEquals(BundleEntrySearchModeEnum.INCLUDE, found.getEntries().get(1).getSearchMode().getValueAsEnum()); + assertEquals(BundleEntrySearchModeEnum.INCLUDE, found.getEntries().get(1).getResource().getResourceMetadata().get(ResourceMetadataKeyEnum.ENTRY_SEARCH_MODE)); } @@ -398,7 +397,7 @@ public class ResourceProviderDstu2Test { Bundle actual = ourClient.search().forResource(Patient.class).where(Patient.IDENTIFIER.exactly().systemAndCode("urn:system", "testSearchByIdentifier01")).encodedJson().prettyPrint().execute(); assertEquals(1, actual.size()); assertEquals(p1Id.getIdPart(), actual.getEntries().get(0).getResource().getId().getIdPart()); - assertEquals(BundleEntryStatusEnum.MATCH, actual.getEntries().get(0).getStatus().getValueAsEnum()); + assertEquals(BundleEntrySearchModeEnum.MATCH, actual.getEntries().get(0).getSearchMode().getValueAsEnum()); } @Test diff --git a/hapi-fhir-jpaserver-example/src/main/java/ca/uhn/fhir/jpa/demo/JpaServerDemo.java b/hapi-fhir-jpaserver-example/src/main/java/ca/uhn/fhir/jpa/demo/JpaServerDemo.java index d071b569fd2..92526fc9a30 100644 --- a/hapi-fhir-jpaserver-example/src/main/java/ca/uhn/fhir/jpa/demo/JpaServerDemo.java +++ b/hapi-fhir-jpaserver-example/src/main/java/ca/uhn/fhir/jpa/demo/JpaServerDemo.java @@ -27,7 +27,10 @@ public class JpaServerDemo extends RestfulServer { protected void initialize() throws ServletException { super.initialize(); - // We want to support FHIR DSTU2 format + /* + * We want to support FHIR DSTU2 format. This means that the server + * will use the DSTU2 bundle format and other DSTU2 encoding changes. + */ setFhirContext(FhirContext.forDstu2()); // Get the spring context from the web container (it's declared in web.xml) @@ -38,14 +41,14 @@ public class JpaServerDemo extends RestfulServer { * file which is automatically generated as a part of hapi-fhir-jpaserver-base and * contains bean definitions for a resource provider for each resource type */ - List beans = myAppCtx.getBean("myResourceProvidersDev", List.class); + List beans = myAppCtx.getBean("myResourceProvidersDstu2", List.class); setResourceProviders(beans); /* * The system provider implements non-resource-type methods, such as * transaction, and global history. */ - JpaSystemProvider systemProvider = myAppCtx.getBean("mySystemProviderDev", JpaSystemProvider.class); + JpaSystemProvider systemProvider = myAppCtx.getBean("mySystemProviderDstu2", JpaSystemProvider.class); setPlainProviders(systemProvider); /* @@ -59,13 +62,17 @@ public class JpaServerDemo extends RestfulServer { FhirContext ctx = getFhirContext(); ctx.setNarrativeGenerator(new DefaultThymeleafNarrativeGenerator()); - /* - * This tells the server to use "incorrect" MIME types if it detects - * that the request is coming from a browser in the hopes that the + * This tells the server to use "browser friendly" MIME types if it + * detects that the request is coming from a browser, in the hopes that the * browser won't just treat the content as a binary payload and try * to download it (which is what generally happens if you load a - * FHIR URL in a browser) + * FHIR URL in a browser). + * + * This means that the server isn't technically complying with the + * FHIR specification for direct browser requests, but this mode + * is very helpful for testing and troubleshooting since it means + * you can look at FHIR URLs directly in a browser. */ setUseBrowserFriendlyContentTypes(true); @@ -78,8 +85,8 @@ public class JpaServerDemo extends RestfulServer { * Do some fancy logging to create a nice access log that has details about each incoming request. */ LoggingInterceptor loggingInterceptor = new LoggingInterceptor(); - loggingInterceptor.setLoggerName("fhirtest.access"); - loggingInterceptor.setMessageFormat("Path[${servletPath}] Source[${requestHeader.x-forwarded-for}] Operation[${operationType} ${idOrResourceName}] UA[${requestHeader.user-agent}] Params[${requestParameters}]"); + loggingInterceptor.setLoggerName("fhir.access"); + loggingInterceptor.setMessageFormat("Path[${servletPath}] Operation[${operationType} ${idOrResourceName}] UA[${requestHeader.user-agent}] Params[${requestParameters}]"); this.registerInterceptor(loggingInterceptor); } diff --git a/hapi-fhir-structures-dstu2/.classpath b/hapi-fhir-structures-dstu2/.classpath index 3219bd332a7..4beb9441d17 100644 --- a/hapi-fhir-structures-dstu2/.classpath +++ b/hapi-fhir-structures-dstu2/.classpath @@ -6,8 +6,8 @@ - - + + @@ -24,16 +24,16 @@ - - - - - + + + + + diff --git a/hapi-fhir-structures-dstu2/.project b/hapi-fhir-structures-dstu2/.project index 2c4df5f1910..e859f7be8bb 100644 --- a/hapi-fhir-structures-dstu2/.project +++ b/hapi-fhir-structures-dstu2/.project @@ -16,12 +16,12 @@ - org.eclipse.m2e.core.maven2Builder + org.eclipse.wst.validation.validationbuilder - org.eclipse.wst.validation.validationbuilder + org.eclipse.m2e.core.maven2Builder diff --git a/hapi-fhir-structures-dstu2/src/main/resources/ca/uhn/fhir/model/dstu2/schema/fhir-all.xsd b/hapi-fhir-structures-dstu2/src/main/resources/ca/uhn/fhir/model/dstu2/schema/fhir-all.xsd index 41778ef5823..e2e022121bd 100644 --- a/hapi-fhir-structures-dstu2/src/main/resources/ca/uhn/fhir/model/dstu2/schema/fhir-all.xsd +++ b/hapi-fhir-structures-dstu2/src/main/resources/ca/uhn/fhir/model/dstu2/schema/fhir-all.xsd @@ -26,7 +26,7 @@ Copyright (c) 2011+, HL7, Inc ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - Generated on Thu, Dec 18, 2014 17:00+0000 for FHIR v0.4.0 + Generated on Sat, Feb 7, 2015 18:18+0000 for FHIR v0.4.0 --> @@ -35,6 +35,7 @@ Copyright (c) 2011+, HL7, Inc + diff --git a/hapi-fhir-structures-dstu2/src/main/resources/ca/uhn/fhir/model/dstu2/schema/fhir-atom-single.xsd b/hapi-fhir-structures-dstu2/src/main/resources/ca/uhn/fhir/model/dstu2/schema/fhir-atom-single.xsd index 04f961016cb..8cd3f7b7f9d 100644 --- a/hapi-fhir-structures-dstu2/src/main/resources/ca/uhn/fhir/model/dstu2/schema/fhir-atom-single.xsd +++ b/hapi-fhir-structures-dstu2/src/main/resources/ca/uhn/fhir/model/dstu2/schema/fhir-atom-single.xsd @@ -26,7 +26,7 @@ Copyright (c) 2011+, HL7, Inc ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - Generated on Thu, Dec 18, 2014 17:00+0000 for FHIR v0.4.0 + Generated on Thu, Jan 8, 2015 07:22-0500 for FHIR v0.4.0 --> diff --git a/hapi-fhir-structures-dstu2/src/main/resources/ca/uhn/fhir/model/dstu2/schema/fhir-atom.sch b/hapi-fhir-structures-dstu2/src/main/resources/ca/uhn/fhir/model/dstu2/schema/fhir-atom.sch new file mode 100644 index 00000000000..5ce1f4c91a6 --- /dev/null +++ b/hapi-fhir-structures-dstu2/src/main/resources/ca/uhn/fhir/model/dstu2/schema/fhir-atom.sch @@ -0,0 +1,8845 @@ + + + + + + + Condition + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: Stage SHALL have summary or assessment + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: evidence SHALL have code or details + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: location SHALL have code or details + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-4: Relationship SHALL have either a code or a target + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-5: Relationship SHALL have either a code or a target + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + Supply + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + DeviceComponent + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + Communication + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: It the Attachment has data, it SHALL have a contentType + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + Group + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: Can only have members if group is "actual" + Inv-4: Can't have more members associated with the group than the value specified for "quantity" + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: Quantity values cannot have a comparator when used in a Range + Inv-2: If present, low SHALL have a lower value than high + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: Member resource types SHALL agree with group type + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + ValueSet + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-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 + Inv-7: A defined code system (if present) SHALL have a different identifier to the value set itself + Inv-5: Value set SHALL contain either a define, a compose, or an expansion element + + + Inv-2: A system is required if a value is provided. + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-3: Within a code system definition, all the codes SHALL be unique + Inv-8: Codes must be unique + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: A value set composition SHALL have an include or an import + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-10: Must have a system if a code is present + Inv-6: SHALL have a code or a display + Inv-9: Must have a code if not abstract + + + + OralHealthClaim + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + Coverage + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + Appointment + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + Slot + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + Contraindication + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + EpisodeOfCare + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + + Composition + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: A section must have either subsections or content + Inv-1: A section can only have a code if it has no content + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + Conformance + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: A Conformance statement SHALL have at least one of description, software, or implementation + Inv-1: A Conformance statement SHALL have at least one of rest, messaging or document + Inv-7: The set of documents must be unique by the combination of profile & mode + Inv-5: The set of end points listed for messaging must be unique + Inv-4: If there is more than one messaging element, endpoint must be specified for each one + Inv-8: There can only be one REST declaration per mode + + + Inv-2: A system is required if a value is provided. + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-10: A given query can only be described once per RESTful mode + Inv-9: A given resource can only be described once per RESTful mode + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-11: Operation codes must be unique in the context of a resource + Inv-12: Search parameter names must be unique in the context of a resource + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: Messaging end point is required (and is only permitted) when statement is for an implementation + Inv-6: The set of events per messaging endpoint must be unique by the combination of code & mode + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + NamingSystem + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: Can only have replacedBy if namingsystem is retired + Inv-2: Can't have more than one preferred identifier for a type + Inv-1: Root systems cannot have uuid or sid identifiers + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-2: A system is required if a value is provided. + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + Profile + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: Parameter names must be unique within structure + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: A system is required if a value is provided. + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Must have at a name or a uri (or both) + + + Inv-1: Element paths must be unique - or not (LM) + Inv-4: If a structure is a snapshot, then each element definition must have a formal definition, cardinalities, and a isModifier flag + + + Inv-2: Min <= Max + Inv-7: Pattern may only be specified if there is one type + Inv-6: Fixed value may only be specified if there is one type + Inv-5: Either a namereference or a fixed value (but not both) is permitted + Inv-15: Constraint names must be unique. + Inv-8: Pattern and value are mutually exclusive + Inv-16: default value and meaningWhenMissing are mutually exclusive + Inv-13: Types must be unique by the combination of code and profile + Inv-14: Constraints must be unique by key + Inv-11: Binding can only be present for coded elements + + + Inv-1: If there is no discriminators, there must be a description + + + Inv-3: Max SHALL be a number or "*" + + + Inv-4: Aggregation may only be specified if one of the allowed types for the element is a resource + + + Inv-10: provide either a reference or a description (or both) + Inv-9: Example value sets are always extensible + + + Inv-12: uri SHALL start with http:// or https:// + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + HealthcareService + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: A system is required if a value is provided. + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + OrderResponse + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + StatusResponse + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + ConceptMap + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: A system is required if a value is provided. + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If the map is narrower or inexact, there SHALL be some comments + + + + PharmacyClaim + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + Reversal + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + Practitioner + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-2: A system is required if a value is provided. + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: It the Attachment has data, it SHALL have a contentType + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + CarePlan + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: Only provide a detail reference, or a simple detail summary + Inv-2: Quantity can only be specified if activity category is supply + Inv-1: DailyDose can only be specified if activity category is drug or food + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: There can only be a repeat element if there is none or one event + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-3: At most, only one of count or end can be present + Inv-2: Either frequency or when SHALL be present, but not both + + + Inv-4: duration SHALL be a positive value + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + + ClinicalAssessment + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + Substance + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: numerator and denominator SHALL both be present, or both be absent + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + DeviceUseRequest + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: There can only be a repeat element if there is none or one event + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-3: At most, only one of count or end can be present + Inv-2: Either frequency or when SHALL be present, but not both + + + Inv-4: duration SHALL be a positive value + + + Inv-1: If present, start SHALL have a lower value than end + + + + Schedule + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + + EligibilityRequest + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + QuestionnaireAnswers + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: Groups may either contain questions or groups but not both + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: It the Attachment has data, it SHALL have a contentType + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + PaymentReconciliation + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + ProfessionalClaim + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + ImagingObjectSelection + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL at least provide retrieve URL or retrieve AE Title + + + + OperationDefinition + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: A system is required if a value is provided. + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: Either a type must be provided, or parts + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + ClaimResponse + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + CommunicationRequest + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: It the Attachment has data, it SHALL have a contentType + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + RiskAssessment + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Must be <= 100 + + + Inv-1: low and high must be percentages, if present + + + Inv-3: Quantity values cannot have a comparator when used in a Range + Inv-2: If present, low SHALL have a lower value than high + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-3: Quantity values cannot have a comparator when used in a Range + Inv-2: If present, low SHALL have a lower value than high + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + + Observation + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: It the Attachment has data, it SHALL have a contentType + + + Inv-1: numerator and denominator SHALL both be present, or both be absent + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-4: Shall only be present if Observation.value[x] is not present + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: Must have at least a low or a high (and no comparators) or text + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: Quantity values cannot have a comparator when used in a Range + Inv-2: If present, low SHALL have a lower value than high + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + AllergyIntolerance + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + ExplanationOfBenefit + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + SupportingDocumentation + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: It the Attachment has data, it SHALL have a contentType + + + + RelatedPerson + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-2: A system is required if a value is provided. + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: It the Attachment has data, it SHALL have a contentType + + + Inv-1: If present, start SHALL have a lower value than end + + + + InstitutionalClaim + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + Alert + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + EligibilityResponse + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + Person + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-2: A system is required if a value is provided. + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: It the Attachment has data, it SHALL have a contentType + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + StatusRequest + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + ProcedureRequest + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: There can only be a repeat element if there is none or one event + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-3: At most, only one of count or end can be present + Inv-2: Either frequency or when SHALL be present, but not both + + + Inv-4: duration SHALL be a positive value + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + VisionClaim + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + DeviceMetric + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: There can only be a repeat element if there is none or one event + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-3: At most, only one of count or end can be present + Inv-2: Either frequency or when SHALL be present, but not both + + + Inv-4: duration SHALL be a positive value + + + + Organization + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: The organization SHALL at least have a name or an id, and possibly more than one + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: The telecom of an organization can never be of use 'home' + + + Inv-2: A system is required if a value is provided. + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-2: An address of an organization can never be of use 'home' + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-2: A system is required if a value is provided. + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + Readjudicate + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + ImmunizationRecommendation + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + MedicationDispense + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: whenHandedOver cannot be before whenPrepared + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: There can only be a repeat element if there is none or one event + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-3: At most, only one of count or end can be present + Inv-2: Either frequency or when SHALL be present, but not both + + + Inv-4: duration SHALL be a positive value + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: numerator and denominator SHALL both be present, or both be absent + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: numerator and denominator SHALL both be present, or both be absent + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + MedicationPrescription + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: There can only be a repeat element if there is none or one event + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-3: At most, only one of count or end can be present + Inv-2: Either frequency or when SHALL be present, but not both + + + Inv-4: duration SHALL be a positive value + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: numerator and denominator SHALL both be present, or both be absent + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: numerator and denominator SHALL both be present, or both be absent + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + PaymentNotice + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + MedicationStatement + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: Reason not given is only permitted if wasNotGiven is true + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: There can only be a repeat element if there is none or one event + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-3: At most, only one of count or end can be present + Inv-2: Either frequency or when SHALL be present, but not both + + + Inv-4: duration SHALL be a positive value + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: numerator and denominator SHALL both be present, or both be absent + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: numerator and denominator SHALL both be present, or both be absent + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + + AppointmentResponse + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + Questionnaire + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: The link ids for groups and questions must be unique within the questionnaire + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: Groups may either contain questions or groups but not both + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + OperationOutcome + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + Media + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: Frames can only be used for a photo + Inv-2: Width can only be used for a photo or video + Inv-1: Height can only be used for a photo or video + Inv-4: Length can only be used for an audio or a video + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: It the Attachment has data, it SHALL have a contentType + + + + Binary + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + Other + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + VisionPrescription + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + + DocumentReference + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: A location or a service (or both) SHALL be provided + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + Immunization + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + ExtensionDefinition + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: All element names must start with the extension name + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: A system is required if a value is provided. + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: Must have at a name or a uri (or both) + + + Inv-3: Path names cannot contain .value + + + Inv-2: Min <= Max + Inv-7: Pattern may only be specified if there is one type + Inv-6: Fixed value may only be specified if there is one type + Inv-5: Either a namereference or a fixed value (but not both) is permitted + Inv-15: Constraint names must be unique. + Inv-8: Pattern and value are mutually exclusive + Inv-16: default value and meaningWhenMissing are mutually exclusive + Inv-13: Types must be unique by the combination of code and profile + Inv-14: Constraints must be unique by key + Inv-11: Binding can only be present for coded elements + + + Inv-1: If there is no discriminators, there must be a description + + + Inv-3: Max SHALL be a number or "*" + + + Inv-4: Aggregation may only be specified if one of the allowed types for the element is a resource + + + Inv-10: provide either a reference or a description (or both) + Inv-9: Example value sets are always extensible + + + Inv-12: uri SHALL start with http:// or https:// + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + Bundle + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Search only when transaction + Inv-1: Status only when transaction or search + Inv-5: Status only when transaction or history + + + Inv-3: status only when resource + Inv-4: deleted or resource (but not both) + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + Subscription + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: A system is required if a value is provided. + + + Inv-1: If present, start SHALL have a lower value than end + + + + ImagingStudy + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + Provenance + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + Device + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: A system is required if a value is provided. + + + Inv-1: If present, start SHALL have a lower value than end + + + + Order + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: Provide a code or a schedule, but not both + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: There can only be a repeat element if there is none or one event + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-3: At most, only one of count or end can be present + Inv-2: Either frequency or when SHALL be present, but not both + + + Inv-4: duration SHALL be a positive value + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + Procedure + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + DiagnosticReport + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: It the Attachment has data, it SHALL have a contentType + + + + Medication + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: numerator and denominator SHALL both be present, or both be absent + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + + MessageHeader + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: A system is required if a value is provided. + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + DocumentManifest + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + DataElement + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: Can have a maximum of one definitional binding or primary concept + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: A system is required if a value is provided. + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: provide either a valueSet or a description (or both) + Inv-14: Example value sets are always extensible + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-26: Must have at a name or a uri (or both) + + + + MedicationAdministration + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Reason not given is only permitted if wasNotGiven is true + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have at least one of dosage.quantity and dosage.rate + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: numerator and denominator SHALL both be present, or both be absent + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: numerator and denominator SHALL both be present, or both be absent + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + + Encounter + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + SecurityEvent + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: Either a userId or a reference, but not both + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Either an identifier or a reference, but not both + Inv-1: Either a name or a query (or both) + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + PendedRequest + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + + List + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: The deleted flag can only be used if the mode of the list is "changes" + Inv-1: A list can only have an emptyReason if it is empty + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + DeviceUseStatement + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: There can only be a repeat element if there is none or one event + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-3: At most, only one of count or end can be present + Inv-2: Either frequency or when SHALL be present, but not both + + + Inv-4: duration SHALL be a positive value + + + Inv-1: If present, start SHALL have a lower value than end + + + + Goal + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + NutritionOrder + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: Nutrition Order SHALL contain either Oral Diet , Supplement, or Enteral Formula class + + + Inv-1: There can only be a repeat element if there is none or one event + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-3: At most, only one of count or end can be present + Inv-2: Either frequency or when SHALL be present, but not both + + + Inv-4: duration SHALL be a positive value + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: Quantity values cannot have a comparator when used in a Range + Inv-2: If present, low SHALL have a lower value than high + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: numerator and denominator SHALL both be present, or both be absent + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + + SearchParameter + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: A system is required if a value is provided. + + + Inv-1: If present, start SHALL have a lower value than end + + + + ReferralRequest + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + + FamilyHistory + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: Can have age[x] or birth[x], but not both + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: Quantity values cannot have a comparator when used in a Range + Inv-2: If present, low SHALL have a lower value than high + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: Quantity values cannot have a comparator when used in a Range + Inv-2: If present, low SHALL have a lower value than high + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: Quantity values cannot have a comparator when used in a Range + Inv-2: If present, low SHALL have a lower value than high + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + + EnrollmentRequest + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + Location + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: A system is required if a value is provided. + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + Contract + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-1: It the Attachment has data, it SHALL have a contentType + + + Inv-1: It the Attachment has data, it SHALL have a contentType + + + Inv-1: It the Attachment has data, it SHALL have a contentType + + + Inv-1: It the Attachment has data, it SHALL have a contentType + + + + Basic + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + Specimen + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-3: If a code for the units is present, the system SHALL also be present + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + EnrollmentResponse + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + Patient + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-2: A system is required if a value is provided. + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: It the Attachment has data, it SHALL have a contentType + + + Inv-1: SHALL at least contain a contact's details or a reference to an organization + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-2: A system is required if a value is provided. + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + CarePlan2 + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + + DiagnosticOrder + + Inv-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource + Inv-2: If the resource is contained in another resource, it SHALL not contain nested Resources + Inv-1: If the resource is contained in another resource, it SHALL not contain any narrative + + + Inv-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 + Inv-2: The narrative SHALL have some non-whitespace content + Inv-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 + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: If present, start SHALL have a lower value than end + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + Inv-2: Only one coding in a set can be chosen directly by the user + + + Inv-1: If a valueSet is provided, a system URI Is required + + + Inv-1: SHALL have a local reference if the resource is provided inline + + + diff --git a/hapi-fhir-structures-dstu2/src/main/resources/ca/uhn/fhir/model/dstu2/schema/fhir-atom.xsd b/hapi-fhir-structures-dstu2/src/main/resources/ca/uhn/fhir/model/dstu2/schema/fhir-atom.xsd index e4f1ef16fe8..03f97581362 100644 --- a/hapi-fhir-structures-dstu2/src/main/resources/ca/uhn/fhir/model/dstu2/schema/fhir-atom.xsd +++ b/hapi-fhir-structures-dstu2/src/main/resources/ca/uhn/fhir/model/dstu2/schema/fhir-atom.xsd @@ -26,7 +26,7 @@ Copyright (c) 2011+, HL7, Inc ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - Generated on Thu, Dec 18, 2014 17:00+0000 for FHIR v0.4.0 + Generated on Thu, Jan 8, 2015 07:22-0500 for FHIR v0.4.0 --> diff --git a/hapi-fhir-structures-dstu2/src/main/resources/ca/uhn/fhir/model/dstu2/schema/fhir-base.xsd b/hapi-fhir-structures-dstu2/src/main/resources/ca/uhn/fhir/model/dstu2/schema/fhir-base.xsd index fd89e9f538f..0e5c7a40c82 100644 --- a/hapi-fhir-structures-dstu2/src/main/resources/ca/uhn/fhir/model/dstu2/schema/fhir-base.xsd +++ b/hapi-fhir-structures-dstu2/src/main/resources/ca/uhn/fhir/model/dstu2/schema/fhir-base.xsd @@ -27,7 +27,7 @@ POSSIBILITY OF SUCH DAMAGE. - Generated on Thu, Dec 18, 2014 17:00+0000 for FHIR v0.4.0 + Generated on Sat, Feb 7, 2015 18:18+0000 for FHIR v0.4.0 --> @@ -264,6 +264,7 @@ + @@ -396,6 +397,7 @@ + @@ -787,7 +789,7 @@ - A reference to a location at which the other resource is found. The reference may 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. + 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. @@ -1170,6 +1172,7 @@ + @@ -1205,6 +1208,7 @@ + @@ -1235,6 +1239,7 @@ + @@ -1265,6 +1270,7 @@ + @@ -1347,7 +1353,7 @@ - A humane 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. + 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. @@ -1421,6 +1427,7 @@ + @@ -1989,6 +1996,48 @@ P.O. Box number, delivery hints, and similar address information. + + + 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. + + + + + Set to 'true' if the resource is deleted. Deleted resources can not be fetched via the RESTful API, but may appear in bundles for various reasons. + + + + + A list of profiles that this resource claims to conform to. The URL is a reference to Profile.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. + + + + + + Details for All kinds of technology mediated contact points for a person or organization, including telephone, email, etc. @@ -2154,6 +2203,7 @@ P.O. Box number, delivery hints, and similar address information. + @@ -2211,6 +2261,7 @@ P.O. Box number, delivery hints, and similar address information. + @@ -2231,7 +2282,7 @@ P.O. Box number, delivery hints, and similar address information.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. @@ -2248,43 +2299,6 @@ P.O. Box number, delivery hints, and similar address information. - - - Base Resource for everything. - 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 that this resource claims to conform to. The URL is a reference to Profile.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. - - - - - - @@ -2316,81 +2330,6 @@ P.O. Box number, delivery hints, and similar address information. - - - - - This Questionnaire is not ready for official use. - - - - - This Questionnaire is ready for use. - - - - - This Questionnaire should no longer be used to gather data. - - - - - - - - If the element is present, it must have either a @value, an @id, or extensions - - - - - - - - - - - - The specified property of the code equals the provided value. - - - - - The specified property of the code has an is-a relationship with the provided value. - - - - - 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). - - - - - - - - If the element is present, it must have either a @value, an @id, or extensions - - - - - - - @@ -2446,61 +2385,6 @@ P.O. Box number, delivery hints, and similar address information. - - - - - This is the current reference for this document. - - - - - This reference has been superseded by another reference. - - - - - This reference was created in error. - - - - - - - - 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 - - - - - - - @@ -2581,6 +2465,526 @@ P.O. Box number, delivery hints, and similar address information. + + + + + This profile is still under development. + + + + + This profile is ready for normal use. + + + + + This profile has been deprecated, withdrawn or superseded and should no longer be used. + + + + + + + + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + 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. + + + + + A duration (length of time) with a UCUM code + + + + + For referring to data content defined in other formats. + + + + + Base definition for all elements that are defined inside a resource - but not those in a data type. + + + + + A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text. + + + + + A reference to a code defined by a terminology system. + + + + + Details for All kinds of technology mediated contact points for a person or organization, including telephone, email, etc. + + + + + A count of a discrete element (no unit) + + + + + A measure of distance + + + + + A length of time + + + + + Base definition for all elements in a resource. + + + + + Captures constraints on each element within the resource, profile, or extension. + + + + + Optional Extensions Element - found in all resources. + + + + + A human's name with the ability to identify parts and usage. + + + + + A technical identifier - identifies some entity uniquely and unambiguously. + + + + + 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. + + + + + An amount of money. With regard to precision, see [[X]] + + + + + A human-readable formatted text, including images. + + + + + A time period defined by a start and end date and optionally time. + + + + + 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. + + + + + A set of ordered Quantities defined by a low and high limit. + + + + + A relationship of two Quantity values - expressed as a numerator and a denominator. + + + + + A reference from one resource to another. + + + + + A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data. + + + + + Specifies an event that may occur multiple times. Timing schedules are used for to record when things are expected or requested to occur. + + + + + A stream of bytes + + + + + Value of "true" or "false" + + + + + 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 + + + + + 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. + + + + + 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 may be provided but may also be ignored. Dates SHALL be valid dates. + + + + + A rational number with implicit precision + + + + + 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. + + + + + An instant in time - known at least to the second + + + + + A whole number + + + + + An oid represented as a URI + + + + + A sequence of Unicode characters + + + + + A time during the day, with no date specified + + + + + String of characters used to identify a name or a resource + + + + + A UUID, represented as a URI + + + + + + + + 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. + + + + + + + + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + Change the status of a Medication Administration to show that it is complete. + + + + + Someone wishes to record that the record of administration of a medication is in error and should be ignored. + + + + + Indicates that a medication has been recorded against the patient's record. + + + + + Update a Medication Administration record. + + + + + Notification of a change to an administrative resource (either create or update). Note that there is no delete, though some administrative resources have status or period elements for this use. + + + + + Translate a code from one value set to another, based on the existing value set and concept maps resources, and/or other additional knowledge available to the server. The coded value is carried as an extension in the message header. The outcome is an operationOutcome with hints, warnings, or errors, or the translated code in an extension. + + + + + Provide a diagnostic report, or update a previously provided diagnostic report. + + + + + Provide a simple observation or update a previously provided simple observation. + + + + + Notification that two patient records actually identify the same patient. + + + + + Notification that previous advice that two patient records concern the same patient is now considered incorrect. + + + + + The definition of a value set is used to create a simple collection of codes suitable for use for data entry or validation. An expanded value set will be returned, or an error message. + + + + + Validate that a coded value is in the set of codes allowed by a value set. The coded value is carried as an extension in the message header. The outcome is an OperationOutcome with hints, warnings, or errors. + + + + + + + + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + This valueset is still under development. + + + + + This valueset is ready for normal use. + + + + + This valueset 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 + + + + + + + + + + + + This Questionnaire is not ready for official use. + + + + + This Questionnaire is ready for use. + + + + + This Questionnaire should no longer be used to gather data. + + + + + + + + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + The specified property of the code equals the provided value. + + + + + The specified property of the code has an is-a relationship with the provided value. + + + + + 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). + + + + + + + + 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 superseded by another reference. + + + + + This reference was created in error. + + + + + + + + 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 + + + + + + + @@ -2738,6 +3142,11 @@ P.O. Box number, delivery hints, and similar address information.A technical identifier - identifies some entity uniquely and unambiguously. + + + 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. + + An amount of money. With regard to precision, see [[X]] @@ -2883,6 +3292,11 @@ P.O. Box number, delivery hints, and similar address information.A binary resource can contain any content, whether text, image, pdf, zip archive, etc. + + + Record details about the anatomical location of a specimen or body part, including precise localisation information. This resource may be used when a coded concept does not provide the necessary detail needed for the use case. + + A container for a group of resources. @@ -3110,9 +3524,7 @@ P.O. Box number, delivery hints, and similar address information. - Describes the event of a patient being given a dose of 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. @@ -3423,286 +3835,6 @@ Related resources tie this event to the authorizing prescription, and the specif - - - - - 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. - - - - - A duration (length of time) with a UCUM code - - - - - For referring to data content defined in other formats. - - - - - Base definition for all elements that are defined inside a resource - but not those in a data type. - - - - - A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text. - - - - - A reference to a code defined by a terminology system. - - - - - Details for All kinds of technology mediated contact points for a person or organization, including telephone, email, etc. - - - - - A count of a discrete element (no unit) - - - - - A measure of distance - - - - - A length of time - - - - - Base definition for all elements in a resource. - - - - - Captures constraints on each element within the resource, profile, or extension. - - - - - Optional Extensions Element - found in all resources. - - - - - A human's name with the ability to identify parts and usage. - - - - - A technical identifier - identifies some entity uniquely and unambiguously. - - - - - An amount of money. With regard to precision, see [[X]] - - - - - A human-readable formatted text, including images. - - - - - A time period defined by a start and end date and optionally time. - - - - - 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. - - - - - A set of ordered Quantities defined by a low and high limit. - - - - - A relationship of two Quantity values - expressed as a numerator and a denominator. - - - - - A reference from one resource to another. - - - - - A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data. - - - - - Specifies an event that may occur multiple times. Timing schedules are used for to record when things are expected or requested to occur. - - - - - A stream of bytes - - - - - Value of "true" or "false" - - - - - 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 - - - - - 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. - - - - - 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 may be provided but may also be ignored. Dates SHALL be valid dates. - - - - - A rational number with implicit precision - - - - - 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. - - - - - An instant in time - known at least to the second - - - - - A whole number - - - - - An oid represented as a URI - - - - - A sequence of Unicode characters - - - - - A time during the day, with no date specified - - - - - String of characters used to identify a name or a resource - - - - - A UUID, represented as a URI - - - - - - - - If the element is present, it must have either a @value, an @id, or extensions - - - - - - - - - - - - This profile is still under development. - - - - - This profile is ready for normal use. - - - - - This profile has been deprecated, withdrawn or superseded and should no longer be used. - - - - - - - - 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. - - - - - - - - If the element is present, it must have either a @value, an @id, or extensions - - - - - - - @@ -3805,6 +3937,11 @@ Related resources tie this event to the authorizing prescription, and the specif A binary resource can contain any content, whether text, image, pdf, zip archive, etc. + + + Record details about the anatomical location of a specimen or body part, including precise localisation information. This resource may be used when a coded concept does not provide the necessary detail needed for the use case. + + A container for a group of resources. @@ -4032,9 +4169,7 @@ Related resources tie this event to the authorizing prescription, and the specif - Describes the event of a patient being given a dose of 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. @@ -4325,81 +4460,6 @@ Related resources tie this event to the authorizing prescription, and the specif - - - - - Change the status of a Medication Administration to show that it is complete. - - - - - Someone wishes to record that the record of administration of a medication is in error and should be ignored. - - - - - Indicates that a medication has been recorded against the patient's record. - - - - - Update a Medication Administration record. - - - - - Notification of a change to an administrative resource (either create or update). Note that there is no delete, though some administrative resources have status or period elements for this use. - - - - - Translate a code from one value set to another, based on the existing value set and concept maps resources, and/or other additional knowledge available to the server. The coded value is carried as an extension in the message header. The outcome is an operationOutcome with hints, warnings, or errors, or the translated code in an extension. - - - - - Provide a diagnostic report, or update a previously provided diagnostic report. - - - - - Provide a simple observation or update a previously provided simple observation. - - - - - Notification that two patient records actually identify the same patient. - - - - - Notification that previous advice that two patient records concern the same patient is now considered incorrect. - - - - - The definition of a value set is used to create a simple collection of codes suitable for use for data entry or validation. An expanded value set will be returned, or an error message. - - - - - Validate that a coded value is in the set of codes allowed by a value set. The coded value is carried as an extension in the message header. The outcome is an OperationOutcome with hints, warnings, or errors. - - - - - - - - If the element is present, it must have either a @value, an @id, or extensions - - - - - - - @@ -4415,34 +4475,4 @@ Related resources tie this event to the authorizing prescription, and the specif - - - - - This valueset is still under development. - - - - - This valueset is ready for normal use. - - - - - This valueset 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 - - - - - - - diff --git a/hapi-fhir-structures-dstu2/src/main/resources/ca/uhn/fhir/model/dstu2/schema/fhir-single.xsd b/hapi-fhir-structures-dstu2/src/main/resources/ca/uhn/fhir/model/dstu2/schema/fhir-single.xsd index 9c442790c31..a36687fdc6e 100644 --- a/hapi-fhir-structures-dstu2/src/main/resources/ca/uhn/fhir/model/dstu2/schema/fhir-single.xsd +++ b/hapi-fhir-structures-dstu2/src/main/resources/ca/uhn/fhir/model/dstu2/schema/fhir-single.xsd @@ -27,7 +27,7 @@ POSSIBILITY OF SUCH DAMAGE. - Generated on Thu, Dec 18, 2014 17:00+0000 for FHIR v0.4.0 + Generated on Sat, Feb 7, 2015 18:18+0000 for FHIR v0.4.0 --> @@ -264,6 +264,7 @@ + @@ -396,6 +397,7 @@ + @@ -787,7 +789,7 @@ - A reference to a location at which the other resource is found. The reference may 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. + 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. @@ -1170,6 +1172,7 @@ + @@ -1205,6 +1208,7 @@ + @@ -1235,6 +1239,7 @@ + @@ -1265,6 +1270,7 @@ + @@ -1347,7 +1353,7 @@ - A humane 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. + 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. @@ -1421,6 +1427,7 @@ + @@ -1989,6 +1996,48 @@ P.O. Box number, delivery hints, and similar address information. + + + 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. + + + + + Set to 'true' if the resource is deleted. Deleted resources can not be fetched via the RESTful API, but may appear in bundles for various reasons. + + + + + A list of profiles that this resource claims to conform to. The URL is a reference to Profile.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. + + + + + + Details for All kinds of technology mediated contact points for a person or organization, including telephone, email, etc. @@ -2154,6 +2203,7 @@ P.O. Box number, delivery hints, and similar address information. + @@ -2211,6 +2261,7 @@ P.O. Box number, delivery hints, and similar address information. + @@ -2231,7 +2282,7 @@ P.O. Box number, delivery hints, and similar address information.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. @@ -2248,43 +2299,6 @@ P.O. Box number, delivery hints, and similar address information. - - - Base Resource for everything. - 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 that this resource claims to conform to. The URL is a reference to Profile.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. - - - - - - @@ -2316,81 +2330,6 @@ P.O. Box number, delivery hints, and similar address information. - - - - - This Questionnaire is not ready for official use. - - - - - This Questionnaire is ready for use. - - - - - This Questionnaire should no longer be used to gather data. - - - - - - - - If the element is present, it must have either a @value, an @id, or extensions - - - - - - - - - - - - The specified property of the code equals the provided value. - - - - - The specified property of the code has an is-a relationship with the provided value. - - - - - 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). - - - - - - - - If the element is present, it must have either a @value, an @id, or extensions - - - - - - - @@ -2446,61 +2385,6 @@ P.O. Box number, delivery hints, and similar address information. - - - - - This is the current reference for this document. - - - - - This reference has been superseded by another reference. - - - - - This reference was created in error. - - - - - - - - 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 - - - - - - - @@ -2581,6 +2465,526 @@ P.O. Box number, delivery hints, and similar address information. + + + + + This profile is still under development. + + + + + This profile is ready for normal use. + + + + + This profile has been deprecated, withdrawn or superseded and should no longer be used. + + + + + + + + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + 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. + + + + + A duration (length of time) with a UCUM code + + + + + For referring to data content defined in other formats. + + + + + Base definition for all elements that are defined inside a resource - but not those in a data type. + + + + + A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text. + + + + + A reference to a code defined by a terminology system. + + + + + Details for All kinds of technology mediated contact points for a person or organization, including telephone, email, etc. + + + + + A count of a discrete element (no unit) + + + + + A measure of distance + + + + + A length of time + + + + + Base definition for all elements in a resource. + + + + + Captures constraints on each element within the resource, profile, or extension. + + + + + Optional Extensions Element - found in all resources. + + + + + A human's name with the ability to identify parts and usage. + + + + + A technical identifier - identifies some entity uniquely and unambiguously. + + + + + 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. + + + + + An amount of money. With regard to precision, see [[X]] + + + + + A human-readable formatted text, including images. + + + + + A time period defined by a start and end date and optionally time. + + + + + 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. + + + + + A set of ordered Quantities defined by a low and high limit. + + + + + A relationship of two Quantity values - expressed as a numerator and a denominator. + + + + + A reference from one resource to another. + + + + + A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data. + + + + + Specifies an event that may occur multiple times. Timing schedules are used for to record when things are expected or requested to occur. + + + + + A stream of bytes + + + + + Value of "true" or "false" + + + + + 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 + + + + + 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. + + + + + 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 may be provided but may also be ignored. Dates SHALL be valid dates. + + + + + A rational number with implicit precision + + + + + 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. + + + + + An instant in time - known at least to the second + + + + + A whole number + + + + + An oid represented as a URI + + + + + A sequence of Unicode characters + + + + + A time during the day, with no date specified + + + + + String of characters used to identify a name or a resource + + + + + A UUID, represented as a URI + + + + + + + + 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. + + + + + + + + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + Change the status of a Medication Administration to show that it is complete. + + + + + Someone wishes to record that the record of administration of a medication is in error and should be ignored. + + + + + Indicates that a medication has been recorded against the patient's record. + + + + + Update a Medication Administration record. + + + + + Notification of a change to an administrative resource (either create or update). Note that there is no delete, though some administrative resources have status or period elements for this use. + + + + + Translate a code from one value set to another, based on the existing value set and concept maps resources, and/or other additional knowledge available to the server. The coded value is carried as an extension in the message header. The outcome is an operationOutcome with hints, warnings, or errors, or the translated code in an extension. + + + + + Provide a diagnostic report, or update a previously provided diagnostic report. + + + + + Provide a simple observation or update a previously provided simple observation. + + + + + Notification that two patient records actually identify the same patient. + + + + + Notification that previous advice that two patient records concern the same patient is now considered incorrect. + + + + + The definition of a value set is used to create a simple collection of codes suitable for use for data entry or validation. An expanded value set will be returned, or an error message. + + + + + Validate that a coded value is in the set of codes allowed by a value set. The coded value is carried as an extension in the message header. The outcome is an OperationOutcome with hints, warnings, or errors. + + + + + + + + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + This valueset is still under development. + + + + + This valueset is ready for normal use. + + + + + This valueset 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 + + + + + + + + + + + + This Questionnaire is not ready for official use. + + + + + This Questionnaire is ready for use. + + + + + This Questionnaire should no longer be used to gather data. + + + + + + + + If the element is present, it must have either a @value, an @id, or extensions + + + + + + + + + + + + The specified property of the code equals the provided value. + + + + + The specified property of the code has an is-a relationship with the provided value. + + + + + 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). + + + + + + + + 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 superseded by another reference. + + + + + This reference was created in error. + + + + + + + + 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 + + + + + + + @@ -2738,6 +3142,11 @@ P.O. Box number, delivery hints, and similar address information.A technical identifier - identifies some entity uniquely and unambiguously. + + + 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. + + An amount of money. With regard to precision, see [[X]] @@ -2883,6 +3292,11 @@ P.O. Box number, delivery hints, and similar address information.A binary resource can contain any content, whether text, image, pdf, zip archive, etc. + + + Record details about the anatomical location of a specimen or body part, including precise localisation information. This resource may be used when a coded concept does not provide the necessary detail needed for the use case. + + A container for a group of resources. @@ -3110,9 +3524,7 @@ P.O. Box number, delivery hints, and similar address information. - Describes the event of a patient being given a dose of 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. @@ -3423,286 +3835,6 @@ Related resources tie this event to the authorizing prescription, and the specif - - - - - 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. - - - - - A duration (length of time) with a UCUM code - - - - - For referring to data content defined in other formats. - - - - - Base definition for all elements that are defined inside a resource - but not those in a data type. - - - - - A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text. - - - - - A reference to a code defined by a terminology system. - - - - - Details for All kinds of technology mediated contact points for a person or organization, including telephone, email, etc. - - - - - A count of a discrete element (no unit) - - - - - A measure of distance - - - - - A length of time - - - - - Base definition for all elements in a resource. - - - - - Captures constraints on each element within the resource, profile, or extension. - - - - - Optional Extensions Element - found in all resources. - - - - - A human's name with the ability to identify parts and usage. - - - - - A technical identifier - identifies some entity uniquely and unambiguously. - - - - - An amount of money. With regard to precision, see [[X]] - - - - - A human-readable formatted text, including images. - - - - - A time period defined by a start and end date and optionally time. - - - - - 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. - - - - - A set of ordered Quantities defined by a low and high limit. - - - - - A relationship of two Quantity values - expressed as a numerator and a denominator. - - - - - A reference from one resource to another. - - - - - A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data. - - - - - Specifies an event that may occur multiple times. Timing schedules are used for to record when things are expected or requested to occur. - - - - - A stream of bytes - - - - - Value of "true" or "false" - - - - - 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 - - - - - 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. - - - - - 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 may be provided but may also be ignored. Dates SHALL be valid dates. - - - - - A rational number with implicit precision - - - - - 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. - - - - - An instant in time - known at least to the second - - - - - A whole number - - - - - An oid represented as a URI - - - - - A sequence of Unicode characters - - - - - A time during the day, with no date specified - - - - - String of characters used to identify a name or a resource - - - - - A UUID, represented as a URI - - - - - - - - If the element is present, it must have either a @value, an @id, or extensions - - - - - - - - - - - - This profile is still under development. - - - - - This profile is ready for normal use. - - - - - This profile has been deprecated, withdrawn or superseded and should no longer be used. - - - - - - - - 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. - - - - - - - - If the element is present, it must have either a @value, an @id, or extensions - - - - - - - @@ -3805,6 +3937,11 @@ Related resources tie this event to the authorizing prescription, and the specif A binary resource can contain any content, whether text, image, pdf, zip archive, etc. + + + Record details about the anatomical location of a specimen or body part, including precise localisation information. This resource may be used when a coded concept does not provide the necessary detail needed for the use case. + + A container for a group of resources. @@ -4032,9 +4169,7 @@ Related resources tie this event to the authorizing prescription, and the specif - Describes the event of a patient being given a dose of 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. @@ -4325,81 +4460,6 @@ Related resources tie this event to the authorizing prescription, and the specif - - - - - Change the status of a Medication Administration to show that it is complete. - - - - - Someone wishes to record that the record of administration of a medication is in error and should be ignored. - - - - - Indicates that a medication has been recorded against the patient's record. - - - - - Update a Medication Administration record. - - - - - Notification of a change to an administrative resource (either create or update). Note that there is no delete, though some administrative resources have status or period elements for this use. - - - - - Translate a code from one value set to another, based on the existing value set and concept maps resources, and/or other additional knowledge available to the server. The coded value is carried as an extension in the message header. The outcome is an operationOutcome with hints, warnings, or errors, or the translated code in an extension. - - - - - Provide a diagnostic report, or update a previously provided diagnostic report. - - - - - Provide a simple observation or update a previously provided simple observation. - - - - - Notification that two patient records actually identify the same patient. - - - - - Notification that previous advice that two patient records concern the same patient is now considered incorrect. - - - - - The definition of a value set is used to create a simple collection of codes suitable for use for data entry or validation. An expanded value set will be returned, or an error message. - - - - - Validate that a coded value is in the set of codes allowed by a value set. The coded value is carried as an extension in the message header. The outcome is an OperationOutcome with hints, warnings, or errors. - - - - - - - - If the element is present, it must have either a @value, an @id, or extensions - - - - - - - @@ -4415,36 +4475,6 @@ Related resources tie this event to the authorizing prescription, and the specif - - - - - This valueset is still under development. - - - - - This valueset is ready for normal use. - - - - - This valueset 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 - - - - - - - Prospective warnings of potential issues when providing care to the patient. @@ -5259,6 +5289,105 @@ Related resources tie this event to the authorizing prescription, and the specif + + + Record details about the anatomical location of a specimen or body part, including precise localisation information. 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, including precise localisation information. 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 + + + + + + + Identifier for this instance of the anatomical location. + + + + + The Specific and identified anatomical location. + + + + + Qualifiers to identify non-specific location eg 5cm (distance) inferior (aspect) to the tibial tuberosity (landmark). There may be more than one relative location required to provide a cross reference. + + + + + Description of anatomical location. + + + + + Image or images used to identify a location. + + + + + + + + + Record details about the anatomical location of a specimen or body part, including precise localisation information. This resource may be used when a coded concept does not provide the necessary detail needed for the use case. + + + + + + + Named anatomical location - ideally would be coded where possible. + + + + + Specify lateraility of the anatomical location. + + + + + Identify the specific anatomical site out of multiple eg tenth rib; fourth vertebra; second toe. + + + + + Line describing the position of a vertical anatomical plane in the body. + + + + + + + + + Record details about the anatomical location of a specimen or body part, including precise localisation information. This resource may be used when a coded concept does not provide the necessary detail needed for the use case. + + + + + + + Identified anatomical landmark from which to specify relative anatomical location. + + + + + Qualifier to identify which direction the anatomical location is in relation to the identified landmark. + + + + + Distance of location from the identified landmark. + + + + + + A container for a group of resources. @@ -5294,7 +5423,7 @@ Related resources tie this event to the authorizing prescription, and the specif - An entry in a bundle resource - will either contain a resource, or a deleted entry (transaction and history bundles only). + An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only). @@ -5339,24 +5468,14 @@ Related resources tie this event to the authorizing prescription, and the specif The Base URL for the resource, if different to the base URL specified for the bundle as a whole. - + - The status of a resource in the bundle. Used for search (to differentiate between resources included as a match, and resources included as an _include), for history (deleted resources), and for transactions (create/update/delete). + Information about the search process that lead to the creation of this entry. - + - Search URL for this resource when processing a transaction (see transaction documentation). - - - - - When searching, the server's search ranking score for the entry. - - - - - If this is an entry that represents a deleted resource. Only used when the bundle is a transaction or a history type. See RESTful API documentation for further information. + Additional information about how this entry should be processed as part of a transaction. @@ -5364,11 +5483,58 @@ Related resources tie this event to the authorizing prescription, and the specif The Resources for the entry. + + + Information about the resource (if deleted, or if a summary transaction response). + + - + + + A container for a group 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 group of resources. + + + + + + + The operation associated with 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). + + + + + + + A container for a group of resources. @@ -5377,60 +5543,45 @@ Related resources tie this event to the authorizing prescription, and the specif - The type of resource that was deleted (required to construct the identity). + The type of resource (required to construct the identity - e.g. identity Patient/345 is type + id). - The id of the resource that was deleted. + The id of the resource (required to construct the identity - e.g. identity Patient/345 is type + id). - + - Version id for releted resource. - - - - - The date/time that the resource was deleted. + The meta information for the resource. Optional - only provided if there is a need for version id, last updated, and/or tag, profile and security information. - + - - - Transaction: perform a create operation on this resource. - - - - - Transaction: perform an update operation on this resource. - - - Transaction: look for this resource using the search url provided. If there's no match, create it. Search: this resource is returned because it matches the search criteria. + This resource matched the search specification. - Search: this resource is returned because it meets an _include criteria. + This resource is returned because it is referred to from another resource in the search set. - + - The status of a resource in the bundle. Used for search (to differentiate between resources included as a match, and resources included as an _include), and for transactions (create/update/delete) + 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 - + @@ -5484,6 +5635,41 @@ Related resources tie this event to the authorizing prescription, and the specif + + + + + + + + + + + + + + + + + + + + No Operation occurred - only valid in a transaction response. + + + + + + + The operation associated with an entry in either a update history, or a transaction/ transaction response + 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. @@ -8917,6 +9103,7 @@ Related resources tie this event to the authorizing prescription, and the specif + @@ -9102,12 +9289,12 @@ Related resources tie this event to the authorizing prescription, and the specif - Identifiers assigned to this device by various organizations. The most likely organizations to assign identifiers are the manufacturer and the owner, though regulatory agencies may also assign an identifier. The identifiers identify the particular device, not the kind of device. + Unique instance identifiers assigned to a device by organizations like manufacturers, owners or regulatory agencies. If the identifier identifies the type of device, Device.type should be used. An example is the FDA Mandated Unique Device Identifier (UDI) which identifies an instance of a device uniquely if the serial number is present, . - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm. - A kind of this device. + Code or identifier to identify a kind of device An example is the FDA Mandated Unique Device Identifier (UDI) which identifies a type of a device when the serial number is absent, otherwise it uniquely identifies the device instance and Device.identifier should be used instead of Device.type. - see http://www.fda.gov/MedicalDevices/DeviceRegulationandGuidance/UniqueDeviceIdentification/default.htm. @@ -9125,14 +9312,14 @@ Related resources tie this event to the authorizing prescription, and the specif The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware. - + - Date of expiry of this device (if applicable). + The Date and time when the device was manufactured. - + - FDA Mandated Unique Device Identifier. 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. + The date and time beyond which this device is no longer valid or should not be used (if applicable). @@ -9939,11 +10126,13 @@ period. If the item is related to a specific specimen. - + Anatomical location where the request test should be performed. - - + + + + The status of this individual item within the order. @@ -14202,6 +14391,11 @@ Note that this AE Title is provided to retrieve all SOP instances of the series Identifies a particular constituent of interest in the product. + + + Information about a group of medication produced or packaged from one production run. + + @@ -14227,6 +14421,27 @@ Note that this AE Title is provided to retrieve all SOP instances of the series + + + 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. @@ -14296,16 +14511,12 @@ Note that this AE Title is provided to retrieve all SOP instances of the series - Describes the event of a patient being given a dose of 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. - Describes the event of a patient being given a dose of 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 @@ -14326,7 +14537,7 @@ Related resources tie this event to the authorizing prescription, and the specif The person or animal to whom the medication was given. - + The individual who was responsible for giving the medication to the patient. @@ -14336,7 +14547,7 @@ Related resources tie this event to the authorizing prescription, and the specif 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. @@ -14351,9 +14562,14 @@ Related resources tie this event to the authorizing prescription, and the specif 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. For many administrations, such as swallowing a tablet the lower and upper values of the interval will be the same. + 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. @@ -14368,9 +14584,14 @@ Related resources tie this event to the authorizing prescription, and the specif The device used in administering the medication to the patient. E.g. a particular infusion pump. - + - Provides details of how much of the medication was administered. + Extra information about the medication administration that is not conveyed by the other attributes. + + + + + Indicates how the medication is/was used by the patient. @@ -14379,27 +14600,16 @@ Related resources tie this event to the authorizing prescription, and the specif - Describes the event of a patient being given a dose of 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. - + - The timing schedule for giving the medication to the patient. This may be a single time point (using dateTime) or it may be a start and end dateTime (Period). - - - - - - - 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. - - - - + 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". @@ -14412,9 +14622,7 @@ Related resources tie this event to the authorizing prescription, and the specif - 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. + 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. @@ -14427,11 +14635,6 @@ Terminologies used often pre-coordinate this term with the route and or form of 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 maximum total quantity of a therapeutic substance that was administered to the patient over the specified period of time. E.g. 1000mg in 24 hours. - - @@ -14514,37 +14717,6 @@ Terminologies used often pre-coordinate this term with the route and or form of Indicates the medication order that is being dispensed against. - - - Indicates the details of the dispense event such as the days supply and quantity of medication dispensed. - - - - - 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. - - - - - - - Identifier assigned by the dispensing facility. This is an identifier assigned outside FHIR. - - - - - 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. @@ -14555,6 +14727,11 @@ Terminologies used often pre-coordinate this term with the route and or form of 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. @@ -14580,16 +14757,26 @@ Terminologies used often pre-coordinate this term with the route and or form of 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. @@ -14628,16 +14815,16 @@ Terminologies used often pre-coordinate this term with the route and or form of - 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. + 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. @@ -14768,9 +14955,14 @@ Terminologies used often pre-coordinate this term with the route and or form of + + + Extra information about the prescription that could not be 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. + 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. @@ -14801,7 +14993,7 @@ Terminologies used often pre-coordinate this term with the route and or form of - Free text dosage instructions for cases where the instructions are too complex to code. + 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. @@ -14836,16 +15028,16 @@ Terminologies used often pre-coordinate this term with the route and or form of - 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. + 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. @@ -14869,31 +15061,27 @@ Terminologies used often pre-coordinate this term with the route and or form of - Identifies the medication that is to be dispensed. This may be a more specifically defined than the medicationPrescription.medication . 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. + 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. + 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. + 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. + 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. + 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. @@ -14953,6 +15141,11 @@ In some situations, this attribute may be used instead of quantity to identify t 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. + + @@ -14989,6 +15182,21 @@ In some situations, this attribute may be used instead of quantity to identify t 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. @@ -14999,9 +15207,23 @@ In some situations, this attribute may be used instead of quantity to identify t A code indicating why the medication was not taken. - + - The interval of time during which it is being asserted that the patient was taking the medication. + 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. @@ -15009,11 +15231,6 @@ In some situations, this attribute may be used instead of quantity to identify t 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. - - - An identifier or a link to a resource that identifies a device used in administering the medication to the patient. - - Indicates how the medication is/was used by the patient. @@ -15030,6 +15247,11 @@ In some situations, this attribute may be used instead of quantity to identify t + + + 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". @@ -15054,9 +15276,7 @@ In some situations, this attribute may be used instead of quantity to identify t - 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. + 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. @@ -15078,6 +15298,36 @@ Terminologies used often pre-coordinate this term with the route and or form of + + + + + 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. @@ -15505,7 +15755,7 @@ Terminologies used often pre-coordinate this term with the route and or form of - + The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding. @@ -15545,45 +15795,12 @@ Terminologies used often pre-coordinate this term with the route and or form of 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. - - - Different items that combine to make a complete description of the nutrition to be provided via oral diet, nutritional supplement and/or formula order. - - - - - The workflow status of the nutrition order request, e.g., Active, Inactive, Pending, Held, Canceled, Suspended. - - - - - - - - - A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. - - - - - - - The frequency at which the diet, oral supplement or enteral formula should be given. - - - - - - - Indicates whether the nutrition item is currently in effect for the patient. - - Class that defines the components of an oral diet order for the patient. - + Class that defines the components of a supplement order for the patient. @@ -15593,6 +15810,11 @@ Terminologies used often pre-coordinate this term with the route and or form of Class that defines the components of an enteral formula order for the patient. + + + The workflow status of the nutrition order request, e.g., Active, Inactive, Pending, Held, Canceled, Suspended. + + @@ -15609,6 +15831,11 @@ Terminologies used often pre-coordinate this term with the route and or form of Indicates the type of oral diet or diet restrictions that describe what can be consumed orally (i.e., take via the mouth). + + + The time period and frequency at which the diet should be given. + + Class that defines the details of any nutrient modifications required for the oral diet. @@ -15645,13 +15872,11 @@ Terminologies used often pre-coordinate this term with the route and or form of Identifies the type of nutrient that is being modified such as carbohydrate or sodium. - + - The quantity or range of the specified nutrient to supply. - - - - + The quantity of the specified nutrient to include in diet. + + @@ -15689,16 +15914,21 @@ Terminologies used often pre-coordinate this term with the route and or form of Indicates the type of nutritional supplement product required such as high protein or pediatric clear liquid supplement. + + + The product or brand name of the nutritional supplement product to be provided to the patient. + + + + + The time period and frequency at which the supplement(s) should be given. + + The amount of the nutritional supplement product to provide to the patient. - - - The product or brand name of the nutritional supplement product to be provided to the patient. - - @@ -15720,17 +15950,22 @@ Terminologies used often pre-coordinate this term with the route and or form of Indicates the type of enteral or infant formula requested 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 to be provided to the patient. + + + The time period and frequency at which the enteral formula should be delivered to the patient. + + 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. @@ -15878,11 +16113,13 @@ Terminologies used often pre-coordinate this term with the route and or form of 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. @@ -15911,7 +16148,7 @@ other observer (for example a relative or EMT), or any observation made about th - The healthcare event ( e.g. a patient and healthcare provider interaction ) that relates to this observation. + The healthcare event ( e.g. a patient and healthcare provider interaction ) during which this observation is made. @@ -21646,11 +21883,13 @@ other observer (for example a relative or EMT), or any observation made about th 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 element is not used for environmental specimens. - - + + + + @@ -22276,7 +22515,7 @@ other observer (for example a relative or EMT), or any observation made about th The time the dispense event occurred. - + The time the dispensed item was sent or handed to the patient (or agent). diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/JsonParserTest.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/JsonParserTest.java index 0a74080ca96..4030fae2d7c 100644 --- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/JsonParserTest.java +++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/JsonParserTest.java @@ -93,10 +93,15 @@ public class JsonParserTest { " \"url\" : \"http://localhost:52788/Binary?_pretty=true\"\n" + " }],\n" + " \"entry\" : [{\n" + - " \"base\" : \"http://foo/fhirBase2\",\n" + - " \"status\" : \"match\",\n" + - " \"search\" : \"http://foo/Patient?identifier=value\",\n" + - " \"score\" : 0.123,\n" + + " \"base\" : \"http://foo/fhirBase2\",\n" + + " \"search\" : {\n" + + " \"mode\" : \"match\",\n" + + " \"score\" : 0.123\n" + + " },\n" + + " \"transaction\" : {\n" + + " \"operation\" : \"create\",\n" + + " \"match\" : \"http://foo/Patient?identifier=value\"\n" + + " },\n" + " \"resource\" : {\n" + " \"resourceType\" : \"Patient\",\n" + " \"id\" : \"1\",\n" + @@ -117,7 +122,8 @@ public class JsonParserTest { assertEquals("http://foo/fhirBase2/Patient/1/_history/2", pt.getId().getValue()); assertEquals("2012-01-02", pt.getBirthDateElement().getValueAsString()); assertEquals("0.123", ResourceMetadataKeyEnum.ENTRY_SCORE.get(pt).getValueAsString()); - assertEquals("match", ResourceMetadataKeyEnum.ENTRY_STATUS.get(pt).getCode()); + assertEquals("match", ResourceMetadataKeyEnum.ENTRY_SEARCH_MODE.get(pt).getCode()); + assertEquals("create", ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.get(pt).getCode()); assertEquals("http://foo/Patient?identifier=value", ResourceMetadataKeyEnum.LINK_SEARCH.get(pt)); assertEquals("2001-02-22T11:22:33-05:00", ResourceMetadataKeyEnum.UPDATED.get(pt).getValueAsString()); @@ -165,17 +171,16 @@ public class JsonParserTest { assertEquals("1", parsed.getResourceMetadata().get(ResourceMetadataKeyEnum.VERSION)); assertEquals("1", parsed.getId().getVersionIdPart()); assertEquals(new InstantDt("2014-08-18T01:43:30Z"), parsed.getResourceMetadata().get(ResourceMetadataKeyEnum.UPDATED)); - assertEquals("transaction", parsed.getType().getValue()); + assertEquals("searchset", parsed.getType().getValue()); assertEquals(3, parsed.getTotalResults().getValue().intValue()); assertEquals("http://example.com/base", parsed.getLinkBase().getValue()); assertEquals("https://example.com/base/MedicationPrescription?patient=347&searchId=ff15fd40-ff71-4b48-b366-09c706bed9d0&page=2", parsed.getLinkNext().getValue()); - assertEquals("https://example.com/base/MedicationPrescription?patient=347", parsed.getLinkSelf().getValue()); + assertEquals("https://example.com/base/MedicationPrescription?patient=347&_include=MedicationPrescription.medication", parsed.getLinkSelf().getValue()); - assertEquals(1, parsed.getEntries().size()); - assertEquals("update", parsed.getEntries().get(0).getStatus().getValue()); + assertEquals(2, parsed.getEntries().size()); MedicationPrescription p = (MedicationPrescription) parsed.getEntries().get(0).getResource(); - assertEquals("Patient/example", p.getPatient().getReference().getValue()); + assertEquals("Patient/347", p.getPatient().getReference().getValue()); assertEquals("2014-08-16T05:31:17Z", ResourceMetadataKeyEnum.UPDATED.get(p).getValueAsString()); assertEquals("http://example.com/base/MedicationPrescription/3123/_history/1", p.getId().getValue()); diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/XmlParserTest.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/XmlParserTest.java index fc234468b34..fe7ce72810f 100644 --- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/XmlParserTest.java +++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/parser/XmlParserTest.java @@ -1,12 +1,7 @@ package ca.uhn.fhir.parser; -import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.emptyOrNullString; -import static org.hamcrest.Matchers.not; -import static org.junit.Assert.assertArrayEquals; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; -import static org.junit.Assert.assertTrue; +import static org.hamcrest.Matchers.*; +import static org.junit.Assert.*; import java.io.StringReader; @@ -28,7 +23,6 @@ import ca.uhn.fhir.model.dstu2.resource.MedicationPrescription; import ca.uhn.fhir.model.dstu2.resource.Organization; import ca.uhn.fhir.model.dstu2.resource.Patient; import ca.uhn.fhir.model.primitive.InstantDt; -import ca.uhn.fhir.model.valueset.BundleEntryStatusEnum; public class XmlParserTest { private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(XmlParserTest.class); @@ -62,26 +56,24 @@ public class XmlParserTest { @Test public void testParseAndEncodeBundle() throws Exception { - String content = IOUtils.toString(XmlParserTest.class.getResourceAsStream("/bundle-example(example).xml")); + String content = IOUtils.toString(XmlParserTest.class.getResourceAsStream("/bundle-example.xml")); Bundle parsed = ourCtx.newXmlParser().parseBundle(content); assertEquals("http://example.com/base/Bundle/example/_history/1", parsed.getId().getValue()); assertEquals("1", parsed.getResourceMetadata().get(ResourceMetadataKeyEnum.VERSION)); assertEquals("1", parsed.getId().getVersionIdPart()); assertEquals(new InstantDt("2014-08-18T01:43:30Z"), parsed.getResourceMetadata().get(ResourceMetadataKeyEnum.UPDATED)); - assertEquals("transaction", parsed.getType().getValue()); + assertEquals("searchset", parsed.getType().getValue()); assertEquals(3, parsed.getTotalResults().getValue().intValue()); assertEquals("http://example.com/base", parsed.getLinkBase().getValue()); assertEquals("https://example.com/base/MedicationPrescription?patient=347&searchId=ff15fd40-ff71-4b48-b366-09c706bed9d0&page=2", parsed.getLinkNext().getValue()); - assertEquals("https://example.com/base/MedicationPrescription?patient=347", parsed.getLinkSelf().getValue()); + assertEquals("https://example.com/base/MedicationPrescription?patient=347&_include=MedicationPrescription.medication", parsed.getLinkSelf().getValue()); - assertEquals(1, parsed.getEntries().size()); - assertEquals("update", parsed.getEntries().get(0).getStatus().getValue()); - assertEquals(BundleEntryStatusEnum.UPDATE, ResourceMetadataKeyEnum.ENTRY_STATUS.get(parsed.getEntries().get(0).getResource())); + assertEquals(2, parsed.getEntries().size()); assertEquals("http://foo?search", parsed.getEntries().get(0).getLinkSearch().getValue()); MedicationPrescription p = (MedicationPrescription) parsed.getEntries().get(0).getResource(); - assertEquals("Patient/example", p.getPatient().getReference().getValue()); + assertEquals("Patient/347", p.getPatient().getReference().getValue()); assertEquals("2014-08-16T05:31:17Z", ResourceMetadataKeyEnum.UPDATED.get(p).getValueAsString()); assertEquals("http://example.com/base/MedicationPrescription/3123/_history/1", p.getId().getValue()); @@ -152,9 +144,14 @@ public class XmlParserTest { " \n" + " \n" + " \n" + - " \n" + - " \n" + - " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + " \n" + " \n" + " \n" + @@ -176,7 +173,8 @@ public class XmlParserTest { assertEquals("http://foo/fhirBase2/Patient/1/_history/2", pt.getId().getValue()); assertEquals("2012-01-02", pt.getBirthDateElement().getValueAsString()); assertEquals("0.123", ResourceMetadataKeyEnum.ENTRY_SCORE.get(pt).getValueAsString()); - assertEquals("match", ResourceMetadataKeyEnum.ENTRY_STATUS.get(pt).getCode()); + assertEquals("match", ResourceMetadataKeyEnum.ENTRY_SEARCH_MODE.get(pt).getCode()); + assertEquals("create", ResourceMetadataKeyEnum.ENTRY_TRANSACTION_OPERATION.get(pt).getCode()); assertEquals("http://foo/Patient?identifier=value", ResourceMetadataKeyEnum.LINK_SEARCH.get(pt)); assertEquals("2001-02-22T11:22:33-05:00", ResourceMetadataKeyEnum.UPDATED.get(pt).getValueAsString()); diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/client/ClientServerValidationTestDev.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/client/ClientServerValidationTestDstu2.java similarity index 81% rename from hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/client/ClientServerValidationTestDev.java rename to hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/client/ClientServerValidationTestDstu2.java index acd193430f5..70cc6c04124 100644 --- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/client/ClientServerValidationTestDev.java +++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/client/ClientServerValidationTestDstu2.java @@ -29,8 +29,9 @@ import ca.uhn.fhir.model.dstu2.resource.Conformance; import ca.uhn.fhir.rest.client.exceptions.FhirClientConnectionException; import ca.uhn.fhir.rest.server.Constants; -public class ClientServerValidationTestDev { - +public class ClientServerValidationTestDstu2 { + + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ClientServerValidationTestDstu2.class); private FhirContext myCtx; private HttpClient myHttpClient; private HttpResponse myHttpResponse; @@ -40,12 +41,12 @@ public class ClientServerValidationTestDev { myHttpClient = mock(HttpClient.class, new ReturnsDeepStubs()); myHttpResponse = mock(HttpResponse.class, new ReturnsDeepStubs()); - myCtx = FhirContext.forDstu1(); + myCtx = FhirContext.forDstu2(); myCtx.getRestfulClientFactory().setHttpClient(myHttpClient); } @Test - public void testServerReturnsAppropriateVersionDev() throws Exception { + public void testServerReturnsAppropriateVersionForDstu2() throws Exception { Conformance conf = new Conformance(); conf.setFhirVersion("0.4.0"); String msg = myCtx.newXmlParser().encodeResourceToString(conf); @@ -66,9 +67,9 @@ public class ClientServerValidationTestDev { } @Test - public void testServerReturnsWrongVersionDev() throws Exception { + public void testServerReturnsWrongVersionForDstu2() throws Exception { Conformance conf = new Conformance(); - conf.setFhirVersion("0.8.0"); + conf.setFhirVersion("0.80"); String msg = myCtx.newXmlParser().encodeResourceToString(conf); ArgumentCaptor capt = ArgumentCaptor.forClass(HttpUriRequest.class); @@ -84,7 +85,11 @@ public class ClientServerValidationTestDev { myCtx.newRestfulGenericClient("http://foo"); fail(); } catch (FhirClientConnectionException e) { - assertThat(e.toString(), containsString("The server at base URL \"http://foo/metadata\" returned a conformance statement indicating that it supports FHIR version \"0.4\" which corresponds to DSTU2, but this client is configured to use DSTU1 (at FhirContext creation time)")); + String out = e.toString(); + String want = "The server at base URL \"http://foo/metadata\" returned a conformance statement indicating that it supports FHIR version \"0.80\" which corresponds to DSTU1, but this client is configured to use DSTU2 (via the FhirContext)"; + ourLog.info(out); + ourLog.info(want); + assertThat(out, containsString(want)); } } } diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/IncludeTest.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/IncludeTest.java index 9f548b2639d..4f2f32d1d8c 100644 --- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/IncludeTest.java +++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/rest/server/IncludeTest.java @@ -1,8 +1,7 @@ package ca.uhn.fhir.rest.server; -import static org.hamcrest.Matchers.containsInAnyOrder; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertThat; +import static org.hamcrest.Matchers.*; +import static org.junit.Assert.*; import java.util.ArrayList; import java.util.Arrays; @@ -40,7 +39,7 @@ import ca.uhn.fhir.model.dstu2.resource.Patient; import ca.uhn.fhir.model.dstu2.resource.Practitioner; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.model.primitive.StringDt; -import ca.uhn.fhir.model.valueset.BundleEntryStatusEnum; +import ca.uhn.fhir.model.valueset.BundleEntrySearchModeEnum; import ca.uhn.fhir.rest.annotation.IncludeParam; import ca.uhn.fhir.rest.annotation.RequiredParam; import ca.uhn.fhir.rest.annotation.Search; @@ -144,7 +143,7 @@ public class IncludeTest { assertEquals(new IdDt("Patient/p1"), bundle.toListOfResources().get(0).getId().toUnqualifiedVersionless()); assertEquals(new IdDt("Patient/p2"), bundle.toListOfResources().get(1).getId().toUnqualifiedVersionless()); assertEquals(new IdDt("Organization/o1"), bundle.toListOfResources().get(2).getId().toUnqualifiedVersionless()); - assertEquals(BundleEntryStatusEnum.INCLUDE, bundle.getEntries().get(2).getStatus().getValueAsEnum()); + assertEquals(BundleEntrySearchModeEnum.INCLUDE, bundle.getEntries().get(2).getSearchMode().getValueAsEnum()); Patient p1 = (Patient) bundle.toListOfResources().get(0); assertEquals(0, p1.getContained().getContainedResources().size()); @@ -170,7 +169,7 @@ public class IncludeTest { assertEquals(new IdDt("Patient/p1"), bundle.toListOfResources().get(0).getId().toUnqualifiedVersionless()); assertEquals(new IdDt("Patient/p2"), bundle.toListOfResources().get(1).getId().toUnqualifiedVersionless()); assertEquals(new IdDt("Organization/o1"), bundle.toListOfResources().get(2).getId().toUnqualifiedVersionless()); - assertEquals(BundleEntryStatusEnum.INCLUDE, bundle.getEntries().get(2).getStatus().getValueAsEnum()); + assertEquals(BundleEntrySearchModeEnum.INCLUDE, bundle.getEntries().get(2).getSearchMode().getValueAsEnum()); Patient p1 = (Patient) bundle.toListOfResources().get(0); assertEquals(0, p1.getContained().getContainedResources().size()); @@ -196,7 +195,7 @@ public class IncludeTest { assertEquals(new IdDt("Patient/p1"), bundle.toListOfResources().get(0).getId().toUnqualifiedVersionless()); assertEquals(new IdDt("Patient/p2"), bundle.toListOfResources().get(1).getId().toUnqualifiedVersionless()); assertEquals(new IdDt("Organization/o1"), bundle.toListOfResources().get(2).getId().toUnqualifiedVersionless()); - assertEquals(BundleEntryStatusEnum.INCLUDE, bundle.getEntries().get(2).getStatus().getValueAsEnum()); + assertEquals(BundleEntrySearchModeEnum.INCLUDE, bundle.getEntries().get(2).getSearchMode().getValueAsEnum()); Patient p1 = (Patient) bundle.toListOfResources().get(0); assertEquals(0, p1.getContained().getContainedResources().size()); @@ -223,8 +222,8 @@ public class IncludeTest { assertEquals(new IdDt("Patient/p2"), bundle.toListOfResources().get(1).getId().toUnqualifiedVersionless()); assertEquals(new IdDt("Organization/o1"), bundle.toListOfResources().get(2).getId().toUnqualifiedVersionless()); assertEquals(new IdDt("Organization/o2"), bundle.toListOfResources().get(3).getId().toUnqualifiedVersionless()); - assertEquals(BundleEntryStatusEnum.INCLUDE, bundle.getEntries().get(2).getStatus().getValueAsEnum()); - assertEquals(BundleEntryStatusEnum.INCLUDE, bundle.getEntries().get(3).getStatus().getValueAsEnum()); + assertEquals(BundleEntrySearchModeEnum.INCLUDE, bundle.getEntries().get(2).getSearchMode().getValueAsEnum()); + assertEquals(BundleEntrySearchModeEnum.INCLUDE, bundle.getEntries().get(3).getSearchMode().getValueAsEnum()); Patient p1 = (Patient) bundle.toListOfResources().get(0); assertEquals(0, p1.getContained().getContainedResources().size()); diff --git a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/validation/ResourceValidatorTest.java b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/validation/ResourceValidatorTest.java index 3dc9cfaa341..de90f1a85d4 100644 --- a/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/validation/ResourceValidatorTest.java +++ b/hapi-fhir-structures-dstu2/src/test/java/ca/uhn/fhir/validation/ResourceValidatorTest.java @@ -136,14 +136,15 @@ public class ResourceValidatorTest { String res = IOUtils.toString(getClass().getClassLoader().getResourceAsStream("bundle-example.json")); Bundle b = ourCtx.newJsonParser().parseBundle(res); + ourLog.info(ourCtx.newXmlParser().setPrettyPrint(true).encodeBundleToString(b)); + FhirValidator val = createFhirValidator(); ValidationResult result = val.validateWithResult(b); + OperationOutcome operationOutcome = (OperationOutcome) result.getOperationOutcome(); - ourLog.info(ourCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(operationOutcome)); - - assertTrue(result.isSuccessful()); + assertTrue(result.toString(), result.isSuccessful()); assertNotNull(operationOutcome); assertEquals(0, operationOutcome.getIssue().size()); } diff --git a/hapi-fhir-structures-dstu2/src/test/resources/bundle-example(example).xml b/hapi-fhir-structures-dstu2/src/test/resources/bundle-example(example).xml deleted file mode 100644 index 959a02b04cb..00000000000 --- a/hapi-fhir-structures-dstu2/src/test/resources/bundle-example(example).xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Penicillin VK 5ml suspension to be administered by oral route

-

ONE 5ml spoonful to be taken THREE times a day

-

100ml bottle

-

to patient ref: a23

-

by doctor X

-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
\ No newline at end of file diff --git a/hapi-fhir-structures-dstu2/src/test/resources/bundle-example.json b/hapi-fhir-structures-dstu2/src/test/resources/bundle-example.json index 301599b2f6e..40a17b8d446 100644 --- a/hapi-fhir-structures-dstu2/src/test/resources/bundle-example.json +++ b/hapi-fhir-structures-dstu2/src/test/resources/bundle-example.json @@ -5,7 +5,7 @@ "versionId": "1", "lastUpdated": "2014-08-18T01:43:30Z" }, - "type": "transaction", + "type": "searchset", "base": "http://example.com/base", "total": 3, "link": [ @@ -15,68 +15,38 @@ }, { "relation": "self", - "url": "https://example.com/base/MedicationPrescription?patient=347" + "url": "https://example.com/base/MedicationPrescription?patient=347&_include=MedicationPrescription.medication" } ], "entry": [ { - "status": "update", + "search": { + "mode": "match", + "score": 1 + }, "resource": { "resourceType": "MedicationPrescription", "id": "3123", - "meta": { - "versionId": "1", - "lastUpdated": "2014-08-16T05:31:17Z" + "meta" : { + "versionId" : "1", + "lastUpdated" : "2014-08-16T05:31:17Z" }, - "text": { - "status": "generated", - "div": "
\n

Penicillin VK 5ml suspension to be administered by oral route

\n

ONE 5ml spoonful to be taken THREE times a day

\n

100ml bottle

\n

to patient ref: a23

\n

by doctor X

\n
" - }, - "status": "active", "patient": { - "reference": "Patient/example" - }, - "prescriber": { - "reference": "Practitioner/example" + "reference": "Patient/347" }, "medication": { "reference": "Medication/example" - }, - "dosageInstruction": [ - { - "scheduledTiming": { - "repeat": { - "frequency": 3, - "duration": 1, - "units": "d" - } - }, - "route": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "394899003", - "display": "oral administration of treatment" - } - ] - }, - "doseQuantity": { - "value": 5, - "units": "ml", - "system": "http://unitsofmeasure.org", - "code": "ml" - } - } - ], - "dispense": { - "quantity": { - "value": 100, - "units": "ml", - "system": "http://unitsofmeasure.org", - "code": "ml" - } } } + }, + { + "search": { + "mode": "include" + }, + "resource": { + "resourceType": "Medication", + "id": "example" + } } ] } \ No newline at end of file diff --git a/hapi-fhir-structures-dstu2/src/test/resources/bundle-example.xml b/hapi-fhir-structures-dstu2/src/test/resources/bundle-example.xml index 6ccd117bec3..7615d06b793 100644 --- a/hapi-fhir-structures-dstu2/src/test/resources/bundle-example.xml +++ b/hapi-fhir-structures-dstu2/src/test/resources/bundle-example.xml @@ -1,12 +1,11 @@ - - + - - + + @@ -14,72 +13,40 @@ - + - + + + + + + + - - - - - -
-

Penicillin VK 5ml suspension to be administered by oral route

-

ONE 5ml spoonful to be taken THREE times a day

-

100ml bottle

-

to patient ref: a23

-

by doctor X

-
-
- + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ + + + + + + + + +
\ No newline at end of file diff --git a/pom.xml b/pom.xml index af00dd9944e..af447e2f65f 100644 --- a/pom.xml +++ b/pom.xml @@ -601,22 +601,6 @@ - - org.codehaus.mojo - findbugs-maven-plugin - 3.0.0 - - ./hapi-fhir-base/target/classes - - - - - findbugs - - - - - @@ -687,6 +671,25 @@ hapi-fhir-jpaserver-base examples + + + + org.codehaus.mojo + findbugs-maven-plugin + 3.0.0 + + ./hapi-fhir-base/target/classes + + + + + findbugs + + + + + + ALLMODULES diff --git a/src/site/site.xml.orig b/src/site/site.xml.orig deleted file mode 100644 index 794aea4f889..00000000000 --- a/src/site/site.xml.orig +++ /dev/null @@ -1,124 +0,0 @@ - - - - - HAPI - images/hapi_fhir_banner.png - http://jamesagnew.github.io/hapi-fhir/ - - - - FHIR - images/hapi_fhir_banner_right.png - http://jamesagnew.github.io/hapi-fhir/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<<<<<<< HEAD:src/site/site.xml - - - -======= - - - ->>>>>>> d22a35788f57e9f7ce64bc8afc2ee7eaf29d94f2:src/site/site.xml - - - - - - - - - - - - - - - org.apache.maven.skins - maven-fluido-skin - 1.3.1 - - - - - - - - - - -