Working on binary resources in DEV

This commit is contained in:
jamesagnew 2014-12-18 08:21:07 -05:00
parent 1f3991caf9
commit a044eb51d7
37 changed files with 93660 additions and 41838 deletions

View File

@ -28,14 +28,20 @@ import org.apache.commons.lang3.StringUtils;
import ca.uhn.fhir.model.api.BaseResource; import ca.uhn.fhir.model.api.BaseResource;
import ca.uhn.fhir.model.api.IElement; import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.ResourceDef; import ca.uhn.fhir.model.api.annotation.ResourceDef;
import ca.uhn.fhir.model.primitive.Base64BinaryDt; import ca.uhn.fhir.model.primitive.Base64BinaryDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.util.ElementUtil;
@ResourceDef(name = "Binary", profile = "http://hl7.org/fhir/profiles/Binary", id = "binary") @ResourceDef(name = "Binary", profile = "http://hl7.org/fhir/profiles/Binary", id = "binary")
public class Binary extends BaseResource implements IResource { public class Binary extends BaseResource implements IResource {
@Child(name = "content", order = 1)
private Base64BinaryDt myContent = new Base64BinaryDt(); private Base64BinaryDt myContent = new Base64BinaryDt();
private String myContentType;
@Child(name = "contentType", order = 0)
private StringDt myContentType;
/** /**
* Constructor * Constructor
@ -71,12 +77,15 @@ public class Binary extends BaseResource implements IResource {
} }
public String getContentType() { public String getContentType() {
return myContentType; if (myContentType == null) {
return null;
}
return myContentType.getValue();
} }
@Override @Override
public boolean isEmpty() { public boolean isEmpty() {
return (myContent.isEmpty()) && StringUtils.isBlank(myContentType); return (myContent.isEmpty()) && ElementUtil.isEmpty(myContentType);
} }
public void setContent(byte[] theContent) { public void setContent(byte[] theContent) {
@ -88,7 +97,7 @@ public class Binary extends BaseResource implements IResource {
} }
public void setContentType(String theContentType) { public void setContentType(String theContentType) {
myContentType = theContentType; myContentType = new StringDt(theContentType);
} }
@Override @Override

View File

@ -811,7 +811,7 @@ class ParserState<T> {
} }
private class BinaryResourceState extends BaseState { private class BinaryResourceStateForDstu1 extends BaseState {
private static final int SUBSTATE_CONTENT = 2; private static final int SUBSTATE_CONTENT = 2;
private static final int SUBSTATE_CT = 1; private static final int SUBSTATE_CT = 1;
@ -819,7 +819,7 @@ class ParserState<T> {
private Binary myInstance; private Binary myInstance;
private int mySubState = 0; private int mySubState = 0;
public BinaryResourceState(PreResourceState thePreResourceState, Binary theInstance) { public BinaryResourceStateForDstu1(PreResourceState thePreResourceState, Binary theInstance) {
super(thePreResourceState); super(thePreResourceState);
myInstance = theInstance; myInstance = theInstance;
} }
@ -1682,8 +1682,8 @@ class ParserState<T> {
} }
String resourceName = def.getName(); String resourceName = def.getName();
if ("Binary".equals(resourceName)) { if ("Binary".equals(resourceName) && myContext.getVersion().getVersion() == FhirVersionEnum.DSTU1) {
push(new BinaryResourceState(getRootPreResourceState(), (Binary) myInstance)); push(new BinaryResourceStateForDstu1(getRootPreResourceState(), (Binary) myInstance));
} else { } else {
push(new ResourceState(getRootPreResourceState(), def, myInstance)); push(new ResourceState(getRootPreResourceState(), def, myInstance));
} }

View File

@ -100,8 +100,8 @@ public class XmlParser extends BaseParser implements IParser {
private boolean myPrettyPrint; private boolean myPrettyPrint;
/** /**
* Do not use this constructor, the recommended way to obtain a new instance of the * Do not use this constructor, the recommended way to obtain a new instance of the XML parser is to invoke
* XML parser is to invoke {@link FhirContext#newXmlParser()}. * {@link FhirContext#newXmlParser()}.
*/ */
public XmlParser(FhirContext theContext) { public XmlParser(FhirContext theContext) {
super(theContext); super(theContext);
@ -307,7 +307,7 @@ public class XmlParser extends BaseParser implements IParser {
} }
private void writeBundleResourceLink(XMLStreamWriter theEventWriter, String theRel, StringDt theUrl) throws XMLStreamException { private void writeBundleResourceLink(XMLStreamWriter theEventWriter, String theRel, StringDt theUrl) throws XMLStreamException {
if (theUrl.isEmpty()==false) { if (theUrl.isEmpty() == false) {
theEventWriter.writeStartElement("link"); theEventWriter.writeStartElement("link");
theEventWriter.writeStartElement("relation"); theEventWriter.writeStartElement("relation");
theEventWriter.writeAttribute("value", theRel); theEventWriter.writeAttribute("value", theRel);
@ -607,7 +607,7 @@ public class XmlParser extends BaseParser implements IParser {
if (nextChild instanceof RuntimeChildNarrativeDefinition && !theIncludedResource) { if (nextChild instanceof RuntimeChildNarrativeDefinition && !theIncludedResource) {
INarrativeGenerator gen = myContext.getNarrativeGenerator(); INarrativeGenerator gen = myContext.getNarrativeGenerator();
if (theResource instanceof IResource) { if (theResource instanceof IResource) {
NarrativeDt narr = ((IResource)theResource).getText(); NarrativeDt narr = ((IResource) theResource).getText();
if (gen != null && narr.isEmpty()) { if (gen != null && narr.isEmpty()) {
narr = gen.generateNarrative(theResDef.getResourceProfile(), theResource); narr = gen.generateNarrative(theResDef.getResourceProfile(), theResource);
} }
@ -619,7 +619,7 @@ public class XmlParser extends BaseParser implements IParser {
continue; continue;
} }
} else { } else {
Narrative narr1 = ((DomainResource)theResource).getText(); Narrative narr1 = ((DomainResource) theResource).getText();
NarrativeDt narr2 = null; NarrativeDt narr2 = null;
if (gen != null && narr1.isEmpty()) { if (gen != null && narr1.isEmpty()) {
narr2 = gen.generateNarrative(theResDef.getResourceProfile(), theResource); narr2 = gen.generateNarrative(theResDef.getResourceProfile(), theResource);
@ -755,13 +755,17 @@ public class XmlParser extends BaseParser implements IParser {
theEventWriter.writeEndElement(); theEventWriter.writeEndElement();
} }
if (theResource instanceof Binary) { if (theResource instanceof Binary) {
Binary bin = (Binary) theResource; Binary bin = (Binary) theResource;
if (bin.getContentType() != null) { if (myContext.getVersion().getVersion().isNewerThan(FhirVersionEnum.DSTU1)) {
theEventWriter.writeAttribute("contentType", bin.getContentType()); writeOptionalTagWithValue(theEventWriter, "contentType", bin.getContentType());
writeOptionalTagWithValue(theEventWriter, "content", bin.getContentAsBase64());
} else {
if (bin.getContentType() != null) {
theEventWriter.writeAttribute("contentType", bin.getContentType());
}
theEventWriter.writeCharacters(bin.getContentAsBase64());
} }
theEventWriter.writeCharacters(bin.getContentAsBase64());
} else { } else {
encodeCompositeElementToStreamWriter(resDef, theResource, theResource, theEventWriter, resDef, theIncludedResource); encodeCompositeElementToStreamWriter(resDef, theResource, theResource, theEventWriter, resDef, theIncludedResource);
} }

View File

@ -66,8 +66,10 @@ import ca.uhn.fhir.util.ExtensionConstants;
* Server FHIR Provider which serves the conformance statement for a RESTful server implementation * Server FHIR Provider which serves the conformance statement for a RESTful server implementation
* *
* <p> * <p>
* Note: This class is safe to extend, but it is important to note that the same instance of {@link Conformance} is always returned unless {@link #setCache(boolean)} is called with a value of * Note: This class is safe to extend, but it is important to note that the same instance of {@link Conformance} is
* <code>false</code>. This means that if you are adding anything to the returned conformance instance on each call you should call <code>setCache(false)</code> in your provider constructor. * always returned unless {@link #setCache(boolean)} is called with a value of <code>false</code>. This means that if
* you are adding anything to the returned conformance instance on each call you should call
* <code>setCache(false)</code> in your provider constructor.
* </p> * </p>
*/ */
public class ServerConformanceProvider { public class ServerConformanceProvider {
@ -82,8 +84,9 @@ public class ServerConformanceProvider {
} }
/** /**
* Gets the value of the "publisher" that will be placed in the generated conformance statement. As this is a mandatory element, the value should not be null (although this is not enforced). The * Gets the value of the "publisher" that will be placed in the generated conformance statement. As this is a
* value defaults to "Not provided" but may be set to null, which will cause this element to be omitted. * mandatory element, the value should not be null (although this is not enforced). The value defaults to
* "Not provided" but may be set to null, which will cause this element to be omitted.
*/ */
public String getPublisher() { public String getPublisher() {
return myPublisher; return myPublisher;
@ -105,7 +108,8 @@ public class ServerConformanceProvider {
retVal.setPublisher(myPublisher); retVal.setPublisher(myPublisher);
retVal.setDate(DateTimeDt.withCurrentTime()); retVal.setDate(DateTimeDt.withCurrentTime());
retVal.setFhirVersion("0.4.0"); // TODO: pull from model retVal.setFhirVersion("0.4.0"); // TODO: pull from model
retVal.setAcceptUnknown(false); // TODO: make this configurable - this is a fairly big effort since the parser needs to be modified to actually allow it retVal.setAcceptUnknown(false); // TODO: make this configurable - this is a fairly big effort since the parser
// needs to be modified to actually allow it
retVal.getImplementation().setDescription(myRestfulServer.getImplementationDescription()); retVal.getImplementation().setDescription(myRestfulServer.getImplementationDescription());
retVal.getSoftware().setName(myRestfulServer.getServerName()); retVal.getSoftware().setName(myRestfulServer.getServerName());
@ -141,27 +145,31 @@ public class ServerConformanceProvider {
// Map<String, Conformance.RestResourceSearchParam> nameToSearchParam = new HashMap<String, // Map<String, Conformance.RestResourceSearchParam> nameToSearchParam = new HashMap<String,
// Conformance.RestResourceSearchParam>(); // Conformance.RestResourceSearchParam>();
for (BaseMethodBinding<?> nextMethodBinding : next.getMethodBindings()) { for (BaseMethodBinding<?> nextMethodBinding : next.getMethodBindings()) {
String resOpCode = nextMethodBinding.getResourceOperationType().getCode(); if (nextMethodBinding.getResourceOperationType() != null) {
if (resOpCode != null) { String resOpCode = nextMethodBinding.getResourceOperationType().getCode();
TypeRestfulInteractionEnum resOp = TypeRestfulInteractionEnum.VALUESET_BINDER.fromCodeString(resOpCode); if (resOpCode != null) {
if (resOp == null) { TypeRestfulInteractionEnum resOp = TypeRestfulInteractionEnum.VALUESET_BINDER.fromCodeString(resOpCode);
throw new InternalErrorException("Unknown type-restful-interaction: " + resOpCode); if (resOp == null) {
} throw new InternalErrorException("Unknown type-restful-interaction: " + resOpCode);
if (resourceOps.contains(resOp) == false) { }
resourceOps.add(resOp); if (resourceOps.contains(resOp) == false) {
resource.addInteraction().setCode(resOp); resourceOps.add(resOp);
resource.addInteraction().setCode(resOp);
}
} }
} }
String sysOpCode = nextMethodBinding.getSystemOperationType().getCode(); if (nextMethodBinding.getSystemOperationType() != null) {
if (sysOpCode != null) { String sysOpCode = nextMethodBinding.getSystemOperationType().getCode();
SystemRestfulInteractionEnum sysOp = SystemRestfulInteractionEnum.VALUESET_BINDER.fromCodeString(sysOpCode); if (sysOpCode != null) {
if (sysOp == null) { SystemRestfulInteractionEnum sysOp = SystemRestfulInteractionEnum.VALUESET_BINDER.fromCodeString(sysOpCode);
throw new InternalErrorException("Unknown system-restful-interaction: " + sysOpCode); if (sysOp == null) {
} throw new InternalErrorException("Unknown system-restful-interaction: " + sysOpCode);
if (systemOps.contains(sysOp) == false) { }
systemOps.add(sysOp); if (systemOps.contains(sysOp) == false) {
rest.addInteraction().setCode(sysOp); systemOps.add(sysOp);
rest.addInteraction().setCode(sysOp);
}
} }
} }
@ -323,7 +331,8 @@ public class ServerConformanceProvider {
} }
/** /**
* Sets the cache property (default is true). If set to true, the same response will be returned for each invocation. * Sets the cache property (default is true). If set to true, the same response will be returned for each
* invocation.
* <p> * <p>
* See the class documentation for an important note if you are extending this class * See the class documentation for an important note if you are extending this class
* </p> * </p>
@ -333,8 +342,9 @@ public class ServerConformanceProvider {
} }
/** /**
* Sets the value of the "publisher" that will be placed in the generated conformance statement. As this is a mandatory element, the value should not be null (although this is not enforced). The * Sets the value of the "publisher" that will be placed in the generated conformance statement. As this is a
* value defaults to "Not provided" but may be set to null, which will cause this element to be omitted. * mandatory element, the value should not be null (although this is not enforced). The value defaults to
* "Not provided" but may be set to null, which will cause this element to be omitted.
*/ */
public void setPublisher(String thePublisher) { public void setPublisher(String thePublisher) {
myPublisher = thePublisher; myPublisher = thePublisher;

View File

@ -14,6 +14,7 @@ import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.model.api.Bundle; import ca.uhn.fhir.model.api.Bundle;
import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum; import ca.uhn.fhir.model.api.ResourceMetadataKeyEnum;
import ca.uhn.fhir.model.dev.resource.MedicationPrescription; import ca.uhn.fhir.model.dev.resource.MedicationPrescription;
import ca.uhn.fhir.model.dstu.resource.Binary;
import ca.uhn.fhir.model.primitive.InstantDt; import ca.uhn.fhir.model.primitive.InstantDt;
public class XmlParserTest { public class XmlParserTest {
@ -63,4 +64,37 @@ public class XmlParserTest {
} }
@Test
public void testBundleWithBinary() {
//@formatter:off
String bundle = "<Bundle xmlns=\"http://hl7.org/fhir\">\n" +
" <meta/>\n" +
" <base value=\"http://localhost:52788\"/>\n" +
" <total value=\"1\"/>\n" +
" <link>\n" +
" <relation value=\"self\"/>\n" +
" <url value=\"http://localhost:52788/Binary?_pretty=true\"/>\n" +
" </link>\n" +
" <entry>\n" +
" <resource>\n" +
" <Binary xmlns=\"http://hl7.org/fhir\">\n" +
" <id value=\"1\"/>\n" +
" <meta/>\n" +
" <contentType value=\"text/plain\"/>\n" +
" <content value=\"AQIDBA==\"/>\n" +
" </Binary>\n" +
" </resource>\n" +
" </entry>\n" +
"</Bundle>";
//@formatter:on
Bundle b = ourCtx.newXmlParser().parseBundle(bundle);
assertEquals(1, b.getEntries().size());
Binary bin = (Binary) b.getEntries().get(0).getResource();
assertArrayEquals(new byte[] {1,2,3,4}, bin.getContent());
}
} }

View File

@ -54,25 +54,13 @@ public class BinaryTest {
@Before @Before
public void before() { public void before() {
ourLast=null; ourLast = null;
} }
@Test
public void testRead() throws Exception {
HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Binary/foo");
HttpResponse status = ourClient.execute(httpGet);
byte[] responseContent = IOUtils.toByteArray(status.getEntity().getContent());
assertEquals(200, status.getStatusLine().getStatusCode());
assertEquals("foo", status.getFirstHeader("content-type").getValue());
assertArrayEquals(new byte[] { 1, 2, 3, 4 }, responseContent);
}
@Test @Test
public void testCreate() throws Exception { public void testCreate() throws Exception {
HttpPost http = new HttpPost("http://localhost:" + ourPort + "/Binary"); HttpPost http = new HttpPost("http://localhost:" + ourPort + "/Binary");
http.setEntity(new ByteArrayEntity(new byte[] {1,2,3,4}, ContentType.create("foo/bar", "UTF-8"))); http.setEntity(new ByteArrayEntity(new byte[] { 1, 2, 3, 4 }, ContentType.create("foo/bar", "UTF-8")));
HttpResponse status = ourClient.execute(http); HttpResponse status = ourClient.execute(http);
assertEquals(201, status.getStatusLine().getStatusCode()); assertEquals(201, status.getStatusLine().getStatusCode());
@ -100,10 +88,41 @@ public class BinaryTest {
} }
@Test @Test
public void testSearch() throws Exception { public void testRead() throws Exception {
HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Binary?"); HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Binary/foo");
HttpResponse status = ourClient.execute(httpGet);
byte[] responseContent = IOUtils.toByteArray(status.getEntity().getContent());
IOUtils.closeQuietly(status.getEntity().getContent());
assertEquals(200, status.getStatusLine().getStatusCode());
assertEquals("foo", status.getFirstHeader("content-type").getValue());
assertArrayEquals(new byte[] { 1, 2, 3, 4 }, responseContent);
}
@Test
public void testSearchJson() throws Exception {
HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Binary?_pretty=true&_format=json");
HttpResponse status = ourClient.execute(httpGet); HttpResponse status = ourClient.execute(httpGet);
String responseContent = IOUtils.toString(status.getEntity().getContent()); String responseContent = IOUtils.toString(status.getEntity().getContent());
IOUtils.closeQuietly(status.getEntity().getContent());
assertEquals(200, status.getStatusLine().getStatusCode());
assertEquals(Constants.CT_FHIR_JSON + "; charset=UTF-8", status.getFirstHeader("content-type").getValue());
ourLog.info(responseContent);
Bundle bundle = ourCtx.newJsonParser().parseBundle(responseContent);
Binary bin = (Binary) bundle.getEntries().get(0).getResource();
assertEquals("text/plain", bin.getContentType());
assertArrayEquals(new byte[] { 1, 2, 3, 4 }, bin.getContent());
}
@Test
public void testSearchXml() throws Exception {
HttpGet httpGet = new HttpGet("http://localhost:" + ourPort + "/Binary?_pretty=true");
HttpResponse status = ourClient.execute(httpGet);
String responseContent = IOUtils.toString(status.getEntity().getContent());
IOUtils.closeQuietly(status.getEntity().getContent());
assertEquals(200, status.getStatusLine().getStatusCode()); assertEquals(200, status.getStatusLine().getStatusCode());
assertEquals(Constants.CT_ATOM_XML + "; charset=UTF-8", status.getFirstHeader("content-type").getValue()); assertEquals(Constants.CT_ATOM_XML + "; charset=UTF-8", status.getFirstHeader("content-type").getValue());
@ -115,6 +134,7 @@ public class BinaryTest {
assertEquals("text/plain", bin.getContentType()); assertEquals("text/plain", bin.getContentType());
assertArrayEquals(new byte[] { 1, 2, 3, 4 }, bin.getContent()); assertArrayEquals(new byte[] { 1, 2, 3, 4 }, bin.getContent());
} }
@AfterClass @AfterClass
public static void afterClass() throws Exception { public static void afterClass() throws Exception {
ourServer.stop(); ourServer.stop();
@ -167,8 +187,6 @@ public class BinaryTest {
return retVal; return retVal;
} }
@Search @Search
public List<Binary> search() { public List<Binary> search() {
Binary retVal = new Binary(); Binary retVal = new Binary();
@ -178,6 +196,6 @@ public class BinaryTest {
return Collections.singletonList(retVal); return Collections.singletonList(retVal);
} }
} }
} }

View File

@ -21,13 +21,16 @@
<artifactId>hapi-fhir-base</artifactId> <artifactId>hapi-fhir-base</artifactId>
<version>0.9-SNAPSHOT</version> <version>0.9-SNAPSHOT</version>
</dependency> </dependency>
<!--
<dependency> <dependency>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-dstu</artifactId> <artifactId>hapi-fhir-structures-dstu</artifactId>
<version>0.7-SNAPSHOT</version> <version>0.9-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-dev</artifactId>
<version>0.9-SNAPSHOT</version>
</dependency> </dependency>
-->
<dependency> <dependency>
<groupId>org.apache.velocity</groupId> <groupId>org.apache.velocity</groupId>

View File

@ -1,48 +0,0 @@
package ca.uhn.fhir.model.dstu;
import java.io.InputStream;
import ca.uhn.fhir.context.ConfigurationException;
import ca.uhn.fhir.context.FhirVersionEnum;
import ca.uhn.fhir.context.RuntimeResourceDefinition;
import ca.uhn.fhir.model.api.IFhirVersion;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.rest.server.IResourceProvider;
import ca.uhn.fhir.rest.server.RestfulServer;
import javax.servlet.http.HttpServletRequest;
public class FhirDstu1 implements IFhirVersion {
@Override
public Object createServerConformanceProvider(RestfulServer theServer) {
throw new UnsupportedOperationException();
}
@Override
public IResourceProvider createServerProfilesProvider(RestfulServer theRestfulServer) {
throw new UnsupportedOperationException();
}
@Override
public IResource generateProfile(RuntimeResourceDefinition theRuntimeResourceDefinition, String theServerBase) {
throw new UnsupportedOperationException();
}
@Override
public InputStream getFhirVersionPropertiesFile() {
InputStream str = FhirDstu1.class.getResourceAsStream("/ca/uhn/fhir/model/dstu/fhirversion.properties");
if (str == null) {
str = FhirDstu1.class.getResourceAsStream("ca/uhn/fhir/model/dstu/fhirversion.properties");
}
if (str == null) {
throw new ConfigurationException("Can not find model property file on classpath: " + "/ca/uhn/fhir/model/dstu/model.properties");
}
return str;
}
@Override
public FhirVersionEnum getVersion() {
return FhirVersionEnum.DSTU1;
}
}

View File

@ -1,521 +0,0 @@
package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import java.util.List;
import ca.uhn.fhir.model.api.BaseIdentifiableElement;
import ca.uhn.fhir.model.api.ICompositeDatatype;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.model.dstu.valueset.AddressUseEnum;
import ca.uhn.fhir.model.primitive.BoundCodeDt;
import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.StringDt;
/**
* HAPI/FHIR <b>AddressDt</b> Datatype
* (A postal address)
*
* <p>
* <b>Definition:</b>
* There is a variety of postal address formats defined around the world. This format defines a superset that is the basis for all addresses around the world
* </p>
*
* <p>
* <b>Requirements:</b>
* Need to be able to record postal addresses, along with notes about their use
* </p>
*/
@DatatypeDef(name="AddressDt")
public class AddressDt
extends BaseIdentifiableElement implements ICompositeDatatype
{
/**
* Constructor
*/
public AddressDt() {
// nothing
}
@Child(name="use", type=CodeDt.class, order=0, min=0, max=1)
@Description(
shortDefinition="home | work | temp | old - purpose of this address",
formalDefinition="The purpose of this address"
)
private BoundCodeDt<AddressUseEnum> myUse;
@Child(name="text", type=StringDt.class, order=1, min=0, max=1)
@Description(
shortDefinition="Text representation of the address",
formalDefinition="A full text representation of the address"
)
private StringDt myText;
@Child(name="line", type=StringDt.class, order=2, min=0, max=Child.MAX_UNLIMITED)
@Description(
shortDefinition="Street name, number, direction & P.O. Box etc",
formalDefinition="This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information"
)
private java.util.List<StringDt> myLine;
@Child(name="city", type=StringDt.class, order=3, min=0, max=1)
@Description(
shortDefinition="Name of city, town etc.",
formalDefinition="The name of the city, town, village or other community or delivery center."
)
private StringDt myCity;
@Child(name="state", type=StringDt.class, order=4, min=0, max=1)
@Description(
shortDefinition="Sub-unit of country (abreviations ok)",
formalDefinition="Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes)."
)
private StringDt myState;
@Child(name="zip", type=StringDt.class, order=5, min=0, max=1)
@Description(
shortDefinition="Postal code for area",
formalDefinition="A postal code designating a region defined by the postal service."
)
private StringDt myZip;
@Child(name="country", type=StringDt.class, order=6, min=0, max=1)
@Description(
shortDefinition="Country (can be ISO 3166 3 letter code)",
formalDefinition="Country - a nation as commonly understood or generally accepted"
)
private StringDt myCountry;
@Child(name="period", type=PeriodDt.class, order=7, min=0, max=1)
@Description(
shortDefinition="Time period when address was/is in use",
formalDefinition="Time period when address was/is in use"
)
private PeriodDt myPeriod;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myUse, myText, myLine, myCity, myState, myZip, myCountry, myPeriod);
}
@Override
public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myUse, myText, myLine, myCity, myState, myZip, myCountry, myPeriod);
}
/**
* Gets the value(s) for <b>use</b> (home | work | temp | old - purpose of this address).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The purpose of this address
* </p>
*/
public BoundCodeDt<AddressUseEnum> getUse() {
if (myUse == null) {
myUse = new BoundCodeDt<AddressUseEnum>(AddressUseEnum.VALUESET_BINDER);
}
return myUse;
}
/**
* Sets the value(s) for <b>use</b> (home | work | temp | old - purpose of this address)
*
* <p>
* <b>Definition:</b>
* The purpose of this address
* </p>
*/
public AddressDt setUse(BoundCodeDt<AddressUseEnum> theValue) {
myUse = theValue;
return this;
}
/**
* Sets the value(s) for <b>use</b> (home | work | temp | old - purpose of this address)
*
* <p>
* <b>Definition:</b>
* The purpose of this address
* </p>
*/
public AddressDt setUse(AddressUseEnum theValue) {
getUse().setValueAsEnum(theValue);
return this;
}
/**
* Gets the value(s) for <b>text</b> (Text representation of the address).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* A full text representation of the address
* </p>
*/
public StringDt getText() {
if (myText == null) {
myText = new StringDt();
}
return myText;
}
/**
* Sets the value(s) for <b>text</b> (Text representation of the address)
*
* <p>
* <b>Definition:</b>
* A full text representation of the address
* </p>
*/
public AddressDt setText(StringDt theValue) {
myText = theValue;
return this;
}
/**
* Sets the value for <b>text</b> (Text representation of the address)
*
* <p>
* <b>Definition:</b>
* A full text representation of the address
* </p>
*/
public AddressDt setText( String theString) {
myText = new StringDt(theString);
return this;
}
/**
* Gets the value(s) for <b>line</b> (Street name, number, direction & P.O. Box etc).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information
* </p>
*/
public java.util.List<StringDt> getLine() {
if (myLine == null) {
myLine = new java.util.ArrayList<StringDt>();
}
return myLine;
}
/**
* Sets the value(s) for <b>line</b> (Street name, number, direction & P.O. Box etc)
*
* <p>
* <b>Definition:</b>
* This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information
* </p>
*/
public AddressDt setLine(java.util.List<StringDt> theValue) {
myLine = theValue;
return this;
}
/**
* Adds and returns a new value for <b>line</b> (Street name, number, direction & P.O. Box etc)
*
* <p>
* <b>Definition:</b>
* This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information
* </p>
*/
public StringDt addLine() {
StringDt newType = new StringDt();
getLine().add(newType);
return newType;
}
/**
* Gets the first repetition for <b>line</b> (Street name, number, direction & P.O. Box etc),
* creating it if it does not already exist.
*
* <p>
* <b>Definition:</b>
* This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information
* </p>
*/
public StringDt getLineFirstRep() {
if (getLine().isEmpty()) {
return addLine();
}
return getLine().get(0);
}
/**
* Adds a new value for <b>line</b> (Street name, number, direction & P.O. Box etc)
*
* <p>
* <b>Definition:</b>
* This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information
* </p>
*
* @return Returns a reference to this object, to allow for simple chaining.
*/
public AddressDt addLine( String theString) {
if (myLine == null) {
myLine = new java.util.ArrayList<StringDt>();
}
myLine.add(new StringDt(theString));
return this;
}
/**
* Gets the value(s) for <b>city</b> (Name of city, town etc.).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The name of the city, town, village or other community or delivery center.
* </p>
*/
public StringDt getCity() {
if (myCity == null) {
myCity = new StringDt();
}
return myCity;
}
/**
* Sets the value(s) for <b>city</b> (Name of city, town etc.)
*
* <p>
* <b>Definition:</b>
* The name of the city, town, village or other community or delivery center.
* </p>
*/
public AddressDt setCity(StringDt theValue) {
myCity = theValue;
return this;
}
/**
* Sets the value for <b>city</b> (Name of city, town etc.)
*
* <p>
* <b>Definition:</b>
* The name of the city, town, village or other community or delivery center.
* </p>
*/
public AddressDt setCity( String theString) {
myCity = new StringDt(theString);
return this;
}
/**
* Gets the value(s) for <b>state</b> (Sub-unit of country (abreviations ok)).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes).
* </p>
*/
public StringDt getState() {
if (myState == null) {
myState = new StringDt();
}
return myState;
}
/**
* Sets the value(s) for <b>state</b> (Sub-unit of country (abreviations ok))
*
* <p>
* <b>Definition:</b>
* Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes).
* </p>
*/
public AddressDt setState(StringDt theValue) {
myState = theValue;
return this;
}
/**
* Sets the value for <b>state</b> (Sub-unit of country (abreviations ok))
*
* <p>
* <b>Definition:</b>
* Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes).
* </p>
*/
public AddressDt setState( String theString) {
myState = new StringDt(theString);
return this;
}
/**
* Gets the value(s) for <b>zip</b> (Postal code for area).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* A postal code designating a region defined by the postal service.
* </p>
*/
public StringDt getZip() {
if (myZip == null) {
myZip = new StringDt();
}
return myZip;
}
/**
* Sets the value(s) for <b>zip</b> (Postal code for area)
*
* <p>
* <b>Definition:</b>
* A postal code designating a region defined by the postal service.
* </p>
*/
public AddressDt setZip(StringDt theValue) {
myZip = theValue;
return this;
}
/**
* Sets the value for <b>zip</b> (Postal code for area)
*
* <p>
* <b>Definition:</b>
* A postal code designating a region defined by the postal service.
* </p>
*/
public AddressDt setZip( String theString) {
myZip = new StringDt(theString);
return this;
}
/**
* Gets the value(s) for <b>country</b> (Country (can be ISO 3166 3 letter code)).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Country - a nation as commonly understood or generally accepted
* </p>
*/
public StringDt getCountry() {
if (myCountry == null) {
myCountry = new StringDt();
}
return myCountry;
}
/**
* Sets the value(s) for <b>country</b> (Country (can be ISO 3166 3 letter code))
*
* <p>
* <b>Definition:</b>
* Country - a nation as commonly understood or generally accepted
* </p>
*/
public AddressDt setCountry(StringDt theValue) {
myCountry = theValue;
return this;
}
/**
* Sets the value for <b>country</b> (Country (can be ISO 3166 3 letter code))
*
* <p>
* <b>Definition:</b>
* Country - a nation as commonly understood or generally accepted
* </p>
*/
public AddressDt setCountry( String theString) {
myCountry = new StringDt(theString);
return this;
}
/**
* Gets the value(s) for <b>period</b> (Time period when address was/is in use).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Time period when address was/is in use
* </p>
*/
public PeriodDt getPeriod() {
if (myPeriod == null) {
myPeriod = new PeriodDt();
}
return myPeriod;
}
/**
* Sets the value(s) for <b>period</b> (Time period when address was/is in use)
*
* <p>
* <b>Definition:</b>
* Time period when address was/is in use
* </p>
*/
public AddressDt setPeriod(PeriodDt theValue) {
myPeriod = theValue;
return this;
}
}

View File

@ -1,30 +0,0 @@
package ca.uhn.fhir.model.dstu.composite;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
@DatatypeDef(name="AgeDt")
public class AgeDt extends QuantityDt {
// TODO: implement restricions
}

View File

@ -1,450 +0,0 @@
package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import java.util.List;
import ca.uhn.fhir.model.api.BaseIdentifiableElement;
import ca.uhn.fhir.model.api.ICompositeDatatype;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.model.primitive.Base64BinaryDt;
import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.IntegerDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.model.primitive.UriDt;
/**
* HAPI/FHIR <b>AttachmentDt</b> Datatype
* (Content in a format defined elsewhere)
*
* <p>
* <b>Definition:</b>
* For referring to data content defined in other formats.
* </p>
*
* <p>
* <b>Requirements:</b>
* Many models need to include data defined in other specifications that is complex and opaque to the healthcare model. This includes documents, media recordings, structured data, etc.
* </p>
*/
@DatatypeDef(name="AttachmentDt")
public class AttachmentDt
extends BaseIdentifiableElement implements ICompositeDatatype
{
/**
* Constructor
*/
public AttachmentDt() {
// nothing
}
@Child(name="contentType", type=CodeDt.class, order=0, min=1, max=1)
@Description(
shortDefinition="Mime type of the content, with charset etc.",
formalDefinition="Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate"
)
private CodeDt myContentType;
@Child(name="language", type=CodeDt.class, order=1, min=0, max=1)
@Description(
shortDefinition="Human language of the content (BCP-47)",
formalDefinition="The human language of the content. The value can be any valid value according to BCP 47"
)
private CodeDt myLanguage;
@Child(name="data", type=Base64BinaryDt.class, order=2, min=0, max=1)
@Description(
shortDefinition="Data inline, base64ed",
formalDefinition="The actual data of the attachment - a sequence of bytes. In XML, represented using base64"
)
private Base64BinaryDt myData;
@Child(name="url", type=UriDt.class, order=3, min=0, max=1)
@Description(
shortDefinition="Uri where the data can be found",
formalDefinition="An alternative location where the data can be accessed"
)
private UriDt myUrl;
@Child(name="size", type=IntegerDt.class, order=4, min=0, max=1)
@Description(
shortDefinition="Number of bytes of content (if url provided)",
formalDefinition="The number of bytes of data that make up this attachment."
)
private IntegerDt mySize;
@Child(name="hash", type=Base64BinaryDt.class, order=5, min=0, max=1)
@Description(
shortDefinition="Hash of the data (sha-1, base64ed )",
formalDefinition="The calculated hash of the data using SHA-1. Represented using base64"
)
private Base64BinaryDt myHash;
@Child(name="title", type=StringDt.class, order=6, min=0, max=1)
@Description(
shortDefinition="Label to display in place of the data",
formalDefinition="A label or set of text to display in place of the data"
)
private StringDt myTitle;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myContentType, myLanguage, myData, myUrl, mySize, myHash, myTitle);
}
@Override
public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myContentType, myLanguage, myData, myUrl, mySize, myHash, myTitle);
}
/**
* Gets the value(s) for <b>contentType</b> (Mime type of the content, with charset etc.).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate
* </p>
*/
public CodeDt getContentType() {
if (myContentType == null) {
myContentType = new CodeDt();
}
return myContentType;
}
/**
* Sets the value(s) for <b>contentType</b> (Mime type of the content, with charset etc.)
*
* <p>
* <b>Definition:</b>
* Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate
* </p>
*/
public AttachmentDt setContentType(CodeDt theValue) {
myContentType = theValue;
return this;
}
/**
* Sets the value for <b>contentType</b> (Mime type of the content, with charset etc.)
*
* <p>
* <b>Definition:</b>
* Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate
* </p>
*/
public AttachmentDt setContentType( String theCode) {
myContentType = new CodeDt(theCode);
return this;
}
/**
* Gets the value(s) for <b>language</b> (Human language of the content (BCP-47)).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The human language of the content. The value can be any valid value according to BCP 47
* </p>
*/
public CodeDt getLanguage() {
if (myLanguage == null) {
myLanguage = new CodeDt();
}
return myLanguage;
}
/**
* Sets the value(s) for <b>language</b> (Human language of the content (BCP-47))
*
* <p>
* <b>Definition:</b>
* The human language of the content. The value can be any valid value according to BCP 47
* </p>
*/
public AttachmentDt setLanguage(CodeDt theValue) {
myLanguage = theValue;
return this;
}
/**
* Sets the value for <b>language</b> (Human language of the content (BCP-47))
*
* <p>
* <b>Definition:</b>
* The human language of the content. The value can be any valid value according to BCP 47
* </p>
*/
public AttachmentDt setLanguage( String theCode) {
myLanguage = new CodeDt(theCode);
return this;
}
/**
* Gets the value(s) for <b>data</b> (Data inline, base64ed).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The actual data of the attachment - a sequence of bytes. In XML, represented using base64
* </p>
*/
public Base64BinaryDt getData() {
if (myData == null) {
myData = new Base64BinaryDt();
}
return myData;
}
/**
* Sets the value(s) for <b>data</b> (Data inline, base64ed)
*
* <p>
* <b>Definition:</b>
* The actual data of the attachment - a sequence of bytes. In XML, represented using base64
* </p>
*/
public AttachmentDt setData(Base64BinaryDt theValue) {
myData = theValue;
return this;
}
/**
* Sets the value for <b>data</b> (Data inline, base64ed)
*
* <p>
* <b>Definition:</b>
* The actual data of the attachment - a sequence of bytes. In XML, represented using base64
* </p>
*/
public AttachmentDt setData( byte[] theBytes) {
myData = new Base64BinaryDt(theBytes);
return this;
}
/**
* Gets the value(s) for <b>url</b> (Uri where the data can be found).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* An alternative location where the data can be accessed
* </p>
*/
public UriDt getUrl() {
if (myUrl == null) {
myUrl = new UriDt();
}
return myUrl;
}
/**
* Sets the value(s) for <b>url</b> (Uri where the data can be found)
*
* <p>
* <b>Definition:</b>
* An alternative location where the data can be accessed
* </p>
*/
public AttachmentDt setUrl(UriDt theValue) {
myUrl = theValue;
return this;
}
/**
* Sets the value for <b>url</b> (Uri where the data can be found)
*
* <p>
* <b>Definition:</b>
* An alternative location where the data can be accessed
* </p>
*/
public AttachmentDt setUrl( String theUri) {
myUrl = new UriDt(theUri);
return this;
}
/**
* Gets the value(s) for <b>size</b> (Number of bytes of content (if url provided)).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The number of bytes of data that make up this attachment.
* </p>
*/
public IntegerDt getSize() {
if (mySize == null) {
mySize = new IntegerDt();
}
return mySize;
}
/**
* Sets the value(s) for <b>size</b> (Number of bytes of content (if url provided))
*
* <p>
* <b>Definition:</b>
* The number of bytes of data that make up this attachment.
* </p>
*/
public AttachmentDt setSize(IntegerDt theValue) {
mySize = theValue;
return this;
}
/**
* Sets the value for <b>size</b> (Number of bytes of content (if url provided))
*
* <p>
* <b>Definition:</b>
* The number of bytes of data that make up this attachment.
* </p>
*/
public AttachmentDt setSize( int theInteger) {
mySize = new IntegerDt(theInteger);
return this;
}
/**
* Gets the value(s) for <b>hash</b> (Hash of the data (sha-1, base64ed )).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The calculated hash of the data using SHA-1. Represented using base64
* </p>
*/
public Base64BinaryDt getHash() {
if (myHash == null) {
myHash = new Base64BinaryDt();
}
return myHash;
}
/**
* Sets the value(s) for <b>hash</b> (Hash of the data (sha-1, base64ed ))
*
* <p>
* <b>Definition:</b>
* The calculated hash of the data using SHA-1. Represented using base64
* </p>
*/
public AttachmentDt setHash(Base64BinaryDt theValue) {
myHash = theValue;
return this;
}
/**
* Sets the value for <b>hash</b> (Hash of the data (sha-1, base64ed ))
*
* <p>
* <b>Definition:</b>
* The calculated hash of the data using SHA-1. Represented using base64
* </p>
*/
public AttachmentDt setHash( byte[] theBytes) {
myHash = new Base64BinaryDt(theBytes);
return this;
}
/**
* Gets the value(s) for <b>title</b> (Label to display in place of the data).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* A label or set of text to display in place of the data
* </p>
*/
public StringDt getTitle() {
if (myTitle == null) {
myTitle = new StringDt();
}
return myTitle;
}
/**
* Sets the value(s) for <b>title</b> (Label to display in place of the data)
*
* <p>
* <b>Definition:</b>
* A label or set of text to display in place of the data
* </p>
*/
public AttachmentDt setTitle(StringDt theValue) {
myTitle = theValue;
return this;
}
/**
* Sets the value for <b>title</b> (Label to display in place of the data)
*
* <p>
* <b>Definition:</b>
* A label or set of text to display in place of the data
* </p>
*/
public AttachmentDt setTitle( String theString) {
myTitle = new StringDt(theString);
return this;
}
}

View File

@ -1,122 +0,0 @@
package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import static org.apache.commons.lang3.StringUtils.*;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import ca.uhn.fhir.model.api.IValueSetEnumBinder;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
@DatatypeDef(name = "CodeableConcept", isSpecialization = true)
public class BoundCodeableConceptDt_<T extends Enum<?>> extends CodeableConceptDt {
private IValueSetEnumBinder<T> myBinder;
/**
* Constructor
*/
public BoundCodeableConceptDt_(IValueSetEnumBinder<T> theBinder) {
myBinder = theBinder;
}
/**
* Constructor
*/
public BoundCodeableConceptDt_(IValueSetEnumBinder<T> theBinder, T theValue) {
myBinder = theBinder;
setValueAsEnum(theValue);
}
/**
* Constructor
*/
public BoundCodeableConceptDt_(IValueSetEnumBinder<T> theBinder, Collection<T> theValues) {
myBinder = theBinder;
setValueAsEnum(theValues);
}
/**
* Sets the {@link #getCoding()} to contain a coding with the code and
* system defined by the given enumerated types, AND clearing any existing
* codings first. If theValue is null, existing codings are cleared and no
* codings are added.
*
* @param theValue
* The value to add, or <code>null</code>
*/
public void setValueAsEnum(Collection<T> theValues) {
getCoding().clear();
if (theValues != null) {
for (T next : theValues) {
getCoding().add(new CodingDt(myBinder.toSystemString(next), myBinder.toCodeString(next)));
}
}
}
/**
* Sets the {@link #getCoding()} to contain a coding with the code and
* system defined by the given enumerated type, AND clearing any existing
* codings first. If theValue is null, existing codings are cleared and no
* codings are added.
*
* @param theValue
* The value to add, or <code>null</code>
*/
public void setValueAsEnum(T theValue) {
getCoding().clear();
if (theValue == null) {
return;
}
getCoding().add(new CodingDt(myBinder.toSystemString(theValue), myBinder.toCodeString(theValue)));
}
/**
* Loops through the {@link #getCoding() codings} in this codeable concept
* and returns the first bound enumerated type that matches. <b>Use
* caution</b> using this method, see the return description for more
* information.
*
* @return Returns the bound enumerated type, or <code>null</code> if none
* are found. Note that a null return value doesn't neccesarily
* imply that this Codeable Concept has no codes, only that it has
* no codes that match the enum.
*/
public Set<T> getValueAsEnum() {
Set<T> retVal = new HashSet<T>();
for (CodingDt next : getCoding()) {
if (next == null) {
continue;
}
T nextT = myBinder.fromCodeString(defaultString(next.getCodeElement().getValue()), defaultString(next.getSystemElement().getValueAsString()));
if (nextT != null) {
retVal.add(nextT);
} else {
// TODO: throw special exception type?
}
}
return retVal;
}
}

View File

@ -1,214 +0,0 @@
package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import java.util.List;
import ca.uhn.fhir.model.api.BaseIdentifiableElement;
import ca.uhn.fhir.model.api.ICompositeDatatype;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.model.primitive.StringDt;
/**
* HAPI/FHIR <b>CodeableConceptDt</b> Datatype
* (Concept - reference to a terminology or just text)
*
* <p>
* <b>Definition:</b>
* A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text
* </p>
*
* <p>
* <b>Requirements:</b>
* This is a common pattern in healthcare - a concept that may be defined by one or more codes from formal definitions including LOINC and SNOMED CT, and/or defined by the provision of text that captures a human sense of the concept
* </p>
*/
@DatatypeDef(name="CodeableConceptDt")
public class CodeableConceptDt
extends BaseIdentifiableElement implements ICompositeDatatype
{
/**
* Constructor
*/
public CodeableConceptDt() {
// nothing
}
/**
* Constructor which creates a CodeableConceptDt with one coding repetition, containing
* the given system and code
*/
public CodeableConceptDt(String theSystem, String theCode) {
addCoding().setSystem(theSystem).setCode(theCode);
}
@Child(name="coding", type=CodingDt.class, order=0, min=0, max=Child.MAX_UNLIMITED)
@Description(
shortDefinition="Code defined by a terminology system",
formalDefinition="A reference to a code defined by a terminology system"
)
private java.util.List<CodingDt> myCoding;
@Child(name="text", type=StringDt.class, order=1, min=0, max=1)
@Description(
shortDefinition="Plain text representation of the concept",
formalDefinition="A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user"
)
private StringDt myText;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCoding, myText);
}
@Override
public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myCoding, myText);
}
/**
* Gets the value(s) for <b>coding</b> (Code defined by a terminology system).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* A reference to a code defined by a terminology system
* </p>
*/
public java.util.List<CodingDt> getCoding() {
if (myCoding == null) {
myCoding = new java.util.ArrayList<CodingDt>();
}
return myCoding;
}
/**
* Sets the value(s) for <b>coding</b> (Code defined by a terminology system)
*
* <p>
* <b>Definition:</b>
* A reference to a code defined by a terminology system
* </p>
*/
public CodeableConceptDt setCoding(java.util.List<CodingDt> theValue) {
myCoding = theValue;
return this;
}
/**
* Adds and returns a new value for <b>coding</b> (Code defined by a terminology system)
*
* <p>
* <b>Definition:</b>
* A reference to a code defined by a terminology system
* </p>
*/
public CodingDt addCoding() {
CodingDt newType = new CodingDt();
getCoding().add(newType);
return newType;
}
/**
* Gets the first repetition for <b>coding</b> (Code defined by a terminology system),
* creating it if it does not already exist.
*
* <p>
* <b>Definition:</b>
* A reference to a code defined by a terminology system
* </p>
*/
public CodingDt getCodingFirstRep() {
if (getCoding().isEmpty()) {
return addCoding();
}
return getCoding().get(0);
}
/**
* Gets the value(s) for <b>text</b> (Plain text representation of the concept).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user
* </p>
*/
public StringDt getText() {
if (myText == null) {
myText = new StringDt();
}
return myText;
}
/**
* Sets the value(s) for <b>text</b> (Plain text representation of the concept)
*
* <p>
* <b>Definition:</b>
* A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user
* </p>
*/
public CodeableConceptDt setText(StringDt theValue) {
myText = theValue;
return this;
}
/**
* Sets the value for <b>text</b> (Plain text representation of the concept)
*
* <p>
* <b>Definition:</b>
* A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user
* </p>
*/
public CodeableConceptDt setText( String theString) {
myText = new StringDt(theString);
return this;
}
}

View File

@ -1,393 +0,0 @@
package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import java.util.List;
import ca.uhn.fhir.model.api.ICompositeDatatype;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.model.base.composite.BaseCodingDt;
import ca.uhn.fhir.model.primitive.BooleanDt;
import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.model.primitive.UriDt;
/**
* HAPI/FHIR <b>CodingDt</b> Datatype
* (A reference to a code defined by a terminology system)
*
* <p>
* <b>Definition:</b>
* A reference to a code defined by a terminology system
* </p>
*
* <p>
* <b>Requirements:</b>
* References to codes are very common in healthcare models
* </p>
*/
@DatatypeDef(name="CodingDt")
public class CodingDt
extends BaseCodingDt implements ICompositeDatatype
{
/**
* Constructor
*/
public CodingDt() {
// nothing
}
/**
* Creates a new Coding with the given system and code
*/
public CodingDt(String theSystem, String theCode) {
setSystem(theSystem);
setCode(theCode);
}
@Child(name="system", type=UriDt.class, order=0, min=0, max=1)
@Description(
shortDefinition="Identity of the terminology system",
formalDefinition="The identification of the code system that defines the meaning of the symbol in the code."
)
private UriDt mySystem;
@Child(name="version", type=StringDt.class, order=1, min=0, max=1)
@Description(
shortDefinition="Version of the system - if relevant",
formalDefinition="The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and When the meaning is not guaranteed to be consistent, the version SHOULD be exchanged"
)
private StringDt myVersion;
@Child(name="code", type=CodeDt.class, order=2, min=0, max=1)
@Description(
shortDefinition="Symbol in syntax defined by the system",
formalDefinition="A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)"
)
private CodeDt myCode;
@Child(name="display", type=StringDt.class, order=3, min=0, max=1)
@Description(
shortDefinition="Representation defined by the system",
formalDefinition="A representation of the meaning of the code in the system, following the rules of the system."
)
private StringDt myDisplay;
@Child(name="primary", type=BooleanDt.class, order=4, min=0, max=1)
@Description(
shortDefinition="If this code was chosen directly by the user",
formalDefinition="Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays)"
)
private BooleanDt myPrimary;
@Child(name="valueSet", order=5, min=0, max=1, type={
ca.uhn.fhir.model.dstu.resource.ValueSet.class })
@Description(
shortDefinition="Set this coding was chosen from",
formalDefinition="The set of possible coded values this coding was chosen from or constrained by"
)
private ResourceReferenceDt myValueSet;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySystem, myVersion, myCode, myDisplay, myPrimary, myValueSet);
}
@Override
public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySystem, myVersion, myCode, myDisplay, myPrimary, myValueSet);
}
/**
* Gets the value(s) for <b>system</b> (Identity of the terminology system).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The identification of the code system that defines the meaning of the symbol in the code.
* </p>
*/
public UriDt getSystemElement() {
if (mySystem == null) {
mySystem = new UriDt();
}
return mySystem;
}
/**
* Sets the value(s) for <b>system</b> (Identity of the terminology system)
*
* <p>
* <b>Definition:</b>
* The identification of the code system that defines the meaning of the symbol in the code.
* </p>
*/
public CodingDt setSystem(UriDt theValue) {
mySystem = theValue;
return this;
}
/**
* Sets the value for <b>system</b> (Identity of the terminology system)
*
* <p>
* <b>Definition:</b>
* The identification of the code system that defines the meaning of the symbol in the code.
* </p>
*/
public CodingDt setSystem( String theUri) {
mySystem = new UriDt(theUri);
return this;
}
/**
* Gets the value(s) for <b>version</b> (Version of the system - if relevant).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and When the meaning is not guaranteed to be consistent, the version SHOULD be exchanged
* </p>
*/
public StringDt getVersion() {
if (myVersion == null) {
myVersion = new StringDt();
}
return myVersion;
}
/**
* Sets the value(s) for <b>version</b> (Version of the system - if relevant)
*
* <p>
* <b>Definition:</b>
* The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and When the meaning is not guaranteed to be consistent, the version SHOULD be exchanged
* </p>
*/
public CodingDt setVersion(StringDt theValue) {
myVersion = theValue;
return this;
}
/**
* Sets the value for <b>version</b> (Version of the system - if relevant)
*
* <p>
* <b>Definition:</b>
* The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and When the meaning is not guaranteed to be consistent, the version SHOULD be exchanged
* </p>
*/
public CodingDt setVersion( String theString) {
myVersion = new StringDt(theString);
return this;
}
/**
* Gets the value(s) for <b>code</b> (Symbol in syntax defined by the system).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)
* </p>
*/
public CodeDt getCodeElement() {
if (myCode == null) {
myCode = new CodeDt();
}
return myCode;
}
/**
* Sets the value(s) for <b>code</b> (Symbol in syntax defined by the system)
*
* <p>
* <b>Definition:</b>
* A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)
* </p>
*/
public CodingDt setCode(CodeDt theValue) {
myCode = theValue;
return this;
}
/**
* Sets the value for <b>code</b> (Symbol in syntax defined by the system)
*
* <p>
* <b>Definition:</b>
* A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)
* </p>
*/
public CodingDt setCode( String theCode) {
myCode = new CodeDt(theCode);
return this;
}
/**
* Gets the value(s) for <b>display</b> (Representation defined by the system).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* A representation of the meaning of the code in the system, following the rules of the system.
* </p>
*/
public StringDt getDisplay() {
if (myDisplay == null) {
myDisplay = new StringDt();
}
return myDisplay;
}
/**
* Sets the value(s) for <b>display</b> (Representation defined by the system)
*
* <p>
* <b>Definition:</b>
* A representation of the meaning of the code in the system, following the rules of the system.
* </p>
*/
public CodingDt setDisplay(StringDt theValue) {
myDisplay = theValue;
return this;
}
/**
* Sets the value for <b>display</b> (Representation defined by the system)
*
* <p>
* <b>Definition:</b>
* A representation of the meaning of the code in the system, following the rules of the system.
* </p>
*/
public CodingDt setDisplay( String theString) {
myDisplay = new StringDt(theString);
return this;
}
/**
* Gets the value(s) for <b>primary</b> (If this code was chosen directly by the user).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays)
* </p>
*/
public BooleanDt getPrimary() {
if (myPrimary == null) {
myPrimary = new BooleanDt();
}
return myPrimary;
}
/**
* Sets the value(s) for <b>primary</b> (If this code was chosen directly by the user)
*
* <p>
* <b>Definition:</b>
* Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays)
* </p>
*/
public CodingDt setPrimary(BooleanDt theValue) {
myPrimary = theValue;
return this;
}
/**
* Sets the value for <b>primary</b> (If this code was chosen directly by the user)
*
* <p>
* <b>Definition:</b>
* Indicates that this code was chosen by a user directly - i.e. off a pick list of available items (codes or displays)
* </p>
*/
public CodingDt setPrimary( boolean theBoolean) {
myPrimary = new BooleanDt(theBoolean);
return this;
}
/**
* Gets the value(s) for <b>valueSet</b> (Set this coding was chosen from).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The set of possible coded values this coding was chosen from or constrained by
* </p>
*/
public ResourceReferenceDt getValueSet() {
if (myValueSet == null) {
myValueSet = new ResourceReferenceDt();
}
return myValueSet;
}
/**
* Sets the value(s) for <b>valueSet</b> (Set this coding was chosen from)
*
* <p>
* <b>Definition:</b>
* The set of possible coded values this coding was chosen from or constrained by
* </p>
*/
public CodingDt setValueSet(ResourceReferenceDt theValue) {
myValueSet = theValue;
return this;
}
}

View File

@ -1,301 +0,0 @@
package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import java.util.List;
import ca.uhn.fhir.model.api.BaseIdentifiableElement;
import ca.uhn.fhir.model.api.ICompositeDatatype;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.model.api.annotation.SimpleSetter;
import ca.uhn.fhir.model.dstu.valueset.ContactSystemEnum;
import ca.uhn.fhir.model.dstu.valueset.ContactUseEnum;
import ca.uhn.fhir.model.primitive.BoundCodeDt;
import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.StringDt;
/**
* HAPI/FHIR <b>ContactDt</b> Datatype
* (Technology mediated contact details (phone, fax, email, etc))
*
* <p>
* <b>Definition:</b>
* All kinds of technology mediated contact details for a person or organization, including telephone, email, etc.
* </p>
*
* <p>
* <b>Requirements:</b>
* Need to track phone, fax, mobile, sms numbers, email addresses, twitter tags, etc.
* </p>
*/
@DatatypeDef(name="ContactDt")
public class ContactDt
extends BaseIdentifiableElement implements ICompositeDatatype
{
/**
* Constructor
*/
public ContactDt() {
// nothing
}
/**
* Constructor
*/
@SimpleSetter
public ContactDt(@SimpleSetter.Parameter(name="theValue") String theValue) {
setValue(theValue);
}
/**
* Constructor
*/
@SimpleSetter
public ContactDt(@SimpleSetter.Parameter(name="theContactUse") ContactUseEnum theContactUse, @SimpleSetter.Parameter(name="theValue") String theValue) {
setUse(theContactUse);
setValue(theValue);
}
@Child(name="system", type=CodeDt.class, order=0, min=0, max=1)
@Description(
shortDefinition="phone | fax | email | url",
formalDefinition="Telecommunications form for contact - what communications system is required to make use of the contact"
)
private BoundCodeDt<ContactSystemEnum> mySystem;
@Child(name="value", type=StringDt.class, order=1, min=0, max=1)
@Description(
shortDefinition="The actual contact details",
formalDefinition="The actual contact details, in a form that is meaningful to the designated communication system (i.e. phone number or email address)."
)
private StringDt myValue;
@Child(name="use", type=CodeDt.class, order=2, min=0, max=1)
@Description(
shortDefinition="home | work | temp | old | mobile - purpose of this address",
formalDefinition="Identifies the purpose for the address"
)
private BoundCodeDt<ContactUseEnum> myUse;
@Child(name="period", type=PeriodDt.class, order=3, min=0, max=1)
@Description(
shortDefinition="Time period when the contact was/is in use",
formalDefinition="Time period when the contact was/is in use"
)
private PeriodDt myPeriod;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySystem, myValue, myUse, myPeriod);
}
@Override
public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySystem, myValue, myUse, myPeriod);
}
/**
* Gets the value(s) for <b>system</b> (phone | fax | email | url).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Telecommunications form for contact - what communications system is required to make use of the contact
* </p>
*/
public BoundCodeDt<ContactSystemEnum> getSystem() {
if (mySystem == null) {
mySystem = new BoundCodeDt<ContactSystemEnum>(ContactSystemEnum.VALUESET_BINDER);
}
return mySystem;
}
/**
* Sets the value(s) for <b>system</b> (phone | fax | email | url)
*
* <p>
* <b>Definition:</b>
* Telecommunications form for contact - what communications system is required to make use of the contact
* </p>
*/
public ContactDt setSystem(BoundCodeDt<ContactSystemEnum> theValue) {
mySystem = theValue;
return this;
}
/**
* Sets the value(s) for <b>system</b> (phone | fax | email | url)
*
* <p>
* <b>Definition:</b>
* Telecommunications form for contact - what communications system is required to make use of the contact
* </p>
*/
public ContactDt setSystem(ContactSystemEnum theValue) {
getSystem().setValueAsEnum(theValue);
return this;
}
/**
* Gets the value(s) for <b>value</b> (The actual contact details).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The actual contact details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).
* </p>
*/
public StringDt getValue() {
if (myValue == null) {
myValue = new StringDt();
}
return myValue;
}
/**
* Sets the value(s) for <b>value</b> (The actual contact details)
*
* <p>
* <b>Definition:</b>
* The actual contact details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).
* </p>
*/
public ContactDt setValue(StringDt theValue) {
myValue = theValue;
return this;
}
/**
* Sets the value for <b>value</b> (The actual contact details)
*
* <p>
* <b>Definition:</b>
* The actual contact details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).
* </p>
*/
public ContactDt setValue( String theString) {
myValue = new StringDt(theString);
return this;
}
/**
* Gets the value(s) for <b>use</b> (home | work | temp | old | mobile - purpose of this address).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Identifies the purpose for the address
* </p>
*/
public BoundCodeDt<ContactUseEnum> getUse() {
if (myUse == null) {
myUse = new BoundCodeDt<ContactUseEnum>(ContactUseEnum.VALUESET_BINDER);
}
return myUse;
}
/**
* Sets the value(s) for <b>use</b> (home | work | temp | old | mobile - purpose of this address)
*
* <p>
* <b>Definition:</b>
* Identifies the purpose for the address
* </p>
*/
public ContactDt setUse(BoundCodeDt<ContactUseEnum> theValue) {
myUse = theValue;
return this;
}
/**
* Sets the value(s) for <b>use</b> (home | work | temp | old | mobile - purpose of this address)
*
* <p>
* <b>Definition:</b>
* Identifies the purpose for the address
* </p>
*/
public ContactDt setUse(ContactUseEnum theValue) {
getUse().setValueAsEnum(theValue);
return this;
}
/**
* Gets the value(s) for <b>period</b> (Time period when the contact was/is in use).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Time period when the contact was/is in use
* </p>
*/
public PeriodDt getPeriod() {
if (myPeriod == null) {
myPeriod = new PeriodDt();
}
return myPeriod;
}
/**
* Sets the value(s) for <b>period</b> (Time period when the contact was/is in use)
*
* <p>
* <b>Definition:</b>
* Time period when the contact was/is in use
* </p>
*/
public ContactDt setPeriod(PeriodDt theValue) {
myPeriod = theValue;
return this;
}
}

View File

@ -1,53 +0,0 @@
package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import java.util.ArrayList;
import java.util.List;
import ca.uhn.fhir.model.api.IDatatype;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
@DatatypeDef(name = "duration")
public class ContainedDt implements IDatatype {
@Child(name = "resource", type = IResource.class, order = 0, min = 0, max = Child.MAX_UNLIMITED)
private List<IResource> myContainedResources;
public List<IResource> getContainedResources() {
if (myContainedResources == null) {
myContainedResources = new ArrayList<IResource>();
}
return myContainedResources;
}
public void setContainedResources(List<IResource> theContainedResources) {
myContainedResources = theContainedResources;
}
@Override
public boolean isEmpty() {
return myContainedResources == null || myContainedResources.size() == 0;
}
}

View File

@ -1,25 +0,0 @@
package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR Structures - DEV (FHIR Latest)
* %%
* Copyright (C) 2014 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
public class CountDt extends QuantityDt {
}

View File

@ -1,25 +0,0 @@
package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR Structures - DEV (FHIR Latest)
* %%
* Copyright (C) 2014 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
public class DistanceDt extends QuantityDt {
}

View File

@ -1,33 +0,0 @@
package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
@DatatypeDef(name = "Duration")
public class DurationDt extends QuantityDt {
// TODO: implement restricions
// There SHALL be a code if there is a value and it SHALL be an expression of length. If system is present, it SHALL be UCUM.
// (f:code or not(f:value)) and (not(exists(f:system)) or f:system/@value='http://unitsofmeasure.org')
}

View File

@ -1,577 +0,0 @@
package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import java.util.List;
import ca.uhn.fhir.model.api.ICompositeDatatype;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.model.base.composite.BaseHumanNameDt;
import ca.uhn.fhir.model.dstu.valueset.NameUseEnum;
import ca.uhn.fhir.model.primitive.BoundCodeDt;
import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.StringDt;
/**
* HAPI/FHIR <b>HumanNameDt</b> Datatype
* (Name of a human - parts and usage)
*
* <p>
* <b>Definition:</b>
* A human's name with the ability to identify parts and usage
* </p>
*
* <p>
* <b>Requirements:</b>
* Need to be able to record names, along with notes about their use
* </p>
*/
@DatatypeDef(name="HumanNameDt")
public class HumanNameDt
extends BaseHumanNameDt implements ICompositeDatatype
{
/**
* Constructor
*/
public HumanNameDt() {
// nothing
}
@Child(name="use", type=CodeDt.class, order=0, min=0, max=1)
@Description(
shortDefinition="usual | official | temp | nickname | anonymous | old | maiden",
formalDefinition="Identifies the purpose for this name"
)
private BoundCodeDt<NameUseEnum> myUse;
@Child(name="text", type=StringDt.class, order=1, min=0, max=1)
@Description(
shortDefinition="Text representation of the full name",
formalDefinition="A full text representation of the name"
)
private StringDt myText;
@Child(name="family", type=StringDt.class, order=2, min=0, max=Child.MAX_UNLIMITED)
@Description(
shortDefinition="Family name (often called 'Surname')",
formalDefinition="The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father."
)
private java.util.List<StringDt> myFamily;
@Child(name="given", type=StringDt.class, order=3, min=0, max=Child.MAX_UNLIMITED)
@Description(
shortDefinition="Given names (not always 'first'). Includes middle names",
formalDefinition="Given name"
)
private java.util.List<StringDt> myGiven;
@Child(name="prefix", type=StringDt.class, order=4, min=0, max=Child.MAX_UNLIMITED)
@Description(
shortDefinition="Parts that come before the name",
formalDefinition="Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name"
)
private java.util.List<StringDt> myPrefix;
@Child(name="suffix", type=StringDt.class, order=5, min=0, max=Child.MAX_UNLIMITED)
@Description(
shortDefinition="Parts that come after the name",
formalDefinition="Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name"
)
private java.util.List<StringDt> mySuffix;
@Child(name="period", type=PeriodDt.class, order=6, min=0, max=1)
@Description(
shortDefinition="Time period when name was/is in use",
formalDefinition="Indicates the period of time when this name was valid for the named person."
)
private PeriodDt myPeriod;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myUse, myText, myFamily, myGiven, myPrefix, mySuffix, myPeriod);
}
@Override
public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myUse, myText, myFamily, myGiven, myPrefix, mySuffix, myPeriod);
}
/**
* Gets the value(s) for <b>use</b> (usual | official | temp | nickname | anonymous | old | maiden).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Identifies the purpose for this name
* </p>
*/
public BoundCodeDt<NameUseEnum> getUse() {
if (myUse == null) {
myUse = new BoundCodeDt<NameUseEnum>(NameUseEnum.VALUESET_BINDER);
}
return myUse;
}
/**
* Sets the value(s) for <b>use</b> (usual | official | temp | nickname | anonymous | old | maiden)
*
* <p>
* <b>Definition:</b>
* Identifies the purpose for this name
* </p>
*/
public HumanNameDt setUse(BoundCodeDt<NameUseEnum> theValue) {
myUse = theValue;
return this;
}
/**
* Sets the value(s) for <b>use</b> (usual | official | temp | nickname | anonymous | old | maiden)
*
* <p>
* <b>Definition:</b>
* Identifies the purpose for this name
* </p>
*/
public HumanNameDt setUse(NameUseEnum theValue) {
getUse().setValueAsEnum(theValue);
return this;
}
/**
* Gets the value(s) for <b>text</b> (Text representation of the full name).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* A full text representation of the name
* </p>
*/
public StringDt getText() {
if (myText == null) {
myText = new StringDt();
}
return myText;
}
/**
* Sets the value(s) for <b>text</b> (Text representation of the full name)
*
* <p>
* <b>Definition:</b>
* A full text representation of the name
* </p>
*/
public HumanNameDt setText(StringDt theValue) {
myText = theValue;
return this;
}
/**
* Sets the value for <b>text</b> (Text representation of the full name)
*
* <p>
* <b>Definition:</b>
* A full text representation of the name
* </p>
*/
public HumanNameDt setText( String theString) {
myText = new StringDt(theString);
return this;
}
/**
* Gets the value(s) for <b>family</b> (Family name (often called 'Surname')).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.
* </p>
*/
public java.util.List<StringDt> getFamily() {
if (myFamily == null) {
myFamily = new java.util.ArrayList<StringDt>();
}
return myFamily;
}
/**
* Sets the value(s) for <b>family</b> (Family name (often called 'Surname'))
*
* <p>
* <b>Definition:</b>
* The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.
* </p>
*/
public HumanNameDt setFamily(java.util.List<StringDt> theValue) {
myFamily = theValue;
return this;
}
/**
* Adds and returns a new value for <b>family</b> (Family name (often called 'Surname'))
*
* <p>
* <b>Definition:</b>
* The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.
* </p>
*/
public StringDt addFamily() {
StringDt newType = new StringDt();
getFamily().add(newType);
return newType;
}
/**
* Gets the first repetition for <b>family</b> (Family name (often called 'Surname')),
* creating it if it does not already exist.
*
* <p>
* <b>Definition:</b>
* The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.
* </p>
*/
public StringDt getFamilyFirstRep() {
if (getFamily().isEmpty()) {
return addFamily();
}
return getFamily().get(0);
}
/**
* Adds a new value for <b>family</b> (Family name (often called 'Surname'))
*
* <p>
* <b>Definition:</b>
* The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.
* </p>
*
* @return Returns a reference to this object, to allow for simple chaining.
*/
public HumanNameDt addFamily( String theString) {
if (myFamily == null) {
myFamily = new java.util.ArrayList<StringDt>();
}
myFamily.add(new StringDt(theString));
return this;
}
/**
* Gets the value(s) for <b>given</b> (Given names (not always 'first'). Includes middle names).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Given name
* </p>
*/
public java.util.List<StringDt> getGiven() {
if (myGiven == null) {
myGiven = new java.util.ArrayList<StringDt>();
}
return myGiven;
}
/**
* Sets the value(s) for <b>given</b> (Given names (not always 'first'). Includes middle names)
*
* <p>
* <b>Definition:</b>
* Given name
* </p>
*/
public HumanNameDt setGiven(java.util.List<StringDt> theValue) {
myGiven = theValue;
return this;
}
/**
* Adds and returns a new value for <b>given</b> (Given names (not always 'first'). Includes middle names)
*
* <p>
* <b>Definition:</b>
* Given name
* </p>
*/
public StringDt addGiven() {
StringDt newType = new StringDt();
getGiven().add(newType);
return newType;
}
/**
* Gets the first repetition for <b>given</b> (Given names (not always 'first'). Includes middle names),
* creating it if it does not already exist.
*
* <p>
* <b>Definition:</b>
* Given name
* </p>
*/
public StringDt getGivenFirstRep() {
if (getGiven().isEmpty()) {
return addGiven();
}
return getGiven().get(0);
}
/**
* Adds a new value for <b>given</b> (Given names (not always 'first'). Includes middle names)
*
* <p>
* <b>Definition:</b>
* Given name
* </p>
*
* @return Returns a reference to this object, to allow for simple chaining.
*/
public HumanNameDt addGiven( String theString) {
if (myGiven == null) {
myGiven = new java.util.ArrayList<StringDt>();
}
myGiven.add(new StringDt(theString));
return this;
}
/**
* Gets the value(s) for <b>prefix</b> (Parts that come before the name).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name
* </p>
*/
public java.util.List<StringDt> getPrefix() {
if (myPrefix == null) {
myPrefix = new java.util.ArrayList<StringDt>();
}
return myPrefix;
}
/**
* Sets the value(s) for <b>prefix</b> (Parts that come before the name)
*
* <p>
* <b>Definition:</b>
* Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name
* </p>
*/
public HumanNameDt setPrefix(java.util.List<StringDt> theValue) {
myPrefix = theValue;
return this;
}
/**
* Adds and returns a new value for <b>prefix</b> (Parts that come before the name)
*
* <p>
* <b>Definition:</b>
* Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name
* </p>
*/
public StringDt addPrefix() {
StringDt newType = new StringDt();
getPrefix().add(newType);
return newType;
}
/**
* Gets the first repetition for <b>prefix</b> (Parts that come before the name),
* creating it if it does not already exist.
*
* <p>
* <b>Definition:</b>
* Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name
* </p>
*/
public StringDt getPrefixFirstRep() {
if (getPrefix().isEmpty()) {
return addPrefix();
}
return getPrefix().get(0);
}
/**
* Adds a new value for <b>prefix</b> (Parts that come before the name)
*
* <p>
* <b>Definition:</b>
* Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name
* </p>
*
* @return Returns a reference to this object, to allow for simple chaining.
*/
public HumanNameDt addPrefix( String theString) {
if (myPrefix == null) {
myPrefix = new java.util.ArrayList<StringDt>();
}
myPrefix.add(new StringDt(theString));
return this;
}
/**
* Gets the value(s) for <b>suffix</b> (Parts that come after the name).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name
* </p>
*/
public java.util.List<StringDt> getSuffix() {
if (mySuffix == null) {
mySuffix = new java.util.ArrayList<StringDt>();
}
return mySuffix;
}
/**
* Sets the value(s) for <b>suffix</b> (Parts that come after the name)
*
* <p>
* <b>Definition:</b>
* Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name
* </p>
*/
public HumanNameDt setSuffix(java.util.List<StringDt> theValue) {
mySuffix = theValue;
return this;
}
/**
* Adds and returns a new value for <b>suffix</b> (Parts that come after the name)
*
* <p>
* <b>Definition:</b>
* Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name
* </p>
*/
public StringDt addSuffix() {
StringDt newType = new StringDt();
getSuffix().add(newType);
return newType;
}
/**
* Gets the first repetition for <b>suffix</b> (Parts that come after the name),
* creating it if it does not already exist.
*
* <p>
* <b>Definition:</b>
* Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name
* </p>
*/
public StringDt getSuffixFirstRep() {
if (getSuffix().isEmpty()) {
return addSuffix();
}
return getSuffix().get(0);
}
/**
* Adds a new value for <b>suffix</b> (Parts that come after the name)
*
* <p>
* <b>Definition:</b>
* Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name
* </p>
*
* @return Returns a reference to this object, to allow for simple chaining.
*/
public HumanNameDt addSuffix( String theString) {
if (mySuffix == null) {
mySuffix = new java.util.ArrayList<StringDt>();
}
mySuffix.add(new StringDt(theString));
return this;
}
/**
* Gets the value(s) for <b>period</b> (Time period when name was/is in use).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Indicates the period of time when this name was valid for the named person.
* </p>
*/
public PeriodDt getPeriod() {
if (myPeriod == null) {
myPeriod = new PeriodDt();
}
return myPeriod;
}
/**
* Sets the value(s) for <b>period</b> (Time period when name was/is in use)
*
* <p>
* <b>Definition:</b>
* Indicates the period of time when this name was valid for the named person.
* </p>
*/
public HumanNameDt setPeriod(PeriodDt theValue) {
myPeriod = theValue;
return this;
}
@Override
public StringDt getTextElement() {
return getText();
}
}

View File

@ -1,399 +0,0 @@
package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import java.util.List;
import ca.uhn.fhir.model.api.ICompositeDatatype;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.model.api.annotation.SimpleSetter;
import ca.uhn.fhir.model.base.composite.BaseIdentifierDt;
import ca.uhn.fhir.model.dstu.valueset.IdentifierUseEnum;
import ca.uhn.fhir.model.primitive.BoundCodeDt;
import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.model.primitive.UriDt;
/**
* HAPI/FHIR <b>IdentifierDt</b> Datatype
* (An identifier intended for computation)
*
* <p>
* <b>Definition:</b>
* A technical identifier - identifies some entity uniquely and unambiguously
* </p>
*
* <p>
* <b>Requirements:</b>
* Need to be able to identify things with confidence and be sure that the identification is not subject to misinterpretation
* </p>
*/
@DatatypeDef(name="IdentifierDt")
public class IdentifierDt
extends BaseIdentifierDt implements ICompositeDatatype
{
/**
* Constructor
*/
public IdentifierDt() {
// nothing
}
/**
* Creates a new identifier with the given system and value
*/
@SimpleSetter
public IdentifierDt(@SimpleSetter.Parameter(name="theSystem") String theSystem, @SimpleSetter.Parameter(name="theValue") String theValue) {
setSystem(theSystem);
setValue(theValue);
}
/**
* Creates a new identifier with the given system and value
*/
@SimpleSetter
public IdentifierDt(@SimpleSetter.Parameter(name="theUse") IdentifierUseEnum theUse, @SimpleSetter.Parameter(name="theSystem") String theSystem, @SimpleSetter.Parameter(name="theValue") String theValue, @SimpleSetter.Parameter(name="theLabel") String theLabel) {
setUse(theUse);
setSystem(theSystem);
setValue(theValue);
setLabel(theLabel);
}
@Override
public String toString() {
return "IdentifierDt[" + getValueAsQueryToken() + "]";
}
@Child(name="use", type=CodeDt.class, order=0, min=0, max=1)
@Description(
shortDefinition="usual | official | temp | secondary (If known)",
formalDefinition="The purpose of this identifier"
)
private BoundCodeDt<IdentifierUseEnum> myUse;
@Child(name="label", type=StringDt.class, order=1, min=0, max=1)
@Description(
shortDefinition="Description of identifier",
formalDefinition="A text string for the identifier that can be displayed to a human so they can recognize the identifier"
)
private StringDt myLabel;
@Child(name="system", type=UriDt.class, order=2, min=0, max=1)
@Description(
shortDefinition="The namespace for the identifier",
formalDefinition="Establishes the namespace in which set of possible id values is unique."
)
private UriDt mySystem;
@Child(name="value", type=StringDt.class, order=3, min=0, max=1)
@Description(
shortDefinition="The value that is unique",
formalDefinition="The portion of the identifier typically displayed to the user and which is unique within the context of the system."
)
private StringDt myValue;
@Child(name="period", type=PeriodDt.class, order=4, min=0, max=1)
@Description(
shortDefinition="Time period when id is/was valid for use",
formalDefinition="Time period during which identifier is/was valid for use"
)
private PeriodDt myPeriod;
@Child(name="assigner", order=5, min=0, max=1, type={
ca.uhn.fhir.model.dstu.resource.Conformance.class })
@Description(
shortDefinition="Organization that issued id (may be just text)",
formalDefinition="Organization that issued/manages the identifier"
)
private ResourceReferenceDt myAssigner;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myUse, myLabel, mySystem, myValue, myPeriod, myAssigner);
}
@Override
public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myUse, myLabel, mySystem, myValue, myPeriod, myAssigner);
}
/**
* Gets the value(s) for <b>use</b> (usual | official | temp | secondary (If known)).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The purpose of this identifier
* </p>
*/
public BoundCodeDt<IdentifierUseEnum> getUse() {
if (myUse == null) {
myUse = new BoundCodeDt<IdentifierUseEnum>(IdentifierUseEnum.VALUESET_BINDER);
}
return myUse;
}
/**
* Sets the value(s) for <b>use</b> (usual | official | temp | secondary (If known))
*
* <p>
* <b>Definition:</b>
* The purpose of this identifier
* </p>
*/
public IdentifierDt setUse(BoundCodeDt<IdentifierUseEnum> theValue) {
myUse = theValue;
return this;
}
/**
* Sets the value(s) for <b>use</b> (usual | official | temp | secondary (If known))
*
* <p>
* <b>Definition:</b>
* The purpose of this identifier
* </p>
*/
public IdentifierDt setUse(IdentifierUseEnum theValue) {
getUse().setValueAsEnum(theValue);
return this;
}
/**
* Gets the value(s) for <b>label</b> (Description of identifier).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* A text string for the identifier that can be displayed to a human so they can recognize the identifier
* </p>
*/
public StringDt getLabel() {
if (myLabel == null) {
myLabel = new StringDt();
}
return myLabel;
}
/**
* Sets the value(s) for <b>label</b> (Description of identifier)
*
* <p>
* <b>Definition:</b>
* A text string for the identifier that can be displayed to a human so they can recognize the identifier
* </p>
*/
public IdentifierDt setLabel(StringDt theValue) {
myLabel = theValue;
return this;
}
/**
* Sets the value for <b>label</b> (Description of identifier)
*
* <p>
* <b>Definition:</b>
* A text string for the identifier that can be displayed to a human so they can recognize the identifier
* </p>
*/
public IdentifierDt setLabel( String theString) {
myLabel = new StringDt(theString);
return this;
}
/**
* Gets the value(s) for <b>system</b> (The namespace for the identifier).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Establishes the namespace in which set of possible id values is unique.
* </p>
*/
public UriDt getSystemElement() {
if (mySystem == null) {
mySystem = new UriDt();
}
return mySystem;
}
/**
* Sets the value(s) for <b>system</b> (The namespace for the identifier)
*
* <p>
* <b>Definition:</b>
* Establishes the namespace in which set of possible id values is unique.
* </p>
*/
public IdentifierDt setSystem(UriDt theValue) {
mySystem = theValue;
return this;
}
/**
* Sets the value for <b>system</b> (The namespace for the identifier)
*
* <p>
* <b>Definition:</b>
* Establishes the namespace in which set of possible id values is unique.
* </p>
*/
public IdentifierDt setSystem( String theUri) {
mySystem = new UriDt(theUri);
return this;
}
/**
* Gets the value(s) for <b>value</b> (The value that is unique).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The portion of the identifier typically displayed to the user and which is unique within the context of the system.
* </p>
*/
public StringDt getValueElement() {
if (myValue == null) {
myValue = new StringDt();
}
return myValue;
}
/**
* Sets the value(s) for <b>value</b> (The value that is unique)
*
* <p>
* <b>Definition:</b>
* The portion of the identifier typically displayed to the user and which is unique within the context of the system.
* </p>
*/
public IdentifierDt setValue(StringDt theValue) {
myValue = theValue;
return this;
}
/**
* Sets the value for <b>value</b> (The value that is unique)
*
* <p>
* <b>Definition:</b>
* The portion of the identifier typically displayed to the user and which is unique within the context of the system.
* </p>
*/
public IdentifierDt setValue( String theString) {
myValue = new StringDt(theString);
return this;
}
/**
* Gets the value(s) for <b>period</b> (Time period when id is/was valid for use).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Time period during which identifier is/was valid for use
* </p>
*/
public PeriodDt getPeriod() {
if (myPeriod == null) {
myPeriod = new PeriodDt();
}
return myPeriod;
}
/**
* Sets the value(s) for <b>period</b> (Time period when id is/was valid for use)
*
* <p>
* <b>Definition:</b>
* Time period during which identifier is/was valid for use
* </p>
*/
public IdentifierDt setPeriod(PeriodDt theValue) {
myPeriod = theValue;
return this;
}
/**
* Gets the value(s) for <b>assigner</b> (Organization that issued id (may be just text)).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Organization that issued/manages the identifier
* </p>
*/
public ResourceReferenceDt getAssigner() {
if (myAssigner == null) {
myAssigner = new ResourceReferenceDt();
}
return myAssigner;
}
/**
* Sets the value(s) for <b>assigner</b> (Organization that issued id (may be just text))
*
* <p>
* <b>Definition:</b>
* Organization that issued/manages the identifier
* </p>
*/
public IdentifierDt setAssigner(ResourceReferenceDt theValue) {
myAssigner = theValue;
return this;
}
}

View File

@ -1,25 +0,0 @@
package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR Structures - DEV (FHIR Latest)
* %%
* Copyright (C) 2014 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
public class MoneyDt extends QuantityDt {
}

View File

@ -1,176 +0,0 @@
package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import java.util.List;
import ca.uhn.fhir.model.api.BaseIdentifiableElement;
import ca.uhn.fhir.model.api.ICompositeDatatype;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.dstu.valueset.NarrativeStatusEnum;
import ca.uhn.fhir.model.primitive.BoundCodeDt;
import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.XhtmlDt;
/**
* HAPI/FHIR <b>Narrative</b> Datatype
* (A human-readable formatted text, including images)
*
* <p>
* <b>Definition:</b>
* A human-readable formatted text, including images
* </p>
*
* <p>
* <b>Requirements:</b>
*
* </p>
*/
@DatatypeDef(name="Narrative")
public class NarrativeDt extends BaseIdentifiableElement implements ICompositeDatatype {
@Child(name="status", type=CodeDt.class, order=0, min=1, max=1)
private BoundCodeDt<NarrativeStatusEnum> myStatus;
@Child(name="div", type=XhtmlDt.class, order=1, min=1, max=1)
private XhtmlDt myDiv;
public NarrativeDt() {
// nothing
}
public NarrativeDt(XhtmlDt theDiv, NarrativeStatusEnum theStatus) {
setDiv(theDiv);
setStatus(theStatus);
}
@Override
public boolean isEmpty() {
return ca.uhn.fhir.util.ElementUtil.isEmpty( myStatus, myDiv );
}
@Override
public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements( theType, myStatus, myDiv );
}
/**
* Gets the value(s) for <b>status</b> (generated | extensions | additional).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data
* </p>
*/
public BoundCodeDt<NarrativeStatusEnum> getStatus() {
if (myStatus == null) {
myStatus = new BoundCodeDt<NarrativeStatusEnum>(NarrativeStatusEnum.VALUESET_BINDER);
}
return myStatus;
}
/**
* Sets the value(s) for <b>status</b> (generated | extensions | additional)
*
* <p>
* <b>Definition:</b>
* The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data
* </p>
*/
public void setStatus(BoundCodeDt<NarrativeStatusEnum> theValue) {
myStatus = theValue;
}
/**
* Sets the value(s) for <b>status</b> (generated | extensions | additional)
*
* <p>
* <b>Definition:</b>
* The status of the narrative - whether it's entirely generated (from just the defined data or the extensions too), or whether a human authored it and it may contain additional data
* </p>
*/
public void setStatus(NarrativeStatusEnum theValue) {
getStatus().setValueAsEnum(theValue);
}
/**
* Gets the value(s) for <b>div</b> (Limited xhtml content).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The actual narrative content, a stripped down version of XHTML
* </p>
*/
public XhtmlDt getDiv() {
if (myDiv == null) {
myDiv = new XhtmlDt();
}
return myDiv;
}
/**
* Sets the value(s) for <b>div</b> (Limited xhtml content)
*
* <p>
* <b>Definition:</b>
* The actual narrative content, a stripped down version of XHTML
* </p>
*/
public void setDiv(XhtmlDt theValue) {
myDiv = theValue;
}
/**
* Sets the value using a textual DIV (or simple text block which will be
* converted to XHTML)
*/
public void setDiv(String theTextDiv) {
myDiv = new XhtmlDt(theTextDiv);
}
}

View File

@ -1,219 +0,0 @@
package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import java.util.Date;
import java.util.List;
import ca.uhn.fhir.model.api.BaseIdentifiableElement;
import ca.uhn.fhir.model.api.ICompositeDatatype;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.model.primitive.DateTimeDt;
/**
* HAPI/FHIR <b>PeriodDt</b> Datatype
* (Time range defined by start and end date/time)
*
* <p>
* <b>Definition:</b>
* A time period defined by a start and end date and optionally time.
* </p>
*
* <p>
* <b>Requirements:</b>
*
* </p>
*/
@DatatypeDef(name="PeriodDt")
public class PeriodDt
extends BaseIdentifiableElement implements ICompositeDatatype
{
/**
* Constructor
*/
public PeriodDt() {
// nothing
}
@Child(name="start", type=DateTimeDt.class, order=0, min=0, max=1)
@Description(
shortDefinition="Starting time with inclusive boundary",
formalDefinition="The start of the period. The boundary is inclusive."
)
private DateTimeDt myStart;
@Child(name="end", type=DateTimeDt.class, order=1, min=0, max=1)
@Description(
shortDefinition="End time with inclusive boundary, if not ongoing",
formalDefinition="The end of the period. If the end of the period is missing, it means that the period is ongoing"
)
private DateTimeDt myEnd;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myStart, myEnd);
}
@Override
public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myStart, myEnd);
}
/**
* Gets the value(s) for <b>start</b> (Starting time with inclusive boundary).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The start of the period. The boundary is inclusive.
* </p>
*/
public DateTimeDt getStart() {
if (myStart == null) {
myStart = new DateTimeDt();
}
return myStart;
}
/**
* Sets the value(s) for <b>start</b> (Starting time with inclusive boundary)
*
* <p>
* <b>Definition:</b>
* The start of the period. The boundary is inclusive.
* </p>
*/
public PeriodDt setStart(DateTimeDt theValue) {
myStart = theValue;
return this;
}
/**
* Sets the value for <b>start</b> (Starting time with inclusive boundary)
*
* <p>
* <b>Definition:</b>
* The start of the period. The boundary is inclusive.
* </p>
*/
public PeriodDt setStartWithSecondsPrecision( Date theDate) {
myStart = new DateTimeDt(theDate);
return this;
}
/**
* Sets the value for <b>start</b> (Starting time with inclusive boundary)
*
* <p>
* <b>Definition:</b>
* The start of the period. The boundary is inclusive.
* </p>
*/
public PeriodDt setStart( Date theDate, TemporalPrecisionEnum thePrecision) {
myStart = new DateTimeDt(theDate, thePrecision);
return this;
}
/**
* Gets the value(s) for <b>end</b> (End time with inclusive boundary, if not ongoing).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The end of the period. If the end of the period is missing, it means that the period is ongoing
* </p>
*/
public DateTimeDt getEnd() {
if (myEnd == null) {
myEnd = new DateTimeDt();
}
return myEnd;
}
/**
* Sets the value(s) for <b>end</b> (End time with inclusive boundary, if not ongoing)
*
* <p>
* <b>Definition:</b>
* The end of the period. If the end of the period is missing, it means that the period is ongoing
* </p>
*/
public PeriodDt setEnd(DateTimeDt theValue) {
myEnd = theValue;
return this;
}
/**
* Sets the value for <b>end</b> (End time with inclusive boundary, if not ongoing)
*
* <p>
* <b>Definition:</b>
* The end of the period. If the end of the period is missing, it means that the period is ongoing
* </p>
*/
public PeriodDt setEndWithSecondsPrecision( Date theDate) {
myEnd = new DateTimeDt(theDate);
return this;
}
/**
* Sets the value for <b>end</b> (End time with inclusive boundary, if not ongoing)
*
* <p>
* <b>Definition:</b>
* The end of the period. If the end of the period is missing, it means that the period is ongoing
* </p>
*/
public PeriodDt setEnd( Date theDate, TemporalPrecisionEnum thePrecision) {
myEnd = new DateTimeDt(theDate, thePrecision);
return this;
}
}

View File

@ -1,436 +0,0 @@
package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import java.util.List;
import ca.uhn.fhir.model.api.ICompositeDatatype;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.model.api.annotation.SimpleSetter;
import ca.uhn.fhir.model.base.composite.BaseQuantityDt;
import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum;
import ca.uhn.fhir.model.primitive.BoundCodeDt;
import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.DecimalDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.model.primitive.UriDt;
/**
* HAPI/FHIR <b>QuantityDt</b> Datatype
* (A measured or measurable amount)
*
* <p>
* <b>Definition:</b>
* A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies
* </p>
*
* <p>
* <b>Requirements:</b>
* Need to able to capture all sorts of measured values, even if the measured value are not precisely quantified. Values include exact measures such as 3.51g, customary units such as 3 tablets, and currencies such as $100.32USD
* </p>
*/
@DatatypeDef(name="QuantityDt")
public class QuantityDt
extends BaseQuantityDt implements ICompositeDatatype
{
/**
* Constructor
*/
public QuantityDt() {
// nothing
}
/**
* Constructor
*/
@SimpleSetter
public QuantityDt(@SimpleSetter.Parameter(name="theValue") double theValue) {
setValue(theValue);
}
/**
* Constructor
*/
@SimpleSetter
public QuantityDt(@SimpleSetter.Parameter(name="theValue") long theValue) {
setValue(theValue);
}
/**
* Constructor
*/
@SimpleSetter
public QuantityDt(@SimpleSetter.Parameter(name = "theComparator") QuantityCompararatorEnum theComparator, @SimpleSetter.Parameter(name = "theValue") double theValue,
@SimpleSetter.Parameter(name = "theUnits") String theUnits) {
setValue(theValue);
setComparator(theComparator);
setUnits(theUnits);
}
/**
* Constructor
*/
@SimpleSetter
public QuantityDt(@SimpleSetter.Parameter(name = "theComparator") QuantityCompararatorEnum theComparator, @SimpleSetter.Parameter(name = "theValue") long theValue,
@SimpleSetter.Parameter(name = "theUnits") String theUnits) {
setValue(theValue);
setComparator(theComparator);
setUnits(theUnits);
}
/**
* Constructor
*/
@SimpleSetter
public QuantityDt(@SimpleSetter.Parameter(name="theComparator") QuantityCompararatorEnum theComparator, @SimpleSetter.Parameter(name="theValue") double theValue, @SimpleSetter.Parameter(name="theSystem") String theSystem, @SimpleSetter.Parameter(name="theUnits") String theUnits) {
setValue(theValue);
setComparator(theComparator);
setSystem(theSystem);
setUnits(theUnits);
}
/**
* Constructor
*/
@SimpleSetter
public QuantityDt(@SimpleSetter.Parameter(name="theComparator") QuantityCompararatorEnum theComparator, @SimpleSetter.Parameter(name="theValue") long theValue, @SimpleSetter.Parameter(name="theSystem") String theSystem, @SimpleSetter.Parameter(name="theUnits") String theUnits) {
setValue(theValue);
setComparator(theComparator);
setSystem(theSystem);
setUnits(theUnits);
}
@Child(name="value", type=DecimalDt.class, order=0, min=0, max=1)
@Description(
shortDefinition="Numerical value (with implicit precision)",
formalDefinition="The value of the measured amount. The value includes an implicit precision in the presentation of the value"
)
private DecimalDt myValue;
@Child(name="comparator", type=CodeDt.class, order=1, min=0, max=1)
@Description(
shortDefinition="< | <= | >= | > - how to understand the value",
formalDefinition="How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is \"<\" , then the real value is < stated value"
)
private BoundCodeDt<QuantityCompararatorEnum> myComparator;
@Child(name="units", type=StringDt.class, order=2, min=0, max=1)
@Description(
shortDefinition="Unit representation",
formalDefinition="A human-readable form of the units"
)
private StringDt myUnits;
@Child(name="system", type=UriDt.class, order=3, min=0, max=1)
@Description(
shortDefinition="System that defines coded unit form",
formalDefinition="The identification of the system that provides the coded form of the unit"
)
private UriDt mySystem;
@Child(name="code", type=CodeDt.class, order=4, min=0, max=1)
@Description(
shortDefinition="Coded form of the unit",
formalDefinition="A computer processable form of the units in some unit representation system"
)
private CodeDt myCode;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myValue, myComparator, myUnits, mySystem, myCode);
}
@Override
public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myValue, myComparator, myUnits, mySystem, myCode);
}
/**
* Gets the value(s) for <b>value</b> (Numerical value (with implicit precision)).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The value of the measured amount. The value includes an implicit precision in the presentation of the value
* </p>
*/
public DecimalDt getValueElement() {
if (myValue == null) {
myValue = new DecimalDt();
}
return myValue;
}
/**
* Sets the value(s) for <b>value</b> (Numerical value (with implicit precision))
*
* <p>
* <b>Definition:</b>
* The value of the measured amount. The value includes an implicit precision in the presentation of the value
* </p>
*/
public QuantityDt setValue(DecimalDt theValue) {
myValue = theValue;
return this;
}
/**
* Sets the value for <b>value</b> (Numerical value (with implicit precision))
*
* <p>
* <b>Definition:</b>
* The value of the measured amount. The value includes an implicit precision in the presentation of the value
* </p>
*/
public QuantityDt setValue( long theValue) {
myValue = new DecimalDt(theValue);
return this;
}
/**
* Sets the value for <b>value</b> (Numerical value (with implicit precision))
*
* <p>
* <b>Definition:</b>
* The value of the measured amount. The value includes an implicit precision in the presentation of the value
* </p>
*/
public QuantityDt setValue( double theValue) {
myValue = new DecimalDt(theValue);
return this;
}
/**
* Sets the value for <b>value</b> (Numerical value (with implicit precision))
*
* <p>
* <b>Definition:</b>
* The value of the measured amount. The value includes an implicit precision in the presentation of the value
* </p>
*/
public QuantityDt setValue( java.math.BigDecimal theValue) {
myValue = new DecimalDt(theValue);
return this;
}
/**
* Gets the value(s) for <b>comparator</b> (< | <= | >= | > - how to understand the value).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is \"<\" , then the real value is < stated value
* </p>
*/
public BoundCodeDt<QuantityCompararatorEnum> getComparatorElement() {
if (myComparator == null) {
myComparator = new BoundCodeDt<QuantityCompararatorEnum>(QuantityCompararatorEnum.VALUESET_BINDER);
}
return myComparator;
}
/**
* Sets the value(s) for <b>comparator</b> (< | <= | >= | > - how to understand the value)
*
* <p>
* <b>Definition:</b>
* How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is \"<\" , then the real value is < stated value
* </p>
*/
public QuantityDt setComparator(BoundCodeDt<QuantityCompararatorEnum> theValue) {
myComparator = theValue;
return this;
}
/**
* Sets the value(s) for <b>comparator</b> (< | <= | >= | > - how to understand the value)
*
* <p>
* <b>Definition:</b>
* How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues. E.g. if the comparator is \"<\" , then the real value is < stated value
* </p>
*/
public QuantityDt setComparator(QuantityCompararatorEnum theValue) {
getComparatorElement().setValueAsEnum(theValue);
return this;
}
/**
* Gets the value(s) for <b>units</b> (Unit representation).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* A human-readable form of the units
* </p>
*/
public StringDt getUnitsElement() {
if (myUnits == null) {
myUnits = new StringDt();
}
return myUnits;
}
/**
* Sets the value(s) for <b>units</b> (Unit representation)
*
* <p>
* <b>Definition:</b>
* A human-readable form of the units
* </p>
*/
public QuantityDt setUnits(StringDt theValue) {
myUnits = theValue;
return this;
}
/**
* Sets the value for <b>units</b> (Unit representation)
*
* <p>
* <b>Definition:</b>
* A human-readable form of the units
* </p>
*/
public QuantityDt setUnits( String theString) {
myUnits = new StringDt(theString);
return this;
}
/**
* Gets the value(s) for <b>system</b> (System that defines coded unit form).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The identification of the system that provides the coded form of the unit
* </p>
*/
public UriDt getSystemElement() {
if (mySystem == null) {
mySystem = new UriDt();
}
return mySystem;
}
/**
* Sets the value(s) for <b>system</b> (System that defines coded unit form)
*
* <p>
* <b>Definition:</b>
* The identification of the system that provides the coded form of the unit
* </p>
*/
public QuantityDt setSystem(UriDt theValue) {
mySystem = theValue;
return this;
}
/**
* Sets the value for <b>system</b> (System that defines coded unit form)
*
* <p>
* <b>Definition:</b>
* The identification of the system that provides the coded form of the unit
* </p>
*/
public QuantityDt setSystem( String theUri) {
mySystem = new UriDt(theUri);
return this;
}
/**
* Gets the value(s) for <b>code</b> (Coded form of the unit).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* A computer processable form of the units in some unit representation system
* </p>
*/
public CodeDt getCodeElement() {
if (myCode == null) {
myCode = new CodeDt();
}
return myCode;
}
/**
* Sets the value(s) for <b>code</b> (Coded form of the unit)
*
* <p>
* <b>Definition:</b>
* A computer processable form of the units in some unit representation system
* </p>
*/
public QuantityDt setCode(CodeDt theValue) {
myCode = theValue;
return this;
}
/**
* Sets the value for <b>code</b> (Coded form of the unit)
*
* <p>
* <b>Definition:</b>
* A computer processable form of the units in some unit representation system
* </p>
*/
public QuantityDt setCode( String theCode) {
myCode = new CodeDt(theCode);
return this;
}
}

View File

@ -1,321 +0,0 @@
package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import java.util.List;
import ca.uhn.fhir.model.api.BaseIdentifiableElement;
import ca.uhn.fhir.model.api.ICompositeDatatype;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum;
/**
* HAPI/FHIR <b>RangeDt</b> Datatype
* (Set of values bounded by low and high)
*
* <p>
* <b>Definition:</b>
* A set of ordered Quantities defined by a low and high limit.
* </p>
*
* <p>
* <b>Requirements:</b>
* Need to be able to specify ranges of values
* </p>
*/
@DatatypeDef(name="RangeDt")
public class RangeDt
extends BaseIdentifiableElement implements ICompositeDatatype
{
/**
* Constructor
*/
public RangeDt() {
// nothing
}
@Child(name="low", type=QuantityDt.class, order=0, min=0, max=1)
@Description(
shortDefinition="Low limit",
formalDefinition="The low limit. The boundary is inclusive."
)
private QuantityDt myLow;
@Child(name="high", type=QuantityDt.class, order=1, min=0, max=1)
@Description(
shortDefinition="High limit",
formalDefinition="The high limit. The boundary is inclusive."
)
private QuantityDt myHigh;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myLow, myHigh);
}
@Override
public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myLow, myHigh);
}
/**
* Gets the value(s) for <b>low</b> (Low limit).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The low limit. The boundary is inclusive.
* </p>
*/
public QuantityDt getLow() {
if (myLow == null) {
myLow = new QuantityDt();
}
return myLow;
}
/**
* Sets the value(s) for <b>low</b> (Low limit)
*
* <p>
* <b>Definition:</b>
* The low limit. The boundary is inclusive.
* </p>
*/
public RangeDt setLow(QuantityDt theValue) {
myLow = theValue;
return this;
}
/**
* Sets the value for <b>low</b> (Low limit)
*
* <p>
* <b>Definition:</b>
* The low limit. The boundary is inclusive.
* </p>
*/
public RangeDt setLow( QuantityCompararatorEnum theComparator, double theValue, String theUnits) {
myLow = new QuantityDt(theComparator, theValue, theUnits);
return this;
}
/**
* Sets the value for <b>low</b> (Low limit)
*
* <p>
* <b>Definition:</b>
* The low limit. The boundary is inclusive.
* </p>
*/
public RangeDt setLow( QuantityCompararatorEnum theComparator, long theValue, String theUnits) {
myLow = new QuantityDt(theComparator, theValue, theUnits);
return this;
}
/**
* Sets the value for <b>low</b> (Low limit)
*
* <p>
* <b>Definition:</b>
* The low limit. The boundary is inclusive.
* </p>
*/
public RangeDt setLow( QuantityCompararatorEnum theComparator, double theValue, String theSystem, String theUnits) {
myLow = new QuantityDt(theComparator, theValue, theSystem, theUnits);
return this;
}
/**
* Sets the value for <b>low</b> (Low limit)
*
* <p>
* <b>Definition:</b>
* The low limit. The boundary is inclusive.
* </p>
*/
public RangeDt setLow( QuantityCompararatorEnum theComparator, long theValue, String theSystem, String theUnits) {
myLow = new QuantityDt(theComparator, theValue, theSystem, theUnits);
return this;
}
/**
* Sets the value for <b>low</b> (Low limit)
*
* <p>
* <b>Definition:</b>
* The low limit. The boundary is inclusive.
* </p>
*/
public RangeDt setLow( double theValue) {
myLow = new QuantityDt(theValue);
return this;
}
/**
* Sets the value for <b>low</b> (Low limit)
*
* <p>
* <b>Definition:</b>
* The low limit. The boundary is inclusive.
* </p>
*/
public RangeDt setLow( long theValue) {
myLow = new QuantityDt(theValue);
return this;
}
/**
* Gets the value(s) for <b>high</b> (High limit).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The high limit. The boundary is inclusive.
* </p>
*/
public QuantityDt getHigh() {
if (myHigh == null) {
myHigh = new QuantityDt();
}
return myHigh;
}
/**
* Sets the value(s) for <b>high</b> (High limit)
*
* <p>
* <b>Definition:</b>
* The high limit. The boundary is inclusive.
* </p>
*/
public RangeDt setHigh(QuantityDt theValue) {
myHigh = theValue;
return this;
}
/**
* Sets the value for <b>high</b> (High limit)
*
* <p>
* <b>Definition:</b>
* The high limit. The boundary is inclusive.
* </p>
*/
public RangeDt setHigh( QuantityCompararatorEnum theComparator, double theValue, String theUnits) {
myHigh = new QuantityDt(theComparator, theValue, theUnits);
return this;
}
/**
* Sets the value for <b>high</b> (High limit)
*
* <p>
* <b>Definition:</b>
* The high limit. The boundary is inclusive.
* </p>
*/
public RangeDt setHigh( QuantityCompararatorEnum theComparator, long theValue, String theUnits) {
myHigh = new QuantityDt(theComparator, theValue, theUnits);
return this;
}
/**
* Sets the value for <b>high</b> (High limit)
*
* <p>
* <b>Definition:</b>
* The high limit. The boundary is inclusive.
* </p>
*/
public RangeDt setHigh( QuantityCompararatorEnum theComparator, double theValue, String theSystem, String theUnits) {
myHigh = new QuantityDt(theComparator, theValue, theSystem, theUnits);
return this;
}
/**
* Sets the value for <b>high</b> (High limit)
*
* <p>
* <b>Definition:</b>
* The high limit. The boundary is inclusive.
* </p>
*/
public RangeDt setHigh( QuantityCompararatorEnum theComparator, long theValue, String theSystem, String theUnits) {
myHigh = new QuantityDt(theComparator, theValue, theSystem, theUnits);
return this;
}
/**
* Sets the value for <b>high</b> (High limit)
*
* <p>
* <b>Definition:</b>
* The high limit. The boundary is inclusive.
* </p>
*/
public RangeDt setHigh( double theValue) {
myHigh = new QuantityDt(theValue);
return this;
}
/**
* Sets the value for <b>high</b> (High limit)
*
* <p>
* <b>Definition:</b>
* The high limit. The boundary is inclusive.
* </p>
*/
public RangeDt setHigh( long theValue) {
myHigh = new QuantityDt(theValue);
return this;
}
}

View File

@ -1,321 +0,0 @@
package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import java.util.List;
import ca.uhn.fhir.model.api.BaseIdentifiableElement;
import ca.uhn.fhir.model.api.ICompositeDatatype;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum;
/**
* HAPI/FHIR <b>RatioDt</b> Datatype
* (A ratio of two Quantity values - a numerator and a denominator)
*
* <p>
* <b>Definition:</b>
* A relationship of two Quantity values - expressed as a numerator and a denominator.
* </p>
*
* <p>
* <b>Requirements:</b>
* Need to able to capture ratios for some measurements (titers) and some rates (costs)
* </p>
*/
@DatatypeDef(name="RatioDt")
public class RatioDt
extends BaseIdentifiableElement implements ICompositeDatatype
{
/**
* Constructor
*/
public RatioDt() {
// nothing
}
@Child(name="numerator", type=QuantityDt.class, order=0, min=0, max=1)
@Description(
shortDefinition="Numerator value",
formalDefinition="The value of the numerator"
)
private QuantityDt myNumerator;
@Child(name="denominator", type=QuantityDt.class, order=1, min=0, max=1)
@Description(
shortDefinition="Denominator value",
formalDefinition="The value of the denominator"
)
private QuantityDt myDenominator;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myNumerator, myDenominator);
}
@Override
public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myNumerator, myDenominator);
}
/**
* Gets the value(s) for <b>numerator</b> (Numerator value).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The value of the numerator
* </p>
*/
public QuantityDt getNumerator() {
if (myNumerator == null) {
myNumerator = new QuantityDt();
}
return myNumerator;
}
/**
* Sets the value(s) for <b>numerator</b> (Numerator value)
*
* <p>
* <b>Definition:</b>
* The value of the numerator
* </p>
*/
public RatioDt setNumerator(QuantityDt theValue) {
myNumerator = theValue;
return this;
}
/**
* Sets the value for <b>numerator</b> (Numerator value)
*
* <p>
* <b>Definition:</b>
* The value of the numerator
* </p>
*/
public RatioDt setNumerator( QuantityCompararatorEnum theComparator, double theValue, String theUnits) {
myNumerator = new QuantityDt(theComparator, theValue, theUnits);
return this;
}
/**
* Sets the value for <b>numerator</b> (Numerator value)
*
* <p>
* <b>Definition:</b>
* The value of the numerator
* </p>
*/
public RatioDt setNumerator( QuantityCompararatorEnum theComparator, long theValue, String theUnits) {
myNumerator = new QuantityDt(theComparator, theValue, theUnits);
return this;
}
/**
* Sets the value for <b>numerator</b> (Numerator value)
*
* <p>
* <b>Definition:</b>
* The value of the numerator
* </p>
*/
public RatioDt setNumerator( QuantityCompararatorEnum theComparator, double theValue, String theSystem, String theUnits) {
myNumerator = new QuantityDt(theComparator, theValue, theSystem, theUnits);
return this;
}
/**
* Sets the value for <b>numerator</b> (Numerator value)
*
* <p>
* <b>Definition:</b>
* The value of the numerator
* </p>
*/
public RatioDt setNumerator( QuantityCompararatorEnum theComparator, long theValue, String theSystem, String theUnits) {
myNumerator = new QuantityDt(theComparator, theValue, theSystem, theUnits);
return this;
}
/**
* Sets the value for <b>numerator</b> (Numerator value)
*
* <p>
* <b>Definition:</b>
* The value of the numerator
* </p>
*/
public RatioDt setNumerator( double theValue) {
myNumerator = new QuantityDt(theValue);
return this;
}
/**
* Sets the value for <b>numerator</b> (Numerator value)
*
* <p>
* <b>Definition:</b>
* The value of the numerator
* </p>
*/
public RatioDt setNumerator( long theValue) {
myNumerator = new QuantityDt(theValue);
return this;
}
/**
* Gets the value(s) for <b>denominator</b> (Denominator value).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The value of the denominator
* </p>
*/
public QuantityDt getDenominator() {
if (myDenominator == null) {
myDenominator = new QuantityDt();
}
return myDenominator;
}
/**
* Sets the value(s) for <b>denominator</b> (Denominator value)
*
* <p>
* <b>Definition:</b>
* The value of the denominator
* </p>
*/
public RatioDt setDenominator(QuantityDt theValue) {
myDenominator = theValue;
return this;
}
/**
* Sets the value for <b>denominator</b> (Denominator value)
*
* <p>
* <b>Definition:</b>
* The value of the denominator
* </p>
*/
public RatioDt setDenominator( QuantityCompararatorEnum theComparator, double theValue, String theUnits) {
myDenominator = new QuantityDt(theComparator, theValue, theUnits);
return this;
}
/**
* Sets the value for <b>denominator</b> (Denominator value)
*
* <p>
* <b>Definition:</b>
* The value of the denominator
* </p>
*/
public RatioDt setDenominator( QuantityCompararatorEnum theComparator, long theValue, String theUnits) {
myDenominator = new QuantityDt(theComparator, theValue, theUnits);
return this;
}
/**
* Sets the value for <b>denominator</b> (Denominator value)
*
* <p>
* <b>Definition:</b>
* The value of the denominator
* </p>
*/
public RatioDt setDenominator( QuantityCompararatorEnum theComparator, double theValue, String theSystem, String theUnits) {
myDenominator = new QuantityDt(theComparator, theValue, theSystem, theUnits);
return this;
}
/**
* Sets the value for <b>denominator</b> (Denominator value)
*
* <p>
* <b>Definition:</b>
* The value of the denominator
* </p>
*/
public RatioDt setDenominator( QuantityCompararatorEnum theComparator, long theValue, String theSystem, String theUnits) {
myDenominator = new QuantityDt(theComparator, theValue, theSystem, theUnits);
return this;
}
/**
* Sets the value for <b>denominator</b> (Denominator value)
*
* <p>
* <b>Definition:</b>
* The value of the denominator
* </p>
*/
public RatioDt setDenominator( double theValue) {
myDenominator = new QuantityDt(theValue);
return this;
}
/**
* Sets the value for <b>denominator</b> (Denominator value)
*
* <p>
* <b>Definition:</b>
* The value of the denominator
* </p>
*/
public RatioDt setDenominator( long theValue) {
myDenominator = new QuantityDt(theValue);
return this;
}
}

View File

@ -1,230 +0,0 @@
package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import java.util.List;
import ca.uhn.fhir.model.api.ICompositeDatatype;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.model.base.composite.BaseResourceReferenceDt;
import ca.uhn.fhir.model.primitive.IdDt;
import ca.uhn.fhir.model.primitive.StringDt;
/**
* HAPI/FHIR <b>ResourceReferenceDt</b> Datatype
* (A reference from one resource to another)
*
* <p>
* <b>Definition:</b>
* A reference from one resource to another
* </p>
*
* <p>
* <b>Requirements:</b>
*
* </p>
*/
@DatatypeDef(name="ResourceReferenceDt")
public class ResourceReferenceDt
extends BaseResourceReferenceDt implements ICompositeDatatype
{
/**
* Constructor
*/
public ResourceReferenceDt() {
// nothing
}
/**
* Constructor which creates a resource reference containing the actual resource in question.
* <p>
* <b> When using this in a server:</b> Generally if this is serialized, it will be serialized as a contained
* resource, so this should not be used if the intent is not to actually supply the referenced resource. This is not
* a hard-and-fast rule however, as the server can be configured to not serialized this resource, or to load an ID
* and contain even if this constructor is not used.
* </p>
*
* @param theResource
* The resource instance
*/
public ResourceReferenceDt(IResource theResource) {
super(theResource);
}
/**
* Constructor which accepts a reference directly (this can be an ID, a partial/relative URL or a complete/absolute
* URL)
*
* @param theId
* The reference itself
*/
public ResourceReferenceDt(String theId) {
setReference(new IdDt(theId));
}
/**
* Constructor which accepts a reference directly (this can be an ID, a partial/relative URL or a complete/absolute
* URL)
*
* @param theId
* The reference itself
*/
public ResourceReferenceDt(IdDt theResourceId) {
setReference(theResourceId);
}
@Child(name="reference", type=IdDt.class, order=0, min=0, max=1)
@Description(
shortDefinition="Relative, internal or absolute URL reference",
formalDefinition="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"
)
private IdDt myReference;
@Child(name="display", type=StringDt.class, order=1, min=0, max=1)
@Description(
shortDefinition="Text alternative for the resource",
formalDefinition="Plain text narrative that identifies the resource in addition to the resource reference"
)
private StringDt myDisplay;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myReference, myDisplay);
}
@Override
public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myReference, myDisplay);
}
/**
* Gets the value(s) for <b>reference</b> (Relative, internal or absolute URL reference).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* 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
* </p>
*/
public IdDt getReference() {
if (myReference == null) {
myReference = new IdDt();
}
return myReference;
}
/**
* Sets the value(s) for <b>reference</b> (Relative, internal or absolute URL reference)
*
* <p>
* <b>Definition:</b>
* 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
* </p>
*/
public ResourceReferenceDt setReference(IdDt theValue) {
myReference = theValue;
return this;
}
/**
* Sets the value for <b>reference</b> (Relative, internal or absolute URL reference)
*
* <p>
* <b>Definition:</b>
* 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
* </p>
*/
public ResourceReferenceDt setReference( String theId) {
myReference = new IdDt(theId);
return this;
}
/**
* Gets the value(s) for <b>display</b> (Text alternative for the resource).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Plain text narrative that identifies the resource in addition to the resource reference
* </p>
*/
public StringDt getDisplay() {
if (myDisplay == null) {
myDisplay = new StringDt();
}
return myDisplay;
}
/**
* Sets the value(s) for <b>display</b> (Text alternative for the resource)
*
* <p>
* <b>Definition:</b>
* Plain text narrative that identifies the resource in addition to the resource reference
* </p>
*/
public ResourceReferenceDt setDisplay(StringDt theValue) {
myDisplay = theValue;
return this;
}
/**
* Sets the value for <b>display</b> (Text alternative for the resource)
*
* <p>
* <b>Definition:</b>
* Plain text narrative that identifies the resource in addition to the resource reference
* </p>
*/
public ResourceReferenceDt setDisplay( String theString) {
myDisplay = new StringDt(theString);
return this;
}
}

View File

@ -1,618 +0,0 @@
package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import java.util.List;
import ca.uhn.fhir.model.api.BaseIdentifiableElement;
import ca.uhn.fhir.model.api.ICompositeDatatype;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.model.dstu.valueset.QuantityCompararatorEnum;
import ca.uhn.fhir.model.primitive.DecimalDt;
import ca.uhn.fhir.model.primitive.IntegerDt;
import ca.uhn.fhir.model.primitive.StringDt;
/**
* HAPI/FHIR <b>SampledDataDt</b> Datatype
* (A series of measurements taken by a device)
*
* <p>
* <b>Definition:</b>
* A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data
* </p>
*
* <p>
* <b>Requirements:</b>
* There is a need for a concise way to handle the data produced by devices that sample a physical state at a high frequency
* </p>
*/
@DatatypeDef(name="SampledDataDt")
public class SampledDataDt
extends BaseIdentifiableElement implements ICompositeDatatype
{
/**
* Constructor
*/
public SampledDataDt() {
// nothing
}
@Child(name="origin", type=QuantityDt.class, order=0, min=1, max=1)
@Description(
shortDefinition="Zero value and units",
formalDefinition="The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series"
)
private QuantityDt myOrigin;
@Child(name="period", type=DecimalDt.class, order=1, min=1, max=1)
@Description(
shortDefinition="Number of milliseconds between samples",
formalDefinition="The length of time between sampling times, measured in milliseconds"
)
private DecimalDt myPeriod;
@Child(name="factor", type=DecimalDt.class, order=2, min=0, max=1)
@Description(
shortDefinition="Multiply data by this before adding to origin",
formalDefinition="A correction factor that is applied to the sampled data points before they are added to the origin"
)
private DecimalDt myFactor;
@Child(name="lowerLimit", type=DecimalDt.class, order=3, min=0, max=1)
@Description(
shortDefinition="Lower limit of detection",
formalDefinition="The lower limit of detection of the measured points. This is needed if any of the data points have the value \"L\" (lower than detection limit)"
)
private DecimalDt myLowerLimit;
@Child(name="upperLimit", type=DecimalDt.class, order=4, min=0, max=1)
@Description(
shortDefinition="Upper limit of detection",
formalDefinition="The upper limit of detection of the measured points. This is needed if any of the data points have the value \"U\" (higher than detection limit)"
)
private DecimalDt myUpperLimit;
@Child(name="dimensions", type=IntegerDt.class, order=5, min=1, max=1)
@Description(
shortDefinition="Number of sample points at each time point",
formalDefinition="The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once"
)
private IntegerDt myDimensions;
@Child(name="data", type=StringDt.class, order=6, min=1, max=1)
@Description(
shortDefinition="Decimal values with spaces, or \"E\" | \"U\" | \"L\"",
formalDefinition="A series of data points which are decimal values separated by a single space (character u20). The special values \"E\" (error), \"L\" (below detection limit) and \"U\" (above detection limit) can also be used in place of a decimal value"
)
private StringDt myData;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myOrigin, myPeriod, myFactor, myLowerLimit, myUpperLimit, myDimensions, myData);
}
@Override
public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myOrigin, myPeriod, myFactor, myLowerLimit, myUpperLimit, myDimensions, myData);
}
/**
* Gets the value(s) for <b>origin</b> (Zero value and units).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series
* </p>
*/
public QuantityDt getOrigin() {
if (myOrigin == null) {
myOrigin = new QuantityDt();
}
return myOrigin;
}
/**
* Sets the value(s) for <b>origin</b> (Zero value and units)
*
* <p>
* <b>Definition:</b>
* The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series
* </p>
*/
public SampledDataDt setOrigin(QuantityDt theValue) {
myOrigin = theValue;
return this;
}
/**
* Sets the value for <b>origin</b> (Zero value and units)
*
* <p>
* <b>Definition:</b>
* The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series
* </p>
*/
public SampledDataDt setOrigin( QuantityCompararatorEnum theComparator, double theValue, String theUnits) {
myOrigin = new QuantityDt(theComparator, theValue, theUnits);
return this;
}
/**
* Sets the value for <b>origin</b> (Zero value and units)
*
* <p>
* <b>Definition:</b>
* The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series
* </p>
*/
public SampledDataDt setOrigin( QuantityCompararatorEnum theComparator, long theValue, String theUnits) {
myOrigin = new QuantityDt(theComparator, theValue, theUnits);
return this;
}
/**
* Sets the value for <b>origin</b> (Zero value and units)
*
* <p>
* <b>Definition:</b>
* The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series
* </p>
*/
public SampledDataDt setOrigin( QuantityCompararatorEnum theComparator, double theValue, String theSystem, String theUnits) {
myOrigin = new QuantityDt(theComparator, theValue, theSystem, theUnits);
return this;
}
/**
* Sets the value for <b>origin</b> (Zero value and units)
*
* <p>
* <b>Definition:</b>
* The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series
* </p>
*/
public SampledDataDt setOrigin( QuantityCompararatorEnum theComparator, long theValue, String theSystem, String theUnits) {
myOrigin = new QuantityDt(theComparator, theValue, theSystem, theUnits);
return this;
}
/**
* Sets the value for <b>origin</b> (Zero value and units)
*
* <p>
* <b>Definition:</b>
* The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series
* </p>
*/
public SampledDataDt setOrigin( double theValue) {
myOrigin = new QuantityDt(theValue);
return this;
}
/**
* Sets the value for <b>origin</b> (Zero value and units)
*
* <p>
* <b>Definition:</b>
* The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series
* </p>
*/
public SampledDataDt setOrigin( long theValue) {
myOrigin = new QuantityDt(theValue);
return this;
}
/**
* Gets the value(s) for <b>period</b> (Number of milliseconds between samples).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The length of time between sampling times, measured in milliseconds
* </p>
*/
public DecimalDt getPeriod() {
if (myPeriod == null) {
myPeriod = new DecimalDt();
}
return myPeriod;
}
/**
* Sets the value(s) for <b>period</b> (Number of milliseconds between samples)
*
* <p>
* <b>Definition:</b>
* The length of time between sampling times, measured in milliseconds
* </p>
*/
public SampledDataDt setPeriod(DecimalDt theValue) {
myPeriod = theValue;
return this;
}
/**
* Sets the value for <b>period</b> (Number of milliseconds between samples)
*
* <p>
* <b>Definition:</b>
* The length of time between sampling times, measured in milliseconds
* </p>
*/
public SampledDataDt setPeriod( long theValue) {
myPeriod = new DecimalDt(theValue);
return this;
}
/**
* Sets the value for <b>period</b> (Number of milliseconds between samples)
*
* <p>
* <b>Definition:</b>
* The length of time between sampling times, measured in milliseconds
* </p>
*/
public SampledDataDt setPeriod( double theValue) {
myPeriod = new DecimalDt(theValue);
return this;
}
/**
* Sets the value for <b>period</b> (Number of milliseconds between samples)
*
* <p>
* <b>Definition:</b>
* The length of time between sampling times, measured in milliseconds
* </p>
*/
public SampledDataDt setPeriod( java.math.BigDecimal theValue) {
myPeriod = new DecimalDt(theValue);
return this;
}
/**
* Gets the value(s) for <b>factor</b> (Multiply data by this before adding to origin).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* A correction factor that is applied to the sampled data points before they are added to the origin
* </p>
*/
public DecimalDt getFactor() {
if (myFactor == null) {
myFactor = new DecimalDt();
}
return myFactor;
}
/**
* Sets the value(s) for <b>factor</b> (Multiply data by this before adding to origin)
*
* <p>
* <b>Definition:</b>
* A correction factor that is applied to the sampled data points before they are added to the origin
* </p>
*/
public SampledDataDt setFactor(DecimalDt theValue) {
myFactor = theValue;
return this;
}
/**
* Sets the value for <b>factor</b> (Multiply data by this before adding to origin)
*
* <p>
* <b>Definition:</b>
* A correction factor that is applied to the sampled data points before they are added to the origin
* </p>
*/
public SampledDataDt setFactor( long theValue) {
myFactor = new DecimalDt(theValue);
return this;
}
/**
* Sets the value for <b>factor</b> (Multiply data by this before adding to origin)
*
* <p>
* <b>Definition:</b>
* A correction factor that is applied to the sampled data points before they are added to the origin
* </p>
*/
public SampledDataDt setFactor( double theValue) {
myFactor = new DecimalDt(theValue);
return this;
}
/**
* Sets the value for <b>factor</b> (Multiply data by this before adding to origin)
*
* <p>
* <b>Definition:</b>
* A correction factor that is applied to the sampled data points before they are added to the origin
* </p>
*/
public SampledDataDt setFactor( java.math.BigDecimal theValue) {
myFactor = new DecimalDt(theValue);
return this;
}
/**
* Gets the value(s) for <b>lowerLimit</b> (Lower limit of detection).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The lower limit of detection of the measured points. This is needed if any of the data points have the value \"L\" (lower than detection limit)
* </p>
*/
public DecimalDt getLowerLimit() {
if (myLowerLimit == null) {
myLowerLimit = new DecimalDt();
}
return myLowerLimit;
}
/**
* Sets the value(s) for <b>lowerLimit</b> (Lower limit of detection)
*
* <p>
* <b>Definition:</b>
* The lower limit of detection of the measured points. This is needed if any of the data points have the value \"L\" (lower than detection limit)
* </p>
*/
public SampledDataDt setLowerLimit(DecimalDt theValue) {
myLowerLimit = theValue;
return this;
}
/**
* Sets the value for <b>lowerLimit</b> (Lower limit of detection)
*
* <p>
* <b>Definition:</b>
* The lower limit of detection of the measured points. This is needed if any of the data points have the value \"L\" (lower than detection limit)
* </p>
*/
public SampledDataDt setLowerLimit( long theValue) {
myLowerLimit = new DecimalDt(theValue);
return this;
}
/**
* Sets the value for <b>lowerLimit</b> (Lower limit of detection)
*
* <p>
* <b>Definition:</b>
* The lower limit of detection of the measured points. This is needed if any of the data points have the value \"L\" (lower than detection limit)
* </p>
*/
public SampledDataDt setLowerLimit( double theValue) {
myLowerLimit = new DecimalDt(theValue);
return this;
}
/**
* Sets the value for <b>lowerLimit</b> (Lower limit of detection)
*
* <p>
* <b>Definition:</b>
* The lower limit of detection of the measured points. This is needed if any of the data points have the value \"L\" (lower than detection limit)
* </p>
*/
public SampledDataDt setLowerLimit( java.math.BigDecimal theValue) {
myLowerLimit = new DecimalDt(theValue);
return this;
}
/**
* Gets the value(s) for <b>upperLimit</b> (Upper limit of detection).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The upper limit of detection of the measured points. This is needed if any of the data points have the value \"U\" (higher than detection limit)
* </p>
*/
public DecimalDt getUpperLimit() {
if (myUpperLimit == null) {
myUpperLimit = new DecimalDt();
}
return myUpperLimit;
}
/**
* Sets the value(s) for <b>upperLimit</b> (Upper limit of detection)
*
* <p>
* <b>Definition:</b>
* The upper limit of detection of the measured points. This is needed if any of the data points have the value \"U\" (higher than detection limit)
* </p>
*/
public SampledDataDt setUpperLimit(DecimalDt theValue) {
myUpperLimit = theValue;
return this;
}
/**
* Sets the value for <b>upperLimit</b> (Upper limit of detection)
*
* <p>
* <b>Definition:</b>
* The upper limit of detection of the measured points. This is needed if any of the data points have the value \"U\" (higher than detection limit)
* </p>
*/
public SampledDataDt setUpperLimit( long theValue) {
myUpperLimit = new DecimalDt(theValue);
return this;
}
/**
* Sets the value for <b>upperLimit</b> (Upper limit of detection)
*
* <p>
* <b>Definition:</b>
* The upper limit of detection of the measured points. This is needed if any of the data points have the value \"U\" (higher than detection limit)
* </p>
*/
public SampledDataDt setUpperLimit( double theValue) {
myUpperLimit = new DecimalDt(theValue);
return this;
}
/**
* Sets the value for <b>upperLimit</b> (Upper limit of detection)
*
* <p>
* <b>Definition:</b>
* The upper limit of detection of the measured points. This is needed if any of the data points have the value \"U\" (higher than detection limit)
* </p>
*/
public SampledDataDt setUpperLimit( java.math.BigDecimal theValue) {
myUpperLimit = new DecimalDt(theValue);
return this;
}
/**
* Gets the value(s) for <b>dimensions</b> (Number of sample points at each time point).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once
* </p>
*/
public IntegerDt getDimensions() {
if (myDimensions == null) {
myDimensions = new IntegerDt();
}
return myDimensions;
}
/**
* Sets the value(s) for <b>dimensions</b> (Number of sample points at each time point)
*
* <p>
* <b>Definition:</b>
* The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once
* </p>
*/
public SampledDataDt setDimensions(IntegerDt theValue) {
myDimensions = theValue;
return this;
}
/**
* Sets the value for <b>dimensions</b> (Number of sample points at each time point)
*
* <p>
* <b>Definition:</b>
* The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once
* </p>
*/
public SampledDataDt setDimensions( int theInteger) {
myDimensions = new IntegerDt(theInteger);
return this;
}
/**
* Gets the value(s) for <b>data</b> (Decimal values with spaces, or \"E\" | \"U\" | \"L\").
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* A series of data points which are decimal values separated by a single space (character u20). The special values \"E\" (error), \"L\" (below detection limit) and \"U\" (above detection limit) can also be used in place of a decimal value
* </p>
*/
public StringDt getData() {
if (myData == null) {
myData = new StringDt();
}
return myData;
}
/**
* Sets the value(s) for <b>data</b> (Decimal values with spaces, or \"E\" | \"U\" | \"L\")
*
* <p>
* <b>Definition:</b>
* A series of data points which are decimal values separated by a single space (character u20). The special values \"E\" (error), \"L\" (below detection limit) and \"U\" (above detection limit) can also be used in place of a decimal value
* </p>
*/
public SampledDataDt setData(StringDt theValue) {
myData = theValue;
return this;
}
/**
* Sets the value for <b>data</b> (Decimal values with spaces, or \"E\" | \"U\" | \"L\")
*
* <p>
* <b>Definition:</b>
* A series of data points which are decimal values separated by a single space (character u20). The special values \"E\" (error), \"L\" (below detection limit) and \"U\" (above detection limit) can also be used in place of a decimal value
* </p>
*/
public SampledDataDt setData( String theString) {
myData = new StringDt(theString);
return this;
}
}

View File

@ -1,575 +0,0 @@
package ca.uhn.fhir.model.dstu.composite;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import java.util.Date;
import java.util.List;
import ca.uhn.fhir.model.api.BaseIdentifiableElement;
import ca.uhn.fhir.model.api.ICompositeDatatype;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResourceBlock;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.Block;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.model.dstu.valueset.EventTimingEnum;
import ca.uhn.fhir.model.dstu.valueset.UnitsOfTimeEnum;
import ca.uhn.fhir.model.primitive.BoundCodeDt;
import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.DateTimeDt;
import ca.uhn.fhir.model.primitive.DecimalDt;
import ca.uhn.fhir.model.primitive.IntegerDt;
/**
* HAPI/FHIR <b>ScheduleDt</b> Datatype
* (A schedule that specifies an event that may occur multiple times)
*
* <p>
* <b>Definition:</b>
* Specifies an event that may occur multiple times. Schedules are used for to reord when things are expected or requested to occur.
* </p>
*
* <p>
* <b>Requirements:</b>
* Need to able to track schedules. There are several different ways to do scheduling: one or more specified times, a simple rules like three times a day, or before/after meals
* </p>
*/
@DatatypeDef(name="ScheduleDt")
public class ScheduleDt
extends BaseIdentifiableElement implements ICompositeDatatype
{
/**
* Constructor
*/
public ScheduleDt() {
// nothing
}
@Child(name="event", type=PeriodDt.class, order=0, min=0, max=Child.MAX_UNLIMITED)
@Description(
shortDefinition="When the event occurs",
formalDefinition="Identifies specific time periods when the event should occur"
)
private java.util.List<PeriodDt> myEvent;
@Child(name="repeat", order=1, min=0, max=1)
@Description(
shortDefinition="Only if there is none or one event",
formalDefinition="Identifies a repeating pattern to the intended time periods."
)
private Repeat myRepeat;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myEvent, myRepeat);
}
@Override
public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myEvent, myRepeat);
}
/**
* Gets the value(s) for <b>event</b> (When the event occurs).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Identifies specific time periods when the event should occur
* </p>
*/
public java.util.List<PeriodDt> getEvent() {
if (myEvent == null) {
myEvent = new java.util.ArrayList<PeriodDt>();
}
return myEvent;
}
/**
* Sets the value(s) for <b>event</b> (When the event occurs)
*
* <p>
* <b>Definition:</b>
* Identifies specific time periods when the event should occur
* </p>
*/
public ScheduleDt setEvent(java.util.List<PeriodDt> theValue) {
myEvent = theValue;
return this;
}
/**
* Adds and returns a new value for <b>event</b> (When the event occurs)
*
* <p>
* <b>Definition:</b>
* Identifies specific time periods when the event should occur
* </p>
*/
public PeriodDt addEvent() {
PeriodDt newType = new PeriodDt();
getEvent().add(newType);
return newType;
}
/**
* Gets the first repetition for <b>event</b> (When the event occurs),
* creating it if it does not already exist.
*
* <p>
* <b>Definition:</b>
* Identifies specific time periods when the event should occur
* </p>
*/
public PeriodDt getEventFirstRep() {
if (getEvent().isEmpty()) {
return addEvent();
}
return getEvent().get(0);
}
/**
* Gets the value(s) for <b>repeat</b> (Only if there is none or one event).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Identifies a repeating pattern to the intended time periods.
* </p>
*/
public Repeat getRepeat() {
if (myRepeat == null) {
myRepeat = new Repeat();
}
return myRepeat;
}
/**
* Sets the value(s) for <b>repeat</b> (Only if there is none or one event)
*
* <p>
* <b>Definition:</b>
* Identifies a repeating pattern to the intended time periods.
* </p>
*/
public ScheduleDt setRepeat(Repeat theValue) {
myRepeat = theValue;
return this;
}
/**
* Block class for child element: <b>Schedule.repeat</b> (Only if there is none or one event)
*
* <p>
* <b>Definition:</b>
* Identifies a repeating pattern to the intended time periods.
* </p>
*/
@Block()
public static class Repeat extends BaseIdentifiableElement implements IResourceBlock {
@Child(name="frequency", type=IntegerDt.class, order=0, min=0, max=1)
@Description(
shortDefinition="Event occurs frequency times per duration",
formalDefinition="Indicates how often the event should occur."
)
private IntegerDt myFrequency;
@Child(name="when", type=CodeDt.class, order=1, min=0, max=1)
@Description(
shortDefinition="HS | WAKE | AC | ACM | ACD | ACV | PC | PCM | PCD | PCV - common life events",
formalDefinition="Identifies the occurrence of daily life that determines timing"
)
private BoundCodeDt<EventTimingEnum> myWhen;
@Child(name="duration", type=DecimalDt.class, order=2, min=1, max=1)
@Description(
shortDefinition="Repeating or event-related duration",
formalDefinition="How long each repetition should last"
)
private DecimalDt myDuration;
@Child(name="units", type=CodeDt.class, order=3, min=1, max=1)
@Description(
shortDefinition="s | min | h | d | wk | mo | a - unit of time (UCUM)",
formalDefinition="The units of time for the duration"
)
private BoundCodeDt<UnitsOfTimeEnum> myUnits;
@Child(name="count", type=IntegerDt.class, order=4, min=0, max=1)
@Description(
shortDefinition="Number of times to repeat",
formalDefinition="A total count of the desired number of repetitions"
)
private IntegerDt myCount;
@Child(name="end", type=DateTimeDt.class, order=5, min=0, max=1)
@Description(
shortDefinition="When to stop repeats",
formalDefinition="When to stop repeating the schedule"
)
private DateTimeDt myEnd;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myFrequency, myWhen, myDuration, myUnits, myCount, myEnd);
}
@Override
public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) {
return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myFrequency, myWhen, myDuration, myUnits, myCount, myEnd);
}
/**
* Gets the value(s) for <b>frequency</b> (Event occurs frequency times per duration).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Indicates how often the event should occur.
* </p>
*/
public IntegerDt getFrequency() {
if (myFrequency == null) {
myFrequency = new IntegerDt();
}
return myFrequency;
}
/**
* Sets the value(s) for <b>frequency</b> (Event occurs frequency times per duration)
*
* <p>
* <b>Definition:</b>
* Indicates how often the event should occur.
* </p>
*/
public Repeat setFrequency(IntegerDt theValue) {
myFrequency = theValue;
return this;
}
/**
* Sets the value for <b>frequency</b> (Event occurs frequency times per duration)
*
* <p>
* <b>Definition:</b>
* Indicates how often the event should occur.
* </p>
*/
public Repeat setFrequency( int theInteger) {
myFrequency = new IntegerDt(theInteger);
return this;
}
/**
* Gets the value(s) for <b>when</b> (HS | WAKE | AC | ACM | ACD | ACV | PC | PCM | PCD | PCV - common life events).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* Identifies the occurrence of daily life that determines timing
* </p>
*/
public BoundCodeDt<EventTimingEnum> getWhen() {
if (myWhen == null) {
myWhen = new BoundCodeDt<EventTimingEnum>(EventTimingEnum.VALUESET_BINDER);
}
return myWhen;
}
/**
* Sets the value(s) for <b>when</b> (HS | WAKE | AC | ACM | ACD | ACV | PC | PCM | PCD | PCV - common life events)
*
* <p>
* <b>Definition:</b>
* Identifies the occurrence of daily life that determines timing
* </p>
*/
public Repeat setWhen(BoundCodeDt<EventTimingEnum> theValue) {
myWhen = theValue;
return this;
}
/**
* Sets the value(s) for <b>when</b> (HS | WAKE | AC | ACM | ACD | ACV | PC | PCM | PCD | PCV - common life events)
*
* <p>
* <b>Definition:</b>
* Identifies the occurrence of daily life that determines timing
* </p>
*/
public Repeat setWhen(EventTimingEnum theValue) {
getWhen().setValueAsEnum(theValue);
return this;
}
/**
* Gets the value(s) for <b>duration</b> (Repeating or event-related duration).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* How long each repetition should last
* </p>
*/
public DecimalDt getDuration() {
if (myDuration == null) {
myDuration = new DecimalDt();
}
return myDuration;
}
/**
* Sets the value(s) for <b>duration</b> (Repeating or event-related duration)
*
* <p>
* <b>Definition:</b>
* How long each repetition should last
* </p>
*/
public Repeat setDuration(DecimalDt theValue) {
myDuration = theValue;
return this;
}
/**
* Sets the value for <b>duration</b> (Repeating or event-related duration)
*
* <p>
* <b>Definition:</b>
* How long each repetition should last
* </p>
*/
public Repeat setDuration( long theValue) {
myDuration = new DecimalDt(theValue);
return this;
}
/**
* Sets the value for <b>duration</b> (Repeating or event-related duration)
*
* <p>
* <b>Definition:</b>
* How long each repetition should last
* </p>
*/
public Repeat setDuration( double theValue) {
myDuration = new DecimalDt(theValue);
return this;
}
/**
* Sets the value for <b>duration</b> (Repeating or event-related duration)
*
* <p>
* <b>Definition:</b>
* How long each repetition should last
* </p>
*/
public Repeat setDuration( java.math.BigDecimal theValue) {
myDuration = new DecimalDt(theValue);
return this;
}
/**
* Gets the value(s) for <b>units</b> (s | min | h | d | wk | mo | a - unit of time (UCUM)).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* The units of time for the duration
* </p>
*/
public BoundCodeDt<UnitsOfTimeEnum> getUnits() {
if (myUnits == null) {
myUnits = new BoundCodeDt<UnitsOfTimeEnum>(UnitsOfTimeEnum.VALUESET_BINDER);
}
return myUnits;
}
/**
* Sets the value(s) for <b>units</b> (s | min | h | d | wk | mo | a - unit of time (UCUM))
*
* <p>
* <b>Definition:</b>
* The units of time for the duration
* </p>
*/
public Repeat setUnits(BoundCodeDt<UnitsOfTimeEnum> theValue) {
myUnits = theValue;
return this;
}
/**
* Sets the value(s) for <b>units</b> (s | min | h | d | wk | mo | a - unit of time (UCUM))
*
* <p>
* <b>Definition:</b>
* The units of time for the duration
* </p>
*/
public Repeat setUnits(UnitsOfTimeEnum theValue) {
getUnits().setValueAsEnum(theValue);
return this;
}
/**
* Gets the value(s) for <b>count</b> (Number of times to repeat).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* A total count of the desired number of repetitions
* </p>
*/
public IntegerDt getCount() {
if (myCount == null) {
myCount = new IntegerDt();
}
return myCount;
}
/**
* Sets the value(s) for <b>count</b> (Number of times to repeat)
*
* <p>
* <b>Definition:</b>
* A total count of the desired number of repetitions
* </p>
*/
public Repeat setCount(IntegerDt theValue) {
myCount = theValue;
return this;
}
/**
* Sets the value for <b>count</b> (Number of times to repeat)
*
* <p>
* <b>Definition:</b>
* A total count of the desired number of repetitions
* </p>
*/
public Repeat setCount( int theInteger) {
myCount = new IntegerDt(theInteger);
return this;
}
/**
* Gets the value(s) for <b>end</b> (When to stop repeats).
* creating it if it does
* not exist. Will not return <code>null</code>.
*
* <p>
* <b>Definition:</b>
* When to stop repeating the schedule
* </p>
*/
public DateTimeDt getEnd() {
if (myEnd == null) {
myEnd = new DateTimeDt();
}
return myEnd;
}
/**
* Sets the value(s) for <b>end</b> (When to stop repeats)
*
* <p>
* <b>Definition:</b>
* When to stop repeating the schedule
* </p>
*/
public Repeat setEnd(DateTimeDt theValue) {
myEnd = theValue;
return this;
}
/**
* Sets the value for <b>end</b> (When to stop repeats)
*
* <p>
* <b>Definition:</b>
* When to stop repeating the schedule
* </p>
*/
public Repeat setEndWithSecondsPrecision( Date theDate) {
myEnd = new DateTimeDt(theDate);
return this;
}
/**
* Sets the value for <b>end</b> (When to stop repeats)
*
* <p>
* <b>Definition:</b>
* When to stop repeating the schedule
* </p>
*/
public Repeat setEnd( Date theDate, TemporalPrecisionEnum thePrecision) {
myEnd = new DateTimeDt(theDate, thePrecision);
return this;
}
}
}

View File

@ -1,55 +0,0 @@
package ca.uhn.fhir.model.primitive;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import ca.uhn.fhir.model.api.IValueSetEnumBinder;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
@DatatypeDef(name = "code", isSpecialization = true)
public class BoundCodeDt<T extends Enum<?>> extends CodeDt {
private IValueSetEnumBinder<T> myBinder;
public BoundCodeDt(IValueSetEnumBinder<T> theBinder) {
myBinder = theBinder;
}
public BoundCodeDt(IValueSetEnumBinder<T> theBinder, T theValue) {
myBinder = theBinder;
setValueAsEnum(theValue);
}
public void setValueAsEnum(T theValue) {
if (theValue==null) {
setValue(null);
} else {
setValue(myBinder.toCodeString(theValue));
}
}
public T getValueAsEnum() {
T retVal = myBinder.fromCodeString(getValue());
if (retVal == null) {
// TODO: throw special exception type?
}
return retVal;
}
}

View File

@ -1,272 +0,0 @@
package ca.uhn.fhir.tinder;
import java.io.File;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import ca.uhn.fhir.tinder.parser.DatatypeGeneratorUsingSpreadsheet;
import ca.uhn.fhir.tinder.parser.ProfileParser;
import ca.uhn.fhir.tinder.parser.ResourceGeneratorUsingSpreadsheet;
@Mojo(name = "generate-structures", defaultPhase = LifecyclePhase.GENERATE_SOURCES)
public class TinderStructuresMojo extends AbstractMojo {
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(TinderStructuresMojo.class);
@Parameter(required = false)
private List<String> baseResourceNames;
@Parameter(required = false, defaultValue = "false")
private boolean buildDatatypes;
@Component
private MavenProject myProject;
@Parameter(alias = "package", required = true)
private String packageName;
@Parameter(alias = "version", required = true, defaultValue="dstu")
private String version = "dstu";
@Parameter(required = false)
private List<ProfileFileDefinition> resourceProfileFiles;
@Parameter(required = false)
private List<ValueSetFileDefinition> resourceValueSetFiles;
@Parameter(required = true, defaultValue = "${project.build.directory}/generated-sources/tinder")
private String targetDirectory;
@Parameter(required = true, defaultValue = "${project.build.directory}/generated-resources/tinder")
private String targetResourceDirectory;
@Parameter(required = true, defaultValue = "${project.build.directory}/..")
private String baseDir;
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
if (StringUtils.isBlank(packageName)) {
throw new MojoFailureException("Package not specified");
}
if (packageName.contains("..") || packageName.endsWith(".")) {
throw new MojoFailureException("Invalid package specified");
}
ourLog.info("Beginning HAPI-FHIR Tinder Code Generation...");
ourLog.info(" * Output Package: " + packageName);
File resDirectoryBase = new File(new File(targetResourceDirectory), packageName.replace('.', File.separatorChar));
resDirectoryBase.mkdirs();
ourLog.info(" * Output Resource Directory: " + resDirectoryBase.getAbsolutePath());
File directoryBase = new File(new File(targetDirectory), packageName.replace('.', File.separatorChar));
directoryBase.mkdirs();
ourLog.info(" * Output Source Directory: " + directoryBase.getAbsolutePath());
ValueSetGenerator vsp = new ValueSetGenerator(version);
vsp.setResourceValueSetFiles(resourceValueSetFiles);
try {
vsp.parse();
} catch (Exception e) {
throw new MojoFailureException("Failed to load valuesets", e);
}
ourLog.info("Loading Datatypes...");
Map<String, String> datatypeLocalImports = new HashMap<String, String>();
DatatypeGeneratorUsingSpreadsheet dtp = new DatatypeGeneratorUsingSpreadsheet(version, baseDir);
if (buildDatatypes) {
try {
dtp.parse();
dtp.markResourcesForImports();
} catch (Exception e) {
throw new MojoFailureException("Failed to load datatypes", e);
}
dtp.bindValueSets(vsp);
datatypeLocalImports = dtp.getLocalImports();
}
ResourceGeneratorUsingSpreadsheet rp = new ResourceGeneratorUsingSpreadsheet(version, baseDir);
if (baseResourceNames != null && baseResourceNames.size() > 0) {
ourLog.info("Loading Resources...");
try {
rp.setBaseResourceNames(baseResourceNames);
rp.parse();
rp.markResourcesForImports();
} catch (Exception e) {
throw new MojoFailureException("Failed to load resources", e);
}
rp.bindValueSets(vsp);
rp.getLocalImports().putAll(datatypeLocalImports);
datatypeLocalImports.putAll(rp.getLocalImports());
ourLog.info("Writing Resources...");
File resSubDirectoryBase = new File(directoryBase, "resource");
rp.combineContentMaps(dtp);
rp.writeAll(resSubDirectoryBase, resDirectoryBase, packageName);
}
ProfileParser pp = new ProfileParser(version, baseDir);
if (resourceProfileFiles != null) {
ourLog.info("Loading profiles...");
for (ProfileFileDefinition next : resourceProfileFiles) {
ourLog.info("Parsing file: {}", next.profileFile);
pp.parseSingleProfile(new File(next.profileFile), next.profileSourceUrl);
}
pp.bindValueSets(vsp);
pp.markResourcesForImports();
pp.getLocalImports().putAll(datatypeLocalImports);
datatypeLocalImports.putAll(pp.getLocalImports());
pp.combineContentMaps(rp);
pp.combineContentMaps(dtp);
pp.writeAll(new File(directoryBase, "resource"), resDirectoryBase, packageName);
}
if (dtp != null) {
ourLog.info("Writing Composite Datatypes...");
dtp.combineContentMaps(pp);
dtp.combineContentMaps(rp);
dtp.writeAll(new File(directoryBase, "composite"), resDirectoryBase, packageName);
}
ourLog.info("Writing ValueSet Enums...");
vsp.writeMarkedValueSets(new File(directoryBase, "valueset"), packageName);
myProject.addCompileSourceRoot(targetDirectory);
}
public List<String> getBaseResourceNames() {
return baseResourceNames;
}
public String getPackageName() {
return packageName;
}
public List<ProfileFileDefinition> getResourceProfileFiles() {
return resourceProfileFiles;
}
public List<ValueSetFileDefinition> getResourceValueSetFiles() {
return resourceValueSetFiles;
}
public String getTargetDirectory() {
return targetDirectory;
}
public boolean isBuildDatatypes() {
return buildDatatypes;
}
public void setBaseResourceNames(List<String> theBaseResourceNames) {
baseResourceNames = theBaseResourceNames;
}
public void setBuildDatatypes(boolean theBuildDatatypes) {
buildDatatypes = theBuildDatatypes;
}
public void setPackageName(String thePackageName) {
packageName = thePackageName;
}
public void setResourceProfileFiles(List<ProfileFileDefinition> theResourceProfileFiles) {
resourceProfileFiles = theResourceProfileFiles;
}
public void setResourceValueSetFiles(List<ValueSetFileDefinition> theResourceValueSetFiles) {
resourceValueSetFiles = theResourceValueSetFiles;
}
public void setTargetDirectory(String theTargetDirectory) {
targetDirectory = theTargetDirectory;
}
public static void main(String[] args) throws Exception {
// ProfileParser pp = new ProfileParser();
// pp.parseSingleProfile(new File("../hapi-tinder-test/src/test/resources/profile/patient.xml"), "http://foo");
ValueSetGenerator vsp = new ValueSetGenerator("dev");
// vsp.setResourceValueSetFiles(theResourceValueSetFiles);Directory("src/main/resources/vs/");
vsp.parse();
DatatypeGeneratorUsingSpreadsheet dtp = new DatatypeGeneratorUsingSpreadsheet("dev", ".");
dtp.parse();
dtp.markResourcesForImports();
dtp.bindValueSets(vsp);
Map<String, String> datatypeLocalImports = dtp.getLocalImports();
String dtOutputDir = "target/generated-sources/tinder/ca/uhn/fhir/model/dev/composite";
ResourceGeneratorUsingSpreadsheet rp = new ResourceGeneratorUsingSpreadsheet("dev", ".");
<<<<<<< HEAD
rp.setBaseResourceNames(Arrays.asList("referralrequest", "patient","practitioner","encounter",
=======
rp.setBaseResourceNames(Arrays.asList("conformance", "referralrequest", "patient","practitioner","encounter",
>>>>>>> d22a35788f57e9f7ce64bc8afc2ee7eaf29d94f2
"organization","location","relatedperson","appointment","slot","order","availability","device", "valueset"));
rp.parse();
rp.bindValueSets(vsp);
rp.markResourcesForImports();
// rp.bindValueSets(vsp);
String rpOutputDir = "target/generated-sources/tinder/ca/uhn/fhir/model/dev/resource";
String rpSOutputDir = "target/generated-resources/tinder/ca/uhn/fhir/model/dev";
dtp.combineContentMaps(rp);
rp.combineContentMaps(dtp);
rp.getLocalImports().putAll(datatypeLocalImports);
datatypeLocalImports.putAll(rp.getLocalImports());
dtp.writeAll(new File(dtOutputDir), null, "ca.uhn.fhir.model.dev");
rp.writeAll(new File(rpOutputDir), new File(rpSOutputDir), "ca.uhn.fhir.model.dev");
String vsOutputDir = "target/generated-sources/tinder/ca/uhn/fhir/model/dev/valueset";
vsp.writeMarkedValueSets(new File(vsOutputDir), "ca.uhn.fhir.model.dev");
}
public static class ProfileFileDefinition {
@Parameter(required = true)
private String profileFile;
@Parameter(required = true)
private String profileSourceUrl;
}
public static class ValueSetFileDefinition {
@Parameter(required = true)
private String valueSetFile;
public String getValueSetFile() {
return valueSetFile;
}
public void setValueSetFile(String theValueSetFile) {
valueSetFile = theValueSetFile;
}
}
}

View File

@ -24,6 +24,7 @@ import org.apache.velocity.app.VelocityEngine;
import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.model.api.Bundle; import ca.uhn.fhir.model.api.Bundle;
import ca.uhn.fhir.model.api.BundleEntry; import ca.uhn.fhir.model.api.BundleEntry;
import ca.uhn.fhir.model.dev.resource.ValueSet.ComposeIncludeConcept;
import ca.uhn.fhir.model.dstu.resource.ValueSet; import ca.uhn.fhir.model.dstu.resource.ValueSet;
import ca.uhn.fhir.model.dstu.resource.ValueSet.ComposeInclude; import ca.uhn.fhir.model.dstu.resource.ValueSet.ComposeInclude;
import ca.uhn.fhir.model.dstu.resource.ValueSet.Define; import ca.uhn.fhir.model.dstu.resource.ValueSet.Define;
@ -46,7 +47,7 @@ public class ValueSetGenerator {
private String myVersion; private String myVersion;
public ValueSetGenerator(String theVersion) { public ValueSetGenerator(String theVersion) {
myVersion =theVersion; myVersion = theVersion;
} }
public String getClassForValueSetIdAndMarkAsNeeded(String theId) { public String getClassForValueSetIdAndMarkAsNeeded(String theId) {
@ -64,14 +65,20 @@ public class ValueSetGenerator {
} }
public void parse() throws FileNotFoundException, IOException { public void parse() throws FileNotFoundException, IOException {
IParser newXmlParser = new FhirContext(ValueSet.class).newXmlParser(); FhirContext ctx = "dstu".equals(myVersion) ? FhirContext.forDstu1() : FhirContext.forDev();
IParser newXmlParser = ctx.newXmlParser();
ourLog.info("Parsing built-in ValueSets"); ourLog.info("Parsing built-in ValueSets");
String vs = IOUtils.toString(ValueSetGenerator.class.getResourceAsStream("/vs/" + myVersion + "/all-valuesets-bundle.xml")); String vs = IOUtils.toString(ValueSetGenerator.class.getResourceAsStream("/vs/" + myVersion + "/all-valuesets-bundle.xml"));
Bundle bundle = newXmlParser.parseBundle(vs); Bundle bundle = newXmlParser.parseBundle(vs);
for (BundleEntry next : bundle.getEntries()) { for (BundleEntry next : bundle.getEntries()) {
ValueSet nextVs = (ValueSet) next.getResource(); if ("dstu".equals(myVersion)) {
parseValueSet(nextVs); ValueSet nextVs = (ValueSet) next.getResource();
parseValueSet(nextVs);
} else {
ca.uhn.fhir.model.dev.resource.ValueSet nextVs = (ca.uhn.fhir.model.dev.resource.ValueSet) next.getResource();
parseValueSet(nextVs);
}
} }
if (myResourceValueSetFiles != null) { if (myResourceValueSetFiles != null) {
@ -145,6 +152,53 @@ public class ValueSetGenerator {
return vs; return vs;
} }
private ValueSetTm parseValueSet(ca.uhn.fhir.model.dev.resource.ValueSet nextVs) {
myConceptCount += nextVs.getDefine().getConcept().size();
ourLog.info("Parsing ValueSetTm #{} - {} - {} concepts total", myValueSetCount++, nextVs.getName(), myConceptCount);
// output.addConcept(next.getCode().getValue(),
// next.getDisplay().getValue(), next.getDefinition());
ValueSetTm vs = new ValueSetTm();
vs.setName(nextVs.getName());
vs.setDescription(nextVs.getDescription());
vs.setId(nextVs.getIdentifierElement().getValueAsString());
vs.setClassName(toClassName(nextVs.getName()));
{
ca.uhn.fhir.model.dev.resource.ValueSet.Define define = nextVs.getDefine();
String system = define.getSystemElement().getValueAsString();
for (ca.uhn.fhir.model.dev.resource.ValueSet.DefineConcept nextConcept : define.getConcept()) {
String nextCodeValue = nextConcept.getCode();
String nextCodeDisplay = StringUtils.defaultString(nextConcept.getDisplay());
String nextCodeDefinition = StringUtils.defaultString(nextConcept.getDefinition());
vs.addConcept(system, nextCodeValue, nextCodeDisplay, nextCodeDefinition);
}
}
for (ca.uhn.fhir.model.dev.resource.ValueSet.ComposeInclude nextInclude : nextVs.getCompose().getInclude()) {
String system = nextInclude.getSystemElement().getValueAsString();
for (ComposeIncludeConcept nextConcept : nextInclude.getConcept()) {
String nextCodeValue = nextConcept.getCode();
vs.addConcept(system, nextCodeValue, null, null);
}
}
if (myValueSets.containsKey(vs.getName())) {
ourLog.warn("Duplicate Name: " + vs.getName());
} else {
myValueSets.put(vs.getName(), vs);
}
// This is hackish, but deals with "Administrative Gender Codes" vs "AdministrativeGender"
if (vs.getName().endsWith(" Codes")) {
myValueSets.put(vs.getName().substring(0, vs.getName().length() - 6).replace(" ", ""), vs);
}
myValueSets.put(vs.getName().replace(" ", ""), vs);
return vs;
}
public void setResourceValueSetFiles(List<ValueSetFileDefinition> theResourceValueSetFiles) { public void setResourceValueSetFiles(List<ValueSetFileDefinition> theResourceValueSetFiles) {
myResourceValueSetFiles = theResourceValueSetFiles; myResourceValueSetFiles = theResourceValueSetFiles;
} }
@ -215,7 +269,7 @@ public class ValueSetGenerator {
public static void main(String[] args) throws FileNotFoundException, IOException { public static void main(String[] args) throws FileNotFoundException, IOException {
ValueSetGenerator p = new ValueSetGenerator("dev"); ValueSetGenerator p = new ValueSetGenerator("dev");
p.parse(); p.parse();
} }

File diff suppressed because one or more lines are too long