diff --git a/example-projects/hapi-fhir-base-example-embedded-ws/pom.xml b/example-projects/hapi-fhir-base-example-embedded-ws/pom.xml
index ec907913df1..80e1330ca7d 100644
--- a/example-projects/hapi-fhir-base-example-embedded-ws/pom.xml
+++ b/example-projects/hapi-fhir-base-example-embedded-ws/pom.xml
@@ -4,7 +4,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 3.7.0
+ 3.8.0-SNAPSHOT
../../pom.xml
diff --git a/example-projects/hapi-fhir-jpaserver-cds-example/pom.xml b/example-projects/hapi-fhir-jpaserver-cds-example/pom.xml
index 747969ff8fb..a8f9343d377 100644
--- a/example-projects/hapi-fhir-jpaserver-cds-example/pom.xml
+++ b/example-projects/hapi-fhir-jpaserver-cds-example/pom.xml
@@ -10,7 +10,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 3.7.0
+ 3.8.0-SNAPSHOT
../../pom.xml
diff --git a/example-projects/hapi-fhir-jpaserver-dynamic/pom.xml b/example-projects/hapi-fhir-jpaserver-dynamic/pom.xml
index fdadc1732e8..1d1616d3f5a 100644
--- a/example-projects/hapi-fhir-jpaserver-dynamic/pom.xml
+++ b/example-projects/hapi-fhir-jpaserver-dynamic/pom.xml
@@ -10,7 +10,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 3.7.0
+ 3.8.0-SNAPSHOT
../../pom.xml
diff --git a/example-projects/hapi-fhir-jpaserver-example-postgres/pom.xml b/example-projects/hapi-fhir-jpaserver-example-postgres/pom.xml
index 342a460b37e..75cf9c63ac4 100644
--- a/example-projects/hapi-fhir-jpaserver-example-postgres/pom.xml
+++ b/example-projects/hapi-fhir-jpaserver-example-postgres/pom.xml
@@ -10,7 +10,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 3.7.0
+ 3.8.0-SNAPSHOT
../../pom.xml
diff --git a/example-projects/hapi-fhir-standalone-overlay-example/pom.xml b/example-projects/hapi-fhir-standalone-overlay-example/pom.xml
index 55987abe2d9..86de1147a06 100644
--- a/example-projects/hapi-fhir-standalone-overlay-example/pom.xml
+++ b/example-projects/hapi-fhir-standalone-overlay-example/pom.xml
@@ -4,7 +4,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 3.7.0
+ 3.8.0-SNAPSHOT
../../pom.xml
hapi-fhir-standalone-overlay-example
diff --git a/examples/pom.xml b/examples/pom.xml
index 54495f97821..67954539d09 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 3.7.0
+ 3.8.0-SNAPSHOT
../pom.xml
diff --git a/hapi-deployable-pom/pom.xml b/hapi-deployable-pom/pom.xml
index 2de01a01948..ed19d054d30 100644
--- a/hapi-deployable-pom/pom.xml
+++ b/hapi-deployable-pom/pom.xml
@@ -4,7 +4,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 3.7.0
+ 3.8.0-SNAPSHOT
../pom.xml
diff --git a/hapi-fhir-android/pom.xml b/hapi-fhir-android/pom.xml
index 0e3d907e1aa..751b20037f9 100644
--- a/hapi-fhir-android/pom.xml
+++ b/hapi-fhir-android/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 3.7.0
+ 3.8.0-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-base/pom.xml b/hapi-fhir-base/pom.xml
index 52b1bec6ada..42fdfa2f678 100644
--- a/hapi-fhir-base/pom.xml
+++ b/hapi-fhir-base/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 3.7.0
+ 3.8.0-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/BaseParser.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/BaseParser.java
index 7d62296e836..4139c11e86e 100644
--- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/BaseParser.java
+++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/BaseParser.java
@@ -9,9 +9,9 @@ package ca.uhn.fhir.parser;
* 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.
@@ -63,7 +63,6 @@ public abstract class BaseParser implements IParser {
private boolean mySummaryMode;
private boolean mySuppressNarratives;
private Set myDontStripVersionsFromReferencesAtPaths;
-
/**
* Constructor
*/
@@ -72,6 +71,55 @@ public abstract class BaseParser implements IParser {
myErrorHandler = theParserErrorHandler;
}
+ List getDontEncodeElements() {
+ return myDontEncodeElements;
+ }
+
+ @Override
+ public void setDontEncodeElements(Set theDontEncodeElements) {
+ if (theDontEncodeElements == null || theDontEncodeElements.isEmpty()) {
+ myDontEncodeElements = null;
+ } else {
+ myDontEncodeElements = theDontEncodeElements
+ .stream()
+ .map(ElementsPath::new)
+ .collect(Collectors.toList());
+ }
+ }
+
+ List getEncodeElements() {
+ return myEncodeElements;
+ }
+
+ @Override
+ public void setEncodeElements(Set theEncodeElements) {
+
+ if (theEncodeElements == null || theEncodeElements.isEmpty()) {
+ myEncodeElements = null;
+ myEncodeElementsAppliesToResourceTypes = null;
+ } else {
+ myEncodeElements = theEncodeElements
+ .stream()
+ .map(ElementsPath::new)
+ .collect(Collectors.toList());
+
+ myEncodeElementsAppliesToResourceTypes = new HashSet<>();
+ for (String next : myEncodeElements.stream().map(t -> t.getPath().get(0).getName()).collect(Collectors.toList())) {
+ if (next.startsWith("*")) {
+ myEncodeElementsAppliesToResourceTypes = null;
+ break;
+ }
+ int dotIdx = next.indexOf('.');
+ if (dotIdx == -1) {
+ myEncodeElementsAppliesToResourceTypes.add(next);
+ } else {
+ myEncodeElementsAppliesToResourceTypes.add(next.substring(0, dotIdx));
+ }
+ }
+
+ }
+ }
+
protected Iterable compositeChildIterator(IBase theCompositeElement, final boolean theContainedResource, final CompositeChildElement theParent, EncodeContext theEncodeContext) {
BaseRuntimeElementCompositeDefinition> elementDef = (BaseRuntimeElementCompositeDefinition>) myContext.getElementDefinition(theCompositeElement.getClass());
@@ -402,35 +450,6 @@ public abstract class BaseParser implements IParser {
return myDontStripVersionsFromReferencesAtPaths;
}
- @Override
- public void setEncodeElements(Set theEncodeElements) {
-
- if (theEncodeElements == null || theEncodeElements.isEmpty()) {
- myEncodeElements = null;
- myEncodeElementsAppliesToResourceTypes = null;
- } else {
- myEncodeElements = theEncodeElements
- .stream()
- .map(ElementsPath::new)
- .collect(Collectors.toList());
-
- myEncodeElementsAppliesToResourceTypes = new HashSet<>();
- for (String next : myEncodeElements.stream().map(t -> t.getPath().get(0).getName()).collect(Collectors.toList())) {
- if (next.startsWith("*")) {
- myEncodeElementsAppliesToResourceTypes = null;
- break;
- }
- int dotIdx = next.indexOf('.');
- if (dotIdx == -1) {
- myEncodeElementsAppliesToResourceTypes.add(next);
- } else {
- myEncodeElementsAppliesToResourceTypes.add(next.substring(0, dotIdx));
- }
- }
-
- }
- }
-
@Override
public IIdType getEncodeForceResourceId() {
return myEncodeForceResourceId;
@@ -803,18 +822,6 @@ public abstract class BaseParser implements IParser {
}
}
- @Override
- public void setDontEncodeElements(Set theDontEncodeElements) {
- if (theDontEncodeElements == null || theDontEncodeElements.isEmpty()) {
- myDontEncodeElements = null;
- } else {
- myDontEncodeElements = theDontEncodeElements
- .stream()
- .map(ElementsPath::new)
- .collect(Collectors.toList());
- }
- }
-
@Override
public IParser setDontStripVersionsFromReferencesAtPaths(String... thePaths) {
if (thePaths == null) {
@@ -936,7 +943,7 @@ public abstract class BaseParser implements IParser {
String resourceName = myContext.getResourceDefinition(theResource).getName();
if (myDontEncodeElements.stream().anyMatch(t -> t.equalsPath(resourceName + "." + thePath))) {
return false;
- } else if (myDontEncodeElements.stream().anyMatch(t -> t.equalsPath("*."+ thePath))) {
+ } else if (myDontEncodeElements.stream().anyMatch(t -> t.equalsPath("*." + thePath))) {
return false;
}
}
@@ -963,6 +970,17 @@ public abstract class BaseParser implements IParser {
throw new DataFormatException(nextChild + " has no child of type " + theType);
}
+ protected boolean shouldEncodeResource(String theName) {
+ if (myDontEncodeElements != null) {
+ for (ElementsPath next : myDontEncodeElements) {
+ if (next.equalsPath(theName)) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
class ChildNameAndDef {
private final BaseRuntimeElementDefinition> myChildDef;
@@ -1289,9 +1307,23 @@ public abstract class BaseParser implements IParser {
if (myResource != theOther.isResource()) {
return false;
}
- if (myName.equals(theOther.getName())) {
+ String otherName = theOther.getName();
+ if (myName.equals(otherName)) {
return true;
}
+ /*
+ * This is here to handle situations where a path like
+ * Observation.valueQuantity has been specified as an include/exclude path,
+ * since we only know that path as
+ * Observation.value
+ * until we get to actually looking at the values there.
+ */
+ if (myName.length() > otherName.length() && myName.startsWith(otherName)) {
+ char ch = myName.charAt(otherName.length());
+ if (Character.isUpperCase(ch)) {
+ return true;
+ }
+ }
if (myName.equals("*")) {
return true;
}
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 4c6e3ea532b..bd032d34192 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
@@ -410,8 +410,17 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
continue;
}
- String childName = childNameAndDef.getChildName();
- theEncodeContext.pushPath(childName, false);
+ /*
+ * Often the two values below will be the same thing. There are cases though
+ * where they will not be. An example would be Observation.value, which is
+ * a choice type. If the value contains a Quantity, then:
+ * nextChildGenericName = "value"
+ * nextChildSpecificName = "valueQuantity"
+ */
+ String nextChildSpecificName = childNameAndDef.getChildName();
+ String nextChildGenericName = nextChild.getElementName();
+
+ theEncodeContext.pushPath(nextChildGenericName, false);
BaseRuntimeElementDefinition> childDef = childNameAndDef.getChildDef();
boolean primitive = childDef.getChildType() == ChildTypeEnum.PRIMITIVE_DATATYPE;
@@ -451,20 +460,20 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
}
}
- if (currentChildName == null || !currentChildName.equals(childName)) {
+ if (currentChildName == null || !currentChildName.equals(nextChildSpecificName)) {
if (inArray) {
theEventWriter.endArray();
}
if (nextChild.getMax() > 1 || nextChild.getMax() == Child.MAX_UNLIMITED) {
- beginArray(theEventWriter, childName);
+ beginArray(theEventWriter, nextChildSpecificName);
inArray = true;
encodeChildElementToStreamWriter(theResDef, theResource, theEventWriter, nextValue, childDef, null, theContainedResource, nextChildElem, force, theEncodeContext);
} else if (nextChild instanceof RuntimeChildNarrativeDefinition && theContainedResource) {
// suppress narratives from contained resources
} else {
- encodeChildElementToStreamWriter(theResDef, theResource, theEventWriter, nextValue, childDef, childName, theContainedResource, nextChildElem, false, theEncodeContext);
+ encodeChildElementToStreamWriter(theResDef, theResource, theEventWriter, nextValue, childDef, nextChildSpecificName, theContainedResource, nextChildElem, false, theEncodeContext);
}
- currentChildName = childName;
+ currentChildName = nextChildSpecificName;
} else {
encodeChildElementToStreamWriter(theResDef, theResource, theEventWriter, nextValue, childDef, null, theContainedResource, nextChildElem, force, theEncodeContext);
}
@@ -594,6 +603,11 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
private void encodeResourceToJsonStreamWriter(RuntimeResourceDefinition theResDef, IBaseResource theResource, JsonLikeWriter theEventWriter, String theObjectNameOrNull,
boolean theContainedResource, IIdType theResourceId, EncodeContext theEncodeContext) throws IOException {
+
+ if (!super.shouldEncodeResource(theResDef.getName())) {
+ return;
+ }
+
if (!theContainedResource) {
super.containResourcesForEncoding(theResource);
}
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 70dfd9ac21e..88327cecede 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
@@ -215,9 +215,19 @@ public class XmlParser extends BaseParser /* implements IParser */ {
}
}
- private void encodeChildElementToStreamWriter(IBaseResource theResource, XMLStreamWriter theEventWriter, IBase theElement, String childName, BaseRuntimeElementDefinition> childDef,
+ private void encodeChildElementToStreamWriter(IBaseResource theResource, XMLStreamWriter theEventWriter, BaseRuntimeChildDefinition theChildDefinition, IBase theElement, String theChildName, BaseRuntimeElementDefinition> childDef,
String theExtensionUrl, boolean theIncludedResource, CompositeChildElement theParent, EncodeContext theEncodeContext) throws XMLStreamException, DataFormatException {
- theEncodeContext.pushPath(childName, false);
+
+ /*
+ * Often the two values below will be the same thing. There are cases though
+ * where they will not be. An example would be Observation.value, which is
+ * a choice type. If the value contains a Quantity, then:
+ * childGenericName = "value"
+ * theChildName = "valueQuantity"
+ */
+ String childGenericName = theChildDefinition.getElementName();
+
+ theEncodeContext.pushPath(childGenericName, false);
try {
if (theElement == null || theElement.isEmpty()) {
@@ -233,9 +243,9 @@ public class XmlParser extends BaseParser /* implements IParser */ {
switch (childDef.getChildType()) {
case ID_DATATYPE: {
IIdType value = IIdType.class.cast(theElement);
- String encodedValue = "id".equals(childName) ? value.getIdPart() : value.getValue();
+ String encodedValue = "id".equals(theChildName) ? value.getIdPart() : value.getValue();
if (StringUtils.isNotBlank(encodedValue) || !super.hasNoExtensions(value)) {
- theEventWriter.writeStartElement(childName);
+ theEventWriter.writeStartElement(theChildName);
if (StringUtils.isNotBlank(encodedValue)) {
theEventWriter.writeAttribute("value", encodedValue);
}
@@ -248,7 +258,7 @@ public class XmlParser extends BaseParser /* implements IParser */ {
IPrimitiveType> pd = IPrimitiveType.class.cast(theElement);
String value = pd.getValueAsString();
if (value != null || !super.hasNoExtensions(pd)) {
- theEventWriter.writeStartElement(childName);
+ theEventWriter.writeStartElement(theChildName);
String elementId = getCompositeElementId(theElement);
if (isNotBlank(elementId)) {
theEventWriter.writeAttribute("id", elementId);
@@ -263,7 +273,7 @@ public class XmlParser extends BaseParser /* implements IParser */ {
}
case RESOURCE_BLOCK:
case COMPOSITE_DATATYPE: {
- theEventWriter.writeStartElement(childName);
+ theEventWriter.writeStartElement(theChildName);
String elementId = getCompositeElementId(theElement);
if (isNotBlank(elementId)) {
theEventWriter.writeAttribute("id", elementId);
@@ -291,9 +301,12 @@ public class XmlParser extends BaseParser /* implements IParser */ {
break;
}
case RESOURCE: {
- theEventWriter.writeStartElement(childName);
IBaseResource resource = (IBaseResource) theElement;
String resourceName = myContext.getResourceDefinition(resource).getName();
+ if (!super.shouldEncodeResource(resourceName)) {
+ break;
+ }
+ theEventWriter.writeStartElement(theChildName);
theEncodeContext.pushPath(resourceName, true);
encodeResourceToXmlStreamWriter(resource, theEventWriter, false, theEncodeContext);
theEncodeContext.popPath();
@@ -364,13 +377,13 @@ public class XmlParser extends BaseParser /* implements IParser */ {
RuntimeChildNarrativeDefinition child = (RuntimeChildNarrativeDefinition) nextChild;
String childName = nextChild.getChildNameByDatatype(child.getDatatype());
BaseRuntimeElementDefinition> type = child.getChildByName(childName);
- encodeChildElementToStreamWriter(theResource, theEventWriter, narr, childName, type, null, theContainedResource, nextChildElem, theEncodeContext);
+ encodeChildElementToStreamWriter(theResource, theEventWriter, nextChild, narr, childName, type, null, theContainedResource, nextChildElem, theEncodeContext);
continue;
}
}
if (nextChild instanceof RuntimeChildContainedResources) {
- encodeChildElementToStreamWriter(theResource, theEventWriter, null, nextChild.getChildNameByDatatype(null), nextChild.getChildElementDefinitionByDatatype(null), null, theContainedResource, nextChildElem, theEncodeContext);
+ encodeChildElementToStreamWriter(theResource, theEventWriter, nextChild, null, nextChild.getChildNameByDatatype(null), nextChild.getChildElementDefinitionByDatatype(null), null, theContainedResource, nextChildElem, theEncodeContext);
} else {
List extends IBase> values = nextChild.getAccessor().getValues(theElement);
@@ -402,11 +415,11 @@ public class XmlParser extends BaseParser /* implements IParser */ {
continue;
}
}
- encodeChildElementToStreamWriter(theResource, theEventWriter, nextValue, childName, childDef, getExtensionUrl(extension.getUrl()), theContainedResource, nextChildElem, theEncodeContext);
+ encodeChildElementToStreamWriter(theResource, theEventWriter, nextChild, nextValue, childName, childDef, getExtensionUrl(extension.getUrl()), theContainedResource, nextChildElem, theEncodeContext);
} else if (nextChild instanceof RuntimeChildNarrativeDefinition && theContainedResource) {
// suppress narratives from contained resources
} else {
- encodeChildElementToStreamWriter(theResource, theEventWriter, nextValue, childName, childDef, extensionUrl, theContainedResource, nextChildElem, theEncodeContext);
+ encodeChildElementToStreamWriter(theResource, theEventWriter, nextChild, nextValue, childName, childDef, extensionUrl, theContainedResource, nextChildElem, theEncodeContext);
}
}
@@ -429,7 +442,7 @@ public class XmlParser extends BaseParser /* implements IParser */ {
}
theEventWriter.writeAttribute("url", extensionUrl);
- encodeChildElementToStreamWriter(theResource, theEventWriter, nextValue, childName, childDef, null, theContainedResource, nextChildElem, theEncodeContext);
+ encodeChildElementToStreamWriter(theResource, theEventWriter, nextChild, nextValue, childName, childDef, null, theContainedResource, nextChildElem, theEncodeContext);
theEventWriter.writeEndElement();
}
@@ -471,15 +484,15 @@ public class XmlParser extends BaseParser /* implements IParser */ {
}
private void encodeResourceToXmlStreamWriter(IBaseResource theResource, XMLStreamWriter theEventWriter, boolean theContainedResource, IIdType theResourceId, EncodeContext theEncodeContext) throws XMLStreamException {
- if (!theContainedResource) {
- super.containResourcesForEncoding(theResource);
- }
-
RuntimeResourceDefinition resDef = myContext.getResourceDefinition(theResource);
if (resDef == null) {
throw new ConfigurationException("Unknown resource type: " + theResource.getClass());
}
+ if (!theContainedResource) {
+ super.containResourcesForEncoding(theResource);
+ }
+
theEventWriter.writeStartElement(resDef.getName());
theEventWriter.writeDefaultNamespace(FHIR_NS);
@@ -609,7 +622,7 @@ public class XmlParser extends BaseParser /* implements IParser */ {
throw new ConfigurationException("Unable to encode extension, unrecognized child element type: " + value.getClass().getCanonicalName());
}
}
- encodeChildElementToStreamWriter(theResource, theEventWriter, value, childName, childDef, null, theIncludedResource, null, theEncodeContext);
+ encodeChildElementToStreamWriter(theResource, theEventWriter, extDef, value, childName, childDef, null, theIncludedResource, null, theEncodeContext);
}
// child extensions
diff --git a/hapi-fhir-cli/hapi-fhir-cli-api/pom.xml b/hapi-fhir-cli/hapi-fhir-cli-api/pom.xml
index 6428e7eb9b7..f90dea9dd1f 100644
--- a/hapi-fhir-cli/hapi-fhir-cli-api/pom.xml
+++ b/hapi-fhir-cli/hapi-fhir-cli-api/pom.xml
@@ -4,7 +4,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 3.7.0
+ 3.8.0-SNAPSHOT
../../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-cli/hapi-fhir-cli-app/pom.xml b/hapi-fhir-cli/hapi-fhir-cli-app/pom.xml
index abcfc9ddac0..c228b3c0bff 100644
--- a/hapi-fhir-cli/hapi-fhir-cli-app/pom.xml
+++ b/hapi-fhir-cli/hapi-fhir-cli-app/pom.xml
@@ -6,7 +6,7 @@
ca.uhn.hapi.fhir
hapi-fhir-cli
- 3.7.0
+ 3.8.0-SNAPSHOT
../pom.xml
diff --git a/hapi-fhir-cli/hapi-fhir-cli-jpaserver/pom.xml b/hapi-fhir-cli/hapi-fhir-cli-jpaserver/pom.xml
index dcd4271f02a..56c5cf80105 100644
--- a/hapi-fhir-cli/hapi-fhir-cli-jpaserver/pom.xml
+++ b/hapi-fhir-cli/hapi-fhir-cli-jpaserver/pom.xml
@@ -6,7 +6,7 @@
ca.uhn.hapi.fhir
hapi-fhir-cli
- 3.7.0
+ 3.8.0-SNAPSHOT
../pom.xml
diff --git a/hapi-fhir-cli/pom.xml b/hapi-fhir-cli/pom.xml
index 9624aa6997a..36a508737b7 100644
--- a/hapi-fhir-cli/pom.xml
+++ b/hapi-fhir-cli/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 3.7.0
+ 3.8.0-SNAPSHOT
../pom.xml
diff --git a/hapi-fhir-client-okhttp/pom.xml b/hapi-fhir-client-okhttp/pom.xml
index bfb7c838e0f..97c36c42338 100644
--- a/hapi-fhir-client-okhttp/pom.xml
+++ b/hapi-fhir-client-okhttp/pom.xml
@@ -4,7 +4,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 3.7.0
+ 3.8.0-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-client/pom.xml b/hapi-fhir-client/pom.xml
index c32fc7e0336..52bb34401af 100644
--- a/hapi-fhir-client/pom.xml
+++ b/hapi-fhir-client/pom.xml
@@ -4,7 +4,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 3.7.0
+ 3.8.0-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-converter/pom.xml b/hapi-fhir-converter/pom.xml
index bba64a54785..bcce41b8e78 100644
--- a/hapi-fhir-converter/pom.xml
+++ b/hapi-fhir-converter/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 3.7.0
+ 3.8.0-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-dist/pom.xml b/hapi-fhir-dist/pom.xml
index 8ad3a11db74..ce77c5e1f53 100644
--- a/hapi-fhir-dist/pom.xml
+++ b/hapi-fhir-dist/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 3.7.0
+ 3.8.0-SNAPSHOT
../pom.xml
diff --git a/hapi-fhir-igpacks/pom.xml b/hapi-fhir-igpacks/pom.xml
index e0bfaf74518..3969dcef1fc 100644
--- a/hapi-fhir-igpacks/pom.xml
+++ b/hapi-fhir-igpacks/pom.xml
@@ -5,7 +5,7 @@
hapi-deployable-pom
ca.uhn.hapi.fhir
- 3.7.0
+ 3.8.0-SNAPSHOT
../hapi-deployable-pom/pom.xml
4.0.0
diff --git a/hapi-fhir-jacoco/pom.xml b/hapi-fhir-jacoco/pom.xml
index 95583e4c200..d3ede7ebf75 100644
--- a/hapi-fhir-jacoco/pom.xml
+++ b/hapi-fhir-jacoco/pom.xml
@@ -11,7 +11,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 3.7.0
+ 3.8.0-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-jaxrsserver-base/pom.xml b/hapi-fhir-jaxrsserver-base/pom.xml
index 5338aaadbbf..9dc1ad08f9a 100644
--- a/hapi-fhir-jaxrsserver-base/pom.xml
+++ b/hapi-fhir-jaxrsserver-base/pom.xml
@@ -4,7 +4,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 3.7.0
+ 3.8.0-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/util/JaxRsRequest.java b/hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/util/JaxRsRequest.java
index 369aa6bd0b6..9aafeb9511c 100644
--- a/hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/util/JaxRsRequest.java
+++ b/hapi-fhir-jaxrsserver-base/src/main/java/ca/uhn/fhir/jaxrs/server/util/JaxRsRequest.java
@@ -9,9 +9,9 @@ package ca.uhn.fhir.jaxrs.server.util;
* 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.
@@ -19,206 +19,54 @@ package ca.uhn.fhir.jaxrs.server.util;
* limitations under the License.
* #L%
*/
-import java.io.*;
-import java.nio.charset.Charset;
-import java.util.Collections;
-import java.util.List;
-
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.MediaType;
-
-import org.apache.commons.lang3.StringUtils;
import ca.uhn.fhir.context.ConfigurationException;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.jaxrs.server.AbstractJaxRsProvider;
-import ca.uhn.fhir.rest.api.*;
+import ca.uhn.fhir.rest.api.Constants;
+import ca.uhn.fhir.rest.api.RequestTypeEnum;
+import ca.uhn.fhir.rest.api.RestOperationTypeEnum;
import ca.uhn.fhir.rest.api.server.IRestfulResponse;
import ca.uhn.fhir.rest.api.server.RequestDetails;
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
import ca.uhn.fhir.rest.server.method.ResourceParameter;
import ca.uhn.fhir.util.UrlUtil;
+import org.apache.commons.lang3.StringUtils;
+
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.MediaType;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+import java.nio.charset.Charset;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
/**
- * The JaxRsRequest is a jax-rs specific implementation of the RequestDetails.
- *
+ * The JaxRsRequest is a jax-rs specific implementation of the RequestDetails.
+ *
* @author Peter Van Houte | peter.vanhoute@agfa.com | Agfa Healthcare
*/
public class JaxRsRequest extends RequestDetails {
- /**
- * An implementation of the builder pattern for the JaxRsRequest
- */
- public static class Builder {
- private String myCompartment;
- private String myId;
- private RequestTypeEnum myRequestType;
- private String myRequestUrl;
- private String myResource;
- private final String myResourceName;
- private RestOperationTypeEnum myRestOperation;
- private AbstractJaxRsProvider myServer;
- private String myVersion;
-
- /**
- * Utility Constructor
- * @param theServer the server
- * @param theRequestType the request type
- * @param theRestOperation the rest operation
- * @param theRequestUrl
- */
- public Builder(AbstractJaxRsProvider theServer, RequestTypeEnum theRequestType,
- RestOperationTypeEnum theRestOperation, String theRequestUrl, String theResourceName) {
- this.myServer = theServer;
- this.myRequestType = theRequestType;
- this.myRestOperation = theRestOperation;
- this.myRequestUrl = theRequestUrl;
- this.myResourceName = theResourceName;
- }
-
- /**
- * Create the jax-rs request
- * @return the jax-rs request
- */
- public JaxRsRequest build() {
- JaxRsRequest result = new JaxRsRequest(myServer, myResource, myRequestType, myRestOperation);
- if ((StringUtils.isNotBlank(myVersion) || StringUtils.isNotBlank(myCompartment))
- && StringUtils.isBlank(myId)) {
- throw new InvalidRequestException("Don't know how to handle request path: "
- + myServer.getUriInfo().getRequestUri().toASCIIString());
- }
-
- FhirVersionEnum fhirContextVersion = myServer.getFhirContext().getVersion().getVersion();
-
- if (StringUtils.isNotBlank(myVersion)) {
- switch (fhirContextVersion) {
- case R4:
- result.setId(new org.hl7.fhir.r4.model.IdType(myServer.getBaseForRequest(), UrlUtil.unescape(myId), UrlUtil.unescape(myVersion)));
- break;
- case DSTU3:
- result.setId(new org.hl7.fhir.dstu3.model.IdType(myServer.getBaseForRequest(), UrlUtil.unescape(myId), UrlUtil.unescape(myVersion)));
- break;
- case DSTU2_1:
- result.setId(new org.hl7.fhir.dstu2016may.model.IdType(myServer.getBaseForRequest(), UrlUtil.unescape(myId), UrlUtil.unescape(myVersion)));
- break;
- case DSTU2_HL7ORG:
- result.setId(new org.hl7.fhir.instance.model.IdType(myServer.getBaseForRequest(), UrlUtil.unescape(myId), UrlUtil.unescape(myVersion)));
- break;
- case DSTU2:
- result.setId(new ca.uhn.fhir.model.primitive.IdDt(myServer.getBaseForRequest(), UrlUtil.unescape(myId), UrlUtil.unescape(myVersion)));
- break;
- default:
- throw new ConfigurationException("Unsupported Fhir version: " + fhirContextVersion);
- }
- } else if (StringUtils.isNotBlank(myId)) {
- switch (fhirContextVersion) {
- case R4:
- result.setId(new org.hl7.fhir.r4.model.IdType(myServer.getBaseForRequest(), UrlUtil.unescape(myId)));
- break;
- case DSTU3:
- result.setId(new org.hl7.fhir.dstu3.model.IdType(myServer.getBaseForRequest(), UrlUtil.unescape(myId)));
- break;
- case DSTU2_1:
- result.setId(new org.hl7.fhir.dstu2016may.model.IdType(myServer.getBaseForRequest(), UrlUtil.unescape(myId)));
- break;
- case DSTU2_HL7ORG:
- result.setId(new org.hl7.fhir.instance.model.IdType(myServer.getBaseForRequest(), UrlUtil.unescape(myId)));
- break;
- case DSTU2:
- result.setId(new ca.uhn.fhir.model.primitive.IdDt(myServer.getBaseForRequest(), UrlUtil.unescape(myId)));
- break;
- default:
- throw new ConfigurationException("Unsupported Fhir version: " + fhirContextVersion);
- }
- }
-
- if (myRestOperation == RestOperationTypeEnum.UPDATE) {
- String contentLocation = result.getHeader(Constants.HEADER_CONTENT_LOCATION);
- if (contentLocation != null) {
- switch (fhirContextVersion) {
- case R4:
- result.setId(new org.hl7.fhir.r4.model.IdType(contentLocation));
- break;
- case DSTU3:
- result.setId(new org.hl7.fhir.dstu3.model.IdType(contentLocation));
- break;
- case DSTU2_1:
- result.setId(new org.hl7.fhir.dstu2016may.model.IdType(contentLocation));
- break;
- case DSTU2_HL7ORG:
- result.setId(new org.hl7.fhir.instance.model.IdType(contentLocation));
- break;
- case DSTU2:
- result.setId(new ca.uhn.fhir.model.primitive.IdDt(contentLocation));
- break;
- default:
- throw new ConfigurationException("Unsupported Fhir version: " + fhirContextVersion);
- }
- }
- }
-
- result.setCompartmentName(myCompartment);
- result.setCompleteUrl(myRequestUrl);
- result.setResourceName(myResourceName);
-
- return result;
- }
-
- /**
- * Set the compartment
- * @param compartment the compartment
- * @return the builder
- */
- public Builder compartment(String compartment) {
- this.myCompartment = compartment;
- return this;
- }
-
- /**
- * Set the id
- * @param id the resource id
- * @return the builder
- */
- public Builder id(String id) {
- this.myId = id;
- return this;
- }
-
- /**
- * Set the resource
- * @param resource the body contents of an http method
- * @return the builder
- */
- public Builder resource(String resource) {
- this.myResource = resource;
- return this;
- }
-
- /**
- * Set the id version
- * @param version the version of the resource
- * @return the builder
- */
- public Builder version(String version) {
- this.myVersion = version;
- return this;
- }
- }
-
private HttpHeaders myHeaders;
private String myResourceString;
private AbstractJaxRsProvider myServer;
+ private Map myAttributes = new HashMap<>();
/**
* Utility Constructor
- * @param server the server
+ *
+ * @param server the server
* @param resourceString the resource body
- * @param requestType the request type
- * @param restOperation the operation type
+ * @param requestType the request type
+ * @param restOperation the operation type
*/
public JaxRsRequest(AbstractJaxRsProvider server, String resourceString, RequestTypeEnum requestType,
- RestOperationTypeEnum restOperation) {
+ RestOperationTypeEnum restOperation) {
this.myHeaders = server.getHeaders();
this.myResourceString = resourceString;
this.setRestOperationType(restOperation);
@@ -231,17 +79,17 @@ public class JaxRsRequest extends RequestDetails {
@Override
protected byte[] getByteStreamRequestContents() {
return StringUtils.defaultString(myResourceString, "")
- .getBytes(ResourceParameter.determineRequestCharset(this));
+ .getBytes(ResourceParameter.determineRequestCharset(this));
}
@Override
public Charset getCharset() {
String charset = null;
-
- if(myHeaders.getMediaType() != null && myHeaders.getMediaType().getParameters() != null) {
+
+ if (myHeaders.getMediaType() != null && myHeaders.getMediaType().getParameters() != null) {
charset = myHeaders.getMediaType().getParameters().get(MediaType.CHARSET_PARAMETER);
}
- if(charset != null) {
+ if (charset != null) {
return Charset.forName(charset);
} else {
return null;
@@ -262,7 +110,17 @@ public class JaxRsRequest extends RequestDetails {
@Override
public List getHeaders(String name) {
List requestHeader = myHeaders.getRequestHeader(name);
- return requestHeader == null ? Collections. emptyList() : requestHeader;
+ return requestHeader == null ? Collections.emptyList() : requestHeader;
+ }
+
+ @Override
+ public Object getAttribute(String theAttributeName) {
+ return myAttributes.get(theAttributeName);
+ }
+
+ @Override
+ public void setAttribute(String theAttributeName, Object theAttributeValue) {
+ myAttributes.put(theAttributeName, theAttributeValue);
}
@Override
@@ -290,16 +148,182 @@ public class JaxRsRequest extends RequestDetails {
return myServer;
}
+ /**
+ * Set the server
+ *
+ * @param theServer the server to set
+ */
+ public void setServer(AbstractJaxRsProvider theServer) {
+ this.myServer = theServer;
+ }
+
@Override
public String getServerBaseForRequest() {
return getServer().getServerAddressStrategy().determineServerBase(null, null);
}
/**
- * Set the server
- * @param theServer the server to set
+ * An implementation of the builder pattern for the JaxRsRequest
*/
- public void setServer(AbstractJaxRsProvider theServer) {
- this.myServer = theServer;
+ public static class Builder {
+ private final String myResourceName;
+ private String myCompartment;
+ private String myId;
+ private RequestTypeEnum myRequestType;
+ private String myRequestUrl;
+ private String myResource;
+ private RestOperationTypeEnum myRestOperation;
+ private AbstractJaxRsProvider myServer;
+ private String myVersion;
+
+ /**
+ * Utility Constructor
+ *
+ * @param theServer the server
+ * @param theRequestType the request type
+ * @param theRestOperation the rest operation
+ * @param theRequestUrl
+ */
+ public Builder(AbstractJaxRsProvider theServer, RequestTypeEnum theRequestType,
+ RestOperationTypeEnum theRestOperation, String theRequestUrl, String theResourceName) {
+ this.myServer = theServer;
+ this.myRequestType = theRequestType;
+ this.myRestOperation = theRestOperation;
+ this.myRequestUrl = theRequestUrl;
+ this.myResourceName = theResourceName;
+ }
+
+ /**
+ * Create the jax-rs request
+ *
+ * @return the jax-rs request
+ */
+ public JaxRsRequest build() {
+ JaxRsRequest result = new JaxRsRequest(myServer, myResource, myRequestType, myRestOperation);
+ if ((StringUtils.isNotBlank(myVersion) || StringUtils.isNotBlank(myCompartment))
+ && StringUtils.isBlank(myId)) {
+ throw new InvalidRequestException("Don't know how to handle request path: "
+ + myServer.getUriInfo().getRequestUri().toASCIIString());
+ }
+
+ FhirVersionEnum fhirContextVersion = myServer.getFhirContext().getVersion().getVersion();
+
+ if (StringUtils.isNotBlank(myVersion)) {
+ switch (fhirContextVersion) {
+ case R4:
+ result.setId(new org.hl7.fhir.r4.model.IdType(myServer.getBaseForRequest(), UrlUtil.unescape(myId), UrlUtil.unescape(myVersion)));
+ break;
+ case DSTU3:
+ result.setId(new org.hl7.fhir.dstu3.model.IdType(myServer.getBaseForRequest(), UrlUtil.unescape(myId), UrlUtil.unescape(myVersion)));
+ break;
+ case DSTU2_1:
+ result.setId(new org.hl7.fhir.dstu2016may.model.IdType(myServer.getBaseForRequest(), UrlUtil.unescape(myId), UrlUtil.unescape(myVersion)));
+ break;
+ case DSTU2_HL7ORG:
+ result.setId(new org.hl7.fhir.instance.model.IdType(myServer.getBaseForRequest(), UrlUtil.unescape(myId), UrlUtil.unescape(myVersion)));
+ break;
+ case DSTU2:
+ result.setId(new ca.uhn.fhir.model.primitive.IdDt(myServer.getBaseForRequest(), UrlUtil.unescape(myId), UrlUtil.unescape(myVersion)));
+ break;
+ default:
+ throw new ConfigurationException("Unsupported Fhir version: " + fhirContextVersion);
+ }
+ } else if (StringUtils.isNotBlank(myId)) {
+ switch (fhirContextVersion) {
+ case R4:
+ result.setId(new org.hl7.fhir.r4.model.IdType(myServer.getBaseForRequest(), UrlUtil.unescape(myId)));
+ break;
+ case DSTU3:
+ result.setId(new org.hl7.fhir.dstu3.model.IdType(myServer.getBaseForRequest(), UrlUtil.unescape(myId)));
+ break;
+ case DSTU2_1:
+ result.setId(new org.hl7.fhir.dstu2016may.model.IdType(myServer.getBaseForRequest(), UrlUtil.unescape(myId)));
+ break;
+ case DSTU2_HL7ORG:
+ result.setId(new org.hl7.fhir.instance.model.IdType(myServer.getBaseForRequest(), UrlUtil.unescape(myId)));
+ break;
+ case DSTU2:
+ result.setId(new ca.uhn.fhir.model.primitive.IdDt(myServer.getBaseForRequest(), UrlUtil.unescape(myId)));
+ break;
+ default:
+ throw new ConfigurationException("Unsupported Fhir version: " + fhirContextVersion);
+ }
+ }
+
+ if (myRestOperation == RestOperationTypeEnum.UPDATE) {
+ String contentLocation = result.getHeader(Constants.HEADER_CONTENT_LOCATION);
+ if (contentLocation != null) {
+ switch (fhirContextVersion) {
+ case R4:
+ result.setId(new org.hl7.fhir.r4.model.IdType(contentLocation));
+ break;
+ case DSTU3:
+ result.setId(new org.hl7.fhir.dstu3.model.IdType(contentLocation));
+ break;
+ case DSTU2_1:
+ result.setId(new org.hl7.fhir.dstu2016may.model.IdType(contentLocation));
+ break;
+ case DSTU2_HL7ORG:
+ result.setId(new org.hl7.fhir.instance.model.IdType(contentLocation));
+ break;
+ case DSTU2:
+ result.setId(new ca.uhn.fhir.model.primitive.IdDt(contentLocation));
+ break;
+ default:
+ throw new ConfigurationException("Unsupported Fhir version: " + fhirContextVersion);
+ }
+ }
+ }
+
+ result.setCompartmentName(myCompartment);
+ result.setCompleteUrl(myRequestUrl);
+ result.setResourceName(myResourceName);
+
+ return result;
+ }
+
+ /**
+ * Set the compartment
+ *
+ * @param compartment the compartment
+ * @return the builder
+ */
+ public Builder compartment(String compartment) {
+ this.myCompartment = compartment;
+ return this;
+ }
+
+ /**
+ * Set the id
+ *
+ * @param id the resource id
+ * @return the builder
+ */
+ public Builder id(String id) {
+ this.myId = id;
+ return this;
+ }
+
+ /**
+ * Set the resource
+ *
+ * @param resource the body contents of an http method
+ * @return the builder
+ */
+ public Builder resource(String resource) {
+ this.myResource = resource;
+ return this;
+ }
+
+ /**
+ * Set the id version
+ *
+ * @param version the version of the resource
+ * @return the builder
+ */
+ public Builder version(String version) {
+ this.myVersion = version;
+ return this;
+ }
}
}
diff --git a/hapi-fhir-jaxrsserver-example/pom.xml b/hapi-fhir-jaxrsserver-example/pom.xml
index 5c9a381c6d1..df96b7d78d1 100644
--- a/hapi-fhir-jaxrsserver-example/pom.xml
+++ b/hapi-fhir-jaxrsserver-example/pom.xml
@@ -6,7 +6,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 3.7.0
+ 3.8.0-SNAPSHOT
../pom.xml
diff --git a/hapi-fhir-jpaserver-base/pom.xml b/hapi-fhir-jpaserver-base/pom.xml
index 0f72ad9260b..7cb3f25e1e7 100644
--- a/hapi-fhir-jpaserver-base/pom.xml
+++ b/hapi-fhir-jpaserver-base/pom.xml
@@ -4,7 +4,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 3.7.0
+ 3.8.0-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4Test.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4Test.java
index aee27813903..aa1628baa74 100644
--- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4Test.java
+++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/provider/r4/ResourceProviderR4Test.java
@@ -1165,6 +1165,22 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
}
+ @Test
+ public void testElements() throws IOException {
+ DiagnosticReport dr = new DiagnosticReport();
+ dr.setStatus(DiagnosticReport.DiagnosticReportStatus.FINAL);
+ dr.getCode().setText("CODE TEXT");
+ ourClient.create().resource(dr).execute();
+
+ HttpGet get = new HttpGet(ourServerBase + "/DiagnosticReport?_include=DiagnosticReport:result&_elements:exclude=DiagnosticReport&_elements=DiagnosticReport:status,Observation:value,Observation:code,Observation:subject&_pretty=true");
+ try (CloseableHttpResponse response = ourHttpClient.execute(get)) {
+ assertEquals(200, response.getStatusLine().getStatusCode());
+ String output = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
+ assertThat(output, not(containsString("
ca.uhn.hapi.fhir
hapi-deployable-pom
- 3.7.0
+ 3.8.0-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-jpaserver-example/pom.xml b/hapi-fhir-jpaserver-example/pom.xml
index 63ec5db19c8..1f3a256f2c3 100644
--- a/hapi-fhir-jpaserver-example/pom.xml
+++ b/hapi-fhir-jpaserver-example/pom.xml
@@ -10,7 +10,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 3.7.0
+ 3.8.0-SNAPSHOT
../pom.xml
diff --git a/hapi-fhir-jpaserver-migrate/pom.xml b/hapi-fhir-jpaserver-migrate/pom.xml
index e61a5ccfe2f..3eff9239bdb 100644
--- a/hapi-fhir-jpaserver-migrate/pom.xml
+++ b/hapi-fhir-jpaserver-migrate/pom.xml
@@ -4,7 +4,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 3.7.0
+ 3.8.0-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-jpaserver-model/pom.xml b/hapi-fhir-jpaserver-model/pom.xml
index d99260c1ede..2a916a21b21 100644
--- a/hapi-fhir-jpaserver-model/pom.xml
+++ b/hapi-fhir-jpaserver-model/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 3.7.0
+ 3.8.0-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-jpaserver-searchparam/pom.xml b/hapi-fhir-jpaserver-searchparam/pom.xml
index fc827b4afaa..44b1de27809 100755
--- a/hapi-fhir-jpaserver-searchparam/pom.xml
+++ b/hapi-fhir-jpaserver-searchparam/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 3.7.0
+ 3.8.0-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-jpaserver-subscription/pom.xml b/hapi-fhir-jpaserver-subscription/pom.xml
index b0073523ab2..4d4527b9bca 100644
--- a/hapi-fhir-jpaserver-subscription/pom.xml
+++ b/hapi-fhir-jpaserver-subscription/pom.xml
@@ -4,7 +4,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 3.7.0
+ 3.8.0-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-jpaserver-uhnfhirtest/pom.xml b/hapi-fhir-jpaserver-uhnfhirtest/pom.xml
index 93fa22ba2de..8c150f1d277 100644
--- a/hapi-fhir-jpaserver-uhnfhirtest/pom.xml
+++ b/hapi-fhir-jpaserver-uhnfhirtest/pom.xml
@@ -5,7 +5,7 @@
ca.uhn.hapi.fhir
hapi-fhir
- 3.7.0
+ 3.8.0-SNAPSHOT
../pom.xml
@@ -158,7 +158,7 @@
ca.uhn.hapi.fhir
hapi-fhir-converter
- 3.7.0
+ 3.8.0-SNAPSHOT
diff --git a/hapi-fhir-server/pom.xml b/hapi-fhir-server/pom.xml
index af7a5f2c084..a2a0b4979da 100644
--- a/hapi-fhir-server/pom.xml
+++ b/hapi-fhir-server/pom.xml
@@ -4,7 +4,7 @@
ca.uhn.hapi.fhir
hapi-deployable-pom
- 3.7.0
+ 3.8.0-SNAPSHOT
../hapi-deployable-pom/pom.xml
diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/api/server/RequestDetails.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/api/server/RequestDetails.java
index 46a51dcfb7a..24ccfde0e8c 100644
--- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/api/server/RequestDetails.java
+++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/api/server/RequestDetails.java
@@ -165,6 +165,20 @@ public abstract class RequestDetails {
myId = theId;
}
+ /**
+ * Returns the attribute map for this request. Attributes are a place for user-supplied
+ * objects of any type to be attached to an individual request. They can be used to pass information
+ * between interceptor methods.
+ */
+ public abstract Object getAttribute(String theAttributeName);
+
+ /**
+ * Returns the attribute map for this request. Attributes are a place for user-supplied
+ * objects of any type to be attached to an individual request. They can be used to pass information
+ * between interceptor methods.
+ */
+ public abstract void setAttribute(String theAttributeName, Object theAttributeValue);
+
/**
* Retrieves the body of the request as binary data. Either this method or {@link #getReader} may be called to read
* the body, not both.
diff --git a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java
index a56ee3195f6..fe152f65678 100644
--- a/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java
+++ b/hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java
@@ -9,9 +9,9 @@ package ca.uhn.fhir.rest.server;
* 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.
@@ -93,13 +93,13 @@ public class RestfulServer extends HttpServlet implements IRestfulServer myInterceptors = new ArrayList<>();
private final List