Merge branch 'master' of https://github.com/jamesagnew/hapi-fhir into jaxrs-sever-evolution
# Conflicts: # hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/parser/JsonParserDstu3Test.java
This commit is contained in:
commit
dabb3ea2c5
|
@ -216,18 +216,6 @@ public abstract class BaseRuntimeElementCompositeDefinition<T extends IBase> ext
|
|||
orderToElementDef = newOrderToExtensionDef;
|
||||
}
|
||||
|
||||
// while (orderToElementDef.size() > 0 && orderToElementDef.firstKey() <
|
||||
// 0) {
|
||||
// BaseRuntimeDeclaredChildDefinition elementDef =
|
||||
// orderToElementDef.remove(orderToElementDef.firstKey());
|
||||
// if (elementDef.getElementName().equals("identifier")) {
|
||||
// orderToElementDef.put(theIdentifierOrder, elementDef);
|
||||
// } else {
|
||||
// throw new ConfigurationException("Don't know how to handle element: "
|
||||
// + elementDef.getElementName());
|
||||
// }
|
||||
// }
|
||||
|
||||
TreeSet<Integer> orders = new TreeSet<Integer>();
|
||||
orders.addAll(orderToElementDef.keySet());
|
||||
orders.addAll(orderToExtensionDef.keySet());
|
||||
|
@ -372,7 +360,7 @@ public abstract class BaseRuntimeElementCompositeDefinition<T extends IBase> ext
|
|||
def = new RuntimeChildDirectResource(nextField, childAnnotation, descriptionAnnotation, elementName);
|
||||
} else {
|
||||
childIsChoiceType |= choiceTypes.size() > 1;
|
||||
if (childIsChoiceType && !BaseResourceReferenceDt.class.isAssignableFrom(nextElementType) && !IBaseReference.class.isAssignableFrom(nextElementType)) {
|
||||
if (extensionAttr == null && childIsChoiceType && !BaseResourceReferenceDt.class.isAssignableFrom(nextElementType) && !IBaseReference.class.isAssignableFrom(nextElementType)) {
|
||||
def = new RuntimeChildChoiceDefinition(nextField, elementName, childAnnotation, descriptionAnnotation, choiceTypes);
|
||||
} else if (extensionAttr != null) {
|
||||
/*
|
||||
|
|
|
@ -38,6 +38,9 @@ public class RuntimeChildChoiceDefinition extends BaseRuntimeDeclaredChildDefini
|
|||
private String myReferenceSuffix;
|
||||
private List<Class<? extends IBaseResource>> myResourceTypes;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public RuntimeChildChoiceDefinition(Field theField, String theElementName, Child theChildAnnotation, Description theDescriptionAnnotation, List<Class<? extends IBase>> theChoiceTypes) {
|
||||
super(theField, theChildAnnotation, theDescriptionAnnotation, theElementName);
|
||||
|
||||
|
@ -45,6 +48,8 @@ public class RuntimeChildChoiceDefinition extends BaseRuntimeDeclaredChildDefini
|
|||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* For extension, if myChoiceTypes will be set some other way
|
||||
*/
|
||||
RuntimeChildChoiceDefinition(Field theField, String theElementName, Child theChildAnnotation, Description theDescriptionAnnotation) {
|
||||
|
@ -143,6 +148,7 @@ public class RuntimeChildChoiceDefinition extends BaseRuntimeDeclaredChildDefini
|
|||
if (IBaseResource.class.isAssignableFrom(next) || IBaseReference.class.isAssignableFrom(next)) {
|
||||
next = theContext.getVersion().getResourceReferenceType();
|
||||
elementName = getElementName() + myReferenceSuffix;
|
||||
myNameToChildDefinition.put(elementName, nextDef);
|
||||
}
|
||||
|
||||
myDatatypeToElementDefinition.put(next, nextDef);
|
||||
|
|
|
@ -22,32 +22,32 @@ package ca.uhn.fhir.context;
|
|||
import static org.apache.commons.lang3.StringUtils.isNotBlank;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.hl7.fhir.instance.model.api.IBase;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
|
||||
import ca.uhn.fhir.model.api.IResource;
|
||||
import ca.uhn.fhir.model.api.IElement;
|
||||
import ca.uhn.fhir.model.api.annotation.Child;
|
||||
import ca.uhn.fhir.model.api.annotation.Description;
|
||||
import ca.uhn.fhir.model.api.annotation.Extension;
|
||||
import ca.uhn.fhir.util.ReflectionUtil;
|
||||
|
||||
public class RuntimeChildDeclaredExtensionDefinition extends BaseRuntimeDeclaredChildDefinition {
|
||||
public class RuntimeChildDeclaredExtensionDefinition extends RuntimeChildChoiceDefinition {
|
||||
|
||||
private BaseRuntimeElementDefinition<?> myChildDef;
|
||||
private Class<? extends IBase> myChildType;
|
||||
private String myDatatypeChildName;
|
||||
private boolean myDefinedLocally;
|
||||
private String myExtensionUrl;
|
||||
private boolean myModifier;
|
||||
private Map<String, RuntimeChildDeclaredExtensionDefinition> myUrlToChildExtension;
|
||||
private volatile Object myInstanceConstructorArguments;
|
||||
private Class<?> myEnumerationType;
|
||||
private Class<? extends IBase> myChildType;
|
||||
private RuntimeResourceBlockDefinition myChildResourceBlock;
|
||||
private BaseRuntimeElementDefinition<?> myChildDef;
|
||||
|
||||
/**
|
||||
* @param theBoundTypeBinder
|
||||
|
@ -56,15 +56,32 @@ public class RuntimeChildDeclaredExtensionDefinition extends BaseRuntimeDeclared
|
|||
* @param theDefinedLocally
|
||||
* See {@link Extension#definedLocally()}
|
||||
*/
|
||||
RuntimeChildDeclaredExtensionDefinition(Field theField, Child theChild, Description theDescriptionAnnotation, Extension theExtension, String theElementName, String theExtensionUrl, Class<? extends IBase> theChildType, Object theBoundTypeBinder)
|
||||
RuntimeChildDeclaredExtensionDefinition(Field theField, Child theChild, Description theDescriptionAnnotation, Extension theExtension, String theElementName, String theExtensionUrl,
|
||||
Class<? extends IBase> theChildType, Object theBoundTypeBinder)
|
||||
throws ConfigurationException {
|
||||
super(theField, theChild, theDescriptionAnnotation, theElementName);
|
||||
super(theField, theElementName, theChild, theDescriptionAnnotation);
|
||||
assert isNotBlank(theExtensionUrl);
|
||||
myExtensionUrl = theExtensionUrl;
|
||||
myChildType = theChildType;
|
||||
myDefinedLocally = theExtension.definedLocally();
|
||||
myModifier = theExtension.isModifier();
|
||||
myInstanceConstructorArguments = theBoundTypeBinder;
|
||||
|
||||
List<Class<? extends IBase>> choiceTypes = new ArrayList<Class<? extends IBase>>();
|
||||
for (Class<? extends IElement> next : theChild.type()) {
|
||||
choiceTypes.add(next);
|
||||
}
|
||||
|
||||
if (Modifier.isAbstract(theChildType.getModifiers()) == false) {
|
||||
choiceTypes.add(theChildType);
|
||||
}
|
||||
|
||||
setChoiceTypes(choiceTypes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getElementName() {
|
||||
return "value";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -82,58 +99,66 @@ public class RuntimeChildDeclaredExtensionDefinition extends BaseRuntimeDeclared
|
|||
}
|
||||
|
||||
@Override
|
||||
public BaseRuntimeElementDefinition<?> getChildByName(String theName) {
|
||||
if (myDatatypeChildName != null) {
|
||||
if (myDatatypeChildName.equals(theName)) {
|
||||
return myChildDef;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
public String getChildNameByDatatype(Class<? extends IBase> theDatatype) {
|
||||
|
||||
String retVal = super.getChildNameByDatatype(theDatatype);
|
||||
|
||||
if (retVal != null) {
|
||||
BaseRuntimeElementDefinition<?> childDef = super.getChildElementDefinitionByDatatype(theDatatype);
|
||||
if (childDef instanceof RuntimeResourceBlockDefinition) {
|
||||
// Child is a newted extension
|
||||
retVal = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (retVal == null) {
|
||||
if (myModifier) {
|
||||
return "modifierExtension";
|
||||
} else {
|
||||
return "extension";
|
||||
}
|
||||
}
|
||||
return retVal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseRuntimeElementDefinition<?> getChildElementDefinitionByDatatype(Class<? extends IBase> theType) {
|
||||
if (myChildType.equals(theType)) {
|
||||
public BaseRuntimeElementDefinition<?> getChildByName(String theName) {
|
||||
String name = theName;
|
||||
if ("extension".equals(name)||"modifierExtension".equals(name)) {
|
||||
if (myChildResourceBlock != null) {
|
||||
return myChildResourceBlock;
|
||||
}
|
||||
if (myChildDef != null) {
|
||||
return myChildDef;
|
||||
}
|
||||
}
|
||||
|
||||
if (getValidChildNames().contains(name) == false) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return super.getChildByName(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseRuntimeElementDefinition<?> getChildElementDefinitionByDatatype(Class<? extends IBase> theDatatype) {
|
||||
if (myChildResourceBlock != null) {
|
||||
if (myChildResourceBlock.getImplementingClass().equals(theDatatype)) {
|
||||
return myChildResourceBlock;
|
||||
}
|
||||
}
|
||||
return super.getChildElementDefinitionByDatatype(theDatatype);
|
||||
}
|
||||
|
||||
public RuntimeChildDeclaredExtensionDefinition getChildExtensionForUrl(String theUrl) {
|
||||
return myUrlToChildExtension.get(theUrl);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getChildNameByDatatype(Class<? extends IBase> theDatatype) {
|
||||
if (myChildType.equals(theDatatype) && myDatatypeChildName != null) {
|
||||
return myDatatypeChildName;
|
||||
} else {
|
||||
return "extension";
|
||||
}
|
||||
}
|
||||
|
||||
public Class<? extends IBase> getChildType() {
|
||||
return myChildType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getExtensionUrl() {
|
||||
return myExtensionUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaseRuntimeElementDefinition<?> getSingleChildOrThrow() {
|
||||
return myChildDef;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getValidChildNames() {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
public boolean isDefinedLocally() {
|
||||
return myDefinedLocally;
|
||||
}
|
||||
|
@ -143,16 +168,6 @@ public class RuntimeChildDeclaredExtensionDefinition extends BaseRuntimeDeclared
|
|||
return myModifier;
|
||||
}
|
||||
|
||||
public IBase newInstance() {
|
||||
try {
|
||||
return myChildType.newInstance();
|
||||
} catch (InstantiationException e) {
|
||||
throw new ConfigurationException("Failed to instantiate type:" + myChildType.getName(), e);
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new ConfigurationException("Failed to instantiate type:" + myChildType.getName(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
void sealAndInitialize(FhirContext theContext, Map<Class<? extends IBase>, BaseRuntimeElementDefinition<?>> theClassToElementDefinitions) {
|
||||
myUrlToChildExtension = new HashMap<String, RuntimeChildDeclaredExtensionDefinition>();
|
||||
|
@ -164,29 +179,41 @@ public class RuntimeChildDeclaredExtensionDefinition extends BaseRuntimeDeclared
|
|||
* built-in types, e.g. custom structures or custom extensions
|
||||
*/
|
||||
if (elementDef == null) {
|
||||
if (Modifier.isAbstract(myChildType.getModifiers()) == false) {
|
||||
elementDef = theContext.getElementDefinition(myChildType);
|
||||
}
|
||||
}
|
||||
|
||||
if (elementDef instanceof RuntimePrimitiveDatatypeDefinition || elementDef instanceof RuntimeCompositeDatatypeDefinition) {
|
||||
myDatatypeChildName = "value" + elementDef.getName().substring(0, 1).toUpperCase() + elementDef.getName().substring(1);
|
||||
if ("valueResourceReference".equals(myDatatypeChildName)) {
|
||||
// myDatatypeChildName = "value" + elementDef.getName().substring(0, 1).toUpperCase() + elementDef.getName().substring(1);
|
||||
// if ("valueResourceReference".equals(myDatatypeChildName)) {
|
||||
// Per one of the examples here: http://hl7.org/implement/standards/fhir/extensibility.html#extension
|
||||
myDatatypeChildName = "valueResource";
|
||||
List<Class<? extends IBaseResource>> types = new ArrayList<Class<? extends IBaseResource>>();
|
||||
types.add(IResource.class);
|
||||
myChildDef = findResourceReferenceDefinition(theClassToElementDefinitions);
|
||||
} else {
|
||||
// myDatatypeChildName = "valueResource";
|
||||
// List<Class<? extends IBaseResource>> types = new ArrayList<Class<? extends IBaseResource>>();
|
||||
// types.add(IBaseResource.class);
|
||||
// myChildDef = findResourceReferenceDefinition(theClassToElementDefinitions);
|
||||
// } else {
|
||||
myChildDef = elementDef;
|
||||
}
|
||||
} else {
|
||||
// }
|
||||
} else if (elementDef instanceof RuntimeResourceBlockDefinition) {
|
||||
RuntimeResourceBlockDefinition extDef = ((RuntimeResourceBlockDefinition) elementDef);
|
||||
for (RuntimeChildDeclaredExtensionDefinition next : extDef.getExtensions()) {
|
||||
myUrlToChildExtension.put(next.getExtensionUrl(), next);
|
||||
}
|
||||
myChildDef = extDef;
|
||||
myChildResourceBlock = (RuntimeResourceBlockDefinition) elementDef;
|
||||
}
|
||||
|
||||
myUrlToChildExtension = Collections.unmodifiableMap(myUrlToChildExtension);
|
||||
|
||||
super.sealAndInitialize(theContext, theClassToElementDefinitions);
|
||||
}
|
||||
|
||||
public IBase newInstance() {
|
||||
return ReflectionUtil.newInstance(myChildType);
|
||||
}
|
||||
|
||||
public Class<? extends IBase> getChildType() {
|
||||
return myChildType;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package ca.uhn.fhir.model.primitive;
|
||||
|
||||
import static org.apache.commons.lang3.StringUtils.defaultString;
|
||||
/*
|
||||
* #%L
|
||||
* HAPI FHIR - Core Library
|
||||
|
@ -202,34 +203,6 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
return getIdPartAsBigDecimal();
|
||||
}
|
||||
|
||||
private String determineLocalPrefix(String theValue) {
|
||||
if (theValue == null || theValue.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
if (theValue.startsWith("#")) {
|
||||
return "#";
|
||||
}
|
||||
int lastPrefix = -1;
|
||||
for (int i = 0; i < theValue.length(); i++) {
|
||||
char nextChar = theValue.charAt(i);
|
||||
if (nextChar == ':') {
|
||||
lastPrefix = i;
|
||||
} else if (!Character.isLetter(nextChar) || !Character.isLowerCase(nextChar)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (lastPrefix != -1) {
|
||||
String candidate = theValue.substring(0, lastPrefix + 1);
|
||||
if (candidate.startsWith("cid:") || candidate.startsWith("urn:")) {
|
||||
return candidate;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object theArg0) {
|
||||
if (!(theArg0 instanceof IdDt)) {
|
||||
|
@ -316,8 +289,8 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
public String getValue() {
|
||||
if (super.getValue() == null && myHaveComponentParts) {
|
||||
|
||||
if (determineLocalPrefix(myBaseUrl) != null && myResourceType == null && myUnqualifiedVersionId == null) {
|
||||
return myBaseUrl + myUnqualifiedId;
|
||||
if (isLocal() || isUrn()) {
|
||||
return myUnqualifiedId;
|
||||
}
|
||||
|
||||
StringBuilder b = new StringBuilder();
|
||||
|
@ -448,11 +421,16 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the ID is a local reference (in other words, it begins with the '#' character)
|
||||
* Returns <code>true</code> if the ID is a local reference (in other words,
|
||||
* it begins with the '#' character)
|
||||
*/
|
||||
@Override
|
||||
public boolean isLocal() {
|
||||
return "#".equals(myBaseUrl);
|
||||
return defaultString(myUnqualifiedId).startsWith("#");
|
||||
}
|
||||
|
||||
private boolean isUrn() {
|
||||
return defaultString(myUnqualifiedId).startsWith("urn:");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -468,6 +446,27 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
setValue(theId.getValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIdType setParts(String theBaseUrl, String theResourceType, String theIdPart, String theVersionIdPart) {
|
||||
if (isNotBlank(theVersionIdPart)) {
|
||||
Validate.notBlank(theResourceType, "If theVersionIdPart is populated, theResourceType and theIdPart must be populated");
|
||||
Validate.notBlank(theIdPart, "If theVersionIdPart is populated, theResourceType and theIdPart must be populated");
|
||||
}
|
||||
if (isNotBlank(theBaseUrl) && isNotBlank(theIdPart)) {
|
||||
Validate.notBlank(theResourceType, "If theBaseUrl is populated and theIdPart is populated, theResourceType must be populated");
|
||||
}
|
||||
|
||||
setValue(null);
|
||||
|
||||
myBaseUrl = theBaseUrl;
|
||||
myResourceType = theResourceType;
|
||||
myUnqualifiedId = theIdPart;
|
||||
myUnqualifiedVersionId = StringUtils.defaultIfBlank(theVersionIdPart, null);
|
||||
myHaveComponentParts = true;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the value
|
||||
*
|
||||
|
@ -485,8 +484,6 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
super.setValue(theValue);
|
||||
myHaveComponentParts = false;
|
||||
|
||||
String localPrefix = determineLocalPrefix(theValue);
|
||||
|
||||
if (StringUtils.isBlank(theValue)) {
|
||||
myBaseUrl = null;
|
||||
super.setValue(null);
|
||||
|
@ -495,14 +492,14 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
myResourceType = null;
|
||||
} else if (theValue.charAt(0) == '#' && theValue.length() > 1) {
|
||||
super.setValue(theValue);
|
||||
myBaseUrl = "#";
|
||||
myUnqualifiedId = theValue.substring(1);
|
||||
myBaseUrl = null;
|
||||
myUnqualifiedId = theValue;
|
||||
myUnqualifiedVersionId = null;
|
||||
myResourceType = null;
|
||||
myHaveComponentParts = true;
|
||||
} else if (localPrefix != null) {
|
||||
myBaseUrl = localPrefix;
|
||||
myUnqualifiedId = theValue.substring(localPrefix.length());
|
||||
} else if (theValue.startsWith("urn:")) {
|
||||
myBaseUrl = null;
|
||||
myUnqualifiedId = theValue;
|
||||
myUnqualifiedVersionId = null;
|
||||
myResourceType = null;
|
||||
myHaveComponentParts = true;
|
||||
|
@ -567,24 +564,33 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
*/
|
||||
@Override
|
||||
public IdDt toUnqualified() {
|
||||
if (isLocal() || isUrn()) {
|
||||
return new IdDt(getValueAsString());
|
||||
}
|
||||
return new IdDt(getResourceType(), getIdPart(), getVersionIdPart());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IdDt toUnqualifiedVersionless() {
|
||||
if (isLocal()) {
|
||||
return toVersionless();
|
||||
if (isLocal() || isUrn()) {
|
||||
return new IdDt(getValueAsString());
|
||||
}
|
||||
return new IdDt(getResourceType(), getIdPart());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IdDt toVersionless() {
|
||||
if (isLocal() || isUrn()) {
|
||||
return new IdDt(getValueAsString());
|
||||
}
|
||||
return new IdDt(getBaseUrl(), getResourceType(), getIdPart(), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IdDt withResourceType(String theResourceName) {
|
||||
if (isLocal() || isUrn()) {
|
||||
return new IdDt(getValueAsString());
|
||||
}
|
||||
return new IdDt(theResourceName, getIdPart(), getVersionIdPart());
|
||||
}
|
||||
|
||||
|
@ -600,6 +606,9 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
*/
|
||||
@Override
|
||||
public IdDt withServerBase(String theServerBase, String theResourceType) {
|
||||
if (isLocal() || isUrn()) {
|
||||
return new IdDt(getValueAsString());
|
||||
}
|
||||
return new IdDt(theServerBase, theResourceType, getIdPart(), getVersionIdPart());
|
||||
}
|
||||
|
||||
|
@ -610,9 +619,14 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
* The actual version string, e.g. "1"
|
||||
* @return A new instance of IdDt which is identical, but refers to the specific version of this resource ID noted by theVersion.
|
||||
*/
|
||||
@Override
|
||||
public IdDt withVersion(String theVersion) {
|
||||
Validate.notBlank(theVersion, "Version may not be null or empty");
|
||||
|
||||
if (isLocal() || isUrn()) {
|
||||
return new IdDt(getValueAsString());
|
||||
}
|
||||
|
||||
String existingValue = getValue();
|
||||
|
||||
int i = existingValue.indexOf(Constants.PARAM_HISTORY);
|
||||
|
@ -678,25 +692,4 @@ public class IdDt extends UriDt implements IPrimitiveDatatype<String>, IIdType {
|
|||
return theIdPart.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIdType setParts(String theBaseUrl, String theResourceType, String theIdPart, String theVersionIdPart) {
|
||||
if (isNotBlank(theVersionIdPart)) {
|
||||
Validate.notBlank(theResourceType, "If theVersionIdPart is populated, theResourceType and theIdPart must be populated");
|
||||
Validate.notBlank(theIdPart, "If theVersionIdPart is populated, theResourceType and theIdPart must be populated");
|
||||
}
|
||||
if (isNotBlank(theBaseUrl) && isNotBlank(theIdPart)) {
|
||||
Validate.notBlank(theResourceType, "If theBaseUrl is populated and theIdPart is populated, theResourceType must be populated");
|
||||
}
|
||||
|
||||
setValue(null);
|
||||
|
||||
myBaseUrl = theBaseUrl;
|
||||
myResourceType = theResourceType;
|
||||
myUnqualifiedId = theIdPart;
|
||||
myUnqualifiedVersionId = StringUtils.defaultIfBlank(theVersionIdPart, null);
|
||||
myHaveComponentParts = true;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -347,7 +347,7 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
|
|||
for (BundleEntry nextEntry : theBundle.getEntries()) {
|
||||
theEventWriter.beginObject();
|
||||
|
||||
if (nextEntry.getResource() != null && nextEntry.getResource().getId().getBaseUrl() != null) {
|
||||
if (nextEntry.getResource() != null && isNotBlank(nextEntry.getResource().getIdElement().getValue()) && (nextEntry.getResource().getId().getBaseUrl() != null || nextEntry.getResource().getId().getValueAsString().startsWith("urn:"))) {
|
||||
writeOptionalTagWithTextNode(theEventWriter, "fullUrl", nextEntry.getResource().getId().getValue());
|
||||
}
|
||||
|
||||
|
|
|
@ -721,7 +721,6 @@ class ParserState<T> {
|
|||
myInstance = theInstance;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void wereBack() {
|
||||
|
||||
|
@ -2090,17 +2089,32 @@ class ParserState<T> {
|
|||
final boolean bundle = "Bundle".equals(myContext.getResourceDefinition(myInstance).getName());
|
||||
if (bundle) {
|
||||
|
||||
FhirTerser t = myContext.newTerser();
|
||||
|
||||
Map<String, IBaseResource> idToResource = new HashMap<String, IBaseResource>();
|
||||
if (myContext.getVersion().getVersion().isNewerThan(FhirVersionEnum.DSTU1)) {
|
||||
List<IBase> entries = t.getValues(myInstance, "Bundle.entry", IBase.class);
|
||||
for (IBase nextEntry : entries) {
|
||||
IPrimitiveType<?> fullUrl = t.getSingleValueOrNull(nextEntry, "fullUrl", IPrimitiveType.class);
|
||||
if (fullUrl != null && isNotBlank(fullUrl.getValueAsString())) {
|
||||
IBaseResource resource = t.getSingleValueOrNull(nextEntry, "resource", IBaseResource.class);
|
||||
if (resource != null) {
|
||||
idToResource.put(fullUrl.getValueAsString(), resource);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Stitch together resource references
|
||||
*/
|
||||
Map<IIdType, IBaseResource> idToResource = new HashMap<IIdType, IBaseResource>();
|
||||
FhirTerser t = myContext.newTerser();
|
||||
List<IBaseResource> resources = t.getAllPopulatedChildElementsOfType(myInstance, IBaseResource.class);
|
||||
for (IBaseResource next : resources) {
|
||||
IIdType id = next.getIdElement();
|
||||
if (id != null && id.isEmpty() == false) {
|
||||
String resName = myContext.getResourceDefinition(next).getName();
|
||||
idToResource.put(id.withResourceType(resName).toUnqualifiedVersionless(), next);
|
||||
IIdType idType = id.withResourceType(resName).toUnqualifiedVersionless();
|
||||
idToResource.put(idType.getValueAsString(), next);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2108,7 +2122,8 @@ class ParserState<T> {
|
|||
List<IBaseReference> refs = myContext.newTerser().getAllPopulatedChildElementsOfType(next, IBaseReference.class);
|
||||
for (IBaseReference nextRef : refs) {
|
||||
if (nextRef.isEmpty() == false && nextRef.getReferenceElement() != null) {
|
||||
IBaseResource target = idToResource.get(nextRef.getReferenceElement().toUnqualifiedVersionless());
|
||||
IIdType unqualifiedVersionless = nextRef.getReferenceElement().toUnqualifiedVersionless();
|
||||
IBaseResource target = idToResource.get(unqualifiedVersionless.getValueAsString());
|
||||
if (target != null) {
|
||||
nextRef.setResource(target);
|
||||
}
|
||||
|
|
|
@ -446,7 +446,7 @@ public class XmlParser extends BaseParser implements IParser {
|
|||
|
||||
writeBundleResourceLink(theEventWriter, "alternate", nextEntry.getLinkAlternate());
|
||||
|
||||
if (nextEntry.getResource() != null && nextEntry.getResource().getId().getBaseUrl() != null) {
|
||||
if (nextEntry.getResource() != null && isNotBlank(nextEntry.getResource().getIdElement().getValue()) && (nextEntry.getResource().getId().getBaseUrl() != null || nextEntry.getResource().getId().getValueAsString().startsWith("urn:"))) {
|
||||
writeOptionalTagWithValue(theEventWriter, "fullUrl", nextEntry.getResource().getId().getValue());
|
||||
}
|
||||
|
||||
|
|
|
@ -75,6 +75,7 @@ import ca.uhn.fhir.rest.server.exceptions.AuthenticationException;
|
|||
import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException;
|
||||
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
|
||||
import ca.uhn.fhir.rest.server.exceptions.NotModifiedException;
|
||||
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
|
||||
import ca.uhn.fhir.rest.server.interceptor.ExceptionHandlingInterceptor;
|
||||
import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor;
|
||||
import ca.uhn.fhir.rest.server.interceptor.ResponseHighlighterInterceptor;
|
||||
|
@ -253,7 +254,7 @@ public class RestfulServer extends HttpServlet implements IRestfulServer<Servlet
|
|||
} else {
|
||||
resourceBinding = myResourceNameToBinding.get(resourceName);
|
||||
if (resourceBinding == null) {
|
||||
throw new InvalidRequestException("Unknown resource type '" + resourceName + "' - Server knows how to handle: " + myResourceNameToBinding.keySet());
|
||||
throw new ResourceNotFoundException("Unknown resource type '" + resourceName + "' - Server knows how to handle: " + myResourceNameToBinding.keySet());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,13 @@ import org.hl7.fhir.instance.model.api.IBaseResource;
|
|||
|
||||
import ca.uhn.fhir.rest.method.RequestDetails;
|
||||
|
||||
/**
|
||||
* Server interceptor with added methods which can be called within the lifecycle of
|
||||
* write operations (create/update/delete) or within transaction and batch
|
||||
* operations that call these sub-operations.
|
||||
*
|
||||
* @see ServerOperationInterceptorAdapter
|
||||
*/
|
||||
public interface IServerOperationInterceptor extends IServerInterceptor {
|
||||
|
||||
/**
|
||||
|
|
|
@ -69,6 +69,7 @@ public class ResponseHighlighterInterceptor extends InterceptorAdapter {
|
|||
public static final String PARAM_RAW_TRUE = "true";
|
||||
|
||||
public static final String PARAM_TRUE = "true";
|
||||
|
||||
private String format(String theResultBody, EncodingEnum theEncodingEnum) {
|
||||
String str = StringEscapeUtils.escapeHtml4(theResultBody);
|
||||
if (str == null || theEncodingEnum == null) {
|
||||
|
@ -181,7 +182,8 @@ public class ResponseHighlighterInterceptor extends InterceptorAdapter {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean handleException(RequestDetails theRequestDetails, BaseServerResponseException theException, HttpServletRequest theServletRequest, HttpServletResponse theServletResponse) throws ServletException, IOException {
|
||||
public boolean handleException(RequestDetails theRequestDetails, BaseServerResponseException theException, HttpServletRequest theServletRequest, HttpServletResponse theServletResponse)
|
||||
throws ServletException, IOException {
|
||||
/*
|
||||
* It's not a browser...
|
||||
*/
|
||||
|
@ -209,13 +211,14 @@ public class ResponseHighlighterInterceptor extends InterceptorAdapter {
|
|||
return super.handleException(theRequestDetails, theException, theServletRequest, theServletResponse);
|
||||
}
|
||||
|
||||
streamResponse(theRequestDetails, theServletResponse, theException.getOperationOutcome(), theServletRequest);
|
||||
streamResponse(theRequestDetails, theServletResponse, theException.getOperationOutcome(), theServletRequest, theException.getStatusCode());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean outgoingResponse(RequestDetails theRequestDetails, IBaseResource theResponseObject, HttpServletRequest theServletRequest, HttpServletResponse theServletResponse) throws AuthenticationException {
|
||||
public boolean outgoingResponse(RequestDetails theRequestDetails, IBaseResource theResponseObject, HttpServletRequest theServletRequest, HttpServletResponse theServletResponse)
|
||||
throws AuthenticationException {
|
||||
|
||||
/*
|
||||
* Request for _raw
|
||||
|
@ -264,7 +267,6 @@ public class ResponseHighlighterInterceptor extends InterceptorAdapter {
|
|||
return super.outgoingResponse(theRequestDetails, theResponseObject, theServletRequest, theServletResponse);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Not a GET
|
||||
*/
|
||||
|
@ -279,12 +281,12 @@ public class ResponseHighlighterInterceptor extends InterceptorAdapter {
|
|||
return super.outgoingResponse(theRequestDetails, theResponseObject, theServletRequest, theServletResponse);
|
||||
}
|
||||
|
||||
streamResponse(theRequestDetails, theServletResponse, theResponseObject, theServletRequest);
|
||||
streamResponse(theRequestDetails, theServletResponse, theResponseObject, theServletRequest, 200);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void streamResponse(RequestDetails theRequestDetails, HttpServletResponse theServletResponse, IBaseResource resource, ServletRequest theServletRequest) {
|
||||
private void streamResponse(RequestDetails theRequestDetails, HttpServletResponse theServletResponse, IBaseResource resource, ServletRequest theServletRequest, int theStatusCode) {
|
||||
IParser p;
|
||||
Map<String, String[]> parameters = theRequestDetails.getParameters();
|
||||
if (parameters.containsKey(Constants.PARAM_FORMAT)) {
|
||||
|
@ -308,10 +310,14 @@ public class ResponseHighlighterInterceptor extends InterceptorAdapter {
|
|||
p.setPrettyPrint(prettyPrintResponse);
|
||||
}
|
||||
|
||||
|
||||
EncodingEnum encoding = p.getEncoding();
|
||||
String encoded = p.encodeResourceToString(resource);
|
||||
|
||||
try {
|
||||
|
||||
if (theStatusCode > 299) {
|
||||
theServletResponse.setStatus(theStatusCode);
|
||||
}
|
||||
theServletResponse.setContentType(Constants.CT_HTML_WITH_UTF8);
|
||||
|
||||
StringBuilder b = new StringBuilder();
|
||||
|
@ -386,7 +392,6 @@ public class ResponseHighlighterInterceptor extends InterceptorAdapter {
|
|||
b.append("ms.");
|
||||
}
|
||||
|
||||
|
||||
b.append("</p>");
|
||||
|
||||
b.append("\n");
|
||||
|
@ -410,7 +415,6 @@ public class ResponseHighlighterInterceptor extends InterceptorAdapter {
|
|||
String out = b.toString();
|
||||
//@formatter:on
|
||||
|
||||
try {
|
||||
theServletResponse.getWriter().append(out);
|
||||
theServletResponse.getWriter().close();
|
||||
} catch (IOException e) {
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
package ca.uhn.fhir.rest.server.interceptor;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
* HAPI FHIR - Core Library
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2017 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 org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
|
||||
import ca.uhn.fhir.rest.method.RequestDetails;
|
||||
|
||||
/**
|
||||
* NOP implementation of {@link IServerOperationInterceptor}
|
||||
*/
|
||||
public class ServerOperationInterceptorAdapter extends InterceptorAdapter implements IServerOperationInterceptor {
|
||||
|
||||
@Override
|
||||
public void resourceDeleted(RequestDetails theRequest, IBaseResource theResource) {
|
||||
// nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resourceCreated(RequestDetails theRequest, IBaseResource theResource) {
|
||||
// nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resourceUpdated(RequestDetails theRequest, IBaseResource theResource) {
|
||||
// nothing
|
||||
}
|
||||
|
||||
}
|
|
@ -130,10 +130,41 @@ public interface IIdType extends IPrimitiveType<String> {
|
|||
|
||||
IIdType toVersionless();
|
||||
|
||||
/**
|
||||
* Returns a copy of this object, but with a different {@link #getResourceType() resource type}
|
||||
* (or if this object does not have a resource type currently, returns a copy of this object with
|
||||
* the given resource type).
|
||||
* <p>
|
||||
* Note that if this object represents a local reference (e.g. <code>#foo</code>) or
|
||||
* a URN (e.g. <code>urn:oid:1.2.3.4</code>) this method will simply return a copy
|
||||
* of this object with no modifications.
|
||||
* </p>
|
||||
*/
|
||||
IIdType withResourceType(String theResName);
|
||||
|
||||
/**
|
||||
* Returns a copy of this object, but with a different {@link #getResourceType() resource type}
|
||||
* and {@link #getBaseUrl() base URL}
|
||||
* (or if this object does not have a resource type currently, returns a copy of this object with
|
||||
* the given server base and resource type).
|
||||
* <p>
|
||||
* Note that if this object represents a local reference (e.g. <code>#foo</code>) or
|
||||
* a URN (e.g. <code>urn:oid:1.2.3.4</code>) this method will simply return a copy
|
||||
* of this object with no modifications.
|
||||
* </p>
|
||||
*/
|
||||
IIdType withServerBase(String theServerBase, String theResourceName);
|
||||
|
||||
/**
|
||||
* Returns a copy of this object, but with a different {@link #getVersionIdPart() version ID}
|
||||
* (or if this object does not have a resource type currently, returns a copy of this object with
|
||||
* the given version).
|
||||
* <p>
|
||||
* Note that if this object represents a local reference (e.g. <code>#foo</code>) or
|
||||
* a URN (e.g. <code>urn:oid:1.2.3.4</code>) this method will simply return a copy
|
||||
* of this object with no modifications.
|
||||
* </p>
|
||||
*/
|
||||
IIdType withVersion(String theVersion);
|
||||
|
||||
/**
|
||||
|
|
|
@ -15,7 +15,7 @@ import org.hl7.fhir.instance.model.api.IBaseBinary;
|
|||
* #%L
|
||||
* HAPI FHIR OkHttp Client
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.okhttp.client;
|
|||
* #%L
|
||||
* HAPI FHIR OkHttp Client
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -8,7 +8,7 @@ import java.util.Map;
|
|||
* #%L
|
||||
* HAPI FHIR OkHttp Client
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.okhttp.client;
|
|||
* #%L
|
||||
* HAPI FHIR OkHttp Client
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.okhttp.utils;
|
|||
* #%L
|
||||
* HAPI FHIR OkHttp Client
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jaxrs.client;
|
|||
* #%L
|
||||
* HAPI FHIR JAX-RS Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jaxrs.client;
|
|||
* #%L
|
||||
* HAPI FHIR JAX-RS Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -6,7 +6,7 @@ import java.io.IOException;
|
|||
* #%L
|
||||
* HAPI FHIR JAX-RS Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jaxrs.client;
|
|||
* #%L
|
||||
* HAPI FHIR JAX-RS Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jaxrs.server;
|
|||
* #%L
|
||||
* HAPI FHIR JAX-RS Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jaxrs.server;
|
|||
* #%L
|
||||
* HAPI FHIR JAX-RS Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jaxrs.server;
|
|||
* #%L
|
||||
* HAPI FHIR JAX-RS Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -5,7 +5,7 @@ import java.io.IOException;
|
|||
* #%L
|
||||
* HAPI FHIR JAX-RS Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jaxrs.server;
|
|||
* #%L
|
||||
* HAPI FHIR JAX-RS Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jaxrs.server.interceptor;
|
|||
* #%L
|
||||
* HAPI FHIR JAX-RS Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jaxrs.server.interceptor;
|
|||
* #%L
|
||||
* HAPI FHIR JAX-RS Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jaxrs.server.util;
|
|||
* #%L
|
||||
* HAPI FHIR JAX-RS Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jaxrs.server.util;
|
|||
* #%L
|
||||
* HAPI FHIR JAX-RS Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -6,7 +6,7 @@ import static org.apache.commons.lang3.StringUtils.isNotBlank;
|
|||
* #%L
|
||||
* HAPI FHIR JAX-RS Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.config;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.config;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.config;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.config;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -1,5 +1,25 @@
|
|||
package ca.uhn.fhir.jpa.config;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2017 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 javax.annotation.PostConstruct;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.hl7.fhir.dstu3.validation.IResourceValidator.BestPracticeWarningLevel
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.config.dstu3;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -1,5 +1,25 @@
|
|||
package ca.uhn.fhir.jpa.config.dstu3;
|
||||
|
||||
/*
|
||||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2017 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 javax.annotation.PostConstruct;
|
||||
|
||||
import org.hl7.fhir.dstu3.model.Subscription;
|
||||
|
|
|
@ -5,7 +5,7 @@ import static org.apache.commons.lang3.StringUtils.defaultIfBlank;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
@ -667,12 +667,16 @@ public abstract class BaseHapiFhirDao<T extends IBaseResource> implements IDao {
|
|||
}
|
||||
|
||||
protected void markRequestAsProcessingSubRequest(ServletRequestDetails theRequestDetails) {
|
||||
if (theRequestDetails != null) {
|
||||
theRequestDetails.getUserData().put(PROCESSING_SUB_REQUEST, Boolean.TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
protected void clearRequestAsProcessingSubRequest(ServletRequestDetails theRequestDetails) {
|
||||
if (theRequestDetails != null) {
|
||||
theRequestDetails.getUserData().remove(PROCESSING_SUB_REQUEST);
|
||||
}
|
||||
}
|
||||
|
||||
public String parseContentTextIntoWords(IBaseResource theResource) {
|
||||
StringBuilder retVal = new StringBuilder();
|
||||
|
@ -1427,6 +1431,8 @@ public abstract class BaseHapiFhirDao<T extends IBaseResource> implements IDao {
|
|||
for (ResourceLink next : links) {
|
||||
myEntityManager.persist(next);
|
||||
}
|
||||
// make sure links are indexed
|
||||
theEntity.setResourceLinks(links);
|
||||
|
||||
theEntity.toString();
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -6,7 +6,7 @@ import static org.apache.commons.lang3.StringUtils.isBlank;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -10,7 +10,7 @@ import org.apache.commons.lang3.time.DateUtils;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
@ -53,8 +53,6 @@ public class DaoConfig {
|
|||
// ***
|
||||
private long myExpireSearchResultsAfterMillis = DateUtils.MILLIS_PER_HOUR;
|
||||
|
||||
private int myHardSearchLimit = 1000;
|
||||
|
||||
private int myHardTagListLimit = 1000;
|
||||
|
||||
private int myIncludeLimit = 2000;
|
||||
|
@ -325,8 +323,17 @@ public class DaoConfig {
|
|||
myExpireSearchResultsAfterMillis = theExpireSearchResultsAfterMillis;
|
||||
}
|
||||
|
||||
public void setHardSearchLimit(int theHardSearchLimit) {
|
||||
myHardSearchLimit = theHardSearchLimit;
|
||||
/**
|
||||
* Do not call this method, it exists only for legacy reasons. It
|
||||
* will be removed in a future version. Configure the page size on your
|
||||
* paging provider instead.
|
||||
*
|
||||
* @deprecated This method does not do anything. Configure the page size on your
|
||||
* paging provider instead. Deprecated in HAPI FHIR 2.3 (Jan 2017)
|
||||
*/
|
||||
@Deprecated
|
||||
public void setHardSearchLimit(@SuppressWarnings("unused") int theHardSearchLimit) {
|
||||
// this method does nothing
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -8,7 +8,7 @@ import java.util.ArrayList;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
@ -164,7 +164,7 @@ public class FhirSystemDaoDstu1 extends BaseHapiFhirSystemDao<List<IResource>, M
|
|||
entity = toEntity(nextResource);
|
||||
entity.setUpdated(updateTime);
|
||||
entity.setPublished(updateTime);
|
||||
if (nextId.isEmpty() == false && "cid:".equals(nextId.getBaseUrl())) {
|
||||
if (nextId.getIdPart() != null && nextId.getIdPart().startsWith("cid:")) {
|
||||
ourLog.debug("Resource in transaction has ID[{}], will replace with server assigned ID", nextId.getIdPart());
|
||||
} else if (nextResouceOperationIn == BundleEntryTransactionMethodEnum.POST) {
|
||||
if (nextId.isEmpty() == false) {
|
||||
|
@ -282,7 +282,7 @@ public class FhirSystemDaoDstu1 extends BaseHapiFhirSystemDao<List<IResource>, M
|
|||
}
|
||||
|
||||
private static boolean isPlaceholder(IdDt theId) {
|
||||
if ("cid:".equals(theId.getBaseUrl())) {
|
||||
if (theId.getIdPart() != null && theId.getIdPart().startsWith("cid:")) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
@ -40,7 +40,6 @@ import java.util.Set;
|
|||
import javax.persistence.TypedQuery;
|
||||
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.hl7.fhir.dstu3.model.Bundle.BundleEntryComponent;
|
||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||
import org.hl7.fhir.instance.model.api.IIdType;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -634,9 +633,11 @@ public class FhirSystemDaoDstu2 extends BaseHapiFhirSystemDao<Bundle, MetaDt> {
|
|||
}
|
||||
|
||||
private static boolean isPlaceholder(IdDt theId) {
|
||||
if ("urn:oid:".equals(theId.getBaseUrl()) || "urn:uuid:".equals(theId.getBaseUrl())) {
|
||||
if (theId.getValue() != null) {
|
||||
if (theId.getValue().startsWith("urn:oid:") || theId.getValue().startsWith("urn:uuid:")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -16,7 +16,7 @@ import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum.ResourceMetadataKeySupporti
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -6,7 +6,7 @@ import java.util.List;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -6,7 +6,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -6,7 +6,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -6,7 +6,7 @@ import java.util.List;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -6,7 +6,7 @@ import java.util.List;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -6,7 +6,7 @@ import static org.apache.commons.lang3.StringUtils.defaultString;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -6,7 +6,7 @@ import java.util.List;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -8,7 +8,7 @@ import javax.persistence.TemporalType;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -6,7 +6,7 @@ import java.util.Collection;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao.data;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -7,7 +7,7 @@ import java.util.Date;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao.data;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -9,7 +9,7 @@ import org.springframework.data.domain.Pageable;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao.data;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao.data;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao.data;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -6,7 +6,7 @@ import java.util.List;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -9,7 +9,7 @@ import org.springframework.data.domain.Pageable;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao.data;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao.dstu3;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -7,7 +7,7 @@ import org.hl7.fhir.dstu3.model.Bundle.BundleType;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao.dstu3;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
@ -119,21 +119,12 @@ public class FhirResourceDaoCodeSystemDstu3 extends FhirResourceDaoDstu3<CodeSys
|
|||
system = theSystem.getValue();
|
||||
}
|
||||
|
||||
// CodeValidationResult validateOutcome = myJpaValidationSupport.validateCode(getContext(), system, code, null);
|
||||
//
|
||||
// LookupCodeResult result = new LookupCodeResult();
|
||||
// result.setSearchedForCode(code);
|
||||
// result.setSearchedForSystem(system);
|
||||
// result.setFound(false);
|
||||
// if (validateOutcome.isOk()) {
|
||||
// result.setFound(true);
|
||||
// result.setCodeIsAbstract(validateOutcome.asConceptDefinition().getAbstract());
|
||||
// result.setCodeDisplay(validateOutcome.asConceptDefinition().getDisplay());
|
||||
// }
|
||||
// return result;
|
||||
ourLog.info("Looking up {} / {}", system, code);
|
||||
|
||||
if (myValidationSupport.isCodeSystemSupported(getContext(), system)) {
|
||||
|
||||
ourLog.info("Code system {} is supported", system);
|
||||
|
||||
CodeValidationResult result = myValidationSupport.validateCode(getContext(), system, code, null);
|
||||
if (result != null) {
|
||||
if (result.isOk()) {
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao.dstu3;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao.dstu3;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao.dstu3;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao.dstu3;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao.dstu3;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao.dstu3;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
|
@ -4,7 +4,7 @@ package ca.uhn.fhir.jpa.dao.dstu3;
|
|||
* #%L
|
||||
* HAPI FHIR JPA Server
|
||||
* %%
|
||||
* Copyright (C) 2014 - 2016 University Health Network
|
||||
* Copyright (C) 2014 - 2017 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.
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue