diff --git a/hapi-fhir-base/src/changes/changes.xml b/hapi-fhir-base/src/changes/changes.xml index b6d06310324..9c5fc1f629b 100644 --- a/hapi-fhir-base/src/changes/changes.xml +++ b/hapi-fhir-base/src/changes/changes.xml @@ -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. + + Server methods with @Include parameter would sometimes fail when no _include was actually + specified in query strings. + diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/BaseResource.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/BaseResource.java index 8ae52072065..92bd2acd8ac 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/BaseResource.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/BaseResource.java @@ -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 myResourceMetadata; + private Map, 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 getResourceMetadata() { + public Map, Object> getResourceMetadata() { if (myResourceMetadata == null) { - myResourceMetadata = new HashMap(); + myResourceMetadata = new HashMap, Object>(); } return myResourceMetadata; } @@ -81,7 +81,7 @@ public abstract class BaseResource extends BaseElement implements IResource { } @Override - public void setResourceMetadata(Map theMap) { + public void setResourceMetadata(Map, Object> theMap) { Validate.notNull(theMap, "The Map must not be null"); myResourceMetadata = theMap; } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IResource.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IResource.java index a13de851aa5..00f108ba26c 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IResource.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/IResource.java @@ -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 getResourceMetadata(); + Map, 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 theMap); + void setResourceMetadata(Map, Object> theMap); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/Include.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/Include.java new file mode 100644 index 00000000000..3ca26827942 --- /dev/null +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/Include.java @@ -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. + * Patient.gender.coding + *

+ * 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)}. + *

+ */ +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(); + } + +} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/PathSpecification.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/PathSpecification.java index cd017b1b687..1326506c576 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/PathSpecification.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/PathSpecification.java @@ -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)}. *

+ * + * @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(); - } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/ResourceMetadataKeyEnum.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/ResourceMetadataKeyEnum.java index 7fcf19fba99..459b360ce6a 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/ResourceMetadataKeyEnum.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/api/ResourceMetadataKeyEnum.java @@ -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 { /** @@ -41,18 +41,17 @@ public enum ResourceMetadataKeyEnum { * Values for this key are of type {@link InstantDt} *

*/ - DELETED_AT { + public static final ResourceMetadataKeyEnum DELETED_AT = new ResourceMetadataKeyEnum("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 {@link IdDt} *

*/ - PREVIOUS_ID { + public static final ResourceMetadataKeyEnum PREVIOUS_ID = new ResourceMetadataKeyEnum("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 Published time. This is @@ -90,19 +88,18 @@ public enum ResourceMetadataKeyEnum { * * @see InstantDt */ - PUBLISHED { + public static final ResourceMetadataKeyEnum PUBLISHED = new ResourceMetadataKeyEnum("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 TAG_LIST = new ResourceMetadataKeyEnum("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 UPDATED = new ResourceMetadataKeyEnum("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 VERSION_ID = new ResourceMetadataKeyEnum("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 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, 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 theResourceMetadata, ResourceMetadataKeyEnum theKey) { + private String name() { + return myValue; + } + + private static InstantDt getInstantFromMetadataOrNullIfNone(Map, Object> theResourceMetadata, ResourceMetadataKeyEnum 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); + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AdverseReaction.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AdverseReaction.java index 2078ea9b4be..62113091ec9 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AdverseReaction.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AdverseReaction.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Alert.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Alert.java index 1a222da8d8d..3f37ea9ad2f 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Alert.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Alert.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AllergyIntolerance.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AllergyIntolerance.java index fb0a782a2f3..b9b57f87917 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AllergyIntolerance.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AllergyIntolerance.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Appointment.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Appointment.java index d183ac3fc26..f94a30e1bc0 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Appointment.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Appointment.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AppointmentResponse.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AppointmentResponse.java index 3e71710710d..9bf7aaea81a 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AppointmentResponse.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/AppointmentResponse.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Availability.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Availability.java index 9736e54d678..57808779ccd 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Availability.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Availability.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/CarePlan.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/CarePlan.java index bb6087a1560..0a9aef043c4 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/CarePlan.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/CarePlan.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Composition.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Composition.java index 62b445a29b8..e8161fcd816 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Composition.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Composition.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ConceptMap.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ConceptMap.java index b78c01f9ea2..20e57e5eb60 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ConceptMap.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ConceptMap.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Condition.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Condition.java index cc2128f4e52..13a996b5fdc 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Condition.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Condition.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Conformance.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Conformance.java index 343d4c78659..36b48852aa1 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Conformance.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Conformance.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Coverage.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Coverage.java index b0d45c35f2d..1f8709388b6 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Coverage.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Coverage.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Device.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Device.java index 0ad1cff68b3..74ee2ccfe24 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Device.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Device.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DeviceObservationReport.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DeviceObservationReport.java index e3b0fce48e2..7bb2fad194e 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DeviceObservationReport.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DeviceObservationReport.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticOrder.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticOrder.java index 364ca79164f..d18e50ca8d0 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticOrder.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticOrder.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticReport.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticReport.java index 52ce01075b2..cea73cdffbc 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticReport.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DiagnosticReport.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DocumentManifest.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DocumentManifest.java index 7e2c50e15fe..38a28820285 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DocumentManifest.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DocumentManifest.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DocumentReference.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DocumentReference.java index 8428d3b30c4..3996f868f27 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DocumentReference.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/DocumentReference.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Encounter.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Encounter.java index 784e426faee..62bcfbfea42 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Encounter.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Encounter.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/FamilyHistory.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/FamilyHistory.java index 18f80dec82d..4c2d18d7a47 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/FamilyHistory.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/FamilyHistory.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GVFMeta.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GVFMeta.java index 2cfaefea4d8..4120e6f035f 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GVFMeta.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GVFMeta.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GVFVariant.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GVFVariant.java index 6f251741c85..39801299f9b 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GVFVariant.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GVFVariant.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GeneExpression.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GeneExpression.java index 39cd9278381..bbacea05191 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GeneExpression.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GeneExpression.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GeneticAnalysis.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GeneticAnalysis.java index 097a23df3b8..8c4febba0d8 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GeneticAnalysis.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/GeneticAnalysis.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Group.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Group.java index 096949b5bb8..6a68604071d 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Group.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Group.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ImagingStudy.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ImagingStudy.java index db7a39f2951..465ded6cd10 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ImagingStudy.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ImagingStudy.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Immunization.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Immunization.java index 729a406d04f..4c0eb47a0b6 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Immunization.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Immunization.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ImmunizationRecommendation.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ImmunizationRecommendation.java index d9a7be3133d..6dd8738c2ec 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ImmunizationRecommendation.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ImmunizationRecommendation.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ListResource.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ListResource.java index e0806bbf687..ed674b06fa6 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ListResource.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/ListResource.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Location.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Location.java index a84782084ae..dd63af89fe5 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Location.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Location.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Media.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Media.java index 9df3ea95433..21a2f7b1ca6 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Media.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Media.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Medication.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Medication.java index 447b40f7745..3e409e18c83 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Medication.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Medication.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationAdministration.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationAdministration.java index 00fa2a71f5f..5e08d67cb8d 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationAdministration.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationAdministration.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationDispense.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationDispense.java index f862f37ef36..e06d16c4ac0 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationDispense.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationDispense.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationPrescription.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationPrescription.java index 3b170d5ff68..51f4ecb72ab 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationPrescription.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationPrescription.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationStatement.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationStatement.java index ff70a50aa0b..d481efc9fd7 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationStatement.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/MedicationStatement.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Microarray.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Microarray.java index 058673c7637..f88b4dde793 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Microarray.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Microarray.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Observation.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Observation.java index 843d51a3b3f..a9abd0c7bfb 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Observation.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Observation.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Order.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Order.java index d19f61229c0..c65ed75c123 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Order.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Order.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/OrderResponse.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/OrderResponse.java index 14e5d652a9a..4ee70e6eada 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/OrderResponse.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/OrderResponse.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Organization.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Organization.java index 61f14d9ee89..a006c505d45 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Organization.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Organization.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Other.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Other.java index ccd77a66319..728f707f20d 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Other.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Other.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Patient.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Patient.java index 89da8c74aa4..636aa574079 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Patient.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Patient.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Practitioner.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Practitioner.java index 3b8ce2117ff..b0aff8139db 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Practitioner.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Practitioner.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Procedure.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Procedure.java index 1fec2218212..c6aadfcf234 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Procedure.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Procedure.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Profile.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Profile.java index bbe605b23f8..67fb9d42e26 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Profile.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Profile.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Provenance.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Provenance.java index e6e25233456..9d9c9516654 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Provenance.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Provenance.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Questionnaire.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Questionnaire.java index 409010733a1..57b19ab0939 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Questionnaire.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Questionnaire.java @@ -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 *

*/ - public ResourceReferenceDt getSubject() { + public ResourceReferenceDt getSubject() { + if (mySubject==null) { + mySubject = new ResourceReferenceDt(); + } return mySubject; } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/RelatedPerson.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/RelatedPerson.java index e1cf668c491..003fce2a593 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/RelatedPerson.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/RelatedPerson.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SecurityEvent.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SecurityEvent.java index 7f71eb31c60..8d6b9706f64 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SecurityEvent.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SecurityEvent.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SequencingAnalysis.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SequencingAnalysis.java index 2cadd671c55..ed05ca99a03 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SequencingAnalysis.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SequencingAnalysis.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SequencingLab.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SequencingLab.java index 612ca14ee8b..8ed09e6b137 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SequencingLab.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/SequencingLab.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Slot.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Slot.java index 98b1080c795..2a121cba16f 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Slot.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Slot.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Specimen.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Specimen.java index 807e66f8028..730dd4144ee 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Specimen.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Specimen.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Substance.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Substance.java index 2cdcac55034..3fd57d39361 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Substance.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Substance.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Supply.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Supply.java index 9c13f18e826..4cb922ba27c 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Supply.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Supply.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/User.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/User.java index 6b929596a75..20681afc179 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/User.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/User.java @@ -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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/IdDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/IdDt.java index f20ef15d5ac..a1b88de25bc 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/IdDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/IdDt.java @@ -72,7 +72,7 @@ public class IdDt extends BasePrimitive { setValue(null); } } - + /** * Create a new ID using a long */ @@ -100,14 +100,17 @@ public class IdDt extends BasePrimitive { /** * 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 { public Long getUnqualifiedVersionIdAsLong() { if (!hasUnqualifiedVersionId()) { return null; - }else { + } else { return Long.parseLong(getUnqualifiedVersionId()); } } @@ -289,13 +292,15 @@ public class IdDt extends BasePrimitive { } /** - * 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 { } 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 { 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 { */ @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 true 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); + } } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/JsonParser.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/JsonParser.java index d3bbb2acc73..32e8e04e684 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/JsonParser.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/JsonParser.java @@ -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()); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/ParserState.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/ParserState.java index 1b45df5c123..92648f6f344 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/ParserState.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/parser/ParserState.java @@ -405,19 +405,19 @@ class ParserState { myEntry.getResource().setId(id); } - Map metadata = myEntry.getResource().getResourceMetadata(); + Map, 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 { 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 { 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 { 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 { 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; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/GenericClient.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/GenericClient.java index 9ab76aa0c95..d7647caa5c5 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/GenericClient.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/GenericClient.java @@ -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) { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/gclient/IQuery.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/gclient/IQuery.java index 96a5db51cec..ce8f45e582b 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/gclient/IQuery.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/gclient/IQuery.java @@ -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 { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/gclient/Include.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/gclient/Include.java deleted file mode 100644 index d66341620de..00000000000 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/gclient/Include.java +++ /dev/null @@ -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; - } - -} diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/BaseQueryParameter.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/BaseQueryParameter.java index 7d9c8d0af8c..388d957ead1 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/BaseQueryParameter.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/BaseQueryParameter.java @@ -100,7 +100,7 @@ public abstract class BaseQueryParameter implements IParameter { if (paramList.isEmpty()) { if (handlesMissing()) { - return paramList; + return parse(paramList); } else { return null; } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/IncludeParameter.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/IncludeParameter.java index 2b69e205bac..a2934079f3c 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/IncludeParameter.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/IncludeParameter.java @@ -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 val = (Collection) 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 theString) throws InternalErrorException, InvalidRequestException { Collection 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 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; } - } diff --git a/hapi-fhir-base/src/site/apt/building.apt b/hapi-fhir-base/src/site/apt/building.apt deleted file mode 100644 index 3c598dcac68..00000000000 --- a/hapi-fhir-base/src/site/apt/building.apt +++ /dev/null @@ -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 -+----------------+ - - \ No newline at end of file diff --git a/hapi-fhir-base/src/site/example/java/example/RestfulPatientResourceProviderMore.java b/hapi-fhir-base/src/site/example/java/example/RestfulPatientResourceProviderMore.java index a3dba718969..852c7d16ca3 100644 --- a/hapi-fhir-base/src/site/example/java/example/RestfulPatientResourceProviderMore.java +++ b/hapi-fhir-base/src/site/example/java/example/RestfulPatientResourceProviderMore.java @@ -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 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 getDiagnosticReport( @RequiredParam(name=DiagnosticReport.SP_IDENTIFIER) IdentifierDt theIdentifier, @IncludeParam(allow= {"DiagnosticReport.subject"}) - Set theIncludes ) { + Set theIncludes ) { List retVal = new ArrayList(); // 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(); diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/JsonParserTest.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/JsonParserTest.java index a3198d2fb0a..280619fa455 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/JsonParserTest.java +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/JsonParserTest.java @@ -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\"}]}]}")); + } diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/IncludeTest.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/IncludeTest.java new file mode 100644 index 00000000000..061269f73a5 --- /dev/null +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/server/IncludeTest.java @@ -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 findPatient(@RequiredParam(name = Patient.SP_NAME) StringDt theName, @IncludeParam(allow = { "foo", "bar" }) Set theIncludes) { + ArrayList retVal = new ArrayList(); + + 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 getResourceType() { + return Patient.class; + } + + } + +} diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirResourceDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirResourceDao.java index 6852b4dec12..b46fc77764e 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirResourceDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirResourceDao.java @@ -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 extends BaseFhirDao implements IFhirResourceDao { @@ -492,7 +496,8 @@ public class FhirResourceDao extends BaseFhirDao implements ArrayList retVal = new ArrayList(); String resourceType = getContext().getResourceDefinition(myResourceType).getName(); - TypedQuery q = myEntityManager.createQuery("SELECT h FROM ResourceHistoryTable h WHERE h.myResourceId = :PID AND h.myResourceType = :RESTYPE ORDER BY h.myUpdated ASC", ResourceHistoryTable.class); + TypedQuery 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 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 extends BaseFhirDao implements if (entity == null) { if (theId.hasUnqualifiedVersionId()) { - TypedQuery q = myEntityManager.createQuery("SELECT t from ResourceHistoryTable t WHERE t.myResourceId = :RID AND t.myResourceType = :RTYP AND t.myResourceVersion = :RVER", ResourceHistoryTable.class); + TypedQuery 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 extends BaseFhirDao implements @Override public List search(SearchParameterMap theParams) { - Set pids; + Set loadPids; if (theParams.isEmpty()) { - pids = null; + loadPids = null; } else { - pids = searchForIdsWithAndOr(theParams); - if (pids.isEmpty()) { + loadPids = searchForIdsWithAndOr(theParams); + if (loadPids.isEmpty()) { return new ArrayList(); } } // Execute the query and make sure we return distinct results - { - CriteriaBuilder builder = myEntityManager.getCriteriaBuilder(); - CriteriaQuery cq = builder.createQuery(ResourceTable.class); - Root 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 q = myEntityManager.createQuery(cq); + List retVal=new ArrayList(); + loadResourcesByPid(loadPids, retVal); - List retVal = new ArrayList(); - for (ResourceTable next : q.getResultList()) { - T resource = toResource(myResourceType, next); - retVal.add(resource); + // Load _include resources + if (theParams.getIncludes() != null && theParams.isEmpty() == false) { + Set includePids = new HashSet(); + FhirTerser t = getContext().newTerser(); + for (Include next : theParams.getIncludes()) { + for (T nextResource : retVal) { + List 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 thePids, List theResourceListToPopulate) { + CriteriaBuilder builder = myEntityManager.getCriteriaBuilder(); + CriteriaQuery cq = builder.createQuery(ResourceTable.class); + Root 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 q = myEntityManager.createQuery(cq); + + for (ResourceTable next : q.getResultList()) { + T resource = toResource(myResourceType, next); + theResourceListToPopulate.add(resource); } } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirSystemDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirSystemDao.java index d90bfb750c0..d915e7423fb 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirSystemDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirSystemDao.java @@ -46,7 +46,9 @@ public class FhirSystemDao extends BaseFhirDao implements IFhirSystemDao { int updates = 0; Map idConversions = new HashMap(); + List persistedResources = new ArrayList(); + 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 allRefs = terser.getAllPopulatedChildElementsOfType(nextResource, ResourceReferenceDt.class); for (ResourceReferenceDt nextRef : allRefs) { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/SearchParameterMap.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/SearchParameterMap.java index 64ea3207db4..d27c979cba5 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/SearchParameterMap.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/SearchParameterMap.java @@ -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>> { private static final long serialVersionUID = 1L; - public void add(String theName, IQueryParameterType theParam) { - if (theParam == null) { - return; - } - if (!containsKey(theName)) { - put(theName, new ArrayList>()); - } - ArrayList list = new ArrayList(); - list.add(theParam); - get(theName).add(list); - } - + private Set myIncludes; + public void add(String theName, IQueryParameterAnd theAnd) { if (theAnd==null) { return; @@ -40,4 +33,33 @@ public class SearchParameterMap extends HashMap>()); + } + ArrayList list = new ArrayList(); + list.add(theParam); + get(theName).add(list); + } + + public Set getIncludes() { + if (myIncludes==null) { + myIncludes=new HashSet(); + } + return myIncludes; + } + + public void setIncludes(Set theIncludes) { + myIncludes = theIncludes; + } + + public void addInclude(Include theInclude) { + getIncludes().add(theInclude); + } + + + } diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirResourceDaoTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirResourceDaoTest.java index 869b07662a1..fabd6eb68be 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirResourceDaoTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirResourceDaoTest.java @@ -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>()); @@ -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 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() { diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoTest.java index 1489cdcbaa1..78b989ae0b4 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirSystemDaoTest.java @@ -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 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 diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/main/java/ca/uhn/fhirtest/TestRestfulServer.java b/hapi-fhir-jpaserver-uhnfhirtest/src/main/java/ca/uhn/fhirtest/TestRestfulServer.java index e62fbc1bc51..42e93fe64cf 100644 --- a/hapi-fhir-jpaserver-uhnfhirtest/src/main/java/ca/uhn/fhirtest/TestRestfulServer.java +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/main/java/ca/uhn/fhirtest/TestRestfulServer.java @@ -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 diff --git a/hapi-fhir-structures-dstu/.classpath b/hapi-fhir-structures-dstu/.classpath index d59649d5f29..9ea3e60fb23 100644 --- a/hapi-fhir-structures-dstu/.classpath +++ b/hapi-fhir-structures-dstu/.classpath @@ -1,39 +1,28 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/hapi-fhir-structures-dstu/.project b/hapi-fhir-structures-dstu/.project index 89992b4c221..22a9a48b013 100644 --- a/hapi-fhir-structures-dstu/.project +++ b/hapi-fhir-structures-dstu/.project @@ -1,14 +1,23 @@ - hapi-fhir-structures-dstu - NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. - - - - org.eclipse.jdt.core.javabuilder - - - - org.eclipse.jdt.core.javanature - - \ No newline at end of file + hapi-fhir-structures-dstu + NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + org.eclipse.jdt.core.javanature + + diff --git a/hapi-fhir-structures-dstu/.settings/org.eclipse.core.resources.prefs b/hapi-fhir-structures-dstu/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000000..99f26c0203a --- /dev/null +++ b/hapi-fhir-structures-dstu/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/hapi-fhir-structures-dstu/.settings/org.eclipse.jdt.core.prefs b/hapi-fhir-structures-dstu/.settings/org.eclipse.jdt.core.prefs index 8000cd6ca61..107056a36e4 100644 --- a/hapi-fhir-structures-dstu/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-fhir-structures-dstu/.settings/org.eclipse.jdt.core.prefs @@ -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 diff --git a/hapi-fhir-structures-dstu/.settings/org.eclipse.m2e.core.prefs b/hapi-fhir-structures-dstu/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 00000000000..f897a7f1cb2 --- /dev/null +++ b/hapi-fhir-structures-dstu/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/hapi-fhir-structures-dstu/pom.xml b/hapi-fhir-structures-dstu/pom.xml index 2522dddf629..72235a0e147 100644 --- a/hapi-fhir-structures-dstu/pom.xml +++ b/hapi-fhir-structures-dstu/pom.xml @@ -9,7 +9,6 @@ ../pom.xml - ca.uhn.hapi.fhir hapi-fhir-structures-dstu jar diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/BaseRootType.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/BaseRootType.java index 446b7d86ece..ed12b48f41c 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/BaseRootType.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/BaseRootType.java @@ -47,5 +47,15 @@ public abstract class BaseRootType extends BaseElement { public void setProfile(String theProfile) { myProfile = theProfile; } + + public ArrayList getSearchParametersResource() { + ArrayList retVal = new ArrayList(); + for(SearchParameter next:getSearchParameters()) { + if(next.getType().equals("reference")) { + retVal.add(next); + } + } + return retVal; + } } diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/parser/BaseStructureParser.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/parser/BaseStructureParser.java index 417f9426efe..70d7c3d75ed 100644 --- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/parser/BaseStructureParser.java +++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/parser/BaseStructureParser.java @@ -289,6 +289,7 @@ public abstract class BaseStructureParser { ctx.put("resourceBlockChildren", theResource.getResourceBlockChildren()); ctx.put("childExtensionTypes", ObjectUtils.defaultIfNull(myExtensions, new ArrayList())); ctx.put("searchParams", (theResource.getSearchParameters())); + ctx.put("searchParamsReference", (theResource.getSearchParametersResource())); ctx.put("searchParamsWithoutComposite", (theResource.getSearchParametersWithoutComposite())); VelocityEngine v = new VelocityEngine(); diff --git a/hapi-tinder-plugin/src/main/resources/vm/jpa_resource_provider.vm b/hapi-tinder-plugin/src/main/resources/vm/jpa_resource_provider.vm index 87161c519b3..81b3d3eb797 100644 --- a/hapi-tinder-plugin/src/main/resources/vm/jpa_resource_provider.vm +++ b/hapi-tinder-plugin/src/main/resources/vm/jpa_resource_provider.vm @@ -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 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); } } diff --git a/hapi-tinder-test/src/test/java/test/TestParticulars.java b/hapi-tinder-test/src/test/java/test/TestParticulars.java new file mode 100644 index 00000000000..f96106ab0d8 --- /dev/null +++ b/hapi-tinder-test/src/test/java/test/TestParticulars.java @@ -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(); + } + +}