Merge branch 'master' of github.com:jamesagnew/hapi-fhir

Conflicts:
	hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/ParameterUtil.java
This commit is contained in:
jamesagnew 2014-07-21 09:24:38 -04:00
commit ad043a1b79
527 changed files with 5666 additions and 2170 deletions

View File

@ -6,6 +6,7 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin" path="src/site/example/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>

View File

@ -2,5 +2,6 @@
<wb-module deploy-name="hapi-fhir-base">
<wb-resource deploy-path="/" source-path="/src/main/java"/>
<wb-resource deploy-path="/" source-path="/src/main/resources"/>
<wb-resource deploy-path="/" source-path="/src/site/example/java"/>
</wb-module>
</project-modules>

View File

@ -76,7 +76,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.6</version>
<version>${slf4j_version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
@ -116,7 +116,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<version>${junit_version}</version>
<scope>test</scope>
</dependency>
<dependency>

View File

@ -10,6 +10,23 @@
<action type="add">
Allow server methods to return wildcard genrric types (e.g. List&lt;? extends IResource&gt;)
</action>
<action type="add">
Search parameters are not properly escaped and unescaped. E.g. for a token parameter such as
"&amp;identifier=system|codepart1\|codepart2"
</action>
<action type="add">
Add support for OPTIONS verb (which returns the server conformance statement)
</action>
<action type="add">
Add support for CORS headers in server
</action>
<action type="add">
Bump SLF4j dependency to latest version (1.7.7)
</action>
<action type="add">
Add interceptor framework for clients (annotation based and generic), and add interceptors
for configurable logging, capturing requests and responses, and HTTP basic auth.
</action>
</release>
<release version="0.4" date="2014-Jul-13">
<action type="add">

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
@ -41,7 +41,6 @@ import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
import ca.uhn.fhir.model.api.BaseResourceReference;
import ca.uhn.fhir.model.api.CodeableConceptElement;
import ca.uhn.fhir.model.api.ExtensionDt;
import ca.uhn.fhir.model.api.ICodeEnum;
@ -62,6 +61,7 @@ import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.model.api.annotation.Extension;
import ca.uhn.fhir.model.api.annotation.ResourceDef;
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
import ca.uhn.fhir.model.base.composite.BaseResourceReferenceDt;
import ca.uhn.fhir.model.dstu.composite.ContainedDt;
import ca.uhn.fhir.model.dstu.composite.NarrativeDt;
import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt;
@ -457,7 +457,7 @@ class ModelScanner {
if (IElement.class.isAssignableFrom(nextElementType)) {
addScanAlso((Class<? extends IElement>) nextElementType);
}
} else if (BaseResourceReference.class.isAssignableFrom(nextElementType)) {
} else if (BaseResourceReferenceDt.class.isAssignableFrom(nextElementType)) {
/*
* Child is a resource reference
*/

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
@ -28,11 +28,11 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import ca.uhn.fhir.model.api.BaseResourceReference;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.model.base.composite.BaseResourceReferenceDt;
public class RuntimeChildResourceDefinition extends BaseRuntimeDeclaredChildDefinition {
@ -51,7 +51,7 @@ public class RuntimeChildResourceDefinition extends BaseRuntimeDeclaredChildDefi
@Override
public String getChildNameByDatatype(Class<? extends IElement> theDatatype) {
if (BaseResourceReference.class.isAssignableFrom(theDatatype)) {
if (BaseResourceReferenceDt.class.isAssignableFrom(theDatatype)) {
return getElementName();
}
return null;
@ -59,7 +59,7 @@ public class RuntimeChildResourceDefinition extends BaseRuntimeDeclaredChildDefi
@Override
public BaseRuntimeElementDefinition<?> getChildElementDefinitionByDatatype(Class<? extends IElement> theDatatype) {
if (BaseResourceReference.class.isAssignableFrom(theDatatype)) {
if (BaseResourceReferenceDt.class.isAssignableFrom(theDatatype)) {
return myRuntimeDef;
}
return null;

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
@ -30,11 +30,11 @@ import java.util.Set;
import org.apache.commons.lang3.text.WordUtils;
import ca.uhn.fhir.model.api.BaseResourceReference;
import ca.uhn.fhir.model.api.ExtensionDt;
import ca.uhn.fhir.model.api.IDatatype;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.base.composite.BaseResourceReferenceDt;
import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt;
public class RuntimeChildUndeclaredExtensionDefinition extends BaseRuntimeChildDefinition {
@ -104,7 +104,7 @@ public class RuntimeChildUndeclaredExtensionDefinition extends BaseRuntimeChildD
RuntimeResourceReferenceDefinition def = new RuntimeResourceReferenceDefinition("valueResource", types);
def.sealAndInitialize(theClassToElementDefinitions);
myAttributeNameToDefinition.put("valueResource", def);
myDatatypeToDefinition.put(BaseResourceReference.class, def);
myDatatypeToDefinition.put(BaseResourceReferenceDt.class, def);
myDatatypeToDefinition.put(ResourceReferenceDt.class, def);
}

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.context;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
@ -24,17 +24,17 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import ca.uhn.fhir.model.api.BaseResourceReference;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.base.composite.BaseResourceReferenceDt;
public class RuntimeResourceReferenceDefinition extends BaseRuntimeElementDefinition<BaseResourceReference> {
public class RuntimeResourceReferenceDefinition extends BaseRuntimeElementDefinition<BaseResourceReferenceDt> {
private final List<Class<? extends IResource>> myResourceTypes;
private HashMap<Class<? extends IResource>, RuntimeResourceDefinition> myResourceTypeToDefinition;
public RuntimeResourceReferenceDefinition(String theName, List<Class<? extends IResource>> theResourceTypes) {
super(theName, BaseResourceReference.class);
super(theName, BaseResourceReferenceDt.class);
if (theResourceTypes == null || theResourceTypes.isEmpty()) {
throw new ConfigurationException("Element '" + theName + "' has no resource types noted");
}

View File

@ -4,7 +4,7 @@ import ca.uhn.fhir.model.dstu.valueset.SearchParamTypeEnum;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
@ -24,6 +24,8 @@ import java.util.HashMap;
import java.util.Map;
import org.apache.commons.lang3.Validate;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.dstu.composite.ContainedDt;
@ -62,6 +64,13 @@ public abstract class BaseResource extends BaseElement implements IResource {
return myId;
}
@Override
public String toString() {
ToStringBuilder b = new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE);
b.append("id", getId().toUnqualified());
return b.toString();
}
public CodeDt getLanguage() {
return myLanguage;
}
@ -118,7 +127,7 @@ public abstract class BaseResource extends BaseElement implements IResource {
*/
@Override
protected boolean isBaseEmpty() {
return super.isBaseEmpty() && ElementUtil.isEmpty(myLanguage, myText);
return super.isBaseEmpty() && ElementUtil.isEmpty(myLanguage, myText, myId);
}
}

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
@ -25,7 +25,7 @@ import java.util.List;
import ca.uhn.fhir.rest.method.QualifiedParamList;
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
public interface IQueryParameterAnd {
public interface IQueryParameterAnd<T extends IQueryParameterOr<?>> {
/**
*
@ -45,7 +45,7 @@ public interface IQueryParameterAnd {
* for information on the <b>token</b> format
* </p>
*/
public List<IQueryParameterOr> getValuesAsQueryTokens();
public List<T> getValuesAsQueryTokens();
}

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
@ -24,7 +24,7 @@ import java.util.List;
import ca.uhn.fhir.rest.method.QualifiedParamList;
public interface IQueryParameterOr {
public interface IQueryParameterOr<T extends IQueryParameterType> {
/**
* Sets the value of this type using the <b>token</b> format. This format is used in HTTP queries as a parameter
@ -47,6 +47,6 @@ public interface IQueryParameterOr {
* SearchParameter Types</a> for information on the <b>token</b> format
* </p>
*/
public List<IQueryParameterType> getValuesAsQueryTokens();
public List<T> getValuesAsQueryTokens();
}

View File

@ -3,7 +3,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -4,7 +4,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api.annotation;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api.annotation;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api.annotation;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api.annotation;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api.annotation;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api.annotation;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api.annotation;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api.annotation;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api.annotation;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api.annotation;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api.annotation;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api.annotation;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
@ -37,4 +37,10 @@ public @interface SearchParamDefinition {
String type() default "string";
/**
* If the parameter is of type "composite", this parameter lists the names of the parameters
* which this parameter is a composite of. E.g. "name-value-token" is a composite of "name" and "value-token"
*/
String[] compositeOf() default {};
}

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api.annotation;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.api.annotation;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -0,0 +1,113 @@
package ca.uhn.fhir.model.base.composite;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 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.apache.commons.lang3.StringUtils;
import ca.uhn.fhir.model.api.BaseIdentifiableElement;
import ca.uhn.fhir.model.api.ICompositeDatatype;
import ca.uhn.fhir.model.api.IQueryParameterType;
import ca.uhn.fhir.model.dstu.composite.CodingDt;
import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.UriDt;
import ca.uhn.fhir.rest.param.ParameterUtil;
public abstract class BaseCodingDt extends BaseIdentifiableElement implements ICompositeDatatype, IQueryParameterType {
/**
* Gets the value(s) for <b>code</b> (Symbol in syntax defined by the system). creating it if it does not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b> A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)
* </p>
*/
public abstract CodeDt getCode();
@Override
public String getQueryParameterQualifier() {
return null;
}
/**
* Gets the value(s) for <b>system</b> (Identity of the terminology system). creating it if it does not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b> The identification of the code system that defines the meaning of the symbol in the code.
* </p>
*/
public abstract UriDt getSystem();
/**
* {@inheritDoc}
*/
@Override
public String getValueAsQueryToken() {
if (getSystem().getValueAsString() != null) {
return ParameterUtil.escape(StringUtils.defaultString(getSystem().getValueAsString())) + '|' + ParameterUtil.escape(getCode().getValueAsString());
} else {
return ParameterUtil.escape(getCode().getValueAsString());
}
}
/**
* {@inheritDoc}
*/
@Override
public void setValueAsQueryToken(String theQualifier, String theParameter) {
int barIndex = ParameterUtil.nonEscapedIndexOf(theParameter, '|');
if (barIndex != -1) {
setSystem(theParameter.substring(0, barIndex));
setCode(ParameterUtil.unescape(theParameter.substring(barIndex + 1)));
} else {
setCode(ParameterUtil.unescape(theParameter));
}
}
/**
* Returns true if <code>this</code> Coding has the same {@link CodingDt#getCode() Code} and {@link CodingDt#getSystem() system} (as compared by simple equals comparison). Does not compare other
* Codes (e.g. {@link CodingDt#getUse() use}) or any extensions.
*/
public boolean matchesSystemAndCode(BaseCodingDt theCoding) {
if (theCoding == null) {
return false;
}
return getCode().equals(theCoding.getCode()) && getSystem().equals(theCoding.getSystem());
}
/**
* Sets the value for <b>code</b> (Symbol in syntax defined by the system)
*
* <p>
* <b>Definition:</b> A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)
* </p>
*/
public abstract BaseCodingDt setCode(String theCode);
/**
* Sets the value for <b>system</b> (Identity of the terminology system)
*
* <p>
* <b>Definition:</b> The identification of the code system that defines the meaning of the symbol in the code.
* </p>
*/
public abstract BaseCodingDt setSystem(String theUri);
}

View File

@ -0,0 +1,100 @@
package ca.uhn.fhir.model.base.composite;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 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 ca.uhn.fhir.model.api.BaseIdentifiableElement;
import ca.uhn.fhir.model.primitive.StringDt;
public abstract class BaseHumanNameDt extends BaseIdentifiableElement {
/**
* Gets the value(s) for <b>family</b> (Family name (often called 'Surname')). creating it if it does not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b> The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.
* </p>
*/
public abstract java.util.List<StringDt> getFamily();
/**
* Returns all repetitions of {@link $ hash}getFamily() family name} as a space separated string
*
* @see DatatypeUtil${hash}joinStringsSpaceSeparated(List)
*/
public String getFamilyAsSingleString() {
return ca.uhn.fhir.util.DatatypeUtil.joinStringsSpaceSeparated(getFamily());
}
/**
* Gets the value(s) for <b>given</b> (Given names (not always 'first'). Includes middle names). creating it if it does not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b> Given name
* </p>
*/
public abstract java.util.List<StringDt> getGiven();
/**
* Returns all repetitions of {@link $ hash}getGiven() given name} as a space separated string
*
* @see DatatypeUtil${hash}joinStringsSpaceSeparated(List)
*/
public String getGivenAsSingleString() {
return ca.uhn.fhir.util.DatatypeUtil.joinStringsSpaceSeparated(getGiven());
}
/**
* Gets the value(s) for <b>prefix</b> (Parts that come before the name). creating it if it does not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b> Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name
* </p>
*/
public abstract java.util.List<StringDt> getPrefix();
/**
* Returns all repetitions of {@link $ hash}getPrefix() prefix name} as a space separated string
*
* @see DatatypeUtil${hash}joinStringsSpaceSeparated(List)
*/
public String getPrefixAsSingleString() {
return ca.uhn.fhir.util.DatatypeUtil.joinStringsSpaceSeparated(getPrefix());
}
/**
* Gets the value(s) for <b>suffix</b> (Parts that come after the name). creating it if it does not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b> Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name
* </p>
*/
public abstract java.util.List<StringDt> getSuffix();
/**
* Returns all repetitions of {@link $ hash}Suffix() suffix} as a space separated string
*
* @see DatatypeUtil${hash}joinStringsSpaceSeparated(List)
*/
public String getSuffixAsSingleString() {
return ca.uhn.fhir.util.DatatypeUtil.joinStringsSpaceSeparated(getSuffix());
}
}

View File

@ -0,0 +1,125 @@
package ca.uhn.fhir.model.base.composite;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 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.apache.commons.lang3.StringUtils;
import ca.uhn.fhir.model.api.BaseIdentifiableElement;
import ca.uhn.fhir.model.api.ICompositeDatatype;
import ca.uhn.fhir.model.api.IQueryParameterType;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.model.primitive.UriDt;
import ca.uhn.fhir.rest.param.ParameterUtil;
public abstract class BaseIdentifierDt extends BaseIdentifiableElement implements ICompositeDatatype, IQueryParameterType {
@Override
public String getQueryParameterQualifier() {
return null;
}
/**
* Gets the value(s) for <b>system</b> (The namespace for the identifier).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Establishes the namespace in which set of possible id values is unique.
* </p>
*/
public abstract UriDt getSystem() ;
/**
* Gets the value(s) for <b>value</b> (The value that is unique).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The portion of the identifier typically displayed to the user and which is unique within the context of the system.
* </p>
*/
public abstract StringDt getValue();
/**
* {@inheritDoc}
*/
@Override
public String getValueAsQueryToken() {
if (getSystem().getValueAsString() != null) {
return ParameterUtil.escape(StringUtils.defaultString(getSystem().getValueAsString())) + '|' + ParameterUtil.escape(getValue().getValueAsString());
} else {
return ParameterUtil.escape(getValue().getValueAsString());
}
}
/**
* Returns true if <code>this</code> identifier has the same {@link IdentifierDt#[[#]]#getValue() value}
* and {@link IdentifierDt#[[#]]#getSystem() system} (as compared by simple equals comparison).
* Does not compare other values (e.g. {@link IdentifierDt#[[#]]#getUse() use}) or any extensions.
*/
public boolean matchesSystemAndValue(BaseIdentifierDt theIdentifier) {
if (theIdentifier == null) {
return false;
}
return getValue().equals(theIdentifier.getValue()) && getSystem().equals(theIdentifier.getSystem());
}
/**
* Sets the value for <b>system</b> (The namespace for the identifier)
*
* <p>
* <b>Definition:</b>
* Establishes the namespace in which set of possible id values is unique.
* </p>
*/
public abstract BaseIdentifierDt setSystem( String theUri);
/**
* Sets the value for <b>value</b> (The value that is unique)
*
* <p>
* <b>Definition:</b>
* The portion of the identifier typically displayed to the user and which is unique within the context of the system.
* </p>
*/
public abstract BaseIdentifierDt setValue( String theString);
/**
* {@inheritDoc}
*/
@Override
public void setValueAsQueryToken(String theQualifier, String theParameter) {
int barIndex = ParameterUtil.nonEscapedIndexOf(theParameter,'|');
if (barIndex != -1) {
setSystem(theParameter.substring(0, barIndex));
setValue(ParameterUtil.unescape(theParameter.substring(barIndex + 1)));
} else {
setValue(ParameterUtil.unescape(theParameter));
}
}
}

View File

@ -0,0 +1,210 @@
package ca.uhn.fhir.model.base.composite;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import java.math.BigDecimal;
import org.apache.commons.lang3.StringUtils;
import ca.uhn.fhir.model.api.BaseIdentifiableElement;
import ca.uhn.fhir.model.api.ICompositeDatatype;
import ca.uhn.fhir.model.api.IQueryParameterType;
import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum;
import ca.uhn.fhir.model.primitive.BoundCodeDt;
import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.DecimalDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.model.primitive.UriDt;
public abstract class BaseQuantityDt extends BaseIdentifiableElement implements ICompositeDatatype, IQueryParameterType {
/**
* Sets the value(s) for <b>value</b> (Numerical value (with implicit precision))
*
* <p>
* <b>Definition:</b>
* The value of the measured amount. The value includes an implicit precision in the presentation of the value
* </p>
*/
public abstract BaseQuantityDt setValue(BigDecimal theValue);
@Override
public void setValueAsQueryToken(String theQualifier, String theValue) {
getComparator().setValue(null);
setCode( null);
setSystem(null);
setUnits( null);
setValue( null);
if (theValue == null) {
return;
}
String[] parts = theValue.split("\\|");
if (parts.length > 0 && StringUtils.isNotBlank(parts[0])) {
if (parts[0].startsWith("<=")) {
getComparator().setValue(QuantityCompararatorEnum.LESSTHAN_OR_EQUALS.getCode());
setValue(new BigDecimal(parts[0].substring(2)));
} else if (parts[0].startsWith("<")) {
getComparator().setValue(QuantityCompararatorEnum.LESSTHAN.getCode());
setValue(new BigDecimal(parts[0].substring(1)));
} else if (parts[0].startsWith(">=")) {
getComparator().setValue(QuantityCompararatorEnum.GREATERTHAN_OR_EQUALS.getCode());
setValue(new BigDecimal(parts[0].substring(2)));
} else if (parts[0].startsWith(">")) {
getComparator().setValue(QuantityCompararatorEnum.GREATERTHAN.getCode());
setValue(new BigDecimal(parts[0].substring(1)));
} else {
setValue(new BigDecimal(parts[0]));
}
}
if (parts.length > 1 && StringUtils.isNotBlank(parts[1])) {
setSystem(parts[1]);
}
if (parts.length > 2 && StringUtils.isNotBlank(parts[2])) {
setUnits(parts[2]);
}
}
/**
* Gets the value(s) for <b>comparator</b> (< | <= | >= | > - how to understand the value).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is \"<\" , then the real value is < stated value
* </p>
*/
public abstract BoundCodeDt<?> getComparator();
@Override
public String getValueAsQueryToken() {
StringBuilder b= new StringBuilder();
if (getComparator() != null) {
b.append(getComparator().getValue());
}
if (!getValue().isEmpty()) {
b.append(getValue().getValueAsString());
}
b.append('|');
if (!getSystem().isEmpty()) {
b.append(getSystem().getValueAsString());
}
b.append('|');
if (!getUnits().isEmpty()) {
b.append(getUnits().getValueAsString());
}
return b.toString();
}
@Override
public String getQueryParameterQualifier() {
return null;
}
/**
* Sets the value for <b>units</b> (Unit representation)
*
* <p>
* <b>Definition:</b>
* A human-readable form of the units
* </p>
*/
public abstract BaseQuantityDt setUnits( String theString);
/**
* Gets the value(s) for <b>system</b> (System that defines coded unit form).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The identification of the system that provides the coded form of the unit
* </p>
*/
public abstract UriDt getSystem();
/**
* Sets the value for <b>system</b> (System that defines coded unit form)
*
* <p>
* <b>Definition:</b>
* The identification of the system that provides the coded form of the unit
* </p>
*/
public abstract BaseQuantityDt setSystem( String theUri);
/**
* Gets the value(s) for <b>code</b> (Coded form of the unit).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* A computer processable form of the units in some unit representation system
* </p>
*/
public abstract CodeDt getCode();
/**
* Sets the value for <b>code</b> (Coded form of the unit)
*
* <p>
* <b>Definition:</b>
* A computer processable form of the units in some unit representation system
* </p>
*/
public abstract BaseQuantityDt setCode( String theCode);
/**
* Gets the value(s) for <b>units</b> (Unit representation).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* A human-readable form of the units
* </p>
*/
public abstract StringDt getUnits() ;
/**
* Gets the value(s) for <b>value</b> (Numerical value (with implicit precision)).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The value of the measured amount. The value includes an implicit precision in the presentation of the value
* </p>
*/
public abstract DecimalDt getValue();
}

View File

@ -1,8 +1,8 @@
package ca.uhn.fhir.model.api;
package ca.uhn.fhir.model.base.composite;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
@ -29,43 +29,43 @@ import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.model.api.BaseIdentifiableElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.primitive.IdDt;
import ca.uhn.fhir.parser.IParser;
import ca.uhn.fhir.rest.client.BaseClient;
import ca.uhn.fhir.rest.client.api.IRestfulClient;
public abstract class BaseResourceReference extends BaseIdentifiableElement {
public abstract class BaseResourceReferenceDt extends BaseIdentifiableElement {
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(BaseResourceReference.class);
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(BaseResourceReferenceDt.class);
private IResource myResource;
/**
* Constructor
*
* @param theResource
*/
public BaseResourceReference() {
*/
public BaseResourceReferenceDt() {
// nothing
}
/**
* Constructor
*
* @param theResource The loaded resource itself
* @param theResource
* The loaded resource itself
*/
public BaseResourceReference(IResource theResource) {
public BaseResourceReferenceDt(IResource theResource) {
myResource = theResource;
setReference(theResource.getId());
}
protected abstract IdDt getReference();
public abstract BaseResourceReference setReference(IdDt theReference);
/**
* Gets the actual loaded and parsed resource instance, <b>if it is already present</b>. This
* method will return the resource instance only if it has previously been loaded using
* {@link #loadResource(IRestfulClient)} or it was contained within the resource containing
* this resource.
* Gets the actual loaded and parsed resource instance, <b>if it is already present</b>. This method will return the resource instance only if it has previously been loaded using
* {@link #loadResource(IRestfulClient)} or it was contained within the resource containing this resource.
*
* @see See {@link #loadResource(IRestfulClient)}
* @see See the FHIR specification section on <a href="http://www.hl7.org/implement/standards/fhir/references.html#id>contained resources</a>
@ -74,7 +74,6 @@ public abstract class BaseResourceReference extends BaseIdentifiableElement {
return myResource;
}
@Override
protected boolean isBaseEmpty() {
return super.isBaseEmpty() && myResource == null;
@ -93,9 +92,9 @@ public abstract class BaseResourceReference extends BaseIdentifiableElement {
if (resourceId == null) {
throw new IllegalStateException("Reference has no resource ID defined");
}
String resourceUrl = resourceId.getValue();
ourLog.debug("Loading resource at URL: {}", resourceUrl);
HttpClient httpClient = theClient.getHttpClient();
@ -104,7 +103,7 @@ public abstract class BaseResourceReference extends BaseIdentifiableElement {
if (!resourceUrl.startsWith("http")) {
resourceUrl = theClient.getServerBase() + resourceUrl;
}
HttpGet get = new HttpGet(resourceUrl);
HttpResponse response = httpClient.execute(get);
try {
@ -123,10 +122,18 @@ public abstract class BaseResourceReference extends BaseIdentifiableElement {
return myResource;
}
protected abstract IdDt getReference();
public abstract BaseResourceReferenceDt setReference(IdDt theReference);
public void setResource(IResource theResource) {
myResource = theResource;
}
@Override
public String toString() {
org.apache.commons.lang3.builder.ToStringBuilder b = new org.apache.commons.lang3.builder.ToStringBuilder(this, org.apache.commons.lang3.builder.ToStringStyle.SHORT_PREFIX_STYLE);
b.append("reference", getReference().getValueAsString());
b.append("loaded", getResource() != null);
return b.toString();
}
}

View File

@ -18,7 +18,7 @@ package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
@ -517,4 +517,4 @@ public class AddressDt
}
}

View File

@ -4,7 +4,7 @@ import ca.uhn.fhir.model.api.annotation.DatatypeDef;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -18,7 +18,7 @@ package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
@ -446,4 +446,4 @@ public class AttachmentDt
}
}

View File

@ -18,7 +18,7 @@ package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
@ -210,4 +210,4 @@ public class CodeableConceptDt
}
}

View File

@ -18,7 +18,7 @@ package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
@ -45,6 +45,7 @@ import ca.uhn.fhir.model.api.IQueryParameterType;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.model.base.composite.BaseCodingDt;
import ca.uhn.fhir.model.primitive.BooleanDt;
import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.StringDt;
@ -66,7 +67,7 @@ import ca.uhn.fhir.model.primitive.UriDt;
*/
@DatatypeDef(name="CodingDt")
public class CodingDt
extends BaseIdentifiableElement implements ICompositeDatatype , IQueryParameterType {
extends BaseCodingDt implements ICompositeDatatype , IQueryParameterType {
/**
* Constructor
@ -389,47 +390,10 @@ public class CodingDt
/**
* Returns true if <code>this</code> Coding has the same {@link CodingDt#getCode() Code}
* and {@link CodingDt#getSystem() system} (as compared by simple equals comparison).
* Does not compare other Codes (e.g. {@link CodingDt#getUse() use}) or any extensions.
*/
public boolean matchesSystemAndCode(CodingDt theCoding) {
if (theCoding == null) {
return false;
}
return getCode().equals(theCoding.getCode()) && getSystem().equals(theCoding.getSystem());
}
/**
* {@inheritDoc}
*/
@Override
public String getValueAsQueryToken() {
if (org.apache.commons.lang3.StringUtils.isNotBlank(getSystem().getValueAsString())) {
return getSystem().getValueAsString() + '|' + getCode().getValueAsString();
} else {
return getCode().getValueAsString();
}
}
/**
* {@inheritDoc}
*/
@Override
public void setValueAsQueryToken(String theQualifier, String theParameter) {
int barIndex = theParameter.indexOf('|');
if (barIndex != -1) {
setSystem(new UriDt(theParameter.substring(0, barIndex)));
setCode(theParameter.substring(barIndex + 1));
} else {
setCode(theParameter);
}
}
@Override
public String getQueryParameterQualifier() {
return null;
}
}
}

View File

@ -18,7 +18,7 @@ package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
@ -297,4 +297,4 @@ public class ContactDt
}
}

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -2,7 +2,7 @@ package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -18,7 +18,7 @@ package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
@ -38,12 +38,12 @@ package ca.uhn.fhir.model.dstu.composite;
import java.util.List;
import ca.uhn.fhir.model.api.BaseIdentifiableElement;
import ca.uhn.fhir.model.api.ICompositeDatatype;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.model.base.composite.BaseHumanNameDt;
import ca.uhn.fhir.model.dstu.valueset.NameUseEnum;
import ca.uhn.fhir.model.primitive.BoundCodeDt;
import ca.uhn.fhir.model.primitive.CodeDt;
@ -66,7 +66,7 @@ import ca.uhn.fhir.util.DatatypeUtil;
*/
@DatatypeDef(name="HumanNameDt")
public class HumanNameDt
extends BaseIdentifiableElement implements ICompositeDatatype {
extends BaseHumanNameDt implements ICompositeDatatype {
/**
* Constructor
@ -604,4 +604,4 @@ public class HumanNameDt
return ca.uhn.fhir.util.DatatypeUtil.joinStringsSpaceSeparated(getSuffix());
}
}
}

View File

@ -18,7 +18,7 @@ package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
@ -38,6 +38,8 @@ package ca.uhn.fhir.model.dstu.composite;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import ca.uhn.fhir.model.api.BaseIdentifiableElement;
import ca.uhn.fhir.model.api.ICompositeDatatype;
import ca.uhn.fhir.model.api.IElement;
@ -51,6 +53,7 @@ import ca.uhn.fhir.model.primitive.BoundCodeDt;
import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.model.primitive.UriDt;
import ca.uhn.fhir.rest.param.ParameterUtil;
/**
* HAPI/FHIR <b>IdentifierDt</b> Datatype
@ -412,10 +415,10 @@ public class IdentifierDt
*/
@Override
public String getValueAsQueryToken() {
if (org.apache.commons.lang3.StringUtils.isNotBlank(getSystem().getValueAsString())) {
return getSystem().getValueAsString() + '|' + getValue().getValueAsString();
if (getSystem().getValueAsString() != null) {
return ParameterUtil.escape(StringUtils.defaultString(getSystem().getValueAsString())) + '|' + ParameterUtil.escape(getValue().getValueAsString());
} else {
return getValue().getValueAsString();
return ParameterUtil.escape(getValue().getValueAsString());
}
}
@ -424,12 +427,12 @@ public class IdentifierDt
*/
@Override
public void setValueAsQueryToken(String theQualifier, String theParameter) {
int barIndex = theParameter.indexOf('|');
int barIndex = ParameterUtil.nonEscapedIndexOf(theParameter,'|');
if (barIndex != -1) {
setSystem(new UriDt(theParameter.substring(0, barIndex)));
setValue(theParameter.substring(barIndex + 1));
setValue(ParameterUtil.unescape(theParameter.substring(barIndex + 1)));
} else {
setValue(theParameter);
setValue(ParameterUtil.unescape(theParameter));
}
}
@ -438,4 +441,4 @@ public class IdentifierDt
return null;
}
}
}

View File

@ -18,7 +18,7 @@ package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%

View File

@ -18,7 +18,7 @@ package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
@ -215,4 +215,4 @@ public class PeriodDt
}
}

View File

@ -18,7 +18,7 @@ package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
@ -41,7 +41,6 @@ import java.util.List;
import org.apache.commons.lang3.StringUtils;
import ca.uhn.fhir.model.api.BaseIdentifiableElement;
import ca.uhn.fhir.model.api.ICompositeDatatype;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IQueryParameterType;
@ -49,6 +48,7 @@ import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.model.api.annotation.SimpleSetter;
import ca.uhn.fhir.model.base.composite.BaseQuantityDt;
import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum;
import ca.uhn.fhir.model.primitive.BoundCodeDt;
import ca.uhn.fhir.model.primitive.CodeDt;
@ -72,7 +72,7 @@ import ca.uhn.fhir.model.primitive.UriDt;
*/
@DatatypeDef(name="QuantityDt")
public class QuantityDt
extends BaseIdentifiableElement implements ICompositeDatatype , IQueryParameterType {
extends BaseQuantityDt implements ICompositeDatatype , IQueryParameterType {
/**
* Constructor
@ -500,4 +500,4 @@ public class QuantityDt
}
}

View File

@ -18,7 +18,7 @@ package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
@ -317,4 +317,4 @@ public class RangeDt
}
}

View File

@ -18,7 +18,7 @@ package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR Library
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
@ -317,4 +317,4 @@ public class RatioDt
}
}

Some files were not shown because too many files have changed in this diff Show More