Lots of cleanup and try to speed up transacitons in JPA

This commit is contained in:
jamesagnew 2014-06-12 11:42:28 -04:00
parent 04fc0827ef
commit 96986f8829
91 changed files with 732 additions and 434 deletions

View File

@ -45,6 +45,10 @@
of the root resource, and the parser looks in the root resource for all container levels when stitching
contained resources back together.
</action>
<action type="fix">
Server methods with @Include parameter would sometimes fail when no _include was actually
specified in query strings.
</action>
</release>
</body>
</document>

View File

@ -39,7 +39,7 @@ public abstract class BaseResource extends BaseElement implements IResource {
@Child(name = "language", order = 0, min = 0, max = Child.MAX_UNLIMITED)
private CodeDt myLanguage;
private Map<ResourceMetadataKeyEnum, Object> myResourceMetadata;
private Map<ResourceMetadataKeyEnum<?>, Object> myResourceMetadata;
@Child(name = "text", order = 1, min = 0, max = 1)
private NarrativeDt myText;
@ -57,9 +57,9 @@ public abstract class BaseResource extends BaseElement implements IResource {
}
@Override
public Map<ResourceMetadataKeyEnum, Object> getResourceMetadata() {
public Map<ResourceMetadataKeyEnum<?>, Object> getResourceMetadata() {
if (myResourceMetadata == null) {
myResourceMetadata = new HashMap<ResourceMetadataKeyEnum, Object>();
myResourceMetadata = new HashMap<ResourceMetadataKeyEnum<?>, Object>();
}
return myResourceMetadata;
}
@ -81,7 +81,7 @@ public abstract class BaseResource extends BaseElement implements IResource {
}
@Override
public void setResourceMetadata(Map<ResourceMetadataKeyEnum, Object> theMap) {
public void setResourceMetadata(Map<ResourceMetadataKeyEnum<?>, Object> theMap) {
Validate.notNull(theMap, "The Map must not be null");
myResourceMetadata = theMap;
}

View File

@ -61,7 +61,7 @@ public interface IResource extends ICompositeElement {
* @see ResourceMetadataKeyEnum for a list of allowable keys and the object
* types that values of a given key must use.
*/
Map<ResourceMetadataKeyEnum, Object> getResourceMetadata();
Map<ResourceMetadataKeyEnum<?>, Object> getResourceMetadata();
/**
* Sets the metadata map for this object. Metadata entries are used to
@ -71,6 +71,6 @@ public interface IResource extends ICompositeElement {
* @throws NullPointerException
* The map must not be null
*/
void setResourceMetadata(Map<ResourceMetadataKeyEnum, Object> theMap);
void setResourceMetadata(Map<ResourceMetadataKeyEnum<?>, Object> theMap);
}

View File

@ -0,0 +1,81 @@
package ca.uhn.fhir.model.api;
import org.apache.commons.lang3.builder.ToStringBuilder;
/*
* #%L
* HAPI FHIR 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%
*/
/**
* Represents a FHIR resource path specification, e.g.
* <code>Patient.gender.coding</code>
* <p>
* Note on equality: This class uses the {@link Include#setValue(String) value}
* as the single item used to provide {@link #hashCode()} and {@link #equals(Object)}.
* </p>
*/
public class Include {
private String myValue;
public Include(String theValue) {
myValue = theValue;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if ((obj instanceof Include)==false)
return false;
Include other = (Include) obj;
if (myValue == null) {
if (other.myValue != null)
return false;
} else if (!myValue.equals(other.myValue))
return false;
return true;
}
public String getValue() {
return myValue;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((myValue == null) ? 0 : myValue.hashCode());
return result;
}
public void setValue(String theValue) {
myValue = theValue;
}
@Override
public String toString() {
ToStringBuilder builder = new ToStringBuilder(this);
builder.append("myValue", myValue);
return builder.toString();
}
}

View File

@ -20,7 +20,6 @@ package ca.uhn.fhir.model.api;
* #L%
*/
import org.apache.commons.lang3.builder.ToStringBuilder;
/**
* Represents a FHIR resource path specification, e.g.
@ -29,53 +28,14 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
* Note on equality: This class uses the {@link PathSpecification#setValue(String) value}
* as the single item used to provide {@link #hashCode()} and {@link #equals(Object)}.
* </p>
*
* @deprecated {@link Include} should be used instead
*/
public class PathSpecification {
public class PathSpecification extends Include {
private String myValue;
public PathSpecification(String theValue) {
myValue = theValue;
public PathSpecification(String theInclude) {
super(theInclude);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PathSpecification other = (PathSpecification) obj;
if (myValue == null) {
if (other.myValue != null)
return false;
} else if (!myValue.equals(other.myValue))
return false;
return true;
}
public String getValue() {
return myValue;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((myValue == null) ? 0 : myValue.hashCode());
return result;
}
public void setValue(String theValue) {
myValue = theValue;
}
@Override
public String toString() {
ToStringBuilder builder = new ToStringBuilder(this);
builder.append("myValue", myValue);
return builder.toString();
}
}

View File

@ -29,7 +29,7 @@ import ca.uhn.fhir.model.primitive.IdDt;
import ca.uhn.fhir.model.primitive.InstantDt;
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
public enum ResourceMetadataKeyEnum {
public abstract class ResourceMetadataKeyEnum<T> {
/**
@ -41,18 +41,17 @@ public enum ResourceMetadataKeyEnum {
* Values for this key are of type <b>{@link InstantDt}</b>
* </p>
*/
DELETED_AT {
public static final ResourceMetadataKeyEnum<InstantDt> DELETED_AT = new ResourceMetadataKeyEnum<InstantDt>("DELETED_AT") {
@Override
public InstantDt get(IResource theResource) {
return getInstantFromMetadataOrNullIfNone(theResource.getResourceMetadata(), DELETED_AT);
}
@Override
public void put(IResource theResource, Object theObject) {
InstantDt obj = (InstantDt) theObject;
theResource.getResourceMetadata().put(DELETED_AT, obj);
public void put(IResource theResource, InstantDt theObject) {
theResource.getResourceMetadata().put(DELETED_AT, theObject);
}
},
};
/**
* The value for this key represents a previous ID used to identify
@ -62,18 +61,17 @@ public enum ResourceMetadataKeyEnum {
* Values for this key are of type <b>{@link IdDt}</b>
* </p>
*/
PREVIOUS_ID {
public static final ResourceMetadataKeyEnum<IdDt> PREVIOUS_ID = new ResourceMetadataKeyEnum<IdDt>("PREVIOUS_ID") {
@Override
public IdDt get(IResource theResource) {
return getIdFromMetadataOrNullIfNone(theResource.getResourceMetadata(), PREVIOUS_ID);
}
@Override
public void put(IResource theResource, Object theObject) {
IdDt obj = (IdDt) theObject;
theResource.getResourceMetadata().put(PREVIOUS_ID, obj);
public void put(IResource theResource, IdDt theObject) {
theResource.getResourceMetadata().put(PREVIOUS_ID, theObject);
}
},
};
/**
* The value for this key is the bundle entry <b>Published</b> time. This is
@ -90,19 +88,18 @@ public enum ResourceMetadataKeyEnum {
*
* @see InstantDt
*/
PUBLISHED {
public static final ResourceMetadataKeyEnum<InstantDt> PUBLISHED = new ResourceMetadataKeyEnum<InstantDt>("PUBLISHED") {
@Override
public InstantDt get(IResource theResource) {
return getInstantFromMetadataOrNullIfNone(theResource.getResourceMetadata(), PUBLISHED);
}
@Override
public void put(IResource theResource, Object theObject) {
InstantDt obj = (InstantDt) theObject;
theResource.getResourceMetadata().put(PUBLISHED, obj);
public void put(IResource theResource, InstantDt theObject) {
theResource.getResourceMetadata().put(PUBLISHED, theObject);
}
},
};
/**
* The value for this key is the list of tags associated with this resource
@ -112,7 +109,7 @@ public enum ResourceMetadataKeyEnum {
*
* @see TagList
*/
TAG_LIST {
public static final ResourceMetadataKeyEnum<TagList> TAG_LIST = new ResourceMetadataKeyEnum<TagList>("TAG_LIST") {
@Override
public TagList get(IResource theResource) {
Object retValObj = theResource.getResourceMetadata().get(TAG_LIST);
@ -129,11 +126,10 @@ public enum ResourceMetadataKeyEnum {
}
@Override
public void put(IResource theResource, Object theObject) {
TagList obj = (TagList) theObject;
theResource.getResourceMetadata().put(TAG_LIST, obj);
public void put(IResource theResource, TagList theObject) {
theResource.getResourceMetadata().put(TAG_LIST, theObject);
}
},
};
/**
@ -147,18 +143,17 @@ public enum ResourceMetadataKeyEnum {
*
* @see InstantDt
*/
UPDATED {
public static final ResourceMetadataKeyEnum<InstantDt> UPDATED = new ResourceMetadataKeyEnum<InstantDt>("UPDATED") {
@Override
public InstantDt get(IResource theResource) {
return getInstantFromMetadataOrNullIfNone(theResource.getResourceMetadata(), UPDATED);
}
@Override
public void put(IResource theResource, Object theObject) {
InstantDt obj = (InstantDt) theObject;
theResource.getResourceMetadata().put(UPDATED, obj);
public void put(IResource theResource, InstantDt theObject) {
theResource.getResourceMetadata().put(UPDATED, theObject);
}
},
};
/**
* The value for this key is the version ID of the resource object.
@ -169,22 +164,52 @@ public enum ResourceMetadataKeyEnum {
* @deprecated The {@link IResource#getId()} resource ID will now be populated with the version ID via the {@link IdDt#getUnqualifiedVersionId()} method
*/
@Deprecated
VERSION_ID {
public static final ResourceMetadataKeyEnum<IdDt> VERSION_ID = new ResourceMetadataKeyEnum<IdDt>("VERSION_ID") {
@Override
public IdDt get(IResource theResource) {
return getIdFromMetadataOrNullIfNone(theResource.getResourceMetadata(), VERSION_ID);
}
@Override
public void put(IResource theResource, Object theObject) {
IdDt obj = (IdDt) theObject;
theResource.getResourceMetadata().put(VERSION_ID, obj);
public void put(IResource theResource, IdDt theObject) {
theResource.getResourceMetadata().put(VERSION_ID, theObject);
}
};
public abstract Object get(IResource theResource);
private final String myValue;
private static IdDt getIdFromMetadataOrNullIfNone(Map<ResourceMetadataKeyEnum, Object> theResourceMetadata, ResourceMetadataKeyEnum theKey) {
public ResourceMetadataKeyEnum(String theValue) {
myValue = theValue;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((myValue == null) ? 0 : myValue.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ResourceMetadataKeyEnum<?> other = (ResourceMetadataKeyEnum<?>) obj;
if (myValue == null) {
if (other.myValue != null)
return false;
} else if (!myValue.equals(other.myValue))
return false;
return true;
}
private static IdDt getIdFromMetadataOrNullIfNone(Map<ResourceMetadataKeyEnum<?>, Object> theResourceMetadata, ResourceMetadataKeyEnum<?> theKey) {
Object retValObj = theResourceMetadata.get(theKey);
if (retValObj == null) {
return null;
@ -206,7 +231,11 @@ public enum ResourceMetadataKeyEnum {
throw new InternalErrorException("Found an object of type '" + retValObj.getClass().getCanonicalName() + "' in resource metadata for key " + theKey.name() + " - Expected " + IdDt.class.getCanonicalName());
}
private static InstantDt getInstantFromMetadataOrNullIfNone(Map<ResourceMetadataKeyEnum, Object> theResourceMetadata, ResourceMetadataKeyEnum theKey) {
private String name() {
return myValue;
}
private static InstantDt getInstantFromMetadataOrNullIfNone(Map<ResourceMetadataKeyEnum<?>, Object> theResourceMetadata, ResourceMetadataKeyEnum<InstantDt> theKey) {
Object retValObj = theResourceMetadata.get(theKey);
if (retValObj == null) {
return null;
@ -222,6 +251,8 @@ public enum ResourceMetadataKeyEnum {
throw new InternalErrorException("Found an object of type '" + retValObj.getClass().getCanonicalName() + "' in resource metadata for key " + theKey.name() + " - Expected " + InstantDt.class.getCanonicalName());
}
public abstract void put(IResource theResource, Object theObject);
public abstract T get(IResource theResource);
public abstract void put(IResource theResource, T theObject);
}

View File

@ -45,6 +45,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -63,7 +64,6 @@ import ca.uhn.fhir.model.primitive.BoundCodeDt;
import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.DateTimeDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -42,6 +42,7 @@ import java.util.List;
import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.model.api.annotation.ResourceDef;
@ -54,7 +55,6 @@ import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum;
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.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;

View File

@ -43,6 +43,7 @@ import java.util.List;
import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.Description;
@ -58,7 +59,6 @@ import ca.uhn.fhir.model.primitive.BoundCodeDt;
import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.DateTimeDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -45,6 +45,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -64,7 +65,6 @@ import ca.uhn.fhir.model.primitive.InstantDt;
import ca.uhn.fhir.model.primitive.IntegerDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.NumberParam;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.StringParam;

View File

@ -43,6 +43,7 @@ import java.util.List;
import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.Description;
@ -59,7 +60,6 @@ import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.DateTimeDt;
import ca.uhn.fhir.model.primitive.InstantDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.StringParam;

View File

@ -43,6 +43,7 @@ import java.util.List;
import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.Description;
@ -56,7 +57,6 @@ import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum;
import ca.uhn.fhir.model.primitive.DateTimeDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -46,6 +46,7 @@ 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.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -71,7 +72,6 @@ import ca.uhn.fhir.model.primitive.DateTimeDt;
import ca.uhn.fhir.model.primitive.IdrefDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -45,6 +45,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -64,7 +65,6 @@ import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.DateTimeDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -45,6 +45,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -62,7 +63,6 @@ import ca.uhn.fhir.model.primitive.DateTimeDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.model.primitive.UriDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.StringParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -46,6 +46,7 @@ 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.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -65,7 +66,6 @@ import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.DateDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -45,6 +45,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -76,7 +77,6 @@ import ca.uhn.fhir.model.primitive.IntegerDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.model.primitive.UriDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.StringParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -45,6 +45,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -60,7 +61,6 @@ import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt;
import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum;
import ca.uhn.fhir.model.primitive.DateDt;
import ca.uhn.fhir.model.primitive.IntegerDt;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -43,6 +43,7 @@ import java.util.List;
import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.Description;
@ -56,7 +57,6 @@ import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum;
import ca.uhn.fhir.model.primitive.DateDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.model.primitive.UriDt;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.StringParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -45,6 +45,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -56,7 +57,6 @@ import ca.uhn.fhir.model.dstu.composite.IdentifierDt;
import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt;
import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum;
import ca.uhn.fhir.model.primitive.InstantDt;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -45,6 +45,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -63,7 +64,6 @@ import ca.uhn.fhir.model.primitive.DateTimeDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.gclient.CompositeParam;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -46,6 +46,7 @@ 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.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -64,7 +65,6 @@ import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.DateTimeDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -43,6 +43,7 @@ import java.util.List;
import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.Description;
@ -59,7 +60,6 @@ import ca.uhn.fhir.model.primitive.DateTimeDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.model.primitive.UriDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.StringParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -45,6 +45,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -67,7 +68,6 @@ import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.model.primitive.UriDt;
import ca.uhn.fhir.rest.gclient.CompositeParam;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.NumberParam;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.StringParam;

View File

@ -24,6 +24,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.Description;
@ -46,7 +47,6 @@ import ca.uhn.fhir.model.primitive.BoundCodeDt;
import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt;
import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.NumberParam;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -45,6 +45,7 @@ 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.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.Description;
@ -60,7 +61,6 @@ import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum;
import ca.uhn.fhir.model.primitive.BooleanDt;
import ca.uhn.fhir.model.primitive.DateDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;

View File

@ -45,6 +45,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -58,7 +59,6 @@ import ca.uhn.fhir.model.primitive.DateDt;
import ca.uhn.fhir.model.primitive.IntegerDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.model.primitive.UriDt;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.StringParam;

View File

@ -44,6 +44,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.Description;
@ -55,7 +56,6 @@ import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.DecimalDt;
import ca.uhn.fhir.model.primitive.IntegerDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.StringParam;

View File

@ -44,6 +44,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.Description;
@ -53,7 +54,6 @@ import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt;
import ca.uhn.fhir.model.primitive.DecimalDt;
import ca.uhn.fhir.model.primitive.IntegerDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.StringParam;

View File

@ -45,6 +45,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -57,7 +58,6 @@ import ca.uhn.fhir.model.primitive.DateDt;
import ca.uhn.fhir.model.primitive.IntegerDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;

View File

@ -45,6 +45,7 @@ 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.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.Description;
@ -63,7 +64,6 @@ import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.IntegerDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.gclient.CompositeParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -45,6 +45,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -66,7 +67,6 @@ import ca.uhn.fhir.model.primitive.OidDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.model.primitive.UriDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.NumberParam;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -45,6 +45,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -66,7 +67,6 @@ import ca.uhn.fhir.model.primitive.DateTimeDt;
import ca.uhn.fhir.model.primitive.IntegerDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.NumberParam;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.StringParam;

View File

@ -45,6 +45,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -62,7 +63,6 @@ import ca.uhn.fhir.model.primitive.DateTimeDt;
import ca.uhn.fhir.model.primitive.IntegerDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.NumberParam;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -45,6 +45,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -61,7 +62,6 @@ import ca.uhn.fhir.model.primitive.BoundCodeDt;
import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.DateTimeDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -44,6 +44,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.Description;
@ -63,7 +64,6 @@ import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt;
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.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.StringParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -43,6 +43,7 @@ import java.util.List;
import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.Description;
@ -60,7 +61,6 @@ import ca.uhn.fhir.model.primitive.DateTimeDt;
import ca.uhn.fhir.model.primitive.IntegerDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -44,6 +44,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.Description;
@ -57,7 +58,6 @@ import ca.uhn.fhir.model.primitive.BooleanDt;
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.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.StringParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -45,6 +45,7 @@ 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.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.Description;
@ -64,7 +65,6 @@ import ca.uhn.fhir.model.primitive.BoundCodeDt;
import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.DateTimeDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -46,6 +46,7 @@ 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.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -67,7 +68,6 @@ import ca.uhn.fhir.model.primitive.BoundCodeDt;
import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.DateTimeDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -46,6 +46,7 @@ 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.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -70,7 +71,6 @@ import ca.uhn.fhir.model.primitive.DateTimeDt;
import ca.uhn.fhir.model.primitive.IntegerDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -45,6 +45,7 @@ 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.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.Description;
@ -61,7 +62,6 @@ import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum;
import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum;
import ca.uhn.fhir.model.primitive.BooleanDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -45,6 +45,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -58,7 +59,6 @@ import ca.uhn.fhir.model.primitive.DateDt;
import ca.uhn.fhir.model.primitive.DecimalDt;
import ca.uhn.fhir.model.primitive.IntegerDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.StringParam;

View File

@ -46,6 +46,7 @@ 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.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -75,7 +76,6 @@ import ca.uhn.fhir.model.primitive.InstantDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.gclient.CompositeParam;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.QuantityParam;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.StringParam;

View File

@ -46,6 +46,7 @@ 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.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -59,7 +60,6 @@ import ca.uhn.fhir.model.dstu.composite.ScheduleDt;
import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum;
import ca.uhn.fhir.model.primitive.DateTimeDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -44,6 +44,7 @@ import ca.uhn.fhir.model.api.BaseResource;
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.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.Description;
@ -59,7 +60,6 @@ import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.DateTimeDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -44,6 +44,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.Description;
@ -61,7 +62,6 @@ import ca.uhn.fhir.model.dstu.valueset.OrganizationTypeEnum;
import ca.uhn.fhir.model.primitive.BooleanDt;
import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.StringParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -43,6 +43,7 @@ import java.util.List;
import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.Description;
@ -54,7 +55,6 @@ import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt;
import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum;
import ca.uhn.fhir.model.primitive.DateDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -46,6 +46,7 @@ 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.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -71,7 +72,6 @@ import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.DateTimeDt;
import ca.uhn.fhir.model.primitive.IntegerDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.StringParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -45,6 +45,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -65,7 +66,6 @@ import ca.uhn.fhir.model.dstu.valueset.PractitionerRoleEnum;
import ca.uhn.fhir.model.dstu.valueset.PractitionerSpecialtyEnum;
import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt;
import ca.uhn.fhir.model.primitive.DateTimeDt;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.StringParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -44,6 +44,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.Description;
@ -59,7 +60,6 @@ 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.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -46,6 +46,7 @@ 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.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -74,7 +75,6 @@ import ca.uhn.fhir.model.primitive.IntegerDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.model.primitive.UriDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.StringParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -45,6 +45,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -62,7 +63,6 @@ import ca.uhn.fhir.model.primitive.InstantDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.model.primitive.UriDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -46,6 +46,7 @@ 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.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -71,7 +72,6 @@ import ca.uhn.fhir.model.primitive.InstantDt;
import ca.uhn.fhir.model.primitive.IntegerDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.TokenParam;
@ -454,7 +454,10 @@ public class Questionnaire extends BaseResource implements IResource {
* The subject of the questionnaires: this is the patient that the answers apply to, but this person is not necessarily the source of information
* </p>
*/
public ResourceReferenceDt getSubject() {
public ResourceReferenceDt getSubject() {
if (mySubject==null) {
mySubject = new ResourceReferenceDt();
}
return mySubject;
}

View File

@ -42,6 +42,7 @@ import java.util.List;
import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.model.api.annotation.ResourceDef;
@ -57,7 +58,6 @@ import ca.uhn.fhir.model.dstu.valueset.AdministrativeGenderCodesEnum;
import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum;
import ca.uhn.fhir.model.dstu.valueset.PatientRelationshipTypeEnum;
import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.StringParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -45,6 +45,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -71,7 +72,6 @@ import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.InstantDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.StringParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -45,6 +45,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -57,7 +58,6 @@ import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.DateDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.StringParam;

View File

@ -45,6 +45,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -58,7 +59,6 @@ import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.DateDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.StringParam;

View File

@ -43,6 +43,7 @@ import java.util.List;
import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.Description;
@ -57,7 +58,6 @@ import ca.uhn.fhir.model.primitive.DateTimeDt;
import ca.uhn.fhir.model.primitive.InstantDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -46,6 +46,7 @@ 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.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -67,7 +68,6 @@ import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt;
import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.DateTimeDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;

View File

@ -45,6 +45,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
@ -63,7 +64,6 @@ import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt;
import ca.uhn.fhir.model.primitive.DateTimeDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.gclient.DateParam;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.NumberParam;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -44,6 +44,7 @@ import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.Description;
@ -63,7 +64,6 @@ import ca.uhn.fhir.model.dstu.valueset.SupplyTypeEnum;
import ca.uhn.fhir.model.primitive.BoundCodeDt;
import ca.uhn.fhir.model.primitive.BoundCodeableConceptDt;
import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -42,6 +42,7 @@ import java.util.List;
import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.model.api.annotation.ResourceDef;
@ -53,7 +54,6 @@ import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.IntegerDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.model.primitive.UriDt;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.gclient.ReferenceParam;
import ca.uhn.fhir.rest.gclient.StringParam;
import ca.uhn.fhir.rest.gclient.TokenParam;

View File

@ -72,7 +72,7 @@ public class IdDt extends BasePrimitive<String> {
setValue(null);
}
}
/**
* Create a new ID using a long
*/
@ -100,14 +100,17 @@ public class IdDt extends BasePrimitive<String> {
/**
* Constructor
*
* @param theResourceType The resource type (e.g. "Patient")
* @param theId The ID (e.g. "123")
* @param theVersionId The version ID ("e.g. "456")
* @param theResourceType
* The resource type (e.g. "Patient")
* @param theId
* The ID (e.g. "123")
* @param theVersionId
* The version ID ("e.g. "456")
*/
public IdDt(String theResourceType, String theId, String theVersionId) {
Validate.notBlank(theResourceType, "Resource type must not be blank");
Validate.notBlank(theId, "ID must not be blank");
myResourceType = theResourceType;
myUnqualifiedId = theId;
myUnqualifiedVersionId = StringUtils.defaultIfBlank(theVersionId, null);
@ -170,7 +173,7 @@ public class IdDt extends BasePrimitive<String> {
public Long getUnqualifiedVersionIdAsLong() {
if (!hasUnqualifiedVersionId()) {
return null;
}else {
} else {
return Long.parseLong(getUnqualifiedVersionId());
}
}
@ -289,13 +292,15 @@ public class IdDt extends BasePrimitive<String> {
}
/**
* Returns a view of this ID as a fully qualified URL, given a server base and resource name
* (which will only be used if the ID does not already contain those respective parts). Essentially,
* because IdDt can contain either a complete URL or a partial one (or even jut a simple ID), this
* method may be used to translate into a complete URL.
* Returns a view of this ID as a fully qualified URL, given a server base and resource name (which will only be
* used if the ID does not already contain those respective parts). Essentially, because IdDt can contain either a
* complete URL or a partial one (or even jut a simple ID), this method may be used to translate into a complete
* URL.
*
* @param theServerBase The server base (e.g. "http://example.com/fhir")
* @param theResourceType The resource name (e.g. "Patient")
* @param theServerBase
* The server base (e.g. "http://example.com/fhir")
* @param theResourceType
* The resource name (e.g. "Patient")
* @return A fully qualified URL for this ID (e.g. "http://example.com/fhir/Patient/1")
*/
public String toQualifiedUrl(String theServerBase, String theResourceType) {
@ -304,12 +309,12 @@ public class IdDt extends BasePrimitive<String> {
}
StringBuilder retVal = new StringBuilder();
retVal.append(theServerBase);
if (retVal.charAt(retVal.length()-1) != '/') {
if (retVal.charAt(retVal.length() - 1) != '/') {
retVal.append('/');
}
if (isNotBlank(getResourceType())) {
retVal.append(getResourceType());
}else {
} else {
retVal.append(theResourceType);
}
retVal.append('/');
@ -325,8 +330,8 @@ public class IdDt extends BasePrimitive<String> {
public IdDt withoutVersion() {
int i = myValue.indexOf(Constants.PARAM_HISTORY);
if (i > 1) {
return new IdDt(myValue.substring(0, i-1));
}else {
return new IdDt(myValue.substring(0, i - 1));
} else {
return this;
}
}
@ -340,18 +345,43 @@ public class IdDt extends BasePrimitive<String> {
*/
@SuppressWarnings("deprecation")
public boolean equalsIgnoreBase(IdDt theId) {
if (theId==null) {
return false;
if (theId == null) {
return false;
}
if (theId.isEmpty()) {
return isEmpty();
}
return
ObjectUtils.equals(getResourceType(),theId.getResourceType())
&& ObjectUtils.equals(getUnqualifiedId(),theId.getUnqualifiedId())
&& ObjectUtils.equals(getUnqualifiedVersionId(),theId.getUnqualifiedVersionId());
return ObjectUtils.equals(getResourceType(), theId.getResourceType()) && ObjectUtils.equals(getUnqualifiedId(), theId.getUnqualifiedId()) && ObjectUtils.equals(getUnqualifiedVersionId(), theId.getUnqualifiedVersionId());
}
/**
* Returns <code>true</code> if the ID is a local reference (in other words, it begins with the '#' character)
*/
public boolean isLocal() {
return myUnqualifiedId != null && myUnqualifiedId.isEmpty() == false && myUnqualifiedId.charAt(0) == '#';
}
/**
* Creates a new instance of this ID which is identical, but refers to the specific version of this resource ID
* noted by theVersion.
*
* @param theVersion
* 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.
*/
public IdDt withVersion(String theVersion) {
Validate.notBlank(theVersion, "Version may not be null or empty");
int i = myValue.indexOf(Constants.PARAM_HISTORY);
String value;
if (i > 1) {
value = myValue.substring(0, i - 1);
} else {
value = myValue;
}
return new IdDt(value + '/' + Constants.PARAM_HISTORY + '/' + theVersion);
}
}

View File

@ -468,8 +468,8 @@ public class JsonParser extends BaseParser implements IParser {
encodeCompositeElementChildrenToStreamWriter(theResDef, theResource, theElement, theEventWriter, resDef.getChildren());
}
private void encodeResourceToJsonStreamWriter(RuntimeResourceDefinition theResDef, IResource theResource, JsonGenerator theEventWriter, String theObjectNameOrNull, boolean theIncludedResource) throws IOException {
if (!theIncludedResource) {
private void encodeResourceToJsonStreamWriter(RuntimeResourceDefinition theResDef, IResource theResource, JsonGenerator theEventWriter, String theObjectNameOrNull, boolean theIsSubElementWithinResource) throws IOException {
if (!theIsSubElementWithinResource) {
super.containResourcesForEncoding(theResource);
}
@ -482,7 +482,7 @@ public class JsonParser extends BaseParser implements IParser {
}
theEventWriter.write("resourceType", resDef.getName());
if (theResource.getId() != null && isNotBlank(theResource.getId().getValue())) {
if (theIsSubElementWithinResource && theResource.getId() != null && isNotBlank(theResource.getId().getValue())) {
theEventWriter.write("id", theResource.getId().getValue());
}

View File

@ -405,19 +405,19 @@ class ParserState<T> {
myEntry.getResource().setId(id);
}
Map<ResourceMetadataKeyEnum, Object> metadata = myEntry.getResource().getResourceMetadata();
Map<ResourceMetadataKeyEnum<?>, Object> metadata = myEntry.getResource().getResourceMetadata();
if (myEntry.getPublished().isEmpty() == false) {
metadata.put(ResourceMetadataKeyEnum.PUBLISHED, myEntry.getPublished());
ResourceMetadataKeyEnum.PUBLISHED.put(myEntry.getResource(), myEntry.getPublished());
}
if (myEntry.getUpdated().isEmpty() == false) {
metadata.put(ResourceMetadataKeyEnum.UPDATED, myEntry.getUpdated());
ResourceMetadataKeyEnum.UPDATED.put(myEntry.getResource(), myEntry.getUpdated());
}
if (myEntry.getCategories().isEmpty() == false) {
TagList tagList = new TagList();
for (Tag next : myEntry.getCategories()) {
tagList.add(next);
}
metadata.put(ResourceMetadataKeyEnum.TAG_LIST, tagList);
ResourceMetadataKeyEnum.TAG_LIST.put(myEntry.getResource(), tagList);
}
if (!myEntry.getLinkSelf().isEmpty()) {
String linkSelfValue = myEntry.getLinkSelf().getValue();
@ -808,7 +808,7 @@ class ParserState<T> {
case RESOURCE_REF: {
ResourceReferenceDt newChildInstance = new ResourceReferenceDt();
myDefinition.getMutator().addValue(myParentInstance, newChildInstance);
ResourceReferenceState newState = new ResourceReferenceState(getPreResourceState(), (RuntimeResourceReferenceDefinition) target, newChildInstance);
ResourceReferenceState newState = new ResourceReferenceState(getPreResourceState(), newChildInstance);
push(newState);
return;
}
@ -914,7 +914,7 @@ class ParserState<T> {
ResourceReferenceDt newChildInstance = new ResourceReferenceDt();
getPreResourceState().getResourceReferences().add(newChildInstance);
child.getMutator().addValue(myInstance, newChildInstance);
ResourceReferenceState newState = new ResourceReferenceState(getPreResourceState(), resourceRefTarget, newChildInstance);
ResourceReferenceState newState = new ResourceReferenceState(getPreResourceState(), newChildInstance);
push(newState);
return;
}
@ -1021,7 +1021,7 @@ class ParserState<T> {
case RESOURCE_REF: {
ResourceReferenceDt newChildInstance = new ResourceReferenceDt();
myExtension.setValue(newChildInstance);
ResourceReferenceState newState = new ResourceReferenceState(getPreResourceState(), null, newChildInstance);
ResourceReferenceState newState = new ResourceReferenceState(getPreResourceState(), newChildInstance);
push(newState);
return;
}
@ -1286,7 +1286,7 @@ class ParserState<T> {
private ResourceReferenceDt myInstance;
private ResourceReferenceSubState mySubState;
public ResourceReferenceState(PreResourceState thePreResourceState, RuntimeResourceReferenceDefinition theTarget, ResourceReferenceDt theInstance) {
public ResourceReferenceState(PreResourceState thePreResourceState, ResourceReferenceDt theInstance) {
super(thePreResourceState);
myInstance = theInstance;
mySubState = ResourceReferenceSubState.INITIAL;

View File

@ -37,6 +37,7 @@ import ca.uhn.fhir.context.RuntimeResourceDefinition;
import ca.uhn.fhir.model.api.Bundle;
import ca.uhn.fhir.model.api.IQueryParameterType;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.dstu.resource.Conformance;
import ca.uhn.fhir.model.primitive.IdDt;
import ca.uhn.fhir.parser.IParser;
@ -48,7 +49,6 @@ import ca.uhn.fhir.rest.gclient.IParam;
import ca.uhn.fhir.rest.gclient.IQuery;
import ca.uhn.fhir.rest.gclient.ISort;
import ca.uhn.fhir.rest.gclient.IUntypedQuery;
import ca.uhn.fhir.rest.gclient.Include;
import ca.uhn.fhir.rest.method.BaseOutcomeReturningMethodBinding;
import ca.uhn.fhir.rest.method.ConformanceMethodBinding;
import ca.uhn.fhir.rest.method.CreateMethodBinding;
@ -369,7 +369,7 @@ public class GenericClient extends BaseClient implements IGenericClient {
}
for (Include next : myInclude) {
addParam(params, Constants.PARAM_INCLUDE, next.getInclude());
addParam(params, Constants.PARAM_INCLUDE, next.getValue());
}
for (SortInternal next : mySort) {

View File

@ -21,6 +21,7 @@ package ca.uhn.fhir.rest.gclient;
*/
import ca.uhn.fhir.model.api.Bundle;
import ca.uhn.fhir.model.api.Include;
public interface IQuery {

View File

@ -1,35 +0,0 @@
package ca.uhn.fhir.rest.gclient;
/*
* #%L
* HAPI FHIR 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%
*/
public class Include {
private String myInclude;
public Include(String theInclude) {
myInclude = theInclude;
}
public String getInclude() {
return myInclude;
}
}

View File

@ -100,7 +100,7 @@ public abstract class BaseQueryParameter implements IParameter {
if (paramList.isEmpty()) {
if (handlesMissing()) {
return paramList;
return parse(paramList);
} else {
return null;
}

View File

@ -49,12 +49,12 @@ public class IncludeParameter extends BaseQueryParameter {
myAllow.add(next);
}
}
mySpecType = theSpecType;
if (mySpecType != PathSpecification.class && mySpecType != String.class) {
throw new ConfigurationException("Invalid @" + IncludeParam.class.getSimpleName() + " parameter type: " + mySpecType);
}
}
@SuppressWarnings("unchecked")
@ -64,17 +64,17 @@ public class IncludeParameter extends BaseQueryParameter {
if (myInstantiableCollectionType == null) {
if (mySpecType == PathSpecification.class) {
retVal.add(QualifiedParamList.singleton(((PathSpecification)theObject).getValue()));
retVal.add(QualifiedParamList.singleton(((PathSpecification) theObject).getValue()));
} else {
retVal.add(QualifiedParamList.singleton(((String)theObject)));
retVal.add(QualifiedParamList.singleton(((String) theObject)));
}
}else {
} else {
Collection<PathSpecification> val = (Collection<PathSpecification>) theObject;
for (PathSpecification pathSpec : val) {
retVal.add(QualifiedParamList.singleton(pathSpec.getValue()));
}
}
return retVal;
}
@ -86,14 +86,14 @@ public class IncludeParameter extends BaseQueryParameter {
@Override
public Object parse(List<QualifiedParamList> theString) throws InternalErrorException, InvalidRequestException {
Collection<PathSpecification> retValCollection = null;
if (myInstantiableCollectionType!=null) {
try {
retValCollection = myInstantiableCollectionType.newInstance();
} catch (Exception e) {
throw new InternalErrorException("Failed to instantiate " + myInstantiableCollectionType.getName(), e);
if (myInstantiableCollectionType != null) {
try {
retValCollection = myInstantiableCollectionType.newInstance();
} catch (Exception e) {
throw new InternalErrorException("Failed to instantiate " + myInstantiableCollectionType.getName(), e);
}
}
}
for (List<String> nextParamList : theString) {
if (nextParamList.isEmpty()) {
continue;
@ -101,7 +101,7 @@ public class IncludeParameter extends BaseQueryParameter {
if (nextParamList.size() > 1) {
throw new InvalidRequestException("'OR' query parameters (values containing ',') are not supported in _include parameters");
}
String value = nextParamList.get(0);
if (myAllow != null) {
if (!myAllow.contains(value)) {
@ -114,11 +114,11 @@ public class IncludeParameter extends BaseQueryParameter {
} else {
return new PathSpecification(value);
}
}else {
} else {
retValCollection.add(new PathSpecification(value));
}
}
return retValCollection;
}
@ -137,5 +137,4 @@ public class IncludeParameter extends BaseQueryParameter {
return true;
}
}

View File

@ -1,96 +0,0 @@
Hacking HAPI
This page explains all of the steps neccesary to work with the actual source
code for HAPI. This might be done for example to fix bugs, add features, or
learn how HAPI works internally.
As of version 0.6, HAPI uses the {{{./http://maven.apache.org}Maven}} build system to build
it's source code. Generating the source takes the following steps.
* Getting the Source
The first step to building HAPI is obtaining the source code. HAPI uses CVS
as its {{{./source-repository.html}source-code repository}}.
Note that the correct subdirectory to check out from the repository is now
called "hapi-mvn". There is an outdated directory called "hapi" which
is kept only for reference.
If you are using Eclipse to check the project out, the project may show errors
when you first check it out. These will be resolved by running through the build
using Maven.
* Understanding the Project Structure
HAPI is now broken up into several subprojects:
*--------------------+------+
hapi-base | This is the core of the HAPI library. It contains things such as parsers, transport, validation, etc. If you are making changes to HAPI itself, this is probably where you want to start.
*--------------------+------+
hapi-sourcegen | This project is used to generate message libraries. It is only used at build time.
*--------------------+------+
hapi-structures-vXX | These projects contain the libraries used to generate and process individual messages for a specific version of HL7. They are generated using the proprietary HL7 database provided by HL7.org, and so are usually not modified by end users of the HAPI library.
*--------------------+------+
hapi-examples | This project provides several annotated examples of how to use HAPI.
*--------------------+------+
hapi-test | This project contains unit tests for the HAPI library
*--------------------+------+
* Install the build tools
Download the latest version of {{{http://maven.apache.org}Maven}}. The download page also
has instructions for installing Maven correctly.
* Building HAPI
Building a HAPI base JAR is as simple as typing:
+----------------+
mvn install
+----------------+
At the end of this build, you should have a compiled JAR in the following
subdirectory:
+----------------+
[workspace]/hapi-mvn/hapi-base/target/hapi-base-VERSION.jar
+----------------+
* Set up Eclipse
Once Maven has been run for the first time, you will need to define an Eclipse classpath variable
pointing to your local maven repository.
* First, find your local Maven repository. It will be a directory called ".m2/repository" in your home directory. So, for a user named "james", it would be in the following location, depending on OS:
*--------------------+------+
Windows XP | C:\Documents and Settings\James\.m2\repository
*--------------------+------+
Windows Vista | C:\Users\James\.m2\repository
*--------------------+------+
Linux | /home/james/.m2/repository
*--------------------+------+
* Next, in Eclipse, open the Preferences dialogue (in the Window menu).
* Navigate to the following section: Java -> Build Path -> Classpath Variables
* Click on "New"
** For "Name", enter "M2_REPO"
** For "Path", enter the path to the local repo. eg: "C:\Users\James\.m2\repository"
* Tips and tricks
To skip running the unit tests, execute the following:
+----------------+
mvn -Dmaven.test.skip -P CORE install
+----------------+

View File

@ -12,7 +12,7 @@ import javax.servlet.http.HttpServletResponse;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.model.api.Bundle;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.PathSpecification;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum;
import ca.uhn.fhir.model.api.Tag;
import ca.uhn.fhir.model.api.TagList;
@ -186,8 +186,7 @@ public List<Patient> getPatientHistory(@IdParam IdDt theId) {
patient.addName().addFamily("Smith");
// Set the ID and version
patient.setId(theId);
patient.getResourceMetadata().put(ResourceMetadataKeyEnum.VERSION_ID, new IdDt("1"));
patient.setId(theId.withVersion("1"));
// ...populate the rest...
return retVal;
@ -322,14 +321,14 @@ public List<DiagnosticReport> getDiagnosticReport(
@RequiredParam(name=DiagnosticReport.SP_IDENTIFIER)
IdentifierDt theIdentifier,
@IncludeParam(allow= {"DiagnosticReport.subject"})
Set<PathSpecification> theIncludes ) {
Set<Include> theIncludes ) {
List<DiagnosticReport> retVal = new ArrayList<DiagnosticReport>();
// Assume this method exists and loads the report from the DB
DiagnosticReport report = loadSomeDiagnosticReportFromDatabase(theIdentifier);
// If the client has asked for the subject to be included:
if (theIncludes.contains(new PathSpecification("DiagnosticReport.subject"))) {
if (theIncludes.contains(new Include("DiagnosticReport.subject"))) {
// The resource reference should contain the ID of the patient
IdDt subjectId = report.getSubject().getId();

View File

@ -352,10 +352,13 @@ public class JsonParserTest {
}
@Test
public void testEncodeExt() throws Exception {
ValueSet valueSet = new ValueSet();
valueSet.setId("123456");
Define define = valueSet.getDefine();
DefineConcept code = define.addConcept();
code.setCode("someCode");
@ -365,6 +368,9 @@ public class JsonParserTest {
String encoded = new FhirContext().newJsonParser().encodeResourceToString(valueSet);
ourLog.info(encoded);
assertThat(encoded, not(containsString("123456")));
assertThat(encoded, containsString("\"define\":{\"concept\":[{\"code\":\"someCode\",\"display\":\"someDisplay\"}],\"_concept\":[{\"extension\":[{\"url\":\"urn:alt\",\"valueString\":\"alt name\"}]}]}"));
}

View File

@ -0,0 +1,156 @@
package ca.uhn.fhir.rest.server;
import static org.junit.Assert.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.model.api.Bundle;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.PathSpecification;
import ca.uhn.fhir.model.dstu.resource.Patient;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.annotation.IncludeParam;
import ca.uhn.fhir.rest.annotation.RequiredParam;
import ca.uhn.fhir.rest.annotation.Search;
import ca.uhn.fhir.rest.annotation.Sort;
import ca.uhn.fhir.rest.api.SortSpec;
import ca.uhn.fhir.testutil.RandomServerPortProvider;
/**
* Created by dsotnikov on 2/25/2014.
*/
public class IncludeTest {
private static CloseableHttpClient ourClient;
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(IncludeTest.class);
private static int ourPort;
private static Server ourServer;
@Test
public void testNoIncludes() throws Exception {
HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?name=Hello");
HttpResponse status = ourClient.execute(httpGet);
String responseContent = IOUtils.toString(status.getEntity().getContent());
assertEquals(200, status.getStatusLine().getStatusCode());
Bundle bundle = new FhirContext().newXmlParser().parseBundle(responseContent);
assertEquals(1, bundle.size());
Patient p = bundle.getResources(Patient.class).get(0);
assertEquals(0, p.getName().size());
assertEquals("Hello", p.getId().getUnqualifiedId());
}
@Test
public void testOneInclude() throws Exception {
HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?name=Hello&_include=foo");
HttpResponse status = ourClient.execute(httpGet);
String responseContent = IOUtils.toString(status.getEntity().getContent());
assertEquals(200, status.getStatusLine().getStatusCode());
Bundle bundle = new FhirContext().newXmlParser().parseBundle(responseContent);
assertEquals(1, bundle.size());
Patient p = bundle.getResources(Patient.class).get(0);
assertEquals(1, p.getName().size());
assertEquals("Hello", p.getId().getUnqualifiedId());
assertEquals("foo", p.getName().get(0).getFamilyFirstRep().getValue());
}
@Test
public void testTwoInclude() throws Exception {
HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?name=Hello&_include=foo&_include=bar");
HttpResponse status = ourClient.execute(httpGet);
String responseContent = IOUtils.toString(status.getEntity().getContent());
assertEquals(200, status.getStatusLine().getStatusCode());
Bundle bundle = new FhirContext().newXmlParser().parseBundle(responseContent);
assertEquals(1, bundle.size());
Patient p = bundle.getResources(Patient.class).get(0);
assertEquals(2, p.getName().size());
assertEquals("Hello", p.getId().getUnqualifiedId());
assertEquals("foo", p.getName().get(0).getFamilyFirstRep().getValue());
assertEquals("bar", p.getName().get(1).getFamilyFirstRep().getValue());
}
@Test
public void testBadInclude() throws Exception {
HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Patient?name=Hello&_include=foo&_include=baz");
HttpResponse status = ourClient.execute(httpGet);
assertEquals(400, status.getStatusLine().getStatusCode());
}
@AfterClass
public static void afterClass() throws Exception {
ourServer.stop();
}
@BeforeClass
public static void beforeClass() throws Exception {
ourPort = RandomServerPortProvider.findFreePort();
ourServer = new Server(ourPort);
DummyPatientResourceProvider patientProvider = new DummyPatientResourceProvider();
ServletHandler proxyHandler = new ServletHandler();
RestfulServer servlet = new RestfulServer();
servlet.setResourceProviders(patientProvider);
ServletHolder servletHolder = new ServletHolder(servlet);
proxyHandler.addServletWithMapping(servletHolder, "/*");
ourServer.setHandler(proxyHandler);
ourServer.start();
PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS);
HttpClientBuilder builder = HttpClientBuilder.create();
builder.setConnectionManager(connectionManager);
ourClient = builder.build();
}
/**
* Created by dsotnikov on 2/25/2014.
*/
public static class DummyPatientResourceProvider implements IResourceProvider {
@Search
public List<Patient> findPatient(@RequiredParam(name = Patient.SP_NAME) StringDt theName, @IncludeParam(allow = { "foo", "bar" }) Set<PathSpecification> theIncludes) {
ArrayList<Patient> retVal = new ArrayList<Patient>();
Patient p = new Patient();
p.addIdentifier("foo", "bar");
p.setId(theName.getValue());
if (theIncludes != null) {
for (PathSpecification next : theIncludes) {
p.addName().addFamily().setValue(next.getValue());
}
}
retVal.add(p);
return retVal;
}
@Override
public Class<? extends IResource> getResourceType() {
return Patient.class;
}
}
}

View File

@ -46,10 +46,12 @@ import ca.uhn.fhir.jpa.entity.TagDefinition;
import ca.uhn.fhir.model.api.IPrimitiveDatatype;
import ca.uhn.fhir.model.api.IQueryParameterType;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.Include;
import ca.uhn.fhir.model.api.TagList;
import ca.uhn.fhir.model.dstu.composite.CodingDt;
import ca.uhn.fhir.model.dstu.composite.IdentifierDt;
import ca.uhn.fhir.model.dstu.composite.QuantityDt;
import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt;
import ca.uhn.fhir.model.dstu.valueset.SearchParamTypeEnum;
import ca.uhn.fhir.model.primitive.IdDt;
import ca.uhn.fhir.model.primitive.StringDt;
@ -59,7 +61,9 @@ import ca.uhn.fhir.rest.param.QualifiedDateParam;
import ca.uhn.fhir.rest.param.ReferenceParam;
import ca.uhn.fhir.rest.param.StringParam;
import ca.uhn.fhir.rest.server.Constants;
import ca.uhn.fhir.rest.server.exceptions.InvalidRequestException;
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
import ca.uhn.fhir.util.FhirTerser;
@Transactional(propagation = Propagation.REQUIRED)
public class FhirResourceDao<T extends IResource> extends BaseFhirDao implements IFhirResourceDao<T> {
@ -492,7 +496,8 @@ public class FhirResourceDao<T extends IResource> extends BaseFhirDao implements
ArrayList<T> retVal = new ArrayList<T>();
String resourceType = getContext().getResourceDefinition(myResourceType).getName();
TypedQuery<ResourceHistoryTable> q = myEntityManager.createQuery("SELECT h FROM ResourceHistoryTable h WHERE h.myResourceId = :PID AND h.myResourceType = :RESTYPE ORDER BY h.myUpdated ASC", ResourceHistoryTable.class);
TypedQuery<ResourceHistoryTable> q = myEntityManager.createQuery("SELECT h FROM ResourceHistoryTable h WHERE h.myResourceId = :PID AND h.myResourceType = :RESTYPE ORDER BY h.myUpdated ASC",
ResourceHistoryTable.class);
q.setParameter("PID", theId.asLong());
q.setParameter("RESTYPE", resourceType);
@ -531,8 +536,9 @@ public class FhirResourceDao<T extends IResource> extends BaseFhirDao implements
if (sp == null) {
throw new ConfigurationException("Unknown search param on resource[" + myResourceName + "] for secondary key[" + mySecondaryPrimaryKeyParamName + "]");
}
if (sp.getParamType()!=SearchParamTypeEnum.TOKEN) {
throw new ConfigurationException("Search param on resource[" + myResourceName + "] for secondary key[" + mySecondaryPrimaryKeyParamName + "] is not a token type, only token is supported");
if (sp.getParamType() != SearchParamTypeEnum.TOKEN) {
throw new ConfigurationException("Search param on resource[" + myResourceName + "] for secondary key[" + mySecondaryPrimaryKeyParamName
+ "] is not a token type, only token is supported");
}
}
@ -557,7 +563,8 @@ public class FhirResourceDao<T extends IResource> extends BaseFhirDao implements
if (entity == null) {
if (theId.hasUnqualifiedVersionId()) {
TypedQuery<ResourceHistoryTable> q = myEntityManager.createQuery("SELECT t from ResourceHistoryTable t WHERE t.myResourceId = :RID AND t.myResourceType = :RTYP AND t.myResourceVersion = :RVER", ResourceHistoryTable.class);
TypedQuery<ResourceHistoryTable> q = myEntityManager.createQuery(
"SELECT t from ResourceHistoryTable t WHERE t.myResourceId = :RID AND t.myResourceType = :RTYP AND t.myResourceVersion = :RVER", ResourceHistoryTable.class);
q.setParameter("RID", theId.asLong());
q.setParameter("RTYP", myResourceName);
q.setParameter("RVER", theId.getUnqualifiedVersionIdAsLong());
@ -608,33 +615,68 @@ public class FhirResourceDao<T extends IResource> extends BaseFhirDao implements
@Override
public List<T> search(SearchParameterMap theParams) {
Set<Long> pids;
Set<Long> loadPids;
if (theParams.isEmpty()) {
pids = null;
loadPids = null;
} else {
pids = searchForIdsWithAndOr(theParams);
if (pids.isEmpty()) {
loadPids = searchForIdsWithAndOr(theParams);
if (loadPids.isEmpty()) {
return new ArrayList<T>();
}
}
// Execute the query and make sure we return distinct results
{
CriteriaBuilder builder = myEntityManager.getCriteriaBuilder();
CriteriaQuery<ResourceTable> cq = builder.createQuery(ResourceTable.class);
Root<ResourceTable> from = cq.from(ResourceTable.class);
cq.where(builder.equal(from.get("myResourceType"), getContext().getResourceDefinition(myResourceType).getName()));
if (!theParams.isEmpty()) {
cq.where(from.get("myId").in(pids));
}
TypedQuery<ResourceTable> q = myEntityManager.createQuery(cq);
List<T> retVal=new ArrayList<T>();
loadResourcesByPid(loadPids, retVal);
List<T> retVal = new ArrayList<T>();
for (ResourceTable next : q.getResultList()) {
T resource = toResource(myResourceType, next);
retVal.add(resource);
// Load _include resources
if (theParams.getIncludes() != null && theParams.isEmpty() == false) {
Set<Long> includePids = new HashSet<Long>();
FhirTerser t = getContext().newTerser();
for (Include next : theParams.getIncludes()) {
for (T nextResource : retVal) {
List<Object> values = t.getValues(nextResource, next.getValue());
for (Object object : values) {
if (object == null) {
continue;
}
if (!(object instanceof ResourceReferenceDt)) {
throw new InvalidRequestException("Path '" + next.getValue() + "' produced non ResourceReferenceDt value: " + object.getClass());
}
ResourceReferenceDt rr = (ResourceReferenceDt) object;
if (rr.getReference().isEmpty()) {
continue;
}
if (rr.getReference().isLocal()) {
continue;
}
includePids.add(rr.getReference().asLong());
}
}
}
return retVal;
if (!includePids.isEmpty()) {
ourLog.info("Loading {} included resources");
loadResourcesByPid(includePids, retVal);
}
}
return retVal;
}
private void loadResourcesByPid(Set<Long> thePids, List<T> theResourceListToPopulate) {
CriteriaBuilder builder = myEntityManager.getCriteriaBuilder();
CriteriaQuery<ResourceTable> cq = builder.createQuery(ResourceTable.class);
Root<ResourceTable> from = cq.from(ResourceTable.class);
cq.where(builder.equal(from.get("myResourceType"), getContext().getResourceDefinition(myResourceType).getName()));
if (thePids != null) {
cq.where(from.get("myId").in(thePids));
}
TypedQuery<ResourceTable> q = myEntityManager.createQuery(cq);
for (ResourceTable next : q.getResultList()) {
T resource = toResource(myResourceType, next);
theResourceListToPopulate.add(resource);
}
}

View File

@ -46,7 +46,9 @@ public class FhirSystemDao extends BaseFhirDao implements IFhirSystemDao {
int updates = 0;
Map<IdDt, IdDt> idConversions = new HashMap<IdDt, IdDt>();
List<ResourceTable> persistedResources = new ArrayList<ResourceTable>();
for (IResource nextResource : theResources) {
IdDt nextId = nextResource.getId();
if (nextId == null) {
@ -73,7 +75,7 @@ public class FhirSystemDao extends BaseFhirDao implements IFhirSystemDao {
if (entity == null) {
entity = toEntity(nextResource);
myEntityManager.persist(entity);
myEntityManager.flush();
// myEntityManager.flush();
creations++;
ourLog.info("Resource Type[{}] with ID[{}] does not exist, creating it", resourceName, nextId);
} else {
@ -81,8 +83,19 @@ public class FhirSystemDao extends BaseFhirDao implements IFhirSystemDao {
ourLog.info("Resource Type[{}] with ID[{}] exists, updating it", resourceName, nextId);
}
persistedResources.add(entity);
}
myEntityManager.flush();
for (int i = 0; i < persistedResources.size();i++) {
ResourceTable entity = persistedResources.get(i);
String resourceName = toResourceName(theResources.get(i));
IdDt nextId = theResources.get(i).getId();
IdDt newId = new IdDt(resourceName + '/' + entity.getId());
if (nextId.isEmpty()) {
if (nextId == null || nextId.isEmpty()) {
ourLog.info("Transaction resource (with no preexisting ID) has been assigned new ID[{}]", nextId, newId);
} else if (newId.equals(entity.getId())) {
ourLog.info("Transaction resource ID[{}] is being updated", newId);
@ -93,11 +106,9 @@ public class FhirSystemDao extends BaseFhirDao implements IFhirSystemDao {
idConversions.put(nextId, newId);
}
}
persistedResources.add(entity);
}
for (IResource nextResource : theResources) {
List<ResourceReferenceDt> allRefs = terser.getAllPopulatedChildElementsOfType(nextResource, ResourceReferenceDt.class);
for (ResourceReferenceDt nextRef : allRefs) {

View File

@ -2,28 +2,21 @@ package ca.uhn.fhir.jpa.dao;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import ca.uhn.fhir.model.api.IQueryParameterAnd;
import ca.uhn.fhir.model.api.IQueryParameterOr;
import ca.uhn.fhir.model.api.IQueryParameterType;
import ca.uhn.fhir.model.api.Include;
public class SearchParameterMap extends HashMap<String, List<List<IQueryParameterType>>> {
private static final long serialVersionUID = 1L;
public void add(String theName, IQueryParameterType theParam) {
if (theParam == null) {
return;
}
if (!containsKey(theName)) {
put(theName, new ArrayList<List<IQueryParameterType>>());
}
ArrayList<IQueryParameterType> list = new ArrayList<IQueryParameterType>();
list.add(theParam);
get(theName).add(list);
}
private Set<Include> myIncludes;
public void add(String theName, IQueryParameterAnd theAnd) {
if (theAnd==null) {
return;
@ -40,4 +33,33 @@ public class SearchParameterMap extends HashMap<String, List<List<IQueryParamete
}
}
public void add(String theName, IQueryParameterType theParam) {
if (theParam == null) {
return;
}
if (!containsKey(theName)) {
put(theName, new ArrayList<List<IQueryParameterType>>());
}
ArrayList<IQueryParameterType> list = new ArrayList<IQueryParameterType>();
list.add(theParam);
get(theName).add(list);
}
public Set<Include> getIncludes() {
if (myIncludes==null) {
myIncludes=new HashSet<Include>();
}
return myIncludes;
}
public void setIncludes(Set<Include> theIncludes) {
myIncludes = theIncludes;
}
public void addInclude(Include theInclude) {
getIncludes().add(theInclude);
}
}

View File

@ -178,12 +178,12 @@ public class FhirResourceDaoTest {
assertEquals(1, found.size());
assertEquals(id, found.get(0).getId().asLong().longValue());
found = ourPatientDao.search(Patient.SP_GENDER, new IdentifierDt(null, "M"));
assertEquals(1, found.size());
assertEquals(id, found.get(0).getId().asLong().longValue());
found = ourPatientDao.search(Patient.SP_GENDER, new IdentifierDt(null, "F"));
assertEquals(0, found.size());
// found = ourPatientDao.search(Patient.SP_GENDER, new IdentifierDt(null, "M"));
// assertEquals(1, found.size());
// assertEquals(id, found.get(0).getId().asLong().longValue());
//
// found = ourPatientDao.search(Patient.SP_GENDER, new IdentifierDt(null, "F"));
// assertEquals(0, found.size());
SearchParameterMap map = new SearchParameterMap();
map.put(Patient.SP_IDENTIFIER, new ArrayList<List<IQueryParameterType>>());
@ -382,6 +382,39 @@ public class FhirResourceDaoTest {
}
@Test
public void testSearchWithIncludes() {
{
Organization org = new Organization();
org.getName().setValue("testSearchWithIncludes_O1");
IdDt orgId = ourOrganizationDao.create(org).getId();
Patient patient = new Patient();
patient.addIdentifier("urn:system", "001");
patient.addName().addFamily("Tester_testSearchWithIncludes_P1").addGiven("Joe");
patient.getManagingOrganization().setReference(orgId);
ourPatientDao.create(patient);
}
{
Patient patient = new Patient();
patient.addIdentifier("urn:system", "002");
patient.addName().addFamily("Tester_testSearchWithIncludes_P2").addGiven("John");
ourPatientDao.create(patient);
}
SearchParameterMap params = new SearchParameterMap();
params.add(Patient.SP_FAMILY, new StringDt("Tester_testSearchWithIncludes_P1"));
params.addInclude(Patient.INCLUDE_MANAGINGORGANIZATION);
List<Patient> patients = ourPatientDao.search(params);
assertEquals(2, patients.size());
params = new SearchParameterMap();
params.add(Patient.SP_FAMILY, new StringDt("Tester_testSearchWithIncludes_P1"));
patients = ourPatientDao.search(params);
assertEquals(1, patients.size());
}
@Test
public void testDatePeriodParamStartOnly() {

View File

@ -16,6 +16,7 @@ import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import ch.qos.logback.core.pattern.color.BlackCompositeConverter;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.model.api.Bundle;
import ca.uhn.fhir.model.api.IResource;
@ -217,6 +218,12 @@ public class FhirSystemDaoTest {
List<IResource> res = bundle.toListOfResources();
ourSystemDao.transaction(res);
Patient p1 = (Patient) res.get(0);
String id = p1.getId().getValue();
ourLog.info("ID: {}",id);
assertThat(id, not(containsString("5556918")));
assertThat(id, not(equalToIgnoringCase("")));
}
@Test

View File

@ -1,7 +1,6 @@
package ca.uhn.fhirtest;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Collection;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@ -40,6 +39,8 @@ public class TestRestfulServer extends RestfulServer {
IFhirSystemDao systemDao = myAppCtx.getBean(IFhirSystemDao.class);
JpaSystemProvider sp = new JpaSystemProvider(systemDao);
setPlainProviders(sp);
setUseBrowserFriendlyContentTypes(true);
}
@Override

View File

@ -1,39 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="target/generated-sources/tinder"/>
<classpathentry kind="var" path="M2_REPO/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar" sourcepath="M2_REPO/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.jar" sourcepath="M2_REPO/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0-sources.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="var" path="M2_REPO/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar" sourcepath="M2_REPO/com/google/code/gson/gson/2.2.4/gson-2.2.4-sources.jar">
<attributes>
<attribute name="javadoc_location" value="jar:file:/home/t3903uhn/.m2/repository/com/google/code/gson/gson/2.2.4/gson-2.2.4-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="var" path="M2_REPO/org/codehaus/woodstox/woodstox-core-asl/4.2.0/woodstox-core-asl-4.2.0.jar" sourcepath="M2_REPO/org/codehaus/woodstox/woodstox-core-asl/4.2.0/woodstox-core-asl-4.2.0-sources.jar">
<attributes>
<attribute name="javadoc_location" value="jar:file:/home/t3903uhn/.m2/repository/org/codehaus/woodstox/woodstox-core-asl/4.2.0/woodstox-core-asl-4.2.0-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="var" path="M2_REPO/org/codehaus/woodstox/stax2-api/3.1.1/stax2-api-3.1.1.jar" sourcepath="M2_REPO/org/codehaus/woodstox/stax2-api/3.1.1/stax2-api-3.1.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/commons/commons-lang3/3.2.1/commons-lang3-3.2.1.jar" sourcepath="M2_REPO/org/apache/commons/commons-lang3/3.2.1/commons-lang3-3.2.1-sources.jar">
<attributes>
<attribute name="javadoc_location" value="jar:file:/home/t3903uhn/.m2/repository/org/apache/commons/commons-lang3/3.2.1/commons-lang3-3.2.1-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.9/commons-codec-1.9.jar" sourcepath="M2_REPO/commons-codec/commons-codec/1.9/commons-codec-1.9-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.7.6/slf4j-api-1.7.6.jar" sourcepath="M2_REPO/org/slf4j/slf4j-api/1.7.6/slf4j-api-1.7.6-sources.jar">
<attributes>
<attribute name="javadoc_location" value="jar:file:/home/t3903uhn/.m2/repository/org/slf4j/slf4j-api/1.7.6/slf4j-api-1.7.6-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpclient/4.2.3/httpclient-4.2.3.jar" sourcepath="M2_REPO/org/apache/httpcomponents/httpclient/4.2.3/httpclient-4.2.3-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpcore/4.2.2/httpcore-4.2.2.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar" sourcepath="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1-sources.jar">
<attributes>
<attribute name="javadoc_location" value="jar:file:/home/t3903uhn/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1-javadoc.jar!/"/>
</attributes>
</classpathentry>
<classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.17/log4j-1.2.17.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/hapi-fhir-base"/>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@ -1,14 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>hapi-fhir-structures-dstu</name>
<comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
<projects/>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
<name>hapi-fhir-structures-dstu</name>
<comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -8,4 +8,5 @@ org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.6

View File

@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

View File

@ -9,7 +9,6 @@
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-dstu</artifactId>
<packaging>jar</packaging>

View File

@ -47,5 +47,15 @@ public abstract class BaseRootType extends BaseElement {
public void setProfile(String theProfile) {
myProfile = theProfile;
}
public ArrayList<SearchParameter> getSearchParametersResource() {
ArrayList<SearchParameter> retVal = new ArrayList<SearchParameter>();
for(SearchParameter next:getSearchParameters()) {
if(next.getType().equals("reference")) {
retVal.add(next);
}
}
return retVal;
}
}

View File

@ -289,6 +289,7 @@ public abstract class BaseStructureParser {
ctx.put("resourceBlockChildren", theResource.getResourceBlockChildren());
ctx.put("childExtensionTypes", ObjectUtils.defaultIfNull(myExtensions, new ArrayList<Extension>()));
ctx.put("searchParams", (theResource.getSearchParameters()));
ctx.put("searchParamsReference", (theResource.getSearchParametersResource()));
ctx.put("searchParamsWithoutComposite", (theResource.getSearchParametersWithoutComposite()));
VelocityEngine v = new VelocityEngine();

View File

@ -24,33 +24,48 @@ public class ${className}ResourceProvider extends JpaResourceProvider<${classNam
@Search()
public List<${className}> search(
@Description(shortDefinition="The resource identity")
@OptionalParam(name="_id")
StringParam theId,
#foreach ( $param in $searchParamsWithoutComposite ) #{if}(true) #{end}
@Description(shortDefinition="${param.description}")
@OptionalParam(name="${param.name}")
#if (${param.type} == 'string' )
StringParam the${param.nameCapitalized} #{if}($foreach.hasNext), #{end}
StringParam the${param.nameCapitalized},
#elseif (${param.type} == 'token' )
IdentifierDt the${param.nameCapitalized} #{if}($foreach.hasNext), #{end}
IdentifierDt the${param.nameCapitalized},
#elseif (${param.type} == 'date' )
DateRangeParam the${param.nameCapitalized} #{if}($foreach.hasNext), #{end}
DateRangeParam the${param.nameCapitalized},
#elseif (${param.type} == 'quantity' )
QuantityDt the${param.nameCapitalized} #{if}($foreach.hasNext), #{end}
QuantityDt the${param.nameCapitalized},
#elseif (${param.type} == 'number' )
QuantityDt the${param.nameCapitalized} #{if}($foreach.hasNext), #{end}
QuantityDt the${param.nameCapitalized},
#elseif (${param.type} == 'reference' )
ReferenceParam the${param.nameCapitalized} #{if}($foreach.hasNext), #{end}
ReferenceParam the${param.nameCapitalized},
#elseif (${param.type} == 'composite' )
ReferenceParam the${param.nameCapitalized} #{if}($foreach.hasNext), #{end}
ReferenceParam the${param.nameCapitalized},
#end
#end
@IncludeParam(allow= {
#foreach ( $param in $searchParamsReference )
#set ( $haveMore = $foreach.hasNext )
#foreach ( $include in $param.paths )
"${include.path}" #{if}($foreach.hasNext || $haveMore), #{end}
#end
#end
})
Set<PathSpecification> theIncludes
) {
SearchParameterMap paramMap = new SearchParameterMap();
paramMap.add("_id", theId);
#foreach ( $param in $searchParamsWithoutComposite )
paramMap.add("${param.name}", the${param.nameCapitalized});
#end
paramMap.setIncludes(theIncludes);
return getDao().search(paramMap);
}
}

View File

@ -0,0 +1,13 @@
package test;
import org.junit.Test;
public class TestParticulars {
@Test
public void testReferenceDoesntReturnNull() {
ca.uhn.test.realstructs.resource.Patient p = new ca.uhn.test.realstructs.resource.Patient();
p.getManagingOrganization().toString();
}
}