theType) {
return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myReference, myDisplay);
}
/**
- * Gets the value(s) for reference (Relative, internal or absolute URL reference). creating it if it does not
- * exist. Will not return null
.
- *
- *
- * Definition: A reference to a location at which the other resource is found. The reference may a relative
- * reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location
- * where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR
- * RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#')
- * refer to contained resources
- *
+ * Gets the value(s) for reference (Relative, internal or absolute URL reference).
+ * creating it if it does
+ * not exist. Will not return null
.
+ *
+ *
+ * Definition:
+ * A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources
+ *
*/
- public StringDt getReference() {
+ public IdDt getReference() {
if (myReference == null) {
- myReference = new StringDt();
+ myReference = new IdDt();
}
return myReference;
}
/**
* Sets the value(s) for reference (Relative, internal or absolute URL reference)
- *
- *
- * Definition: A reference to a location at which the other resource is found. The reference may a relative
- * reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location
- * where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR
- * RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#')
- * refer to contained resources
- *
+ *
+ *
+ * Definition:
+ * A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources
+ *
*/
- public ResourceReferenceDt setReference(StringDt theValue) {
+ public ResourceReferenceDt setReference(IdDt theValue) {
myReference = theValue;
return this;
}
- /**
+ /**
* Sets the value for reference (Relative, internal or absolute URL reference)
- *
- *
- * Definition: A reference to a location at which the other resource is found. The reference may a relative
- * reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location
- * where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR
- * RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#')
- * refer to contained resources
- *
+ *
+ *
+ * Definition:
+ * A reference to a location at which the other resource is found. The reference may a relative reference, in which case it is relative to the service base URL, or an absolute URL that resolves to the location where the resource is found. The reference may be version specific or not. If the reference is not to a FHIR RESTful server, then it should be assumed to be version specific. Internal fragment references (start with '#') refer to contained resources
+ *
*/
- public ResourceReferenceDt setReference(String theString) {
- return setReference(new StringDt(theString));
+ public ResourceReferenceDt setReference( String theId) {
+ myReference = new IdDt(theId);
+ return this;
}
+
/**
- * Gets the value(s) for display (Text alternative for the resource). creating it if it does not exist. Will
- * not return null
.
- *
- *
- * Definition: Plain text narrative that identifies the resource in addition to the resource reference
- *
+ * Gets the value(s) for display (Text alternative for the resource).
+ * creating it if it does
+ * not exist. Will not return null
.
+ *
+ *
+ * Definition:
+ * Plain text narrative that identifies the resource in addition to the resource reference
+ *
*/
- public StringDt getDisplay() {
+ public StringDt getDisplay() {
if (myDisplay == null) {
myDisplay = new StringDt();
}
@@ -177,39 +179,31 @@ public class ResourceReferenceDt extends BaseResourceReference implements ICompo
/**
* Sets the value(s) for display (Text alternative for the resource)
- *
- *
- * Definition: Plain text narrative that identifies the resource in addition to the resource reference
- *
+ *
+ *
+ * Definition:
+ * Plain text narrative that identifies the resource in addition to the resource reference
+ *
*/
public ResourceReferenceDt setDisplay(StringDt theValue) {
myDisplay = theValue;
return this;
}
- /**
+ /**
* Sets the value for display (Text alternative for the resource)
- *
- *
- * Definition: Plain text narrative that identifies the resource in addition to the resource reference
- *
+ *
+ *
+ * Definition:
+ * Plain text narrative that identifies the resource in addition to the resource reference
+ *
*/
- public ResourceReferenceDt setDisplay(String theString) {
- myDisplay = new StringDt(theString);
- return this;
+ public ResourceReferenceDt setDisplay( String theString) {
+ myDisplay = new StringDt(theString);
+ return this;
}
- @Override
- public IdDt getResourceId() {
- if (myReference == null) {
- return new IdDt();
- }
- return new IdDt(myReference.getValue());
- }
+
- @Override
- public void setResourceId(IdDt theResourceId) {
- myReference = new StringDt(theResourceId.getValue());
- }
-}
+}
\ No newline at end of file
diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Binary.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Binary.java
index cacb74c61c5..cc5eb54b3be 100644
--- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Binary.java
+++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/model/dstu/resource/Binary.java
@@ -75,14 +75,6 @@ public class Binary extends BaseResource implements IResource {
return myContentType;
}
- /**
- * Do not call - throws {@link UnsupportedOperationException}
- */
- @Override
- public NarrativeDt getText() {
- throw new UnsupportedOperationException();
- }
-
@Override
public boolean isEmpty() {
return (myContent.isEmpty()) && StringUtils.isBlank(myContentType);
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 ba13ea89a3a..784e426faee 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
@@ -16,26 +16,6 @@
package ca.uhn.fhir.model.dstu.resource;
-/*
- * #%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%
- */
-
import java.util.List;
@@ -185,33 +165,6 @@ public class Encounter extends BaseResource implements IResource {
*/
public static final Include INCLUDE_SUBJECT = new Include("Encounter.subject");
- /**
- * Search parameter constant for !fulfills
- *
- * Description:
- * Type: reference
- * Path: Encounter.fulfills
- *
- */
- @SearchParamDefinition(name="!fulfills", path="Encounter.fulfills", description="", type="reference")
- public static final String SP_FULFILLS = "!fulfills";
-
- /**
- * Fluent Client search parameter constant for !fulfills
- *
- * Description:
- * Type: reference
- * Path: Encounter.fulfills
- *
- */
- public static final ReferenceParam FULFILLS = new ReferenceParam(SP_FULFILLS);
-
- /**
- * Constant for fluent queries to be used to add include statements. Specifies
- * the path value of "Encounter.fulfills".
- */
- public static final Include INCLUDE_FULFILLS = new Include("Encounter.fulfills");
-
/**
* Search parameter constant for length
*
@@ -498,11 +451,11 @@ public class Encounter extends BaseResource implements IResource {
*
* @return Returns a reference to this object, to allow for simple chaining.
*/
- public Encounter addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) {
+ public Encounter addIdentifier( String theSystem, String theValue) {
if (myIdentifier == null) {
myIdentifier = new java.util.ArrayList();
}
- myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel));
+ myIdentifier.add(new IdentifierDt(theSystem, theValue));
return this;
}
@@ -516,11 +469,11 @@ public class Encounter extends BaseResource implements IResource {
*
* @return Returns a reference to this object, to allow for simple chaining.
*/
- public Encounter addIdentifier( String theSystem, String theValue) {
+ public Encounter addIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) {
if (myIdentifier == null) {
myIdentifier = new java.util.ArrayList();
}
- myIdentifier.add(new IdentifierDt(theSystem, theValue));
+ myIdentifier.add(new IdentifierDt(theUse, theSystem, theValue, theLabel));
return this;
}
@@ -651,8 +604,24 @@ public class Encounter extends BaseResource implements IResource {
* Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation)
*
*/
- public void addType(EncounterTypeEnum theValue) {
- getType().add(new BoundCodeableConceptDt(EncounterTypeEnum.VALUESET_BINDER, theValue));
+ public BoundCodeableConceptDt addType(EncounterTypeEnum theValue) {
+ BoundCodeableConceptDt retVal = new BoundCodeableConceptDt(EncounterTypeEnum.VALUESET_BINDER, theValue);
+ getType().add(retVal);
+ return retVal;
+ }
+
+ /**
+ * Add a value for type (Specific type of encounter)
+ *
+ *
+ * Definition:
+ * Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation)
+ *
+ */
+ public BoundCodeableConceptDt addType() {
+ BoundCodeableConceptDt retVal = new BoundCodeableConceptDt(EncounterTypeEnum.VALUESET_BINDER);
+ getType().add(retVal);
+ return retVal;
}
/**
@@ -1157,8 +1126,24 @@ public class Encounter extends BaseResource implements IResource {
*
*
*/
- public void addType(ParticipantTypeEnum theValue) {
- getType().add(new BoundCodeableConceptDt(ParticipantTypeEnum.VALUESET_BINDER, theValue));
+ public BoundCodeableConceptDt addType(ParticipantTypeEnum theValue) {
+ BoundCodeableConceptDt retVal = new BoundCodeableConceptDt(ParticipantTypeEnum.VALUESET_BINDER, theValue);
+ getType().add(retVal);
+ return retVal;
+ }
+
+ /**
+ * Add a value for type (Role of participant in encounter)
+ *
+ *
+ * Definition:
+ *
+ *
+ */
+ public BoundCodeableConceptDt addType() {
+ BoundCodeableConceptDt retVal = new BoundCodeableConceptDt(ParticipantTypeEnum.VALUESET_BINDER);
+ getType().add(retVal);
+ return retVal;
}
/**
@@ -1187,6 +1172,9 @@ public class Encounter extends BaseResource implements IResource {
*
*/
public ResourceReferenceDt getIndividual() {
+ if (myIndividual == null) {
+ myIndividual = new ResourceReferenceDt();
+ }
return myIndividual;
}
@@ -1355,8 +1343,8 @@ public class Encounter extends BaseResource implements IResource {
*
*
*/
- public Hospitalization setPreAdmissionIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) {
- myPreAdmissionIdentifier = new IdentifierDt(theUse, theSystem, theValue, theLabel);
+ public Hospitalization setPreAdmissionIdentifier( String theSystem, String theValue) {
+ myPreAdmissionIdentifier = new IdentifierDt(theSystem, theValue);
return this;
}
@@ -1368,8 +1356,8 @@ public class Encounter extends BaseResource implements IResource {
*
*
*/
- public Hospitalization setPreAdmissionIdentifier( String theSystem, String theValue) {
- myPreAdmissionIdentifier = new IdentifierDt(theSystem, theValue);
+ public Hospitalization setPreAdmissionIdentifier( IdentifierUseEnum theUse, String theSystem, String theValue, String theLabel) {
+ myPreAdmissionIdentifier = new IdentifierDt(theUse, theSystem, theValue, theLabel);
return this;
}
@@ -2040,4 +2028,4 @@ public class Encounter extends BaseResource implements IResource {
-}
+}
\ No newline at end of file
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 fed1bc16517..3d08bc8207c 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
@@ -273,7 +273,7 @@ public class JsonParser extends BaseParser implements IParser {
}
case RESOURCE_REF: {
ResourceReferenceDt referenceDt = (ResourceReferenceDt) theValue;
- IdDt value = referenceDt.getResourceId();
+ IdDt value = referenceDt.getReference();
if (theChildName != null) {
theWriter.writeStartObject(theChildName);
} else {
diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/DateRangeParam.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/DateRangeParam.java
index 391b8988fba..69b614b420f 100644
--- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/DateRangeParam.java
+++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/DateRangeParam.java
@@ -24,6 +24,8 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
+import org.apache.commons.lang3.StringUtils;
+
import ca.uhn.fhir.model.api.IQueryParameterAnd;
import ca.uhn.fhir.model.api.IQueryParameterOr;
import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum;
@@ -184,8 +186,12 @@ public class DateRangeParam implements IQueryParameterAnd {
* "2011-02-22" or "2011-02-22T13:12:00". Will be treated inclusively.
*/
public void setRangeFromDatesInclusive(Date theLowerBound, Date theUpperBound) {
- myLowerBound = new QualifiedDateParam(QuantityCompararatorEnum.GREATERTHAN_OR_EQUALS, theLowerBound);
- myUpperBound = new QualifiedDateParam(QuantityCompararatorEnum.LESSTHAN_OR_EQUALS, theUpperBound);
+ if (theLowerBound != null) {
+ myLowerBound = new QualifiedDateParam(QuantityCompararatorEnum.GREATERTHAN_OR_EQUALS, theLowerBound);
+ }
+ if (theUpperBound != null) {
+ myUpperBound = new QualifiedDateParam(QuantityCompararatorEnum.LESSTHAN_OR_EQUALS, theUpperBound);
+ }
validateAndThrowDataFormatExceptionIfInvalid();
}
@@ -200,8 +206,12 @@ public class DateRangeParam implements IQueryParameterAnd {
* "2011-02-22" or "2011-02-22T13:12:00". Will be treated inclusively.
*/
public void setRangeFromDatesInclusive(String theLowerBound, String theUpperBound) {
- myLowerBound = new QualifiedDateParam(QuantityCompararatorEnum.GREATERTHAN_OR_EQUALS, theLowerBound);
- myUpperBound = new QualifiedDateParam(QuantityCompararatorEnum.LESSTHAN_OR_EQUALS, theUpperBound);
+ if (StringUtils.isNotBlank(theLowerBound)) {
+ myLowerBound = new QualifiedDateParam(QuantityCompararatorEnum.GREATERTHAN_OR_EQUALS, theLowerBound);
+ }
+ if (StringUtils.isNotBlank(theUpperBound)) {
+ myUpperBound = new QualifiedDateParam(QuantityCompararatorEnum.LESSTHAN_OR_EQUALS, theUpperBound);
+ }
validateAndThrowDataFormatExceptionIfInvalid();
}
diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/model/primitive/IdDtTest.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/model/primitive/IdDtTest.java
index 6c79b1408ae..b457bf3a05d 100644
--- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/model/primitive/IdDtTest.java
+++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/model/primitive/IdDtTest.java
@@ -24,8 +24,8 @@ public class IdDtTest {
Patient actual = parseAndEncode(patient);
ResourceReferenceDt ref = actual.getManagingOrganization();
- assertEquals("Organization", ref.getResourceId().getResourceType());
- assertEquals("123", ref.getResourceId().getUnqualifiedId());
+ assertEquals("Organization", ref.getReference().getResourceType());
+ assertEquals("123", ref.getReference().getUnqualifiedId());
}
@@ -38,9 +38,9 @@ public class IdDtTest {
Patient actual = parseAndEncode(patient);
ResourceReferenceDt ref = actual.getManagingOrganization();
- assertEquals("Organization", ref.getResourceId().getResourceType());
- assertEquals("123", ref.getResourceId().getUnqualifiedId());
- assertEquals("999", ref.getResourceId().getUnqualifiedVersionId());
+ assertEquals("Organization", ref.getReference().getResourceType());
+ assertEquals("123", ref.getReference().getUnqualifiedId());
+ assertEquals("999", ref.getReference().getUnqualifiedVersionId());
}
@@ -53,9 +53,9 @@ public class IdDtTest {
Patient actual = parseAndEncode(patient);
ResourceReferenceDt ref = actual.getManagingOrganization();
- assertEquals(null, ref.getResourceId().getResourceType());
- assertEquals("123", ref.getResourceId().getUnqualifiedId());
- assertEquals("999", ref.getResourceId().getUnqualifiedVersionId());
+ assertEquals(null, ref.getReference().getResourceType());
+ assertEquals("123", ref.getReference().getUnqualifiedId());
+ assertEquals("999", ref.getReference().getUnqualifiedVersionId());
}
@@ -69,8 +69,8 @@ public class IdDtTest {
Patient actual = parseAndEncode(patient);
ResourceReferenceDt ref = actual.getManagingOrganization();
- assertEquals(null, ref.getResourceId().getResourceType());
- assertEquals("123", ref.getResourceId().getUnqualifiedId());
+ assertEquals(null, ref.getReference().getResourceType());
+ assertEquals("123", ref.getReference().getUnqualifiedId());
}
@@ -83,8 +83,8 @@ public class IdDtTest {
Patient actual = parseAndEncode(patient);
ResourceReferenceDt ref = actual.getManagingOrganization();
- assertEquals(null, ref.getResourceId().getResourceType());
- assertEquals("123", ref.getResourceId().getUnqualifiedId());
+ assertEquals(null, ref.getReference().getResourceType());
+ assertEquals("123", ref.getReference().getUnqualifiedId());
}
@@ -97,8 +97,8 @@ public class IdDtTest {
Patient actual = parseAndEncode(patient);
ResourceReferenceDt ref = actual.getManagingOrganization();
- assertEquals("Organization", ref.getResourceId().getResourceType());
- assertEquals("123", ref.getResourceId().getUnqualifiedId());
+ assertEquals("Organization", ref.getReference().getResourceType());
+ assertEquals("123", ref.getReference().getUnqualifiedId());
}
@@ -111,8 +111,8 @@ public class IdDtTest {
Patient actual = parseAndEncode(patient);
ResourceReferenceDt ref = actual.getManagingOrganization();
- assertEquals("Organization", ref.getResourceId().getResourceType());
- assertEquals("123", ref.getResourceId().getUnqualifiedId());
+ assertEquals("Organization", ref.getReference().getResourceType());
+ assertEquals("123", ref.getReference().getUnqualifiedId());
}
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 5a2cf103c07..408bee73fc4 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
@@ -347,7 +347,7 @@ public class JsonParserTest {
MyPatientWithOneDeclaredExtension actual = parser.parseResource(MyPatientWithOneDeclaredExtension.class, val);
assertEquals(AddressUseEnum.HOME, patient.getAddressFirstRep().getUse().getValueAsEnum());
ResourceReferenceDt ref = actual.getFoo();
- assertEquals("Organization/123", ref.getResourceId().getValue());
+ assertEquals("Organization/123", ref.getReference().getValue());
}
@@ -400,7 +400,7 @@ public class JsonParserTest {
try {
p.encodeResourceToString(obs);
} catch (DataFormatException e) {
- assertThat(e.getMessage(), StringContains.containsString("PeriodDt"));
+ assertThat(e.getMessage(), StringContains.containsString("DecimalDt"));
}
}
diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/XmlParserTest.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/XmlParserTest.java
index b4ec787f716..bc0ac0f0e10 100644
--- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/XmlParserTest.java
+++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/parser/XmlParserTest.java
@@ -420,7 +420,7 @@ public class XmlParserTest {
try {
p.encodeResourceToString(obs);
} catch (DataFormatException e) {
- assertThat(e.getMessage(), StringContains.containsString("PeriodDt"));
+ assertThat(e.getMessage(), StringContains.containsString("DecimalDt"));
}
}
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseFhirDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseFhirDao.java
index fc3a5ae0cae..51c8d88f731 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseFhirDao.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseFhirDao.java
@@ -1,6 +1,6 @@
package ca.uhn.fhir.jpa.dao;
-import static org.apache.commons.lang3.StringUtils.*;
+import static org.apache.commons.lang3.StringUtils.isBlank;
import java.text.Normalizer;
import java.util.ArrayList;
@@ -57,6 +57,7 @@ import ca.uhn.fhir.model.dstu.composite.CodingDt;
import ca.uhn.fhir.model.dstu.composite.ContactDt;
import ca.uhn.fhir.model.dstu.composite.HumanNameDt;
import ca.uhn.fhir.model.dstu.composite.IdentifierDt;
+import ca.uhn.fhir.model.dstu.composite.PeriodDt;
import ca.uhn.fhir.model.dstu.composite.QuantityDt;
import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt;
import ca.uhn.fhir.model.dstu.valueset.SearchParamTypeEnum;
@@ -74,13 +75,14 @@ import com.google.common.collect.Lists;
public abstract class BaseFhirDao {
private FhirContext myContext = new FhirContext();
+
@PersistenceContext(name = "FHIR_UT", type = PersistenceContextType.TRANSACTION, unitName = "FHIR_UT")
private EntityManager myEntityManager;
@Autowired
private List> myResourceDaos;
private Map, IFhirResourceDao>> myResourceTypeToDao;
-
+
public FhirContext getContext() {
return myContext;
}
@@ -195,6 +197,8 @@ public abstract class BaseFhirDao {
}
}
+ private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(BaseFhirDao.class);
+
private void searchHistoryHistory(List theTuples, List theRetVal) {
Collection tuples = Collections2.filter(theTuples, new com.google.common.base.Predicate() {
@Override
@@ -211,6 +215,8 @@ public abstract class BaseFhirDao {
if (ids.isEmpty()) {
return;
}
+
+ ourLog.info("Retrieving {} history elements from ResourceHistoryTable", ids.size());
CriteriaBuilder builder = myEntityManager.getCriteriaBuilder();
CriteriaQuery cq = builder.createQuery(ResourceHistoryTable.class);
@@ -258,19 +264,19 @@ public abstract class BaseFhirDao {
continue;
}
- String typeString = nextValue.getResourceId().getResourceType();
+ String typeString = nextValue.getReference().getResourceType();
if (isBlank(typeString)) {
throw new InvalidRequestException("Invalid resource reference found at path[" + nextPath + "] - Does not contain resource type - " + nextValue.getReference().getValue());
}
Class extends IResource> type = getContext().getResourceDefinition(typeString).getImplementingClass();
- String id = nextValue.getResourceId().getUnqualifiedId();
+ String id = nextValue.getReference().getUnqualifiedId();
if (StringUtils.isBlank(id)) {
continue;
}
IFhirResourceDao> dao = getDao(type);
if (dao == null) {
- throw new InvalidRequestException("This server is not able to handle resources of type: " + nextValue.getResourceId().getResourceType());
+ throw new InvalidRequestException("This server is not able to handle resources of type: " + nextValue.getReference().getResourceType());
}
Long valueOf;
try {
@@ -333,6 +339,12 @@ public abstract class BaseFhirDao {
continue;
}
nextEntity = new ResourceIndexedSearchParamDate(nextSpDef.getName(), nextValue.getValue(), nextValue.getValue());
+ } else if (nextObject instanceof PeriodDt) {
+ PeriodDt nextValue = (PeriodDt) nextObject;
+ if (nextValue.isEmpty()) {
+ continue;
+ }
+ nextEntity = new ResourceIndexedSearchParamDate(nextSpDef.getName(), nextValue.getStart().getValue(), nextValue.getEnd().getValue());
} else {
if (!multiType) {
throw new ConfigurationException("Search param " + nextSpDef.getName() + " is of unexpected datatype: " + nextObject.getClass());
@@ -377,7 +389,8 @@ public abstract class BaseFhirDao {
if (nextObject instanceof QuantityDt) {
QuantityDt nextValue = (QuantityDt) nextObject;
- ResourceIndexedSearchParamNumber nextEntity = new ResourceIndexedSearchParamNumber(resourceName, nextValue.getValue().getValue(), nextValue.getSystem().getValueAsString(), nextValue.getUnits().getValue());
+ ResourceIndexedSearchParamNumber nextEntity = new ResourceIndexedSearchParamNumber(resourceName, nextValue.getValue().getValue(), nextValue.getSystem().getValueAsString(),
+ nextValue.getUnits().getValue());
nextEntity.setResource(theEntity);
retVal.add(nextEntity);
} else {
@@ -460,7 +473,8 @@ public abstract class BaseFhirDao {
} else if (nextObject instanceof ContactDt) {
ContactDt nextContact = (ContactDt) nextObject;
if (nextContact.getValue().isEmpty() == false) {
- ResourceIndexedSearchParamString nextEntity = new ResourceIndexedSearchParamString(resourceName, normalizeString(nextContact.getValue().getValueAsString()), nextContact.getValue().getValueAsString());
+ ResourceIndexedSearchParamString nextEntity = new ResourceIndexedSearchParamString(resourceName, normalizeString(nextContact.getValue().getValueAsString()), nextContact
+ .getValue().getValueAsString());
nextEntity.setResource(theEntity);
retVal.add(nextEntity);
}
@@ -549,12 +563,12 @@ public abstract class BaseFhirDao {
for (IFhirResourceDao> next : myResourceDaos) {
myResourceTypeToDao.put(next.getResourceType(), next);
}
-
+
if (this instanceof IFhirResourceDao>) {
IFhirResourceDao> thiz = (IFhirResourceDao>) this;
myResourceTypeToDao.put(thiz.getResourceType(), thiz);
}
-
+
}
return myResourceTypeToDao.get(theType);
@@ -685,11 +699,11 @@ public abstract class BaseFhirDao {
protected String toResourceName(IResource theResource) {
return myContext.getResourceDefinition(theResource).getName();
}
+
protected String toResourceName(Class extends IResource> theResourceType) {
return myContext.getResourceDefinition(theResourceType).getName();
}
-
protected ResourceTable updateEntity(final IResource theResource, ResourceTable entity, boolean theUpdateHistory) {
if (entity.getPublished() == null) {
entity.setPublished(new Date());
@@ -702,6 +716,12 @@ public abstract class BaseFhirDao {
entity.setVersion(entity.getVersion() + 1);
+ Collection paramsString = new ArrayList(entity.getParamsString());
+ Collection paramsToken = new ArrayList(entity.getParamsToken());
+ Collection paramsNumber = new ArrayList(entity.getParamsNumber());
+ Collection paramsDate = new ArrayList(entity.getParamsDate());
+ Collection resourceLinks = new ArrayList(entity.getResourceLinks());
+
final List stringParams = extractSearchParamStrings(entity, theResource);
final List tokenParams = extractSearchParamTokens(entity, theResource);
final List numberParams = extractSearchParamNumber(entity, theResource);
@@ -711,6 +731,16 @@ public abstract class BaseFhirDao {
populateResourceIntoEntity(theResource, entity);
entity.setUpdated(new Date());
+ entity.setParamsString(stringParams);
+ entity.setParamsStringPopulated(stringParams.isEmpty()==false);
+ entity.setParamsToken(tokenParams);
+ entity.setParamsTokenPopulated(tokenParams.isEmpty()==false);
+ entity.setParamsNumber(numberParams);
+ entity.setParamsNumberPopulated(numberParams.isEmpty()==false);
+ entity.setParamsDate(dateParams);
+ entity.setParamsDatePopulated(dateParams.isEmpty()==false);
+ entity.setResourceLinks(links);
+ entity.setHasLinks(links.isEmpty()==false);
if (entity.getId() == null) {
myEntityManager.persist(entity);
@@ -719,16 +749,16 @@ public abstract class BaseFhirDao {
}
if (entity.isParamsStringPopulated()) {
- for (ResourceIndexedSearchParamString next : entity.getParamsString()) {
+ for (ResourceIndexedSearchParamString next : paramsString) {
myEntityManager.remove(next);
}
}
for (ResourceIndexedSearchParamString next : stringParams) {
myEntityManager.persist(next);
}
-
+
if (entity.isParamsTokenPopulated()) {
- for (ResourceIndexedSearchParamToken next : entity.getParamsToken()) {
+ for (ResourceIndexedSearchParamToken next : paramsToken) {
myEntityManager.remove(next);
}
}
@@ -737,7 +767,7 @@ public abstract class BaseFhirDao {
}
if (entity.isParamsNumberPopulated()) {
- for (ResourceIndexedSearchParamNumber next : entity.getParamsNumber()) {
+ for (ResourceIndexedSearchParamNumber next : paramsNumber) {
myEntityManager.remove(next);
}
}
@@ -746,7 +776,7 @@ public abstract class BaseFhirDao {
}
if (entity.isParamsDatePopulated()) {
- for (ResourceIndexedSearchParamDate next : entity.getParamsDate()) {
+ for (ResourceIndexedSearchParamDate next : paramsDate) {
myEntityManager.remove(next);
}
}
@@ -755,14 +785,14 @@ public abstract class BaseFhirDao {
}
if (entity.isHasLinks()) {
- for (ResourceLink next : entity.getResourceLinks()) {
+ for (ResourceLink next : resourceLinks) {
myEntityManager.remove(next);
}
}
for (ResourceLink next : links) {
myEntityManager.persist(next);
}
-
+
myEntityManager.flush();
theResource.setId(new IdDt(entity.getResourceType(), entity.getId().toString(), Long.toString(entity.getVersion())));
@@ -770,7 +800,7 @@ public abstract class BaseFhirDao {
}
protected TagList getTags(Class extends IResource> theResourceType, IdDt theResourceId) {
- String resourceName=null;
+ String resourceName = null;
if (theResourceType != null) {
resourceName = toResourceName(theResourceType);
if (theResourceId != null && theResourceId.hasUnqualifiedVersionId()) {
@@ -783,7 +813,7 @@ public abstract class BaseFhirDao {
return retVal;
}
}
-
+
Set tagIds = new HashSet();
findMatchingTagIds(resourceName, theResourceId, tagIds, ResourceTag.class);
findMatchingTagIds(resourceName, theResourceId, tagIds, ResourceHistoryTag.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 faee52179ef..70e6dd27167 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
@@ -67,299 +67,15 @@ public class FhirResourceDao extends BaseFhirDao implements
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirResourceDao.class);
- // name = "FHIR_UT", type = PersistenceContextType.TRANSACTION, unitName = "FHIR_UT"
@PersistenceContext()
private EntityManager myEntityManager;
@Autowired
private PlatformTransactionManager myPlatformTransactionManager;
+
private String myResourceName;
private Class myResourceType;
-
- @Override
- public void addTag(IdDt theId, String theScheme, String theTerm, String theLabel) {
- BaseHasResource entity = readEntity(theId);
- if (entity == null) {
- throw new ResourceNotFoundException(theId);
- }
-
- for (BaseTag next : new ArrayList(entity.getTags())) {
- if (next.getTag().getScheme().equals(theScheme) && next.getTag().getTerm().equals(theTerm)) {
- return;
- }
- }
-
- TagDefinition def = getTag(theScheme, theTerm, theLabel);
- BaseTag newEntity = entity.addTag(def);
-
- myEntityManager.persist(newEntity);
- myEntityManager.merge(entity);
- }
-
- @Override
- public MethodOutcome create(final T theResource) {
- ResourceTable entity = new ResourceTable();
- entity.setResourceType(toResourceName(theResource));
-
- updateEntity(theResource, entity, false);
-
- MethodOutcome outcome = toMethodOutcome(entity);
- return outcome;
- }
-
- @Override
- public TagList getAllResourceTags() {
- return super.getTags(myResourceType, null);
- }
-
- public Class getResourceType() {
- return myResourceType;
- }
-
- @Override
- public TagList getTags(IdDt theResourceId) {
- return super.getTags(myResourceType, theResourceId);
- }
-
- @Override
- public List history() {
- return null;
- }
-
- @Override
- public List history(Date theSince, Integer theLimit) {
- return super.history(myResourceName, null, theSince, theLimit);
- }
-
- @Override
- public List history(IdDt theId) {
- ArrayList retVal = new ArrayList();
-
- String resourceType = getContext().getResourceDefinition(myResourceType).getName();
- TypedQuery q = myEntityManager.createQuery(ResourceHistoryTable.Q_GETALL, ResourceHistoryTable.class);
- q.setParameter("PID", theId.asLong());
- q.setParameter("RESTYPE", resourceType);
-
- // TypedQuery query =
- // myEntityManager.createQuery(criteriaQuery);
- List results = q.getResultList();
- for (ResourceHistoryTable next : results) {
- retVal.add(toResource(myResourceType, next));
- }
-
- try {
- retVal.add(read(theId.withoutVersion()));
- } catch (ResourceNotFoundException e) {
- // ignore
- }
-
- if (retVal.isEmpty()) {
- throw new ResourceNotFoundException(theId);
- }
-
- return retVal;
- }
-
- @Override
- public List history(Long theId, Date theSince, Integer theLimit) {
- return super.history(myResourceName, theId, theSince, theLimit);
- }
-
- @PostConstruct
- public void postConstruct() {
- myResourceName = getContext().getResourceDefinition(myResourceType).getName();
- }
-
- @Override
- public T read(IdDt theId) {
- BaseHasResource entity = readEntity(theId);
-
- T retVal = toResource(myResourceType, entity);
- return retVal;
- }
-
- @Override
- public BaseHasResource readEntity(IdDt theId) {
- BaseHasResource entity = myEntityManager.find(ResourceTable.class, theId.asLong());
- if (theId.hasUnqualifiedVersionId()) {
- if (entity.getVersion() != theId.getUnqualifiedVersionIdAsLong()) {
- entity = null;
- }
- }
-
- if (entity == null) {
- if (theId.hasUnqualifiedVersionId()) {
- entity = myEntityManager.find(ResourceHistoryTable.class, new ResourceHistoryTablePk(myResourceName, theId.asLong(), theId.getUnqualifiedVersionIdAsLong()));
- }
- if (entity == null) {
- throw new ResourceNotFoundException(theId);
- }
- }
- return entity;
- }
-
- @Override
- public void removeTag(IdDt theId, String theScheme, String theTerm) {
- BaseHasResource entity = readEntity(theId);
- if (entity == null) {
- throw new ResourceNotFoundException(theId);
- }
-
- for (BaseTag next : new ArrayList(entity.getTags())) {
- if (next.getTag().getScheme().equals(theScheme) && next.getTag().getTerm().equals(theTerm)) {
- myEntityManager.remove(next);
- entity.getTags().remove(next);
- }
- }
-
- myEntityManager.merge(entity);
- }
-
- @Override
- public List search(Map theParams) {
- SearchParameterMap map = new SearchParameterMap();
- for (Entry nextEntry : theParams.entrySet()) {
- map.put(nextEntry.getKey(), new ArrayList>());
- map.get(nextEntry.getKey()).add(Collections.singletonList(nextEntry.getValue()));
- }
- return search(map);
- }
-
- @Override
- public List search(SearchParameterMap theParams) {
-
- Set pids;
- if (theParams.isEmpty()) {
- pids = null;
- } else {
- pids = searchForIdsWithAndOr(theParams);
- if (pids.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();
- for (ResourceTable next : q.getResultList()) {
- T resource = toResource(myResourceType, next);
- retVal.add(resource);
- }
- return retVal;
- }
- }
-
- @Override
- public List search(String theParameterName, IQueryParameterType theValue) {
- return search(Collections.singletonMap(theParameterName, theValue));
- }
-
- @Override
- public Set searchForIds(Map theParams) {
- Map>> map = new HashMap>>();
- for (Entry nextEntry : theParams.entrySet()) {
- map.put(nextEntry.getKey(), new ArrayList>());
- map.get(nextEntry.getKey()).add(Collections.singletonList(nextEntry.getValue()));
- }
- return searchForIdsWithAndOr(map);
- }
-
- @Override
- public Set searchForIds(String theParameterName, IQueryParameterType theValue) {
- return searchForIds(Collections.singletonMap(theParameterName, theValue));
- }
-
- @Override
- public Set searchForIdsWithAndOr(Map>> theParams) {
- Map>> params = theParams;
- if (params == null) {
- params = Collections.emptyMap();
- }
-
- RuntimeResourceDefinition resourceDef = getContext().getResourceDefinition(myResourceType);
-
- Set pids = new HashSet();
-
- for (Entry>> nextParamEntry : params.entrySet()) {
- String nextParamName = nextParamEntry.getKey();
- RuntimeSearchParam nextParamDef = resourceDef.getSearchParam(nextParamName);
- if (nextParamDef != null) {
- if (nextParamDef.getParamType() == SearchParamTypeEnum.TOKEN) {
- for (List nextAnd : nextParamEntry.getValue()) {
- pids = addPredicateToken(pids, nextAnd);
- if (pids.isEmpty()) {
- return new HashSet();
- }
- }
- } else if (nextParamDef.getParamType() == SearchParamTypeEnum.STRING) {
- for (List nextAnd : nextParamEntry.getValue()) {
- pids = addPredicateString(pids, nextAnd);
- if (pids.isEmpty()) {
- return new HashSet();
- }
- }
- } else if (nextParamDef.getParamType() == SearchParamTypeEnum.QUANTITY) {
- for (List nextAnd : nextParamEntry.getValue()) {
- pids = addPredicateQuantity(pids, nextAnd);
- if (pids.isEmpty()) {
- return new HashSet();
- }
- }
- } else if (nextParamDef.getParamType() == SearchParamTypeEnum.DATE) {
- for (List nextAnd : nextParamEntry.getValue()) {
- pids = addPredicateDate(pids, nextAnd);
- if (pids.isEmpty()) {
- return new HashSet();
- }
- }
- } else if (nextParamDef.getParamType() == SearchParamTypeEnum.REFERENCE) {
- for (List nextAnd : nextParamEntry.getValue()) {
- pids = addPredicateReference(nextParamName, pids, nextAnd);
- if (pids.isEmpty()) {
- return new HashSet();
- }
- }
- } else {
- throw new IllegalArgumentException("Don't know how to handle parameter of type: " + nextParamDef.getParamType());
- }
- }
- }
-
- return pids;
- }
-
- @SuppressWarnings("unchecked")
- @Required
- public void setResourceType(Class extends IResource> theTableType) {
- myResourceType = (Class) theTableType;
- }
-
- @Override
- public MethodOutcome update(final T theResource, final IdDt theId) {
-
- // TransactionTemplate template = new TransactionTemplate(myPlatformTransactionManager);
- // ResourceTable savedEntity = template.execute(new TransactionCallback() {
- // @Override
- // public ResourceTable doInTransaction(TransactionStatus theStatus) {
- // final ResourceTable entity = readEntity(theId);
- // return updateEntity(theResource, entity,true);
- // }
- // });
-
- final ResourceTable entity = readEntityLatestVersion(theId);
- ResourceTable savedEntity = updateEntity(theResource, entity, true);
-
- return toMethodOutcome(savedEntity);
- }
+ private String mySecondaryPrimaryKeyParamName;
private Set addPredicateDate(Set thePids, List theOrParams) {
if (theOrParams == null || theOrParams.isEmpty()) {
@@ -403,21 +119,42 @@ public class FhirResourceDao extends BaseFhirDao implements
}
private void addPredicateDateFromRange(CriteriaBuilder builder, Root from, List codePredicates, DateRangeParam range) {
- Predicate singleCode;
Date lowerBound = range.getLowerBoundAsInstant();
Date upperBound = range.getUpperBoundAsInstant();
- if (lowerBound != null && upperBound != null) {
- Predicate low = builder.greaterThanOrEqualTo(from. get("myValueLow"), lowerBound);
- Predicate high = builder.lessThanOrEqualTo(from. get("myValueHigh"), upperBound);
- singleCode = builder.and(low, high);
- } else if (lowerBound != null) {
- singleCode = builder.greaterThanOrEqualTo(from. get("myValueLow"), lowerBound);
- } else {
- singleCode = builder.lessThanOrEqualTo(from. get("myValueHigh"), upperBound);
+ Predicate lb = null;
+ if (lowerBound != null) {
+ Predicate gt = builder.greaterThanOrEqualTo(from. get("myValueLow"), lowerBound);
+ Predicate gin = builder.isNull(from.get("myValueLow"));
+ Predicate lbo = builder.or(gt, gin);
+
+ Predicate lt = builder.greaterThanOrEqualTo(from. get("myValueHigh"), lowerBound);
+ Predicate lin = builder.isNull(from.get("myValueHigh"));
+ Predicate hbo = builder.or(lt, lin);
+
+ lb = builder.and(lbo, hbo);
}
- codePredicates.add(singleCode);
+ Predicate ub = null;
+ if (upperBound != null) {
+ Predicate gt = builder.lessThanOrEqualTo(from. get("myValueLow"), upperBound);
+ Predicate gin = builder.isNull(from.get("myValueLow"));
+ Predicate lbo = builder.or(gt, gin);
+
+ Predicate lt = builder.lessThanOrEqualTo(from. get("myValueHigh"), upperBound);
+ Predicate lin = builder.isNull(from.get("myValueHigh"));
+ Predicate ubo = builder.or(lt, lin);
+
+ ub = builder.and(ubo, lbo);
+ }
+
+ if (lb != null && ub != null) {
+ codePredicates.add(builder.and(lb, ub));
+ } else if (lb != null) {
+ codePredicates.add(lb);
+ } else {
+ codePredicates.add(ub);
+ }
}
private Set addPredicateQuantity(Set thePids, List theOrParams) {
@@ -696,6 +433,140 @@ public class FhirResourceDao extends BaseFhirDao implements
return new HashSet(q.getResultList());
}
+ @Override
+ public void addTag(IdDt theId, String theScheme, String theTerm, String theLabel) {
+ BaseHasResource entity = readEntity(theId);
+ if (entity == null) {
+ throw new ResourceNotFoundException(theId);
+ }
+
+ for (BaseTag next : new ArrayList(entity.getTags())) {
+ if (next.getTag().getScheme().equals(theScheme) && next.getTag().getTerm().equals(theTerm)) {
+ return;
+ }
+ }
+
+ TagDefinition def = getTag(theScheme, theTerm, theLabel);
+ BaseTag newEntity = entity.addTag(def);
+
+ myEntityManager.persist(newEntity);
+ myEntityManager.merge(entity);
+ }
+
+ @Override
+ public MethodOutcome create(final T theResource) {
+ ResourceTable entity = new ResourceTable();
+ entity.setResourceType(toResourceName(theResource));
+
+ updateEntity(theResource, entity, false);
+
+ MethodOutcome outcome = toMethodOutcome(entity);
+ return outcome;
+ }
+
+ @Override
+ public TagList getAllResourceTags() {
+ return super.getTags(myResourceType, null);
+ }
+
+ public Class getResourceType() {
+ return myResourceType;
+ }
+
+ @Override
+ public TagList getTags(IdDt theResourceId) {
+ return super.getTags(myResourceType, theResourceId);
+ }
+
+ @Override
+ public List history() {
+ return null;
+ }
+
+ @Override
+ public List history(Date theSince, Integer theLimit) {
+ return super.history(myResourceName, null, theSince, theLimit);
+ }
+
+ @Override
+ public List history(IdDt theId) {
+ ArrayList retVal = new ArrayList();
+
+ String resourceType = getContext().getResourceDefinition(myResourceType).getName();
+ TypedQuery q = myEntityManager.createQuery(ResourceHistoryTable.Q_GETALL, ResourceHistoryTable.class);
+ q.setParameter("PID", theId.asLong());
+ q.setParameter("RESTYPE", resourceType);
+
+ // TypedQuery query =
+ // myEntityManager.createQuery(criteriaQuery);
+ List results = q.getResultList();
+ for (ResourceHistoryTable next : results) {
+ retVal.add(toResource(myResourceType, next));
+ }
+
+ try {
+ retVal.add(read(theId.withoutVersion()));
+ } catch (ResourceNotFoundException e) {
+ // ignore
+ }
+
+ if (retVal.isEmpty()) {
+ throw new ResourceNotFoundException(theId);
+ }
+
+ return retVal;
+ }
+
+ @Override
+ public List history(Long theId, Date theSince, Integer theLimit) {
+ return super.history(myResourceName, theId, theSince, theLimit);
+ }
+
+ @PostConstruct
+ public void postConstruct() {
+ RuntimeResourceDefinition def = getContext().getResourceDefinition(myResourceType);
+ myResourceName = def.getName();
+
+ if (mySecondaryPrimaryKeyParamName != null) {
+ RuntimeSearchParam sp = def.getSearchParam(mySecondaryPrimaryKeyParamName);
+ 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");
+ }
+ }
+
+ }
+
+ @Override
+ public T read(IdDt theId) {
+ BaseHasResource entity = readEntity(theId);
+
+ T retVal = toResource(myResourceType, entity);
+ return retVal;
+ }
+
+ @Override
+ public BaseHasResource readEntity(IdDt theId) {
+ BaseHasResource entity = myEntityManager.find(ResourceTable.class, theId.asLong());
+ if (theId.hasUnqualifiedVersionId()) {
+ if (entity.getVersion() != theId.getUnqualifiedVersionIdAsLong()) {
+ entity = null;
+ }
+ }
+
+ if (entity == null) {
+ if (theId.hasUnqualifiedVersionId()) {
+ entity = myEntityManager.find(ResourceHistoryTable.class, new ResourceHistoryTablePk(myResourceName, theId.asLong(), theId.getUnqualifiedVersionIdAsLong()));
+ }
+ if (entity == null) {
+ throw new ResourceNotFoundException(theId);
+ }
+ }
+ return entity;
+ }
+
private ResourceTable readEntityLatestVersion(IdDt theId) {
ResourceTable entity = myEntityManager.find(ResourceTable.class, theId.asLong());
if (entity == null) {
@@ -704,6 +575,158 @@ public class FhirResourceDao extends BaseFhirDao implements
return entity;
}
+ @Override
+ public void removeTag(IdDt theId, String theScheme, String theTerm) {
+ BaseHasResource entity = readEntity(theId);
+ if (entity == null) {
+ throw new ResourceNotFoundException(theId);
+ }
+
+ for (BaseTag next : new ArrayList(entity.getTags())) {
+ if (next.getTag().getScheme().equals(theScheme) && next.getTag().getTerm().equals(theTerm)) {
+ myEntityManager.remove(next);
+ entity.getTags().remove(next);
+ }
+ }
+
+ myEntityManager.merge(entity);
+ }
+
+ @Override
+ public List search(Map theParams) {
+ SearchParameterMap map = new SearchParameterMap();
+ for (Entry nextEntry : theParams.entrySet()) {
+ map.put(nextEntry.getKey(), new ArrayList>());
+ map.get(nextEntry.getKey()).add(Collections.singletonList(nextEntry.getValue()));
+ }
+ return search(map);
+ }
+
+ @Override
+ public List search(SearchParameterMap theParams) {
+
+ Set pids;
+ if (theParams.isEmpty()) {
+ pids = null;
+ } else {
+ pids = searchForIdsWithAndOr(theParams);
+ if (pids.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();
+ for (ResourceTable next : q.getResultList()) {
+ T resource = toResource(myResourceType, next);
+ retVal.add(resource);
+ }
+ return retVal;
+ }
+ }
+
+ @Override
+ public List search(String theParameterName, IQueryParameterType theValue) {
+ return search(Collections.singletonMap(theParameterName, theValue));
+ }
+
+ @Override
+ public Set searchForIds(Map theParams) {
+ Map>> map = new HashMap>>();
+ for (Entry nextEntry : theParams.entrySet()) {
+ map.put(nextEntry.getKey(), new ArrayList>());
+ map.get(nextEntry.getKey()).add(Collections.singletonList(nextEntry.getValue()));
+ }
+ return searchForIdsWithAndOr(map);
+ }
+
+ @Override
+ public Set searchForIds(String theParameterName, IQueryParameterType theValue) {
+ return searchForIds(Collections.singletonMap(theParameterName, theValue));
+ }
+
+ @Override
+ public Set searchForIdsWithAndOr(Map>> theParams) {
+ Map>> params = theParams;
+ if (params == null) {
+ params = Collections.emptyMap();
+ }
+
+ RuntimeResourceDefinition resourceDef = getContext().getResourceDefinition(myResourceType);
+
+ Set pids = new HashSet();
+
+ for (Entry>> nextParamEntry : params.entrySet()) {
+ String nextParamName = nextParamEntry.getKey();
+ RuntimeSearchParam nextParamDef = resourceDef.getSearchParam(nextParamName);
+ if (nextParamDef != null) {
+ if (nextParamDef.getParamType() == SearchParamTypeEnum.TOKEN) {
+ for (List nextAnd : nextParamEntry.getValue()) {
+ pids = addPredicateToken(pids, nextAnd);
+ if (pids.isEmpty()) {
+ return new HashSet();
+ }
+ }
+ } else if (nextParamDef.getParamType() == SearchParamTypeEnum.STRING) {
+ for (List nextAnd : nextParamEntry.getValue()) {
+ pids = addPredicateString(pids, nextAnd);
+ if (pids.isEmpty()) {
+ return new HashSet();
+ }
+ }
+ } else if (nextParamDef.getParamType() == SearchParamTypeEnum.QUANTITY) {
+ for (List nextAnd : nextParamEntry.getValue()) {
+ pids = addPredicateQuantity(pids, nextAnd);
+ if (pids.isEmpty()) {
+ return new HashSet();
+ }
+ }
+ } else if (nextParamDef.getParamType() == SearchParamTypeEnum.DATE) {
+ for (List nextAnd : nextParamEntry.getValue()) {
+ pids = addPredicateDate(pids, nextAnd);
+ if (pids.isEmpty()) {
+ return new HashSet();
+ }
+ }
+ } else if (nextParamDef.getParamType() == SearchParamTypeEnum.REFERENCE) {
+ for (List nextAnd : nextParamEntry.getValue()) {
+ pids = addPredicateReference(nextParamName, pids, nextAnd);
+ if (pids.isEmpty()) {
+ return new HashSet();
+ }
+ }
+ } else {
+ throw new IllegalArgumentException("Don't know how to handle parameter of type: " + nextParamDef.getParamType());
+ }
+ }
+ }
+
+ return pids;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Required
+ public void setResourceType(Class extends IResource> theTableType) {
+ myResourceType = (Class) theTableType;
+ }
+
+ /**
+ * If set, the given param will be treated as a secondary primary key, and multiple resources will not be able to share the same value.
+ */
+ public void setSecondaryPrimaryKeyParamName(String theSecondaryPrimaryKeyParamName) {
+ mySecondaryPrimaryKeyParamName = theSecondaryPrimaryKeyParamName;
+ }
+
private MethodOutcome toMethodOutcome(final ResourceTable entity) {
MethodOutcome outcome = new MethodOutcome();
outcome.setId(new IdDt(entity.getResourceType() + '/' + entity.getId() + '/' + Constants.PARAM_HISTORY + '/' + entity.getVersion()));
@@ -738,4 +761,22 @@ public class FhirResourceDao extends BaseFhirDao implements
}
}
+ @Override
+ public MethodOutcome update(final T theResource, final IdDt theId) {
+
+ // TransactionTemplate template = new TransactionTemplate(myPlatformTransactionManager);
+ // ResourceTable savedEntity = template.execute(new TransactionCallback() {
+ // @Override
+ // public ResourceTable doInTransaction(TransactionStatus theStatus) {
+ // final ResourceTable entity = readEntity(theId);
+ // return updateEntity(theResource, entity,true);
+ // }
+ // });
+
+ final ResourceTable entity = readEntityLatestVersion(theId);
+ ResourceTable savedEntity = updateEntity(theResource, entity, true);
+
+ return toMethodOutcome(savedEntity);
+ }
+
}
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 0557887fb6e..ef0b1ae5fed 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
@@ -91,11 +91,11 @@ public class FhirSystemDao extends BaseFhirDao implements IFhirSystemDao {
for (IResource nextResource : theResources) {
List allRefs = terser.getAllPopulatedChildElementsOfType(nextResource, ResourceReferenceDt.class);
for (ResourceReferenceDt nextRef : allRefs) {
- IdDt nextId = nextRef.getResourceId();
+ IdDt nextId = nextRef.getReference();
if (idConversions.containsKey(nextId)) {
IdDt newId = idConversions.get(nextId);
ourLog.info(" * Replacing resource ref {} with {}", nextId, newId);
- nextRef.setResourceId(newId);
+ nextRef.setReference(newId);
} else {
ourLog.info(" * Reference [{}] does not exist in bundle", nextId);
}
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceHistoryTablePk.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceHistoryTablePk.java
index 557b4980bd3..70458a91c5b 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceHistoryTablePk.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceHistoryTablePk.java
@@ -30,6 +30,43 @@ public class ResourceHistoryTablePk implements Serializable {
myVersion = theVersion;
}
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((myId == null) ? 0 : myId.hashCode());
+ result = prime * result + ((myResourceType == null) ? 0 : myResourceType.hashCode());
+ result = prime * result + ((myVersion == null) ? 0 : myVersion.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;
+ ResourceHistoryTablePk other = (ResourceHistoryTablePk) obj;
+ if (myId == null) {
+ if (other.myId != null)
+ return false;
+ } else if (!myId.equals(other.myId))
+ return false;
+ if (myResourceType == null) {
+ if (other.myResourceType != null)
+ return false;
+ } else if (!myResourceType.equals(other.myResourceType))
+ return false;
+ if (myVersion == null) {
+ if (other.myVersion != null)
+ return false;
+ } else if (!myVersion.equals(other.myVersion))
+ return false;
+ return true;
+ }
+
public Long getId() {
return myId;
}
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamDate.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamDate.java
index c65789704f0..f09796f7a43 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamDate.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamDate.java
@@ -23,6 +23,11 @@ public class ResourceIndexedSearchParamDate extends BaseResourceIndexedSearchPar
@Temporal(TemporalType.TIMESTAMP)
public Date myValueLow;
+
+
+ public ResourceIndexedSearchParamDate() {
+ }
+
public ResourceIndexedSearchParamDate(String theName, Date theLow, Date theHigh) {
setName(theName);
setValueLow(theLow);
diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceTable.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceTable.java
index 939b569f19f..61f11ea7871 100644
--- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceTable.java
+++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceTable.java
@@ -3,6 +3,7 @@ package ca.uhn.fhir.jpa.entity;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
@@ -26,7 +27,7 @@ import ca.uhn.fhir.rest.server.Constants;
@Entity
@Table(name = "HFJ_RESOURCE", uniqueConstraints = {})
@Inheritance(strategy = InheritanceType.JOINED)
-@org.hibernate.annotations.Table(appliesTo="HFJ_RESOURCE", indexes= {@Index(name="IDX_RES_DATE", columnNames= {"RES_UPDATED"})})
+@org.hibernate.annotations.Table(appliesTo = "HFJ_RESOURCE", indexes = { @Index(name = "IDX_RES_DATE", columnNames = { "RES_UPDATED" }) })
public class ResourceTable extends BaseHasResource implements Serializable {
static final int RESTYPE_LEN = 30;
@@ -80,23 +81,21 @@ public class ResourceTable extends BaseHasResource implements Serializable {
@Column(name = "RES_VER")
private long myVersion;
- public boolean hasTag(String theTerm, String theLabel, String theScheme) {
- for (ResourceTag next : getTags()) {
- if (next.getTag().getTerm().equals(theTerm)) {
- return true;
- }
- }
- return false;
- }
-
- public IdDt getIdDt() {
- return new IdDt(myResourceType + '/' + myId + '/' + Constants.PARAM_HISTORY + '/' + myVersion);
+ public ResourceTag addTag(TagDefinition theTag) {
+ ResourceTag tag = new ResourceTag(this, theTag);
+ tag.setResourceType(getResourceType());
+ getTags().add(tag);
+ return tag;
}
public Long getId() {
return myId;
}
+ public IdDt getIdDt() {
+ return new IdDt(myResourceType + '/' + myId + '/' + Constants.PARAM_HISTORY + '/' + myVersion);
+ }
+
public Collection getParamsDate() {
if (myParamsDate == null) {
myParamsDate = new ArrayList();
@@ -147,6 +146,15 @@ public class ResourceTable extends BaseHasResource implements Serializable {
return myVersion;
}
+ public boolean hasTag(String theTerm, String theLabel, String theScheme) {
+ for (ResourceTag next : getTags()) {
+ if (next.getTag().getTerm().equals(theTerm)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
public boolean isHasLinks() {
return myHasLinks;
}
@@ -176,19 +184,35 @@ public class ResourceTable extends BaseHasResource implements Serializable {
}
public void setParamsDate(Collection theParamsDate) {
- myParamsDate = theParamsDate;
+ if (!isParamsDatePopulated() && theParamsDate.isEmpty()) {
+ return;
+ }
+ getParamsDate().clear();
+ getParamsDate().addAll(theParamsDate);
}
public void setParamsDatePopulated(boolean theParamsDatePopulated) {
myParamsDatePopulated = theParamsDatePopulated;
}
+ public void setParamsNumber(List theNumberParams) {
+ if (!isParamsNumberPopulated() && theNumberParams.isEmpty()) {
+ return;
+ }
+ getParamsNumber().clear();
+ getParamsNumber().addAll(theNumberParams);
+ }
+
public void setParamsNumberPopulated(boolean theParamsNumberPopulated) {
myParamsNumberPopulated = theParamsNumberPopulated;
}
public void setParamsString(Collection theParamsString) {
- myParamsString = theParamsString;
+ if (!isParamsStringPopulated() && theParamsString.isEmpty()) {
+ return;
+ }
+ getParamsString().clear();
+ getParamsString().addAll(theParamsString);
}
public void setParamsStringPopulated(boolean theParamsStringPopulated) {
@@ -196,13 +220,25 @@ public class ResourceTable extends BaseHasResource implements Serializable {
}
public void setParamsToken(Collection theParamsToken) {
- myParamsToken = theParamsToken;
+ if (!isParamsTokenPopulated() && theParamsToken.isEmpty()) {
+ return;
+ }
+ getParamsToken().clear();
+ getParamsToken().addAll(theParamsToken);
}
public void setParamsTokenPopulated(boolean theParamsTokenPopulated) {
myParamsTokenPopulated = theParamsTokenPopulated;
}
+ public void setResourceLinks(List theLinks) {
+ if (!isHasLinks() && theLinks.isEmpty()) {
+ return;
+ }
+ getResourceLinks().clear();
+ getResourceLinks().addAll(theLinks);
+ }
+
public void setResourceType(String theResourceType) {
myResourceType = theResourceType;
}
@@ -231,11 +267,4 @@ public class ResourceTable extends BaseHasResource implements Serializable {
return retVal;
}
-
- public ResourceTag addTag(TagDefinition theTag) {
- ResourceTag tag = new ResourceTag(this, theTag);
- tag.setResourceType(getResourceType());
- getTags().add(tag);
- return tag;
- }
}
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 c0702b1e1f0..869b07662a1 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
@@ -24,6 +24,7 @@ import ca.uhn.fhir.model.dstu.composite.QuantityDt;
import ca.uhn.fhir.model.dstu.composite.ResourceReferenceDt;
import ca.uhn.fhir.model.dstu.resource.Device;
import ca.uhn.fhir.model.dstu.resource.DiagnosticReport;
+import ca.uhn.fhir.model.dstu.resource.Encounter;
import ca.uhn.fhir.model.dstu.resource.Location;
import ca.uhn.fhir.model.dstu.resource.Observation;
import ca.uhn.fhir.model.dstu.resource.Organization;
@@ -35,6 +36,7 @@ import ca.uhn.fhir.model.primitive.IdDt;
import ca.uhn.fhir.model.primitive.InstantDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.rest.api.MethodOutcome;
+import ca.uhn.fhir.rest.param.DateRangeParam;
import ca.uhn.fhir.rest.param.QualifiedDateParam;
import ca.uhn.fhir.rest.param.ReferenceParam;
import ca.uhn.fhir.rest.param.StringParam;
@@ -52,6 +54,7 @@ public class FhirResourceDaoTest {
private static IFhirResourceDao ourLocationDao;
private static Date ourTestStarted;
+ private static IFhirResourceDao ourEncounterDao;
@Test
public void testPersistAndReadResource() {
@@ -378,7 +381,146 @@ public class FhirResourceDaoTest {
assertEquals(0, patients.size());
}
+
+
+ @Test
+ public void testDatePeriodParamStartOnly() {
+ {
+ Encounter enc = new Encounter();
+ enc.addIdentifier("testDatePeriodParam", "01");
+ enc.getPeriod().getStart().setValueAsString("2001-01-02");
+ ourEncounterDao.create(enc);
+ }
+ SearchParameterMap params = new SearchParameterMap();
+ params.add(Encounter.SP_DATE, new DateRangeParam("2001-01-01", "2001-01-03"));
+ params.add(Encounter.SP_IDENTIFIER, new IdentifierDt("testDatePeriodParam", "01"));
+ List encs = ourEncounterDao.search(params);
+ assertEquals(1, encs.size());
+
+ params = new SearchParameterMap();
+ params.add(Encounter.SP_DATE, new DateRangeParam("2001-01-01", null));
+ params.add(Encounter.SP_IDENTIFIER, new IdentifierDt("testDatePeriodParam", "01"));
+ encs = ourEncounterDao.search(params);
+ assertEquals(1, encs.size());
+
+ params = new SearchParameterMap();
+ params.add(Encounter.SP_DATE, new DateRangeParam(null, "2001-01-03"));
+ params.add(Encounter.SP_IDENTIFIER, new IdentifierDt("testDatePeriodParam", "01"));
+ encs = ourEncounterDao.search(params);
+ assertEquals(1, encs.size());
+
+ params = new SearchParameterMap();
+ params.add(Encounter.SP_DATE, new DateRangeParam(null, "2001-01-01"));
+ params.add(Encounter.SP_IDENTIFIER, new IdentifierDt("testDatePeriodParam", "01"));
+ encs = ourEncounterDao.search(params);
+ assertEquals(0, encs.size());
+
+ params = new SearchParameterMap();
+ params.add(Encounter.SP_DATE, new DateRangeParam("2001-01-03",null));
+ params.add(Encounter.SP_IDENTIFIER, new IdentifierDt("testDatePeriodParam", "01"));
+ encs = ourEncounterDao.search(params);
+ assertEquals(0, encs.size());
+
+ }
+
+ @Test
+ public void testDatePeriodParamEndOnly() {
+ {
+ Encounter enc = new Encounter();
+ enc.addIdentifier("testDatePeriodParam", "02");
+ enc.getPeriod().getEnd().setValueAsString("2001-01-02");
+ ourEncounterDao.create(enc);
+ }
+
+ SearchParameterMap params = new SearchParameterMap();
+ params.add(Encounter.SP_DATE, new DateRangeParam("2001-01-01", "2001-01-03"));
+ params.add(Encounter.SP_IDENTIFIER, new IdentifierDt("testDatePeriodParam", "02"));
+ List encs = ourEncounterDao.search(params);
+ assertEquals(1, encs.size());
+
+ params = new SearchParameterMap();
+ params.add(Encounter.SP_DATE, new DateRangeParam("2001-01-01", null));
+ params.add(Encounter.SP_IDENTIFIER, new IdentifierDt("testDatePeriodParam", "02"));
+ encs = ourEncounterDao.search(params);
+ assertEquals(1, encs.size());
+
+ params = new SearchParameterMap();
+ params.add(Encounter.SP_DATE, new DateRangeParam(null, "2001-01-03"));
+ params.add(Encounter.SP_IDENTIFIER, new IdentifierDt("testDatePeriodParam", "02"));
+ encs = ourEncounterDao.search(params);
+ assertEquals(1, encs.size());
+
+ params = new SearchParameterMap();
+ params.add(Encounter.SP_DATE, new DateRangeParam(null, "2001-01-01"));
+ params.add(Encounter.SP_IDENTIFIER, new IdentifierDt("testDatePeriodParam", "02"));
+ encs = ourEncounterDao.search(params);
+ assertEquals(0, encs.size());
+
+ params = new SearchParameterMap();
+ params.add(Encounter.SP_DATE, new DateRangeParam( "2001-01-03",null));
+ params.add(Encounter.SP_IDENTIFIER, new IdentifierDt("testDatePeriodParam", "02"));
+ encs = ourEncounterDao.search(params);
+ assertEquals(0, encs.size());
+
+ }
+
+
+ @Test
+ public void testDatePeriodParamStartAndEnd() {
+ {
+ Encounter enc = new Encounter();
+ enc.addIdentifier("testDatePeriodParam", "03");
+ enc.getPeriod().getStart().setValueAsString("2001-01-02");
+ enc.getPeriod().getEnd().setValueAsString("2001-01-03");
+ ourEncounterDao.create(enc);
+ }
+
+ SearchParameterMap params = new SearchParameterMap();
+ params.add(Encounter.SP_DATE, new DateRangeParam("2001-01-01", "2001-01-03"));
+ params.add(Encounter.SP_IDENTIFIER, new IdentifierDt("testDatePeriodParam", "03"));
+ List encs = ourEncounterDao.search(params);
+ assertEquals(1, encs.size());
+
+ params = new SearchParameterMap();
+ params.add(Encounter.SP_DATE, new DateRangeParam("2001-01-02", "2001-01-06"));
+ params.add(Encounter.SP_IDENTIFIER, new IdentifierDt("testDatePeriodParam", "03"));
+ encs = ourEncounterDao.search(params);
+ assertEquals(1, encs.size());
+
+ params = new SearchParameterMap();
+ params.add(Encounter.SP_DATE, new DateRangeParam("2001-01-01", null));
+ params.add(Encounter.SP_IDENTIFIER, new IdentifierDt("testDatePeriodParam", "03"));
+ encs = ourEncounterDao.search(params);
+ assertEquals(1, encs.size());
+
+ params = new SearchParameterMap();
+ params.add(Encounter.SP_DATE, new DateRangeParam(null, "2001-01-03"));
+ params.add(Encounter.SP_IDENTIFIER, new IdentifierDt("testDatePeriodParam", "03"));
+ encs = ourEncounterDao.search(params);
+ assertEquals(1, encs.size());
+
+ params = new SearchParameterMap();
+ params.add(Encounter.SP_DATE, new DateRangeParam(null, "2001-01-05"));
+ params.add(Encounter.SP_IDENTIFIER, new IdentifierDt("testDatePeriodParam", "03"));
+ encs = ourEncounterDao.search(params);
+ assertEquals(1, encs.size());
+
+ params = new SearchParameterMap();
+ params.add(Encounter.SP_DATE, new DateRangeParam(null, "2001-01-01"));
+ params.add(Encounter.SP_IDENTIFIER, new IdentifierDt("testDatePeriodParam", "03"));
+ encs = ourEncounterDao.search(params);
+ assertEquals(0, encs.size());
+
+ params = new SearchParameterMap();
+ params.add(Encounter.SP_DATE, new DateRangeParam( "2001-01-05",null));
+ params.add(Encounter.SP_IDENTIFIER, new IdentifierDt("testDatePeriodParam", "03"));
+ encs = ourEncounterDao.search(params);
+ assertEquals(0, encs.size());
+
+ }
+
+
@Test
public void testSearchStringParamWithNonNormalized() {
{
@@ -522,7 +664,8 @@ public class FhirResourceDaoTest {
// Update the name
p1.getNameFirstRep().getGivenFirstRep().setValue("testUpdateMaintainsSearchParamsBBB");
- IdDt p1id2 = ourPatientDao.update(p1, p1id).getId();
+ MethodOutcome update2 = ourPatientDao.update(p1, p1id);
+ IdDt p1id2 = update2.getId();
ids = ourPatientDao.searchForIds(Patient.SP_GIVEN, new StringDt("testUpdateMaintainsSearchParamsAAA"));
assertEquals(0, ids.size());
@@ -555,6 +698,7 @@ public class FhirResourceDaoTest {
ourDeviceDao = ourCtx.getBean("myDeviceDao", IFhirResourceDao.class);
ourOrganizationDao = ourCtx.getBean("myOrganizationDao", IFhirResourceDao.class);
ourLocationDao = ourCtx.getBean("myLocationDao", IFhirResourceDao.class);
+ ourEncounterDao = ourCtx.getBean("myEncounterDao", IFhirResourceDao.class);
}
}
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 12842a344bd..495b9157ade 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
@@ -65,7 +65,7 @@ public class FhirSystemDaoTest {
Thread.sleep(10);
IdDt newpid3 = ourPatientDao.update(patient, pid).getId();
- List values = ourSystemDao.history(start, 1000);
+ List values = ourSystemDao.history(start, null);
assertEquals(4, values.size());
assertEquals(newpid3, values.get(0).getId());
@@ -207,7 +207,7 @@ public class FhirSystemDaoTest {
IdDt foundPatientId = patResults.get(0).getId();
ResourceReferenceDt subject = obs.getSubject();
- assertEquals(foundPatientId.getUnqualifiedId(), subject.getResourceId().getUnqualifiedId());
+ assertEquals(foundPatientId.getUnqualifiedId(), subject.getReference().getUnqualifiedId());
// Update
diff --git a/hapi-fhir-jpaserver-base/src/test/resources/META-INF/persistence.xml b/hapi-fhir-jpaserver-base/src/test/resources/META-INF/persistence.xml
index 520df7bef9c..1af1d488a8d 100644
--- a/hapi-fhir-jpaserver-base/src/test/resources/META-INF/persistence.xml
+++ b/hapi-fhir-jpaserver-base/src/test/resources/META-INF/persistence.xml
@@ -29,7 +29,7 @@
-
+
diff --git a/hapi-fhir-jpaserver-base/src/test/resources/fhir-jpabase-spring-test-config.xml b/hapi-fhir-jpaserver-base/src/test/resources/fhir-jpabase-spring-test-config.xml
index 32f4c59e855..d04391add55 100644
--- a/hapi-fhir-jpaserver-base/src/test/resources/fhir-jpabase-spring-test-config.xml
+++ b/hapi-fhir-jpaserver-base/src/test/resources/fhir-jpabase-spring-test-config.xml
@@ -40,6 +40,9 @@
+
+
+
diff --git a/hapi-tinder-plugin/.classpath b/hapi-tinder-plugin/.classpath
index 8d568ad96ec..534b5e52fa5 100644
--- a/hapi-tinder-plugin/.classpath
+++ b/hapi-tinder-plugin/.classpath
@@ -1,97 +1,36 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
-
-
+
-
+
-
-
-
+
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/TinderStructuresMojo.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/TinderStructuresMojo.java
index 026f1c13018..385f59a1e4e 100644
--- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/TinderStructuresMojo.java
+++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/TinderStructuresMojo.java
@@ -183,24 +183,24 @@ public class TinderStructuresMojo extends AbstractMojo {
public static void main(String[] args) throws Exception {
-// ValueSetGenerator vsp = new ValueSetGenerator();
+ ValueSetGenerator vsp = new ValueSetGenerator();
// vsp.setDirectory("src/test/resources/vs/");
-// vsp.parse();
-//
-// DatatypeGeneratorUsingSpreadsheet dtp = new DatatypeGeneratorUsingSpreadsheet();
-// dtp.parse();
-// dtp.bindValueSets(vsp);
-//
-// String dtOutputDir = "target/generated/valuesets/ca/uhn/fhir/model/dstu/composite";
-// dtp.writeAll(dtOutputDir);
-//
+ vsp.parse();
+
+ DatatypeGeneratorUsingSpreadsheet dtp = new DatatypeGeneratorUsingSpreadsheet();
+ dtp.parse();
+ dtp.bindValueSets(vsp);
+
+ String dtOutputDir = "target/generated/valuesets/ca/uhn/fhir/model/dstu/composite";
+ dtp.writeAll(new File(dtOutputDir), "ca.uhn.fhir.model.dstu");
+
ResourceGeneratorUsingSpreadsheet rp = new ResourceGeneratorUsingSpreadsheet();
- rp.setBaseResourceNames(Arrays.asList("list"));
+ rp.setBaseResourceNames(Arrays.asList("list", "encounter"));
rp.parse();
// rp.bindValueSets(vsp);
String rpOutputDir = "target/generated/valuesets/ca/uhn/fhir/model/dstu/resource";
- rp.writeAll(new File(rpOutputDir), "ca.uhn.test");
+ rp.writeAll(new File(rpOutputDir), "ca.uhn.fhir.model.dstu");
//
// String vsOutputDir = "target/generated/valuesets/ca/uhn/fhir/model/dstu/valueset";
// vsp.writeMarkedValueSets(vsOutputDir);
diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/BaseElement.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/BaseElement.java
index 512c0f207c2..650ffb9b4f1 100644
--- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/BaseElement.java
+++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/BaseElement.java
@@ -217,6 +217,10 @@ public abstract class BaseElement {
myShortName = theShortName;
}
+ public void clearTypes() {
+ getType().clear();
+ }
+
public void setTypeFromString(String theType) {
if (theType == null) {
myType = null;
diff --git a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/Child.java b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/Child.java
index 20b41f509ee..723944e6143 100644
--- a/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/Child.java
+++ b/hapi-tinder-plugin/src/main/java/ca/uhn/fhir/tinder/model/Child.java
@@ -13,6 +13,12 @@ public abstract class Child extends BaseElement {
private List mySimpleStters = new ArrayList();
+ @Override
+ public void clearTypes() {
+ super.clearTypes();
+ mySimpleStters.clear();
+ }
+
public String getAnnotationType() {
return getSingleType();
}
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 6d3ea0c0f74..417f9426efe 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
@@ -334,6 +334,7 @@ public abstract class BaseStructureParser {
for (BaseRootType next : myResources) {
ourLog.info("Writing Resource {}", next.getName());
+ scanForCorrections(next);
scanForTypeNameConflicts(next);
fixResourceReferenceClassNames(next, thePackageBase);
@@ -349,6 +350,18 @@ public abstract class BaseStructureParser {
}
}
+ private void scanForCorrections(BaseRootType theNext) {
+ if (theNext.getElementName().equals("ResourceReference")) {
+ for (BaseElement next : theNext.getChildren()) {
+ if (next.getElementName().equals("reference")) {
+ next.clearTypes();
+ next.setTypeFromString("id");
+ scanForSimpleSetters((Child) next);
+ }
+ }
+ }
+ }
+
private String translateClassName(String theName) {
if ("List".equals(theName)) {
return "ListResource";
diff --git a/hapi-tinder-plugin/src/main/resources/vm/dt_composite.vm b/hapi-tinder-plugin/src/main/resources/vm/dt_composite.vm
index 105c4509545..3cdf391c881 100644
--- a/hapi-tinder-plugin/src/main/resources/vm/dt_composite.vm
+++ b/hapi-tinder-plugin/src/main/resources/vm/dt_composite.vm
@@ -256,7 +256,7 @@ public class ${className}
* The reference itself
*/
public ResourceReferenceDt(String theId) {
- setResourceId(new IdDt(theId));
+ setReference(new IdDt(theId));
}
/**
@@ -267,7 +267,7 @@ public class ${className}
* The reference itself
*/
public ResourceReferenceDt(IdDt theResourceId) {
- setResourceId(theResourceId);
+ setReference(theResourceId);
}
#end
@@ -404,19 +404,6 @@ public class ${className}
return null;
}
#end
-#if ( ${className} == "ResourceReferenceDt" )
- /** TODO: document */
- @Override
- public IdDt getResourceId() {
- return new IdDt(myReference.getValue());
- }
-
- /** TODO: document */
- @Override
- public void setResourceId(IdDt theResourceId) {
- myReference = new StringDt(theResourceId.getValue());
- }
-#end
#childExtensionTypes( $childExtensionTypes )
}
\ No newline at end of file
diff --git a/hapi-tinder-plugin/src/main/resources/vm/templates.vm b/hapi-tinder-plugin/src/main/resources/vm/templates.vm
index c1e85f51aab..8a1ccd29b99 100644
--- a/hapi-tinder-plugin/src/main/resources/vm/templates.vm
+++ b/hapi-tinder-plugin/src/main/resources/vm/templates.vm
@@ -134,6 +134,23 @@
}
#end
#if ( ${child.boundCode} && ${child.repeatable} )
+ /**
+ * Add a value for ${child.elementName} (${child.shortName}) using an enumerated type. This
+ * is intended as a convenience method for situations where the FHIR defined ValueSets are mandatory
+ * or contain the desirable codes. If you wish to use codes other than those which are built-in,
+ * you may also use the {@link ${hash}addType()} method.
+ *
+ *
+ * Definition:
+ * ${child.definition}
+ *
+ */
+ public ${child.boundDatatype}<${child.bindingClass}> add${child.methodName}(${child.bindingClass} theValue) {
+ ${child.boundDatatype}<${child.bindingClass}> retVal = new ${child.boundDatatype}<${child.bindingClass}>(${child.bindingClass}.VALUESET_BINDER, theValue);
+ get${child.methodName}().add(retVal);
+ return retVal;
+ }
+
/**
* Add a value for ${child.elementName} (${child.shortName})
*
@@ -142,8 +159,10 @@
* ${child.definition}
*
*/
- public void add${child.methodName}(${child.bindingClass} theValue) {
- get${child.methodName}().add(new ${child.boundDatatype}<${child.bindingClass}>(${child.bindingClass}.VALUESET_BINDER, theValue));
+ public ${child.boundDatatype}<${child.bindingClass}> add${child.methodName}() {
+ ${child.boundDatatype}<${child.bindingClass}> retVal = new ${child.boundDatatype}<${child.bindingClass}>(${child.bindingClass}.VALUESET_BINDER);
+ get${child.methodName}().add(retVal);
+ return retVal;
}
/**
diff --git a/hapi-tinder-plugin/tmp/ValueSet.java b/hapi-tinder-plugin/tmp/ValueSet.java
deleted file mode 100644
index 74fd17b7014..00000000000
--- a/hapi-tinder-plugin/tmp/ValueSet.java
+++ /dev/null
@@ -1,2539 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-package ca.test.resource;
-
-
-import java.util.*;
-import ca.uhn.fhir.model.api.*;
-import ca.uhn.fhir.model.api.annotation.*;
-
-import ca.uhn.fhir.model.dstu.composite.ContactDt;
-import ca.uhn.fhir.model.dstu.composite.IdentifierDt;
-import ca.uhn.fhir.model.primitive.BooleanDt;
-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.model.primitive.UriDt;
-
-
-/**
- * HAPI/FHIR ValueSet Resource
- * (A set of codes drawn from one or more code systems)
- *
- *
- * Definition:
- * A value set specifies a set of codes drawn from one or more code systems
- *
- *
- *
- * Requirements:
- *
- *
- */
-@ResourceDef(name="ValueSet", profile="http://hl7.org/fhir/profiles/ValueSet", id="valueset")
-public class ValueSet extends BaseResource implements IResource {
-
- /**
- * Search parameter constant for identifier
- *
- * Description: The identifier of the value set
- * Type: token
- * Path: ValueSet.identifier
- *
- */
- public static final String SP_IDENTIFIER = "identifier";
-
- /**
- * Search parameter constant for version
- *
- * Description: The version identifier of the value set
- * Type: token
- * Path: ValueSet.version
- *
- */
- public static final String SP_VERSION = "version";
-
- /**
- * Search parameter constant for name
- *
- * Description: The name of the value set
- * Type: string
- * Path: ValueSet.name
- *
- */
- public static final String SP_NAME = "name";
-
- /**
- * Search parameter constant for publisher
- *
- * Description: Name of the publisher of the value set
- * Type: string
- * Path: ValueSet.publisher
- *
- */
- public static final String SP_PUBLISHER = "publisher";
-
- /**
- * Search parameter constant for description
- *
- * Description: Text search in the description of the value set
- * Type: string
- * Path: ValueSet.description
- *
- */
- public static final String SP_DESCRIPTION = "description";
-
- /**
- * Search parameter constant for status
- *
- * Description: The status of the value set
- * Type: token
- * Path: ValueSet.status
- *
- */
- public static final String SP_STATUS = "status";
-
- /**
- * Search parameter constant for date
- *
- * Description: The value set publication date
- * Type: date
- * Path: ValueSet.date
- *
- */
- public static final String SP_DATE = "date";
-
- /**
- * Search parameter constant for system
- *
- * Description: The system for any codes defined by this value set
- * Type: token
- * Path: ValueSet.define.system
- *
- */
- public static final String SP_SYSTEM = "system";
-
- /**
- * Search parameter constant for code
- *
- * Description: A code defined in the value set
- * Type: token
- * Path: ValueSet.define.concept.code
- *
- */
- public static final String SP_CODE = "code";
-
- /**
- * Search parameter constant for reference
- *
- * Description: A code system included or excluded in the value set or an imported value set
- * Type: token
- * Path: ValueSet.compose.include.system
- *
- */
- public static final String SP_REFERENCE = "reference";
-
- /**
- * Search parameter constant for !restricts
- *
- * Description: A value set listed in the restricts list
- * Type: token
- * Path: ValueSet.compose.restricts
- *
- */
- public static final String SP_RESTRICTS = "!restricts";
-
-
- @Child(name="identifier", type=StringDt.class, order=0, min=0, max=1)
- @Description(
- shortDefinition="Logical id to reference this value set",
- formalDefinition="The identifier that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI)"
- )
- private StringDt myIdentifier;
-
- @Child(name="version", type=StringDt.class, order=1, min=0, max=1)
- @Description(
- shortDefinition="Logical id for this version of the value set",
- formalDefinition="The identifier that is used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp"
- )
- private StringDt myVersion;
-
- @Child(name="name", type=StringDt.class, order=2, min=1, max=1)
- @Description(
- shortDefinition="Informal name for this value set",
- formalDefinition="A free text natural language name describing the value set"
- )
- private StringDt myName;
-
- @Child(name="publisher", type=StringDt.class, order=3, min=0, max=1)
- @Description(
- shortDefinition="Name of the publisher (Organization or individual)",
- formalDefinition="The name of the individual or organization that published the value set"
- )
- private StringDt myPublisher;
-
- @Child(name="telecom", type=ContactDt.class, order=4, min=0, max=Child.MAX_UNLIMITED)
- @Description(
- shortDefinition="Contact information of the publisher",
- formalDefinition="Contacts of the publisher to assist a user in finding and communicating with the publisher"
- )
- private java.util.List myTelecom;
-
- @Child(name="description", type=StringDt.class, order=5, min=1, max=1)
- @Description(
- shortDefinition="Human language description of the value set",
- formalDefinition="A free text natural language description of the use of the value set - reason for definition, conditions of use, etc."
- )
- private StringDt myDescription;
-
- @Child(name="copyright", type=StringDt.class, order=6, min=0, max=1)
- @Description(
- shortDefinition="About the value set or its content",
- formalDefinition="A copyright statement relating to the value set and/or its contents"
- )
- private StringDt myCopyright;
-
- @Child(name="status", type=CodeDt.class, order=7, min=1, max=1)
- @Description(
- shortDefinition="draft | active | retired",
- formalDefinition="The status of the value set"
- )
- private CodeDt myStatus;
-
- @Child(name="experimental", type=BooleanDt.class, order=8, min=0, max=1)
- @Description(
- shortDefinition="If for testing purposes, not real usage",
- formalDefinition="This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage"
- )
- private BooleanDt myExperimental;
-
- @Child(name="extensible", type=BooleanDt.class, order=9, min=0, max=1)
- @Description(
- shortDefinition="Whether this is intended to be used with an extensible binding",
- formalDefinition="Whether this is intended to be used with an extensible binding or not"
- )
- private BooleanDt myExtensible;
-
- @Child(name="date", type=DateTimeDt.class, order=10, min=0, max=1)
- @Description(
- shortDefinition="Date for given status",
- formalDefinition="The date that the value set status was last changed"
- )
- private DateTimeDt myDate;
-
- @Child(name="define", order=11, min=0, max=1)
- @Description(
- shortDefinition="When value set defines its own codes",
- formalDefinition=""
- )
- private Define myDefine;
-
- @Child(name="compose", order=12, min=0, max=1)
- @Description(
- shortDefinition="When value set includes codes from elsewhere",
- formalDefinition=""
- )
- private Compose myCompose;
-
- @Child(name="expansion", order=13, min=0, max=1)
- @Description(
- shortDefinition="When value set is an expansion",
- formalDefinition=""
- )
- private Expansion myExpansion;
-
-
- @Override
- public boolean isEmpty() {
- return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myVersion, myName, myPublisher, myTelecom, myDescription, myCopyright, myStatus, myExperimental, myExtensible, myDate, myDefine, myCompose, myExpansion);
- }
-
- @Override
- public java.util.List getAllPopulatedChildElements() {
- return getAllPopulatedChildElementsOfType(null);
- }
-
- @Override
- public List getAllPopulatedChildElementsOfType(Class theType) {
- return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myVersion, myName, myPublisher, myTelecom, myDescription, myCopyright, myStatus, myExperimental, myExtensible, myDate, myDefine, myCompose, myExpansion);
- }
-
- /**
- * Gets the value(s) for identifier (Logical id to reference this value set).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- * The identifier that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI)
- *
- */
- public StringDt getIdentifier() {
- if (myIdentifier == null) {
- myIdentifier = new StringDt();
- }
- return myIdentifier;
- }
-
- /**
- * Sets the value(s) for identifier (Logical id to reference this value set)
- *
- *
- * Definition:
- * The identifier that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI)
- *
- */
- public void setIdentifier(StringDt theValue) {
- myIdentifier = theValue;
- }
-
- /**
- * Sets the value for identifier (Logical id to reference this value set)
- *
- *
- * Definition:
- * The identifier that is used to identify this value set when it is referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI)
- *
- */
- public void setIdentifier( String theString) {
- myIdentifier = new StringDt(theString);
- }
-
-
- /**
- * Gets the value(s) for version (Logical id for this version of the value set).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- * The identifier that is used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp
- *
- */
- public StringDt getVersion() {
- if (myVersion == null) {
- myVersion = new StringDt();
- }
- return myVersion;
- }
-
- /**
- * Sets the value(s) for version (Logical id for this version of the value set)
- *
- *
- * Definition:
- * The identifier that is used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp
- *
- */
- public void setVersion(StringDt theValue) {
- myVersion = theValue;
- }
-
- /**
- * Sets the value for version (Logical id for this version of the value set)
- *
- *
- * Definition:
- * The identifier that is used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp
- *
- */
- public void setVersion( String theString) {
- myVersion = new StringDt(theString);
- }
-
-
- /**
- * Gets the value(s) for name (Informal name for this value set).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- * A free text natural language name describing the value set
- *
- */
- public StringDt getName() {
- if (myName == null) {
- myName = new StringDt();
- }
- return myName;
- }
-
- /**
- * Sets the value(s) for name (Informal name for this value set)
- *
- *
- * Definition:
- * A free text natural language name describing the value set
- *
- */
- public void setName(StringDt theValue) {
- myName = theValue;
- }
-
- /**
- * Sets the value for name (Informal name for this value set)
- *
- *
- * Definition:
- * A free text natural language name describing the value set
- *
- */
- public void setName( String theString) {
- myName = new StringDt(theString);
- }
-
-
- /**
- * Gets the value(s) for publisher (Name of the publisher (Organization or individual)).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- * The name of the individual or organization that published the value set
- *
- */
- public StringDt getPublisher() {
- if (myPublisher == null) {
- myPublisher = new StringDt();
- }
- return myPublisher;
- }
-
- /**
- * Sets the value(s) for publisher (Name of the publisher (Organization or individual))
- *
- *
- * Definition:
- * The name of the individual or organization that published the value set
- *
- */
- public void setPublisher(StringDt theValue) {
- myPublisher = theValue;
- }
-
- /**
- * Sets the value for publisher (Name of the publisher (Organization or individual))
- *
- *
- * Definition:
- * The name of the individual or organization that published the value set
- *
- */
- public void setPublisher( String theString) {
- myPublisher = new StringDt(theString);
- }
-
-
- /**
- * Gets the value(s) for telecom (Contact information of the publisher).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- * Contacts of the publisher to assist a user in finding and communicating with the publisher
- *
- */
- public java.util.List getTelecom() {
- if (myTelecom == null) {
- myTelecom = new java.util.ArrayList();
- }
- return myTelecom;
- }
-
- /**
- * Sets the value(s) for telecom (Contact information of the publisher)
- *
- *
- * Definition:
- * Contacts of the publisher to assist a user in finding and communicating with the publisher
- *
- */
- public void setTelecom(java.util.List theValue) {
- myTelecom = theValue;
- }
-
- /**
- * Adds and returns a new value for telecom (Contact information of the publisher)
- *
- *
- * Definition:
- * Contacts of the publisher to assist a user in finding and communicating with the publisher
- *
- */
- public ContactDt addTelecom() {
- ContactDt newType = new ContactDt();
- getTelecom().add(newType);
- return newType;
- }
-
- /**
- * Gets the first repetition for telecom (Contact information of the publisher),
- * creating it if it does not already exist.
- *
- *
- * Definition:
- * Contacts of the publisher to assist a user in finding and communicating with the publisher
- *
- */
- public ContactDt getTelecomFirstRep() {
- if (getTelecom().isEmpty()) {
- return addTelecom();
- }
- return getTelecom().get(0);
- }
-
- /**
- * Gets the value(s) for description (Human language description of the value set).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- * A free text natural language description of the use of the value set - reason for definition, conditions of use, etc.
- *
- */
- public StringDt getDescription() {
- if (myDescription == null) {
- myDescription = new StringDt();
- }
- return myDescription;
- }
-
- /**
- * Sets the value(s) for description (Human language description of the value set)
- *
- *
- * Definition:
- * A free text natural language description of the use of the value set - reason for definition, conditions of use, etc.
- *
- */
- public void setDescription(StringDt theValue) {
- myDescription = theValue;
- }
-
- /**
- * Sets the value for description (Human language description of the value set)
- *
- *
- * Definition:
- * A free text natural language description of the use of the value set - reason for definition, conditions of use, etc.
- *
- */
- public void setDescription( String theString) {
- myDescription = new StringDt(theString);
- }
-
-
- /**
- * Gets the value(s) for copyright (About the value set or its content).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- * A copyright statement relating to the value set and/or its contents
- *
- */
- public StringDt getCopyright() {
- if (myCopyright == null) {
- myCopyright = new StringDt();
- }
- return myCopyright;
- }
-
- /**
- * Sets the value(s) for copyright (About the value set or its content)
- *
- *
- * Definition:
- * A copyright statement relating to the value set and/or its contents
- *
- */
- public void setCopyright(StringDt theValue) {
- myCopyright = theValue;
- }
-
- /**
- * Sets the value for copyright (About the value set or its content)
- *
- *
- * Definition:
- * A copyright statement relating to the value set and/or its contents
- *
- */
- public void setCopyright( String theString) {
- myCopyright = new StringDt(theString);
- }
-
-
- /**
- * Gets the value(s) for status (draft | active | retired).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- * The status of the value set
- *
- */
- public CodeDt getStatus() {
- if (myStatus == null) {
- myStatus = new CodeDt();
- }
- return myStatus;
- }
-
- /**
- * Sets the value(s) for status (draft | active | retired)
- *
- *
- * Definition:
- * The status of the value set
- *
- */
- public void setStatus(CodeDt theValue) {
- myStatus = theValue;
- }
-
- /**
- * Sets the value for status (draft | active | retired)
- *
- *
- * Definition:
- * The status of the value set
- *
- */
- public void setStatus( String theCode) {
- myStatus = new CodeDt(theCode);
- }
-
-
- /**
- * Gets the value(s) for experimental (If for testing purposes, not real usage).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- * This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage
- *
- */
- public BooleanDt getExperimental() {
- if (myExperimental == null) {
- myExperimental = new BooleanDt();
- }
- return myExperimental;
- }
-
- /**
- * Sets the value(s) for experimental (If for testing purposes, not real usage)
- *
- *
- * Definition:
- * This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage
- *
- */
- public void setExperimental(BooleanDt theValue) {
- myExperimental = theValue;
- }
-
- /**
- * Sets the value for experimental (If for testing purposes, not real usage)
- *
- *
- * Definition:
- * This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage
- *
- */
- public void setExperimental( Boolean theBoolean) {
- myExperimental = new BooleanDt(theBoolean);
- }
-
-
- /**
- * Gets the value(s) for extensible (Whether this is intended to be used with an extensible binding).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- * Whether this is intended to be used with an extensible binding or not
- *
- */
- public BooleanDt getExtensible() {
- if (myExtensible == null) {
- myExtensible = new BooleanDt();
- }
- return myExtensible;
- }
-
- /**
- * Sets the value(s) for extensible (Whether this is intended to be used with an extensible binding)
- *
- *
- * Definition:
- * Whether this is intended to be used with an extensible binding or not
- *
- */
- public void setExtensible(BooleanDt theValue) {
- myExtensible = theValue;
- }
-
- /**
- * Sets the value for extensible (Whether this is intended to be used with an extensible binding)
- *
- *
- * Definition:
- * Whether this is intended to be used with an extensible binding or not
- *
- */
- public void setExtensible( Boolean theBoolean) {
- myExtensible = new BooleanDt(theBoolean);
- }
-
-
- /**
- * Gets the value(s) for date (Date for given status).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- * The date that the value set status was last changed
- *
- */
- public DateTimeDt getDate() {
- if (myDate == null) {
- myDate = new DateTimeDt();
- }
- return myDate;
- }
-
- /**
- * Sets the value(s) for date (Date for given status)
- *
- *
- * Definition:
- * The date that the value set status was last changed
- *
- */
- public void setDate(DateTimeDt theValue) {
- myDate = theValue;
- }
-
- /**
- * Sets the value for date (Date for given status)
- *
- *
- * Definition:
- * The date that the value set status was last changed
- *
- */
- public void setDateWithSecondsPrecision( Date theDate) {
- myDate = new DateTimeDt(theDate);
- }
-
- /**
- * Sets the value for date (Date for given status)
- *
- *
- * Definition:
- * The date that the value set status was last changed
- *
- */
- public void setDate( Date theDate, TemporalPrecisionEnum thePrecision) {
- myDate = new DateTimeDt(theDate, thePrecision);
- }
-
-
- /**
- * Gets the value(s) for define (When value set defines its own codes).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- *
- *
- */
- public Define getDefine() {
- if (myDefine == null) {
- myDefine = new Define();
- }
- return myDefine;
- }
-
- /**
- * Sets the value(s) for define (When value set defines its own codes)
- *
- *
- * Definition:
- *
- *
- */
- public void setDefine(Define theValue) {
- myDefine = theValue;
- }
-
-
- /**
- * Gets the value(s) for compose (When value set includes codes from elsewhere).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- *
- *
- */
- public Compose getCompose() {
- if (myCompose == null) {
- myCompose = new Compose();
- }
- return myCompose;
- }
-
- /**
- * Sets the value(s) for compose (When value set includes codes from elsewhere)
- *
- *
- * Definition:
- *
- *
- */
- public void setCompose(Compose theValue) {
- myCompose = theValue;
- }
-
-
- /**
- * Gets the value(s) for expansion (When value set is an expansion).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- *
- *
- */
- public Expansion getExpansion() {
- if (myExpansion == null) {
- myExpansion = new Expansion();
- }
- return myExpansion;
- }
-
- /**
- * Sets the value(s) for expansion (When value set is an expansion)
- *
- *
- * Definition:
- *
- *
- */
- public void setExpansion(Expansion theValue) {
- myExpansion = theValue;
- }
-
-
- /**
- * Block class for child element: ValueSet.define (When value set defines its own codes)
- *
- *
- * Definition:
- *
- *
- */
- @Block(name="ValueSet.define")
- public static class Define extends BaseElement implements IResourceBlock {
-
- @Child(name="system", type=UriDt.class, order=0, min=1, max=1)
- @Description(
- shortDefinition="URI to identify the code system",
- formalDefinition=""
- )
- private UriDt mySystem;
-
- @Child(name="version", type=StringDt.class, order=1, min=0, max=1)
- @Description(
- shortDefinition="Version of this system",
- formalDefinition="The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked"
- )
- private StringDt myVersion;
-
- @Child(name="caseSensitive", type=BooleanDt.class, order=2, min=0, max=1)
- @Description(
- shortDefinition="If code comparison is case sensitive",
- formalDefinition="If code comparison is case sensitive when codes within this system are compared to each other"
- )
- private BooleanDt myCaseSensitive;
-
- @Child(name="concept", order=3, min=0, max=Child.MAX_UNLIMITED)
- @Description(
- shortDefinition="Concepts in the code system",
- formalDefinition=""
- )
- private java.util.List myConcept;
-
-
- @Override
- public boolean isEmpty() {
- return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySystem, myVersion, myCaseSensitive, myConcept);
- }
-
- @Override
- public java.util.List getAllPopulatedChildElements() {
- return getAllPopulatedChildElementsOfType(null);
- }
-
- @Override
- public List getAllPopulatedChildElementsOfType(Class theType) {
- return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySystem, myVersion, myCaseSensitive, myConcept);
- }
-
- /**
- * Gets the value(s) for system (URI to identify the code system).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- *
- *
- */
- public UriDt getSystem() {
- if (mySystem == null) {
- mySystem = new UriDt();
- }
- return mySystem;
- }
-
- /**
- * Sets the value(s) for system (URI to identify the code system)
- *
- *
- * Definition:
- *
- *
- */
- public void setSystem(UriDt theValue) {
- mySystem = theValue;
- }
-
- /**
- * Sets the value for system (URI to identify the code system)
- *
- *
- * Definition:
- *
- *
- */
- public void setSystem( String theUri) {
- mySystem = new UriDt(theUri);
- }
-
-
- /**
- * Gets the value(s) for version (Version of this system).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- * The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked
- *
- */
- public StringDt getVersion() {
- if (myVersion == null) {
- myVersion = new StringDt();
- }
- return myVersion;
- }
-
- /**
- * Sets the value(s) for version (Version of this system)
- *
- *
- * Definition:
- * The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked
- *
- */
- public void setVersion(StringDt theValue) {
- myVersion = theValue;
- }
-
- /**
- * Sets the value for version (Version of this system)
- *
- *
- * Definition:
- * The version of this code system that defines the codes. Note that the version is optional because a well maintained code system does not suffer from versioning, and therefore the version does not need to be maintained. However many code systems are not well maintained, and the version needs to be defined and tracked
- *
- */
- public void setVersion( String theString) {
- myVersion = new StringDt(theString);
- }
-
-
- /**
- * Gets the value(s) for caseSensitive (If code comparison is case sensitive).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- * If code comparison is case sensitive when codes within this system are compared to each other
- *
- */
- public BooleanDt getCaseSensitive() {
- if (myCaseSensitive == null) {
- myCaseSensitive = new BooleanDt();
- }
- return myCaseSensitive;
- }
-
- /**
- * Sets the value(s) for caseSensitive (If code comparison is case sensitive)
- *
- *
- * Definition:
- * If code comparison is case sensitive when codes within this system are compared to each other
- *
- */
- public void setCaseSensitive(BooleanDt theValue) {
- myCaseSensitive = theValue;
- }
-
- /**
- * Sets the value for caseSensitive (If code comparison is case sensitive)
- *
- *
- * Definition:
- * If code comparison is case sensitive when codes within this system are compared to each other
- *
- */
- public void setCaseSensitive( Boolean theBoolean) {
- myCaseSensitive = new BooleanDt(theBoolean);
- }
-
-
- /**
- * Gets the value(s) for concept (Concepts in the code system).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- *
- *
- */
- public java.util.List getConcept() {
- if (myConcept == null) {
- myConcept = new java.util.ArrayList();
- }
- return myConcept;
- }
-
- /**
- * Sets the value(s) for concept (Concepts in the code system)
- *
- *
- * Definition:
- *
- *
- */
- public void setConcept(java.util.List theValue) {
- myConcept = theValue;
- }
-
- /**
- * Adds and returns a new value for concept (Concepts in the code system)
- *
- *
- * Definition:
- *
- *
- */
- public DefineConcept addConcept() {
- DefineConcept newType = new DefineConcept();
- getConcept().add(newType);
- return newType;
- }
-
- /**
- * Gets the first repetition for concept (Concepts in the code system),
- * creating it if it does not already exist.
- *
- *
- * Definition:
- *
- *
- */
- public DefineConcept getConceptFirstRep() {
- if (getConcept().isEmpty()) {
- return addConcept();
- }
- return getConcept().get(0);
- }
-
-
- }
-
- /**
- * Block class for child element: ValueSet.define.concept (Concepts in the code system)
- *
- *
- * Definition:
- *
- *
- */
- @Block(name="ValueSet.define.concept")
- public static class DefineConcept extends BaseElement implements IResourceBlock {
-
- @Child(name="code", type=CodeDt.class, order=0, min=1, max=1)
- @Description(
- shortDefinition="Code that identifies concept",
- formalDefinition=""
- )
- private CodeDt myCode;
-
- @Child(name="abstract", type=BooleanDt.class, order=1, min=0, max=1)
- @Description(
- shortDefinition="If this code is not for use as a real concept",
- formalDefinition="If this code is not for use as a real concept"
- )
- private BooleanDt myAbstract;
-
- @Child(name="display", type=StringDt.class, order=2, min=0, max=1)
- @Description(
- shortDefinition="Text to Display to the user",
- formalDefinition=""
- )
- private StringDt myDisplay;
-
- @Child(name="definition", type=StringDt.class, order=3, min=0, max=1)
- @Description(
- shortDefinition="Formal Definition",
- formalDefinition="The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept"
- )
- private StringDt myDefinition;
-
- @Child(name="concept", type=DefineConcept.class, order=4, min=0, max=Child.MAX_UNLIMITED)
- @Description(
- shortDefinition="Child Concepts (is-a / contains)",
- formalDefinition=""
- )
- private java.util.List myConcept;
-
-
- @Override
- public boolean isEmpty() {
- return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCode, myAbstract, myDisplay, myDefinition, myConcept);
- }
-
- @Override
- public java.util.List getAllPopulatedChildElements() {
- return getAllPopulatedChildElementsOfType(null);
- }
-
- @Override
- public List getAllPopulatedChildElementsOfType(Class theType) {
- return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCode, myAbstract, myDisplay, myDefinition, myConcept);
- }
-
- /**
- * Gets the value(s) for code (Code that identifies concept).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- *
- *
- */
- public CodeDt getCode() {
- if (myCode == null) {
- myCode = new CodeDt();
- }
- return myCode;
- }
-
- /**
- * Sets the value(s) for code (Code that identifies concept)
- *
- *
- * Definition:
- *
- *
- */
- public void setCode(CodeDt theValue) {
- myCode = theValue;
- }
-
- /**
- * Sets the value for code (Code that identifies concept)
- *
- *
- * Definition:
- *
- *
- */
- public void setCode( String theCode) {
- myCode = new CodeDt(theCode);
- }
-
-
- /**
- * Gets the value(s) for abstract (If this code is not for use as a real concept).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- * If this code is not for use as a real concept
- *
- */
- public BooleanDt getAbstract() {
- if (myAbstract == null) {
- myAbstract = new BooleanDt();
- }
- return myAbstract;
- }
-
- /**
- * Sets the value(s) for abstract (If this code is not for use as a real concept)
- *
- *
- * Definition:
- * If this code is not for use as a real concept
- *
- */
- public void setAbstract(BooleanDt theValue) {
- myAbstract = theValue;
- }
-
- /**
- * Sets the value for abstract (If this code is not for use as a real concept)
- *
- *
- * Definition:
- * If this code is not for use as a real concept
- *
- */
- public void setAbstract( Boolean theBoolean) {
- myAbstract = new BooleanDt(theBoolean);
- }
-
-
- /**
- * Gets the value(s) for display (Text to Display to the user).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- *
- *
- */
- public StringDt getDisplay() {
- if (myDisplay == null) {
- myDisplay = new StringDt();
- }
- return myDisplay;
- }
-
- /**
- * Sets the value(s) for display (Text to Display to the user)
- *
- *
- * Definition:
- *
- *
- */
- public void setDisplay(StringDt theValue) {
- myDisplay = theValue;
- }
-
- /**
- * Sets the value for display (Text to Display to the user)
- *
- *
- * Definition:
- *
- *
- */
- public void setDisplay( String theString) {
- myDisplay = new StringDt(theString);
- }
-
-
- /**
- * Gets the value(s) for definition (Formal Definition).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- * The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept
- *
- */
- public StringDt getDefinition() {
- if (myDefinition == null) {
- myDefinition = new StringDt();
- }
- return myDefinition;
- }
-
- /**
- * Sets the value(s) for definition (Formal Definition)
- *
- *
- * Definition:
- * The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept
- *
- */
- public void setDefinition(StringDt theValue) {
- myDefinition = theValue;
- }
-
- /**
- * Sets the value for definition (Formal Definition)
- *
- *
- * Definition:
- * The formal definition of the concept. Formal definitions are not required, because of the prevalence of legacy systems without them, but they are highly recommended, as without them there is no formal meaning associated with the concept
- *
- */
- public void setDefinition( String theString) {
- myDefinition = new StringDt(theString);
- }
-
-
- /**
- * Gets the value(s) for concept (Child Concepts (is-a / contains)).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- *
- *
- */
- public java.util.List getConcept() {
- if (myConcept == null) {
- myConcept = new java.util.ArrayList();
- }
- return myConcept;
- }
-
- /**
- * Sets the value(s) for concept (Child Concepts (is-a / contains))
- *
- *
- * Definition:
- *
- *
- */
- public void setConcept(java.util.List theValue) {
- myConcept = theValue;
- }
-
- /**
- * Adds and returns a new value for concept (Child Concepts (is-a / contains))
- *
- *
- * Definition:
- *
- *
- */
- public DefineConcept addConcept() {
- DefineConcept newType = new DefineConcept();
- getConcept().add(newType);
- return newType;
- }
-
- /**
- * Gets the first repetition for concept (Child Concepts (is-a / contains)),
- * creating it if it does not already exist.
- *
- *
- * Definition:
- *
- *
- */
- public DefineConcept getConceptFirstRep() {
- if (getConcept().isEmpty()) {
- return addConcept();
- }
- return getConcept().get(0);
- }
-
-
- }
-
-
-
- /**
- * Block class for child element: ValueSet.compose (When value set includes codes from elsewhere)
- *
- *
- * Definition:
- *
- *
- */
- @Block(name="ValueSet.compose")
- public static class Compose extends BaseElement implements IResourceBlock {
-
- @Child(name="import", type=UriDt.class, order=0, min=0, max=Child.MAX_UNLIMITED)
- @Description(
- shortDefinition="Import the contents of another value set",
- formalDefinition="Includes the contents of the referenced value set as a part of the contents of this value set"
- )
- private java.util.List myImport;
-
- @Child(name="include", order=1, min=0, max=Child.MAX_UNLIMITED)
- @Description(
- shortDefinition="Include one or more codes from a code system",
- formalDefinition="Include one or more codes from a code system"
- )
- private java.util.List myInclude;
-
- @Child(name="exclude", type=ComposeInclude.class, order=2, min=0, max=Child.MAX_UNLIMITED)
- @Description(
- shortDefinition="Explicitly exclude codes",
- formalDefinition="Exclude one or more codes from the value set"
- )
- private java.util.List myExclude;
-
-
- @Override
- public boolean isEmpty() {
- return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myImport, myInclude, myExclude);
- }
-
- @Override
- public java.util.List getAllPopulatedChildElements() {
- return getAllPopulatedChildElementsOfType(null);
- }
-
- @Override
- public List getAllPopulatedChildElementsOfType(Class theType) {
- return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myImport, myInclude, myExclude);
- }
-
- /**
- * Gets the value(s) for import (Import the contents of another value set).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- * Includes the contents of the referenced value set as a part of the contents of this value set
- *
- */
- public java.util.List getImport() {
- if (myImport == null) {
- myImport = new java.util.ArrayList();
- }
- return myImport;
- }
-
- /**
- * Sets the value(s) for import (Import the contents of another value set)
- *
- *
- * Definition:
- * Includes the contents of the referenced value set as a part of the contents of this value set
- *
- */
- public void setImport(java.util.List theValue) {
- myImport = theValue;
- }
-
- /**
- * Adds and returns a new value for import (Import the contents of another value set)
- *
- *
- * Definition:
- * Includes the contents of the referenced value set as a part of the contents of this value set
- *
- */
- public UriDt addImport() {
- UriDt newType = new UriDt();
- getImport().add(newType);
- return newType;
- }
-
- /**
- * Gets the first repetition for import (Import the contents of another value set),
- * creating it if it does not already exist.
- *
- *
- * Definition:
- * Includes the contents of the referenced value set as a part of the contents of this value set
- *
- */
- public UriDt getImportFirstRep() {
- if (getImport().isEmpty()) {
- return addImport();
- }
- return getImport().get(0);
- }
- /**
- * Adds a new value for import (Import the contents of another value set)
- *
- *
- * Definition:
- * Includes the contents of the referenced value set as a part of the contents of this value set
- *
- *
- * @return Returns a reference to this object, to allow for simple chaining.
- */
- public Compose addImport( String theUri) {
- if (myImport == null) {
- myImport = new java.util.ArrayList();
- }
- myImport.add(new UriDt(theUri));
- return this;
- }
-
-
- /**
- * Gets the value(s) for include (Include one or more codes from a code system).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- * Include one or more codes from a code system
- *
- */
- public java.util.List getInclude() {
- if (myInclude == null) {
- myInclude = new java.util.ArrayList();
- }
- return myInclude;
- }
-
- /**
- * Sets the value(s) for include (Include one or more codes from a code system)
- *
- *
- * Definition:
- * Include one or more codes from a code system
- *
- */
- public void setInclude(java.util.List theValue) {
- myInclude = theValue;
- }
-
- /**
- * Adds and returns a new value for include (Include one or more codes from a code system)
- *
- *
- * Definition:
- * Include one or more codes from a code system
- *
- */
- public ComposeInclude addInclude() {
- ComposeInclude newType = new ComposeInclude();
- getInclude().add(newType);
- return newType;
- }
-
- /**
- * Gets the first repetition for include (Include one or more codes from a code system),
- * creating it if it does not already exist.
- *
- *
- * Definition:
- * Include one or more codes from a code system
- *
- */
- public ComposeInclude getIncludeFirstRep() {
- if (getInclude().isEmpty()) {
- return addInclude();
- }
- return getInclude().get(0);
- }
-
- /**
- * Gets the value(s) for exclude (Explicitly exclude codes).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- * Exclude one or more codes from the value set
- *
- */
- public java.util.List getExclude() {
- if (myExclude == null) {
- myExclude = new java.util.ArrayList();
- }
- return myExclude;
- }
-
- /**
- * Sets the value(s) for exclude (Explicitly exclude codes)
- *
- *
- * Definition:
- * Exclude one or more codes from the value set
- *
- */
- public void setExclude(java.util.List theValue) {
- myExclude = theValue;
- }
-
- /**
- * Adds and returns a new value for exclude (Explicitly exclude codes)
- *
- *
- * Definition:
- * Exclude one or more codes from the value set
- *
- */
- public ComposeInclude addExclude() {
- ComposeInclude newType = new ComposeInclude();
- getExclude().add(newType);
- return newType;
- }
-
- /**
- * Gets the first repetition for exclude (Explicitly exclude codes),
- * creating it if it does not already exist.
- *
- *
- * Definition:
- * Exclude one or more codes from the value set
- *
- */
- public ComposeInclude getExcludeFirstRep() {
- if (getExclude().isEmpty()) {
- return addExclude();
- }
- return getExclude().get(0);
- }
-
-
- }
-
- /**
- * Block class for child element: ValueSet.compose.include (Include one or more codes from a code system)
- *
- *
- * Definition:
- * Include one or more codes from a code system
- *
- */
- @Block(name="ValueSet.compose.include")
- public static class ComposeInclude extends BaseElement implements IResourceBlock {
-
- @Child(name="system", type=UriDt.class, order=0, min=1, max=1)
- @Description(
- shortDefinition="The system the codes come from",
- formalDefinition="The code system from which the selected codes come from"
- )
- private UriDt mySystem;
-
- @Child(name="version", type=StringDt.class, order=1, min=0, max=1)
- @Description(
- shortDefinition="Specific version of the code system referred to",
- formalDefinition="The version of the code system that the codes are selected from"
- )
- private StringDt myVersion;
-
- @Child(name="code", type=CodeDt.class, order=2, min=0, max=Child.MAX_UNLIMITED)
- @Description(
- shortDefinition="Code or concept from system",
- formalDefinition="Specifies a code or concept to be included or excluded. The list of codes is considered ordered, though the order may not have any particular significance"
- )
- private java.util.List myCode;
-
- @Child(name="filter", order=3, min=0, max=Child.MAX_UNLIMITED)
- @Description(
- shortDefinition="Select codes/concepts by their properties (including relationships)",
- formalDefinition="Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true."
- )
- private java.util.List myFilter;
-
-
- @Override
- public boolean isEmpty() {
- return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySystem, myVersion, myCode, myFilter);
- }
-
- @Override
- public java.util.List getAllPopulatedChildElements() {
- return getAllPopulatedChildElementsOfType(null);
- }
-
- @Override
- public List getAllPopulatedChildElementsOfType(Class theType) {
- return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySystem, myVersion, myCode, myFilter);
- }
-
- /**
- * Gets the value(s) for system (The system the codes come from).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- * The code system from which the selected codes come from
- *
- */
- public UriDt getSystem() {
- if (mySystem == null) {
- mySystem = new UriDt();
- }
- return mySystem;
- }
-
- /**
- * Sets the value(s) for system (The system the codes come from)
- *
- *
- * Definition:
- * The code system from which the selected codes come from
- *
- */
- public void setSystem(UriDt theValue) {
- mySystem = theValue;
- }
-
- /**
- * Sets the value for system (The system the codes come from)
- *
- *
- * Definition:
- * The code system from which the selected codes come from
- *
- */
- public void setSystem( String theUri) {
- mySystem = new UriDt(theUri);
- }
-
-
- /**
- * Gets the value(s) for version (Specific version of the code system referred to).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- * The version of the code system that the codes are selected from
- *
- */
- public StringDt getVersion() {
- if (myVersion == null) {
- myVersion = new StringDt();
- }
- return myVersion;
- }
-
- /**
- * Sets the value(s) for version (Specific version of the code system referred to)
- *
- *
- * Definition:
- * The version of the code system that the codes are selected from
- *
- */
- public void setVersion(StringDt theValue) {
- myVersion = theValue;
- }
-
- /**
- * Sets the value for version (Specific version of the code system referred to)
- *
- *
- * Definition:
- * The version of the code system that the codes are selected from
- *
- */
- public void setVersion( String theString) {
- myVersion = new StringDt(theString);
- }
-
-
- /**
- * Gets the value(s) for code (Code or concept from system).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- * Specifies a code or concept to be included or excluded. The list of codes is considered ordered, though the order may not have any particular significance
- *
- */
- public java.util.List getCode() {
- if (myCode == null) {
- myCode = new java.util.ArrayList();
- }
- return myCode;
- }
-
- /**
- * Sets the value(s) for code (Code or concept from system)
- *
- *
- * Definition:
- * Specifies a code or concept to be included or excluded. The list of codes is considered ordered, though the order may not have any particular significance
- *
- */
- public void setCode(java.util.List theValue) {
- myCode = theValue;
- }
-
- /**
- * Adds and returns a new value for code (Code or concept from system)
- *
- *
- * Definition:
- * Specifies a code or concept to be included or excluded. The list of codes is considered ordered, though the order may not have any particular significance
- *
- */
- public CodeDt addCode() {
- CodeDt newType = new CodeDt();
- getCode().add(newType);
- return newType;
- }
-
- /**
- * Gets the first repetition for code (Code or concept from system),
- * creating it if it does not already exist.
- *
- *
- * Definition:
- * Specifies a code or concept to be included or excluded. The list of codes is considered ordered, though the order may not have any particular significance
- *
- */
- public CodeDt getCodeFirstRep() {
- if (getCode().isEmpty()) {
- return addCode();
- }
- return getCode().get(0);
- }
- /**
- * Adds a new value for code (Code or concept from system)
- *
- *
- * Definition:
- * Specifies a code or concept to be included or excluded. The list of codes is considered ordered, though the order may not have any particular significance
- *
- *
- * @return Returns a reference to this object, to allow for simple chaining.
- */
- public ComposeInclude addCode( String theCode) {
- if (myCode == null) {
- myCode = new java.util.ArrayList();
- }
- myCode.add(new CodeDt(theCode));
- return this;
- }
-
-
- /**
- * Gets the value(s) for filter (Select codes/concepts by their properties (including relationships)).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- * Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.
- *
- */
- public java.util.List getFilter() {
- if (myFilter == null) {
- myFilter = new java.util.ArrayList();
- }
- return myFilter;
- }
-
- /**
- * Sets the value(s) for filter (Select codes/concepts by their properties (including relationships))
- *
- *
- * Definition:
- * Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.
- *
- */
- public void setFilter(java.util.List theValue) {
- myFilter = theValue;
- }
-
- /**
- * Adds and returns a new value for filter (Select codes/concepts by their properties (including relationships))
- *
- *
- * Definition:
- * Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.
- *
- */
- public ComposeIncludeFilter addFilter() {
- ComposeIncludeFilter newType = new ComposeIncludeFilter();
- getFilter().add(newType);
- return newType;
- }
-
- /**
- * Gets the first repetition for filter (Select codes/concepts by their properties (including relationships)),
- * creating it if it does not already exist.
- *
- *
- * Definition:
- * Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.
- *
- */
- public ComposeIncludeFilter getFilterFirstRep() {
- if (getFilter().isEmpty()) {
- return addFilter();
- }
- return getFilter().get(0);
- }
-
-
- }
-
- /**
- * Block class for child element: ValueSet.compose.include.filter (Select codes/concepts by their properties (including relationships))
- *
- *
- * Definition:
- * Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.
- *
- */
- @Block(name="ValueSet.compose.include.filter")
- public static class ComposeIncludeFilter extends BaseElement implements IResourceBlock {
-
- @Child(name="property", type=CodeDt.class, order=0, min=1, max=1)
- @Description(
- shortDefinition="",
- formalDefinition="A code that identifies a property defined in the code system"
- )
- private CodeDt myProperty;
-
- @Child(name="op", type=CodeDt.class, order=1, min=1, max=1)
- @Description(
- shortDefinition="= | is-a | is-not-a | regex | in | not in",
- formalDefinition="The kind of operation to perform as a part of the filter criteria"
- )
- private CodeDt myOp;
-
- @Child(name="value", type=CodeDt.class, order=2, min=1, max=1)
- @Description(
- shortDefinition="Code from the system, or regex criteria",
- formalDefinition="The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value"
- )
- private CodeDt myValue;
-
-
- @Override
- public boolean isEmpty() {
- return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myProperty, myOp, myValue);
- }
-
- @Override
- public java.util.List getAllPopulatedChildElements() {
- return getAllPopulatedChildElementsOfType(null);
- }
-
- @Override
- public List getAllPopulatedChildElementsOfType(Class theType) {
- return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myProperty, myOp, myValue);
- }
-
- /**
- * Gets the value(s) for property ().
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- * A code that identifies a property defined in the code system
- *
- */
- public CodeDt getProperty() {
- if (myProperty == null) {
- myProperty = new CodeDt();
- }
- return myProperty;
- }
-
- /**
- * Sets the value(s) for property ()
- *
- *
- * Definition:
- * A code that identifies a property defined in the code system
- *
- */
- public void setProperty(CodeDt theValue) {
- myProperty = theValue;
- }
-
- /**
- * Sets the value for property ()
- *
- *
- * Definition:
- * A code that identifies a property defined in the code system
- *
- */
- public void setProperty( String theCode) {
- myProperty = new CodeDt(theCode);
- }
-
-
- /**
- * Gets the value(s) for op (= | is-a | is-not-a | regex | in | not in).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- * The kind of operation to perform as a part of the filter criteria
- *
- */
- public CodeDt getOp() {
- if (myOp == null) {
- myOp = new CodeDt();
- }
- return myOp;
- }
-
- /**
- * Sets the value(s) for op (= | is-a | is-not-a | regex | in | not in)
- *
- *
- * Definition:
- * The kind of operation to perform as a part of the filter criteria
- *
- */
- public void setOp(CodeDt theValue) {
- myOp = theValue;
- }
-
- /**
- * Sets the value for op (= | is-a | is-not-a | regex | in | not in)
- *
- *
- * Definition:
- * The kind of operation to perform as a part of the filter criteria
- *
- */
- public void setOp( String theCode) {
- myOp = new CodeDt(theCode);
- }
-
-
- /**
- * Gets the value(s) for value (Code from the system, or regex criteria).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- * The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value
- *
- */
- public CodeDt getValue() {
- if (myValue == null) {
- myValue = new CodeDt();
- }
- return myValue;
- }
-
- /**
- * Sets the value(s) for value (Code from the system, or regex criteria)
- *
- *
- * Definition:
- * The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value
- *
- */
- public void setValue(CodeDt theValue) {
- myValue = theValue;
- }
-
- /**
- * Sets the value for value (Code from the system, or regex criteria)
- *
- *
- * Definition:
- * The match value may be either a code defined by the system, or a string value which is used a regex match on the literal string of the property value
- *
- */
- public void setValue( String theCode) {
- myValue = new CodeDt(theCode);
- }
-
-
-
- }
-
-
-
-
- /**
- * Block class for child element: ValueSet.expansion (When value set is an expansion)
- *
- *
- * Definition:
- *
- *
- */
- @Block(name="ValueSet.expansion")
- public static class Expansion extends BaseElement implements IResourceBlock {
-
- @Child(name="identifier", type=IdentifierDt.class, order=0, min=0, max=1)
- @Description(
- shortDefinition="Uniquely identifies this expansion",
- formalDefinition="An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so"
- )
- private IdentifierDt myIdentifier;
-
- @Child(name="timestamp", type=InstantDt.class, order=1, min=1, max=1)
- @Description(
- shortDefinition="Time valueset expansion happened",
- formalDefinition=""
- )
- private InstantDt myTimestamp;
-
- @Child(name="contains", order=2, min=0, max=Child.MAX_UNLIMITED)
- @Description(
- shortDefinition="Codes in the value set",
- formalDefinition=""
- )
- private java.util.List myContains;
-
-
- @Override
- public boolean isEmpty() {
- return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myTimestamp, myContains);
- }
-
- @Override
- public java.util.List getAllPopulatedChildElements() {
- return getAllPopulatedChildElementsOfType(null);
- }
-
- @Override
- public List getAllPopulatedChildElementsOfType(Class theType) {
- return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myIdentifier, myTimestamp, myContains);
- }
-
- /**
- * Gets the value(s) for identifier (Uniquely identifies this expansion).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- * An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so
- *
- */
- public IdentifierDt getIdentifier() {
- if (myIdentifier == null) {
- myIdentifier = new IdentifierDt();
- }
- return myIdentifier;
- }
-
- /**
- * Sets the value(s) for identifier (Uniquely identifies this expansion)
- *
- *
- * Definition:
- * An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so
- *
- */
- public void setIdentifier(IdentifierDt theValue) {
- myIdentifier = theValue;
- }
-
-
- /**
- * Gets the value(s) for timestamp (Time valueset expansion happened).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- *
- *
- */
- public InstantDt getTimestamp() {
- if (myTimestamp == null) {
- myTimestamp = new InstantDt();
- }
- return myTimestamp;
- }
-
- /**
- * Sets the value(s) for timestamp (Time valueset expansion happened)
- *
- *
- * Definition:
- *
- *
- */
- public void setTimestamp(InstantDt theValue) {
- myTimestamp = theValue;
- }
-
- /**
- * Sets the value for timestamp (Time valueset expansion happened)
- *
- *
- * Definition:
- *
- *
- */
- public void setTimestamp( Date theDate, TemporalPrecisionEnum thePrecision) {
- myTimestamp = new InstantDt(theDate, thePrecision);
- }
-
- /**
- * Sets the value for timestamp (Time valueset expansion happened)
- *
- *
- * Definition:
- *
- *
- */
- public void setTimestampWithMillisPrecision( Date theDate) {
- myTimestamp = new InstantDt(theDate);
- }
-
-
- /**
- * Gets the value(s) for contains (Codes in the value set).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- *
- *
- */
- public java.util.List getContains() {
- if (myContains == null) {
- myContains = new java.util.ArrayList();
- }
- return myContains;
- }
-
- /**
- * Sets the value(s) for contains (Codes in the value set)
- *
- *
- * Definition:
- *
- *
- */
- public void setContains(java.util.List theValue) {
- myContains = theValue;
- }
-
- /**
- * Adds and returns a new value for contains (Codes in the value set)
- *
- *
- * Definition:
- *
- *
- */
- public ExpansionContains addContains() {
- ExpansionContains newType = new ExpansionContains();
- getContains().add(newType);
- return newType;
- }
-
- /**
- * Gets the first repetition for contains (Codes in the value set),
- * creating it if it does not already exist.
- *
- *
- * Definition:
- *
- *
- */
- public ExpansionContains getContainsFirstRep() {
- if (getContains().isEmpty()) {
- return addContains();
- }
- return getContains().get(0);
- }
-
-
- }
-
- /**
- * Block class for child element: ValueSet.expansion.contains (Codes in the value set)
- *
- *
- * Definition:
- *
- *
- */
- @Block(name="ValueSet.expansion.contains")
- public static class ExpansionContains extends BaseElement implements IResourceBlock {
-
- @Child(name="system", type=UriDt.class, order=0, min=0, max=1)
- @Description(
- shortDefinition="System value for the code",
- formalDefinition=""
- )
- private UriDt mySystem;
-
- @Child(name="code", type=CodeDt.class, order=1, min=0, max=1)
- @Description(
- shortDefinition="Code - if blank, this is not a choosable code",
- formalDefinition=""
- )
- private CodeDt myCode;
-
- @Child(name="display", type=StringDt.class, order=2, min=0, max=1)
- @Description(
- shortDefinition="User display for the concept",
- formalDefinition=""
- )
- private StringDt myDisplay;
-
- @Child(name="contains", type=ExpansionContains.class, order=3, min=0, max=Child.MAX_UNLIMITED)
- @Description(
- shortDefinition="Codes contained in this concept",
- formalDefinition=""
- )
- private java.util.List myContains;
-
-
- @Override
- public boolean isEmpty() {
- return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySystem, myCode, myDisplay, myContains);
- }
-
- @Override
- public java.util.List getAllPopulatedChildElements() {
- return getAllPopulatedChildElementsOfType(null);
- }
-
- @Override
- public List getAllPopulatedChildElementsOfType(Class theType) {
- return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySystem, myCode, myDisplay, myContains);
- }
-
- /**
- * Gets the value(s) for system (System value for the code).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- *
- *
- */
- public UriDt getSystem() {
- if (mySystem == null) {
- mySystem = new UriDt();
- }
- return mySystem;
- }
-
- /**
- * Sets the value(s) for system (System value for the code)
- *
- *
- * Definition:
- *
- *
- */
- public void setSystem(UriDt theValue) {
- mySystem = theValue;
- }
-
- /**
- * Sets the value for system (System value for the code)
- *
- *
- * Definition:
- *
- *
- */
- public void setSystem( String theUri) {
- mySystem = new UriDt(theUri);
- }
-
-
- /**
- * Gets the value(s) for code (Code - if blank, this is not a choosable code).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- *
- *
- */
- public CodeDt getCode() {
- if (myCode == null) {
- myCode = new CodeDt();
- }
- return myCode;
- }
-
- /**
- * Sets the value(s) for code (Code - if blank, this is not a choosable code)
- *
- *
- * Definition:
- *
- *
- */
- public void setCode(CodeDt theValue) {
- myCode = theValue;
- }
-
- /**
- * Sets the value for code (Code - if blank, this is not a choosable code)
- *
- *
- * Definition:
- *
- *
- */
- public void setCode( String theCode) {
- myCode = new CodeDt(theCode);
- }
-
-
- /**
- * Gets the value(s) for display (User display for the concept).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- *
- *
- */
- public StringDt getDisplay() {
- if (myDisplay == null) {
- myDisplay = new StringDt();
- }
- return myDisplay;
- }
-
- /**
- * Sets the value(s) for display (User display for the concept)
- *
- *
- * Definition:
- *
- *
- */
- public void setDisplay(StringDt theValue) {
- myDisplay = theValue;
- }
-
- /**
- * Sets the value for display (User display for the concept)
- *
- *
- * Definition:
- *
- *
- */
- public void setDisplay( String theString) {
- myDisplay = new StringDt(theString);
- }
-
-
- /**
- * Gets the value(s) for contains (Codes contained in this concept).
- * creating it if it does
- * not exist. Will not return null
.
- *
- *
- * Definition:
- *
- *
- */
- public java.util.List getContains() {
- if (myContains == null) {
- myContains = new java.util.ArrayList();
- }
- return myContains;
- }
-
- /**
- * Sets the value(s) for contains (Codes contained in this concept)
- *
- *
- * Definition:
- *
- *
- */
- public void setContains(java.util.List theValue) {
- myContains = theValue;
- }
-
- /**
- * Adds and returns a new value for contains (Codes contained in this concept)
- *
- *
- *