diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/BoundCodeDt.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/BoundCodeDt.java index 515a9d0a214..d8de65f25e8 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/BoundCodeDt.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/primitive/BoundCodeDt.java @@ -37,25 +37,20 @@ public class BoundCodeDt> extends CodeDt { public BoundCodeDt() { // nothing } - + public BoundCodeDt(IValueSetEnumBinder theBinder) { Validate.notNull(theBinder, "theBinder must not be null"); myBinder = theBinder; } - + public BoundCodeDt(IValueSetEnumBinder theBinder, T theValue) { Validate.notNull(theBinder, "theBinder must not be null"); myBinder = theBinder; setValueAsEnum(theValue); } - public void setValueAsEnum(T theValue) { - Validate.notNull(myBinder, "This object does not have a binder. Constructor BoundCodeDt() should not be called!"); - if (theValue==null) { - setValue(null); - } else { - setValue(myBinder.toCodeString(theValue)); - } + public IValueSetEnumBinder getBinder() { + return myBinder; } public T getValueAsEnum() { @@ -66,4 +61,13 @@ public class BoundCodeDt> extends CodeDt { } return retVal; } + + public void setValueAsEnum(T theValue) { + Validate.notNull(myBinder, "This object does not have a binder. Constructor BoundCodeDt() should not be called!"); + if (theValue==null) { + setValue(null); + } else { + setValue(myBinder.toCodeString(theValue)); + } + } } diff --git a/hapi-fhir-jpaserver-base/.classpath b/hapi-fhir-jpaserver-base/.classpath index 845e0284061..dcca171a6c6 100644 --- a/hapi-fhir-jpaserver-base/.classpath +++ b/hapi-fhir-jpaserver-base/.classpath @@ -1,12 +1,12 @@ - + - + diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/SearchParamExtractorDstu2.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/SearchParamExtractorDstu2.java index b8bede8cb10..75175161ab4 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/SearchParamExtractorDstu2.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/SearchParamExtractorDstu2.java @@ -52,6 +52,7 @@ import ca.uhn.fhir.jpa.entity.ResourceTable; import ca.uhn.fhir.model.api.IDatatype; import ca.uhn.fhir.model.api.IPrimitiveDatatype; import ca.uhn.fhir.model.api.IResource; +import ca.uhn.fhir.model.api.IValueSetEnumBinder; import ca.uhn.fhir.model.base.composite.BaseHumanNameDt; import ca.uhn.fhir.model.dstu2.composite.AddressDt; import ca.uhn.fhir.model.dstu2.composite.BoundCodeableConceptDt; @@ -71,6 +72,7 @@ import ca.uhn.fhir.model.dstu2.resource.Questionnaire; import ca.uhn.fhir.model.dstu2.resource.ValueSet; import ca.uhn.fhir.model.dstu2.valueset.RestfulSecurityServiceEnum; import ca.uhn.fhir.model.primitive.BaseDateTimeDt; +import ca.uhn.fhir.model.primitive.BoundCodeDt; import ca.uhn.fhir.model.primitive.IntegerDt; import ca.uhn.fhir.model.primitive.StringDt; import ca.uhn.fhir.model.primitive.UriDt; @@ -79,7 +81,7 @@ import ca.uhn.fhir.rest.method.RestSearchParameterTypeEnum; public class SearchParamExtractorDstu2 extends BaseSearchParamExtractor implements ISearchParamExtractor { private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(SearchParamExtractorDstu2.class); - + public SearchParamExtractorDstu2(FhirContext theContext) { super(theContext); } @@ -115,7 +117,8 @@ public class SearchParamExtractorDstu2 extends BaseSearchParamExtractor implemen /* * (non-Javadoc) * - * @see ca.uhn.fhir.jpa.dao.ISearchParamExtractor#extractSearchParamDates(ca.uhn.fhir.jpa.entity.ResourceTable, ca.uhn.fhir.model.api.IResource) + * @see ca.uhn.fhir.jpa.dao.ISearchParamExtractor#extractSearchParamDates(ca.uhn.fhir.jpa.entity.ResourceTable, + * ca.uhn.fhir.model.api.IResource) */ @Override public Set extractSearchParamDates(ResourceTable theEntity, IResource theResource) { @@ -175,7 +178,8 @@ public class SearchParamExtractorDstu2 extends BaseSearchParamExtractor implemen /* * (non-Javadoc) * - * @see ca.uhn.fhir.jpa.dao.ISearchParamExtractor#extractSearchParamNumber(ca.uhn.fhir.jpa.entity.ResourceTable, ca.uhn.fhir.model.api.IResource) + * @see ca.uhn.fhir.jpa.dao.ISearchParamExtractor#extractSearchParamNumber(ca.uhn.fhir.jpa.entity.ResourceTable, + * ca.uhn.fhir.model.api.IResource) */ @Override public HashSet extractSearchParamNumber(ResourceTable theEntity, IResource theResource) { @@ -222,12 +226,17 @@ public class SearchParamExtractorDstu2 extends BaseSearchParamExtractor implemen nextValue = newValue; /* - * @SuppressWarnings("unchecked") PhysicsUnit> unit = (PhysicsUnit>) - * UCUMFormat.getCaseInsensitiveInstance().parse(nextValue.getCode().getValue(), null); if (unit.isCompatible(UCUM.DAY)) { + * @SuppressWarnings("unchecked") PhysicsUnit> unit = (PhysicsUnit>) + * UCUMFormat.getCaseInsensitiveInstance().parse(nextValue.getCode().getValue(), null); if + * (unit.isCompatible(UCUM.DAY)) { * - * @SuppressWarnings("unchecked") PhysicsUnit timeUnit = (PhysicsUnit