More client work

This commit is contained in:
jamesagnew 2014-03-07 16:23:49 -05:00
parent 9751aa15e8
commit ff28a821d4
69 changed files with 3352 additions and 278 deletions

View File

@ -4,4 +4,5 @@
* Fix XML encoder to not encode empty elements
* Add SimpleSetters for all primitive datatypes
* Implement and add Simple Getters in a similar way to simple setters
* Add support for modifierExtensions
*

View File

@ -10,6 +10,7 @@ import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.parser.IParser;
import ca.uhn.fhir.parser.XmlParser;
import ca.uhn.fhir.rest.client.IRestfulClientFactory;
import ca.uhn.fhir.rest.client.RestfulClientFactory;
public class FhirContext {
@ -37,10 +38,6 @@ public class FhirContext {
return myClassToElementDefinition;
}
public Map<String, RuntimeResourceDefinition> getNameToResourceDefinition() {
return myNameToElementDefinition;
}
public RuntimeResourceDefinition getResourceDefinition(Class<? extends IResource> theResourceType) {
return (RuntimeResourceDefinition) myClassToElementDefinition.get(theResourceType);
}
@ -53,7 +50,7 @@ public class FhirContext {
return myRuntimeChildUndeclaredExtensionDefinition;
}
public RestfulClientFactory newClientFactory() {
public IRestfulClientFactory newRestfulClientFactory() {
return new RestfulClientFactory(this);
}
@ -67,4 +64,8 @@ public class FhirContext {
return retVal;
}
public BaseRuntimeElementDefinition<?> getResourceDefinition(String theResourceName) {
return myNameToElementDefinition.get(theResourceName);
}
}

View File

@ -1,8 +1,9 @@
package ca.uhn.fhir.model.api;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.util.ElementUtil;
public class BaseBundle {
public class BaseBundle implements IElement {
private StringDt myAuthorName;
private StringDt myAuthorUri;
@ -21,4 +22,11 @@ public class BaseBundle {
return myAuthorUri;
}
@Override
public boolean isEmpty() {
return ElementUtil.isEmpty(myAuthorName, myAuthorUri);
}
}

View File

@ -15,4 +15,19 @@ public abstract class BaseElement implements IElement, ISupportsUndeclaredExtens
return myUndeclaredExtensions;
}
/**
* Intended to be called by extending classes {@link #isEmpty()} implementations, returns <code>true</code> if all content in this superclass instance is empty per the semantics of
* {@link #isEmpty()}.
*/
protected boolean isBaseEmpty() {
if (myUndeclaredExtensions != null) {
for (UndeclaredExtension next : myUndeclaredExtensions) {
if (!next.isEmpty()) {
return false;
}
}
}
return true;
}
}

View File

@ -0,0 +1,11 @@
package ca.uhn.fhir.model.api;
public abstract class BasePrimitive<T> extends BaseElement implements IPrimitiveDatatype<T> {
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && getValue() == null;
}
}

View File

@ -1,24 +1,25 @@
package ca.uhn.fhir.model.api;
import ca.uhn.fhir.model.api.annotation.Child;
import ca.uhn.fhir.model.dstu.composite.NarrativeDt;
import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.XhtmlDt;
import ca.uhn.fhir.util.ElementUtil;
public class BaseResource extends BaseElement implements IResource {
public abstract class BaseResource extends BaseElement implements IResource {
@Child(name="language", order=0, min=0, max=Child.MAX_UNLIMITED)
private CodeDt myLanguage;
@Child(name="text", order=1, min=0, max=1)
private XhtmlDt myText;
private NarrativeDt myText;
public CodeDt getLanguage() {
return myLanguage;
}
public XhtmlDt getText() {
public NarrativeDt getText() {
if (myText == null) {
myText = new XhtmlDt();
myText = new NarrativeDt();
}
return myText;
}
@ -27,8 +28,18 @@ public class BaseResource extends BaseElement implements IResource {
myLanguage = theLanguage;
}
public void setText(XhtmlDt theText) {
public void setText(NarrativeDt theText) {
myText = theText;
}
/**
* Intended to be called by extending classes {@link #isEmpty()} implementations, returns <code>true</code>
* if all content in this superclass instance is empty per the semantics of {@link #isEmpty()}.
*/
@Override
protected boolean isBaseEmpty() {
return super.isBaseEmpty() && ElementUtil.isEmpty(myLanguage, myText);
}
}

View File

@ -6,9 +6,15 @@ import java.util.List;
import ca.uhn.fhir.model.primitive.InstantDt;
import ca.uhn.fhir.model.primitive.IntegerDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.util.ElementUtil;
public class Bundle extends BaseBundle implements IElement {
//@formatter:off
/* ****************************************************
* NB: add any new fields to the isEmpty() method!!!
*****************************************************/
//@formatter:on
private List<BundleEntry> myEntries;
private StringDt myId;
private StringDt myLinkBase;
@ -22,6 +28,15 @@ public class Bundle extends BaseBundle implements IElement {
private IntegerDt myTotalResults;
private InstantDt myUpdated;
@Override
public boolean isEmpty() {
//@formatter:off
return super.isEmpty() &&
ElementUtil.isEmpty(myId, myLinkBase, myLinkFirst, myLinkLast, myLinkNext, myLinkPrevious, myLinkSelf, myPublished, myTitle, myTotalResults) &&
ElementUtil.isEmpty(myEntries);
//@formatter:on
}
/**
* Adds and returns a new bundle entry
*/

View File

@ -1,6 +1,8 @@
package ca.uhn.fhir.model.api;
public class BundleCategory {
import org.apache.commons.lang3.StringUtils;
public class BundleCategory implements IElement {
private String myLabel;
private String myScheme;
@ -30,4 +32,9 @@ public class BundleCategory {
myTerm = theTerm;
}
@Override
public boolean isEmpty() {
return StringUtils.isBlank(myLabel) && StringUtils.isBlank(myScheme) && StringUtils.isBlank(myTerm);
}
}

View File

@ -4,10 +4,18 @@ import java.util.ArrayList;
import java.util.List;
import ca.uhn.fhir.model.primitive.InstantDt;
import ca.uhn.fhir.model.primitive.IntegerDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.model.primitive.XhtmlDt;
import ca.uhn.fhir.util.ElementUtil;
public class BundleEntry extends BaseBundle {
//@formatter:off
/* ****************************************************
* NB: add any new fields to the isEmpty() method!!!
*****************************************************/
//@formatter:on
private StringDt myId;
private StringDt myLinkSelf;
private InstantDt myPublished;
@ -17,6 +25,15 @@ public class BundleEntry extends BaseBundle {
private XhtmlDt mySummary;
private List<BundleCategory> myCategories;
@Override
public boolean isEmpty() {
//@formatter:off
return super.isEmpty() &&
ElementUtil.isEmpty(myId, myLinkSelf, myPublished, myResource, myTitle, myUpdated, mySummary) &&
ElementUtil.isEmpty(myCategories);
//@formatter:on
}
public StringDt getId() {
if (myId == null) {
myId = new StringDt();

View File

@ -2,4 +2,6 @@ package ca.uhn.fhir.model.api;
public interface IElement {
boolean isEmpty();
}

View File

@ -24,8 +24,9 @@ public class ResourceReference implements IDatatype {
myReference = theReference;
}
public boolean hasContent() {
return StringUtils.isNotBlank(myDisplay) || StringUtils.isNotBlank(myReference);
@Override
public boolean isEmpty() {
return StringUtils.isBlank(myDisplay) && StringUtils.isBlank(myReference);
}
}

View File

@ -1,5 +1,6 @@
package ca.uhn.fhir.model.api;
public class UndeclaredExtension extends BaseElement {
private String myUrl;
@ -29,4 +30,9 @@ public class UndeclaredExtension extends BaseElement {
myValue = theValue;
}
@Override
public boolean isEmpty() {
return myValue == null || myValue.isEmpty();
}
}

View File

@ -6,7 +6,6 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import ca.uhn.fhir.model.api.IElement;
import ca.uhn.fhir.model.api.IValueSetEnumBinder;
@Retention(RetentionPolicy.RUNTIME)
@Target(value= {ElementType.FIELD})
@ -43,6 +42,11 @@ public @interface Child {
private NoDatatype() {
// non instantiable
}
@Override
public boolean isEmpty() {
return true;
}
}
}

View File

@ -38,7 +38,8 @@ import ca.uhn.fhir.model.dstu.resource.*;
* </p>
*/
@DatatypeDef(name="Address")
public class AddressDt extends BaseElement implements ICompositeDatatype {
public class AddressDt extends BaseElement implements ICompositeDatatype {
@Child(name="use", type=CodeDt.class, order=0, min=0, max=1)
private BoundCodeDt<AddressUseEnum> myUse;
@ -64,6 +65,12 @@ public class AddressDt extends BaseElement implements ICompositeDatatype {
@Child(name="period", type=PeriodDt.class, order=7, min=0, max=1)
private PeriodDt myPeriod;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( 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
@ -93,6 +100,7 @@ public class AddressDt extends BaseElement implements ICompositeDatatype {
myUse = theValue;
}
/**
* Sets the value(s) for <b>use</b> (home | work | temp | old - purpose of this address)
*
@ -135,8 +143,9 @@ public class AddressDt extends BaseElement implements ICompositeDatatype {
myText = theValue;
}
/**
* Sets the value(s) for <b>text</b> (Text representation of the address)
* Sets the value for <b>text</b> (Text representation of the address)
*
* <p>
* <b>Definition:</b>
@ -146,6 +155,7 @@ public class AddressDt extends BaseElement implements ICompositeDatatype {
public void setText( String theString) {
myText = new StringDt(theString);
}
/**
* Gets the value(s) for <b>line</b> (Street name, number, direction & P.O. Box etc ).
@ -178,8 +188,23 @@ P.O. Box number, delivery hints, and similar address information
myLine = theValue;
}
/**
* 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;
}
/**
* Sets the value(s) for <b>line</b> (Street name, number, direction & P.O. Box etc )
* Adds a new value for <b>line</b> (Street name, number, direction & P.O. Box etc )
*
* <p>
* <b>Definition:</b>
@ -193,6 +218,7 @@ P.O. Box number, delivery hints, and similar address information
}
myLine.add(new StringDt(theString));
}
/**
* Gets the value(s) for <b>city</b> (Name of city, town etc.).
@ -223,8 +249,9 @@ P.O. Box number, delivery hints, and similar address information
myCity = theValue;
}
/**
* Sets the value(s) for <b>city</b> (Name of city, town etc.)
* Sets the value for <b>city</b> (Name of city, town etc.)
*
* <p>
* <b>Definition:</b>
@ -234,6 +261,7 @@ P.O. Box number, delivery hints, and similar address information
public void setCity( String theString) {
myCity = new StringDt(theString);
}
/**
* Gets the value(s) for <b>state</b> (Sub-unit of country (abreviations ok)).
@ -264,8 +292,9 @@ P.O. Box number, delivery hints, and similar address information
myState = theValue;
}
/**
* Sets the value(s) for <b>state</b> (Sub-unit of country (abreviations ok))
* Sets the value for <b>state</b> (Sub-unit of country (abreviations ok))
*
* <p>
* <b>Definition:</b>
@ -275,6 +304,7 @@ P.O. Box number, delivery hints, and similar address information
public void setState( String theString) {
myState = new StringDt(theString);
}
/**
* Gets the value(s) for <b>zip</b> (Postal code for area).
@ -305,8 +335,9 @@ P.O. Box number, delivery hints, and similar address information
myZip = theValue;
}
/**
* Sets the value(s) for <b>zip</b> (Postal code for area)
* Sets the value for <b>zip</b> (Postal code for area)
*
* <p>
* <b>Definition:</b>
@ -316,6 +347,7 @@ P.O. Box number, delivery hints, and similar address information
public void setZip( String theString) {
myZip = new StringDt(theString);
}
/**
* Gets the value(s) for <b>country</b> (Country (can be ISO 3166 3 letter code)).
@ -346,8 +378,9 @@ P.O. Box number, delivery hints, and similar address information
myCountry = theValue;
}
/**
* Sets the value(s) for <b>country</b> (Country (can be ISO 3166 3 letter code))
* Sets the value for <b>country</b> (Country (can be ISO 3166 3 letter code))
*
* <p>
* <b>Definition:</b>
@ -357,6 +390,7 @@ P.O. Box number, delivery hints, and similar address information
public void setCountry( String theString) {
myCountry = new StringDt(theString);
}
/**
* Gets the value(s) for <b>period</b> (Time period when address was/is in use).
@ -387,6 +421,7 @@ P.O. Box number, delivery hints, and similar address information
myPeriod = theValue;
}

View File

@ -38,7 +38,8 @@ import ca.uhn.fhir.model.dstu.resource.*;
* </p>
*/
@DatatypeDef(name="Attachment")
public class AttachmentDt extends BaseElement implements ICompositeDatatype {
public class AttachmentDt extends BaseElement implements ICompositeDatatype {
@Child(name="contentType", type=CodeDt.class, order=0, min=1, max=1)
private CodeDt myContentType;
@ -61,6 +62,12 @@ public class AttachmentDt extends BaseElement implements ICompositeDatatype {
@Child(name="title", type=StringDt.class, order=6, min=0, max=1)
private StringDt myTitle;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( 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
@ -90,6 +97,7 @@ public class AttachmentDt extends BaseElement implements ICompositeDatatype {
myContentType = theValue;
}
/**
* Gets the value(s) for <b>language</b> (Human language of the content (BCP-47)).
@ -120,6 +128,7 @@ public class AttachmentDt extends BaseElement implements ICompositeDatatype {
myLanguage = theValue;
}
/**
* Gets the value(s) for <b>data</b> (Data inline, base64ed).
@ -150,7 +159,20 @@ public class AttachmentDt extends BaseElement implements ICompositeDatatype {
myData = theValue;
}
/**
* 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 void setData( byte[] theBytes) {
myData = new Base64BinaryDt(theBytes);
}
/**
* Gets the value(s) for <b>url</b> (Uri where the data can be found).
* creating it if it does
@ -180,8 +202,9 @@ public class AttachmentDt extends BaseElement implements ICompositeDatatype {
myUrl = theValue;
}
/**
* Sets the value(s) for <b>url</b> (Uri where the data can be found)
* Sets the value for <b>url</b> (Uri where the data can be found)
*
* <p>
* <b>Definition:</b>
@ -191,6 +214,7 @@ public class AttachmentDt extends BaseElement implements ICompositeDatatype {
public void setUrl( String theUri) {
myUrl = new UriDt(theUri);
}
/**
* Gets the value(s) for <b>size</b> (Number of bytes of content (if url provided)).
@ -221,7 +245,20 @@ public class AttachmentDt extends BaseElement implements ICompositeDatatype {
mySize = theValue;
}
/**
* 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 void setSize( Integer theInteger) {
mySize = new IntegerDt(theInteger);
}
/**
* Gets the value(s) for <b>hash</b> (Hash of the data (sha-1, base64ed )).
* creating it if it does
@ -251,7 +288,20 @@ public class AttachmentDt extends BaseElement implements ICompositeDatatype {
myHash = theValue;
}
/**
* 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 void setHash( byte[] theBytes) {
myHash = new Base64BinaryDt(theBytes);
}
/**
* Gets the value(s) for <b>title</b> (Label to display in place of the data).
* creating it if it does
@ -281,8 +331,9 @@ public class AttachmentDt extends BaseElement implements ICompositeDatatype {
myTitle = theValue;
}
/**
* Sets the value(s) for <b>title</b> (Label to display in place of the data)
* Sets the value for <b>title</b> (Label to display in place of the data)
*
* <p>
* <b>Definition:</b>
@ -292,6 +343,7 @@ public class AttachmentDt extends BaseElement implements ICompositeDatatype {
public void setTitle( String theString) {
myTitle = new StringDt(theString);
}

View File

@ -38,7 +38,8 @@ import ca.uhn.fhir.model.dstu.resource.*;
* </p>
*/
@DatatypeDef(name="CodeableConcept")
public class CodeableConceptDt extends BaseElement implements ICompositeDatatype {
public class CodeableConceptDt extends BaseElement implements ICompositeDatatype {
@Child(name="coding", type=CodingDt.class, order=0, min=0, max=Child.MAX_UNLIMITED)
private List<CodingDt> myCoding;
@ -46,6 +47,12 @@ public class CodeableConceptDt extends BaseElement implements ICompositeDatatype
@Child(name="text", type=StringDt.class, order=1, min=0, max=1)
private StringDt myText;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCoding, myText);
}
/**
* Gets the value(s) for <b>coding</b> (Code defined by a terminology system ).
* creating it if it does
@ -75,6 +82,20 @@ public class CodeableConceptDt extends BaseElement implements ICompositeDatatype
myCoding = theValue;
}
/**
* 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 value(s) for <b>text</b> (Plain text representation of the concept).
@ -105,8 +126,9 @@ public class CodeableConceptDt extends BaseElement implements ICompositeDatatype
myText = theValue;
}
/**
* Sets the value(s) for <b>text</b> (Plain text representation of the concept)
* Sets the value for <b>text</b> (Plain text representation of the concept)
*
* <p>
* <b>Definition:</b>
@ -116,6 +138,7 @@ public class CodeableConceptDt extends BaseElement implements ICompositeDatatype
public void setText( String theString) {
myText = new StringDt(theString);
}

View File

@ -38,7 +38,8 @@ import ca.uhn.fhir.model.dstu.resource.*;
* </p>
*/
@DatatypeDef(name="Coding")
public class CodingDt extends BaseElement implements ICompositeDatatype {
public class CodingDt extends BaseElement implements ICompositeDatatype {
@Child(name="system", type=UriDt.class, order=0, min=0, max=1)
private UriDt mySystem;
@ -61,6 +62,12 @@ public class CodingDt extends BaseElement implements ICompositeDatatype {
})
private ResourceReference myValueSet;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySystem, myVersion, myCode, myDisplay, myPrimary, myValueSet);
}
/**
* Gets the value(s) for <b>system</b> (Identity of the terminology system ).
* creating it if it does
@ -90,8 +97,9 @@ public class CodingDt extends BaseElement implements ICompositeDatatype {
mySystem = theValue;
}
/**
* Sets the value(s) for <b>system</b> (Identity of the terminology system )
* Sets the value for <b>system</b> (Identity of the terminology system )
*
* <p>
* <b>Definition:</b>
@ -101,6 +109,7 @@ public class CodingDt extends BaseElement implements ICompositeDatatype {
public void setSystem( String theUri) {
mySystem = new UriDt(theUri);
}
/**
* Gets the value(s) for <b>version</b> (Version of the system - if relevant).
@ -131,8 +140,9 @@ public class CodingDt extends BaseElement implements ICompositeDatatype {
myVersion = theValue;
}
/**
* Sets the value(s) for <b>version</b> (Version of the system - if relevant)
* Sets the value for <b>version</b> (Version of the system - if relevant)
*
* <p>
* <b>Definition:</b>
@ -142,6 +152,7 @@ public class CodingDt extends BaseElement implements ICompositeDatatype {
public void setVersion( String theString) {
myVersion = new StringDt(theString);
}
/**
* Gets the value(s) for <b>code</b> (Symbol in syntax defined by the system).
@ -172,6 +183,7 @@ public class CodingDt extends BaseElement implements ICompositeDatatype {
myCode = theValue;
}
/**
* Gets the value(s) for <b>display</b> (Representation defined by the system).
@ -202,8 +214,9 @@ public class CodingDt extends BaseElement implements ICompositeDatatype {
myDisplay = theValue;
}
/**
* Sets the value(s) for <b>display</b> (Representation defined by the system)
* Sets the value for <b>display</b> (Representation defined by the system)
*
* <p>
* <b>Definition:</b>
@ -213,6 +226,7 @@ public class CodingDt extends BaseElement implements ICompositeDatatype {
public void setDisplay( String theString) {
myDisplay = new StringDt(theString);
}
/**
* Gets the value(s) for <b>primary</b> (If this code was chosen directly by the user).
@ -243,7 +257,20 @@ public class CodingDt extends BaseElement implements ICompositeDatatype {
myPrimary = theValue;
}
/**
* 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 void setPrimary( Boolean theBoolean) {
myPrimary = new BooleanDt(theBoolean);
}
/**
* Gets the value(s) for <b>valueSet</b> (Set this coding was chosen from).
* creating it if it does
@ -273,6 +300,7 @@ public class CodingDt extends BaseElement implements ICompositeDatatype {
myValueSet = theValue;
}

View File

@ -38,7 +38,8 @@ import ca.uhn.fhir.model.dstu.resource.*;
* </p>
*/
@DatatypeDef(name="Contact")
public class ContactDt extends BaseElement implements ICompositeDatatype {
public class ContactDt extends BaseElement implements ICompositeDatatype {
@Child(name="system", type=CodeDt.class, order=0, min=0, max=1)
private BoundCodeDt<ContactSystemEnum> mySystem;
@ -52,6 +53,12 @@ public class ContactDt extends BaseElement implements ICompositeDatatype {
@Child(name="period", type=PeriodDt.class, order=3, min=0, max=1)
private PeriodDt myPeriod;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySystem, myValue, myUse, myPeriod);
}
/**
* Gets the value(s) for <b>system</b> (phone | fax | email | url).
* creating it if it does
@ -81,6 +88,7 @@ public class ContactDt extends BaseElement implements ICompositeDatatype {
mySystem = theValue;
}
/**
* Sets the value(s) for <b>system</b> (phone | fax | email | url)
*
@ -123,8 +131,9 @@ public class ContactDt extends BaseElement implements ICompositeDatatype {
myValue = theValue;
}
/**
* Sets the value(s) for <b>value</b> (The actual contact details)
* Sets the value for <b>value</b> (The actual contact details)
*
* <p>
* <b>Definition:</b>
@ -134,6 +143,7 @@ public class ContactDt extends BaseElement implements ICompositeDatatype {
public void setValue( String theString) {
myValue = new StringDt(theString);
}
/**
* Gets the value(s) for <b>use</b> (home | work | temp | old | mobile - purpose of this address).
@ -164,6 +174,7 @@ public class ContactDt extends BaseElement implements ICompositeDatatype {
myUse = theValue;
}
/**
* Sets the value(s) for <b>use</b> (home | work | temp | old | mobile - purpose of this address)
*
@ -206,6 +217,7 @@ public class ContactDt extends BaseElement implements ICompositeDatatype {
myPeriod = theValue;
}

View File

@ -38,7 +38,8 @@ import ca.uhn.fhir.model.dstu.resource.*;
* </p>
*/
@DatatypeDef(name="HumanName")
public class HumanNameDt extends BaseElement implements ICompositeDatatype {
public class HumanNameDt extends BaseElement implements ICompositeDatatype {
@Child(name="use", type=CodeDt.class, order=0, min=0, max=1)
private BoundCodeDt<NameUseEnum> myUse;
@ -61,6 +62,12 @@ public class HumanNameDt extends BaseElement implements ICompositeDatatype {
@Child(name="period", type=PeriodDt.class, order=6, min=0, max=1)
private PeriodDt myPeriod;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( 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
@ -90,6 +97,7 @@ public class HumanNameDt extends BaseElement implements ICompositeDatatype {
myUse = theValue;
}
/**
* Sets the value(s) for <b>use</b> (usual | official | temp | nickname | anonymous | old | maiden)
*
@ -132,8 +140,9 @@ public class HumanNameDt extends BaseElement implements ICompositeDatatype {
myText = theValue;
}
/**
* Sets the value(s) for <b>text</b> (Text representation of the full name)
* Sets the value for <b>text</b> (Text representation of the full name)
*
* <p>
* <b>Definition:</b>
@ -143,6 +152,7 @@ public class HumanNameDt extends BaseElement implements ICompositeDatatype {
public void setText( String theString) {
myText = new StringDt(theString);
}
/**
* Gets the value(s) for <b>family</b> (Family name (often called 'Surname')).
@ -173,8 +183,22 @@ public class HumanNameDt extends BaseElement implements ICompositeDatatype {
myFamily = theValue;
}
/**
* 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;
}
/**
* Sets the value(s) for <b>family</b> (Family name (often called 'Surname'))
* Adds a new value for <b>family</b> (Family name (often called 'Surname'))
*
* <p>
* <b>Definition:</b>
@ -187,6 +211,7 @@ public class HumanNameDt extends BaseElement implements ICompositeDatatype {
}
myFamily.add(new StringDt(theString));
}
/**
* Gets the value(s) for <b>given</b> (Given names (not always 'first'). Includes middle names).
@ -217,8 +242,22 @@ public class HumanNameDt extends BaseElement implements ICompositeDatatype {
myGiven = theValue;
}
/**
* 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;
}
/**
* Sets the value(s) for <b>given</b> (Given names (not always 'first'). Includes middle names)
* Adds a new value for <b>given</b> (Given names (not always 'first'). Includes middle names)
*
* <p>
* <b>Definition:</b>
@ -231,6 +270,7 @@ public class HumanNameDt extends BaseElement implements ICompositeDatatype {
}
myGiven.add(new StringDt(theString));
}
/**
* Gets the value(s) for <b>prefix</b> (Parts that come before the name).
@ -261,8 +301,22 @@ public class HumanNameDt extends BaseElement implements ICompositeDatatype {
myPrefix = theValue;
}
/**
* 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;
}
/**
* Sets the value(s) for <b>prefix</b> (Parts that come before the name)
* Adds a new value for <b>prefix</b> (Parts that come before the name)
*
* <p>
* <b>Definition:</b>
@ -275,6 +329,7 @@ public class HumanNameDt extends BaseElement implements ICompositeDatatype {
}
myPrefix.add(new StringDt(theString));
}
/**
* Gets the value(s) for <b>suffix</b> (Parts that come after the name).
@ -305,8 +360,22 @@ public class HumanNameDt extends BaseElement implements ICompositeDatatype {
mySuffix = theValue;
}
/**
* 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;
}
/**
* Sets the value(s) for <b>suffix</b> (Parts that come after the name)
* Adds a new value for <b>suffix</b> (Parts that come after the name)
*
* <p>
* <b>Definition:</b>
@ -319,6 +388,7 @@ public class HumanNameDt extends BaseElement implements ICompositeDatatype {
}
mySuffix.add(new StringDt(theString));
}
/**
* Gets the value(s) for <b>period</b> (Time period when name was/is in use).
@ -349,6 +419,7 @@ public class HumanNameDt extends BaseElement implements ICompositeDatatype {
myPeriod = theValue;
}

View File

@ -17,7 +17,6 @@
package ca.uhn.fhir.model.dstu.composite;
import java.util.*;
import ca.uhn.fhir.model.api.*;
import ca.uhn.fhir.model.api.annotation.*;
import ca.uhn.fhir.model.primitive.*;
@ -39,7 +38,22 @@ import ca.uhn.fhir.model.dstu.resource.*;
* </p>
*/
@DatatypeDef(name="Identifier")
public class IdentifierDt extends BaseElement implements ICompositeDatatype, IQueryParameterType {
public class IdentifierDt extends BaseElement implements ICompositeDatatype , IQueryParameterType {
/**
* Creates a new identifier
*/
public IdentifierDt() {
// nothing
}
/**
* Creates a new identifier with the given system and value
*/
public IdentifierDt(String theSystem, String theValue) {
setSystem(theSystem);
setValue(theValue);
}
@Child(name="use", type=CodeDt.class, order=0, min=0, max=1)
private BoundCodeDt<IdentifierUseEnum> myUse;
@ -62,19 +76,10 @@ public class IdentifierDt extends BaseElement implements ICompositeDatatype, IQu
})
private ResourceReference myAssigner;
/**
* Creates a new identifier
*/
public IdentifierDt() {
// nothing
}
/**
* Creates a new identifier with the given system and value
*/
public IdentifierDt(String theSystem, String theValue) {
setSystem(theSystem);
setValue(theValue);
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myUse, myLabel, mySystem, myValue, myPeriod, myAssigner);
}
/**
@ -108,6 +113,7 @@ public class IdentifierDt extends BaseElement implements ICompositeDatatype, IQu
myUse = theValue;
}
/**
* Sets the value(s) for <b>use</b> (usual | official | temp | secondary (If known)
)
@ -151,8 +157,9 @@ public class IdentifierDt extends BaseElement implements ICompositeDatatype, IQu
myLabel = theValue;
}
/**
* Sets the value(s) for <b>label</b> (Description of identifier)
* Sets the value for <b>label</b> (Description of identifier)
*
* <p>
* <b>Definition:</b>
@ -162,6 +169,7 @@ public class IdentifierDt extends BaseElement implements ICompositeDatatype, IQu
public void setLabel( String theString) {
myLabel = new StringDt(theString);
}
/**
* Gets the value(s) for <b>system</b> (The namespace for the identifier).
@ -192,8 +200,9 @@ public class IdentifierDt extends BaseElement implements ICompositeDatatype, IQu
mySystem = theValue;
}
/**
* Sets the value(s) for <b>system</b> (The namespace for the identifier)
* Sets the value for <b>system</b> (The namespace for the identifier)
*
* <p>
* <b>Definition:</b>
@ -203,6 +212,7 @@ public class IdentifierDt extends BaseElement implements ICompositeDatatype, IQu
public void setSystem( String theUri) {
mySystem = new UriDt(theUri);
}
/**
* Gets the value(s) for <b>value</b> (The value that is unique).
@ -233,8 +243,9 @@ public class IdentifierDt extends BaseElement implements ICompositeDatatype, IQu
myValue = theValue;
}
/**
* Sets the value(s) for <b>value</b> (The value that is unique)
* Sets the value for <b>value</b> (The value that is unique)
*
* <p>
* <b>Definition:</b>
@ -244,6 +255,7 @@ public class IdentifierDt extends BaseElement implements ICompositeDatatype, IQu
public void setValue( String theString) {
myValue = new StringDt(theString);
}
/**
* Gets the value(s) for <b>period</b> (Time period when id is/was valid for use).
@ -274,6 +286,7 @@ public class IdentifierDt extends BaseElement implements ICompositeDatatype, IQu
myPeriod = theValue;
}
/**
* Gets the value(s) for <b>assigner</b> (Organization that issued id (may be just text)).
@ -304,6 +317,7 @@ public class IdentifierDt extends BaseElement implements ICompositeDatatype, IQu
myAssigner = theValue;
}
/**

View File

@ -17,6 +17,7 @@
package ca.uhn.fhir.model.dstu.composite;
import java.util.*;
import ca.uhn.fhir.model.api.*;
import ca.uhn.fhir.model.api.annotation.*;
import ca.uhn.fhir.model.primitive.*;
@ -45,6 +46,11 @@ public class NarrativeDt extends BaseElement implements ICompositeDatatype {
@Child(name="div", type=XhtmlDt.class, order=1, min=1, max=1)
private XhtmlDt myDiv;
@Override
public boolean isEmpty() {
return ca.uhn.fhir.util.ElementUtil.isEmpty( myStatus, myDiv );
}
/**
* Gets the value(s) for <b>status</b> (generated | extensions | additional).
* creating it if it does

View File

@ -38,7 +38,8 @@ import ca.uhn.fhir.model.dstu.resource.*;
* </p>
*/
@DatatypeDef(name="Period")
public class PeriodDt extends BaseElement implements ICompositeDatatype {
public class PeriodDt extends BaseElement implements ICompositeDatatype {
@Child(name="start", type=DateTimeDt.class, order=0, min=0, max=1)
private DateTimeDt myStart;
@ -46,6 +47,12 @@ public class PeriodDt extends BaseElement implements ICompositeDatatype {
@Child(name="end", type=DateTimeDt.class, order=1, min=0, max=1)
private DateTimeDt myEnd;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myStart, myEnd);
}
/**
* Gets the value(s) for <b>start</b> (Starting time with inclusive boundary).
* creating it if it does
@ -75,8 +82,9 @@ public class PeriodDt extends BaseElement implements ICompositeDatatype {
myStart = theValue;
}
/**
* Sets the value(s) for <b>start</b> (Starting time with inclusive boundary)
* Sets the value for <b>start</b> (Starting time with inclusive boundary)
*
* <p>
* <b>Definition:</b>
@ -86,6 +94,19 @@ public class PeriodDt extends BaseElement implements ICompositeDatatype {
public void setStartWithSecondsPrecision( Date theDate) {
myStart = new DateTimeDt(theDate);
}
/**
* 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 void setStart( Date theDate, TemporalPrecisionEnum thePrecision) {
myStart = new DateTimeDt(theDate, thePrecision);
}
/**
* Gets the value(s) for <b>end</b> (End time with inclusive boundary, if not ongoing).
@ -116,8 +137,9 @@ public class PeriodDt extends BaseElement implements ICompositeDatatype {
myEnd = theValue;
}
/**
* Sets the value(s) for <b>end</b> (End time with inclusive boundary, if not ongoing)
* Sets the value for <b>end</b> (End time with inclusive boundary, if not ongoing)
*
* <p>
* <b>Definition:</b>
@ -127,6 +149,19 @@ public class PeriodDt extends BaseElement implements ICompositeDatatype {
public void setEndWithSecondsPrecision( Date theDate) {
myEnd = new DateTimeDt(theDate);
}
/**
* 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 void setEnd( Date theDate, TemporalPrecisionEnum thePrecision) {
myEnd = new DateTimeDt(theDate, thePrecision);
}

View File

@ -38,7 +38,8 @@ import ca.uhn.fhir.model.dstu.resource.*;
* </p>
*/
@DatatypeDef(name="Quantity")
public class QuantityDt extends BaseElement implements ICompositeDatatype {
public class QuantityDt extends BaseElement implements ICompositeDatatype {
@Child(name="value", type=DecimalDt.class, order=0, min=0, max=1)
private DecimalDt myValue;
@ -55,6 +56,12 @@ public class QuantityDt extends BaseElement implements ICompositeDatatype {
@Child(name="code", type=CodeDt.class, order=4, min=0, max=1)
private CodeDt myCode;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myValue, myComparator, myUnits, mySystem, myCode);
}
/**
* Gets the value(s) for <b>value</b> (Numerical value (with implicit precision)).
* creating it if it does
@ -84,7 +91,44 @@ public class QuantityDt extends BaseElement implements ICompositeDatatype {
myValue = theValue;
}
/**
* 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 void setValue( java.math.BigDecimal theValue) {
myValue = new DecimalDt(theValue);
}
/**
* 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 void setValue( double theValue) {
myValue = new DecimalDt(theValue);
}
/**
* 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 void setValue( long theValue) {
myValue = new DecimalDt(theValue);
}
/**
* Gets the value(s) for <b>comparator</b> (< | <= | >= | > - how to understand the value).
* creating it if it does
@ -114,6 +158,7 @@ public class QuantityDt extends BaseElement implements ICompositeDatatype {
myComparator = theValue;
}
/**
* Sets the value(s) for <b>comparator</b> (< | <= | >= | > - how to understand the value)
*
@ -156,8 +201,9 @@ public class QuantityDt extends BaseElement implements ICompositeDatatype {
myUnits = theValue;
}
/**
* Sets the value(s) for <b>units</b> (Unit representation)
* Sets the value for <b>units</b> (Unit representation)
*
* <p>
* <b>Definition:</b>
@ -167,6 +213,7 @@ public class QuantityDt extends BaseElement implements ICompositeDatatype {
public void setUnits( String theString) {
myUnits = new StringDt(theString);
}
/**
* Gets the value(s) for <b>system</b> (System that defines coded unit form).
@ -197,8 +244,9 @@ public class QuantityDt extends BaseElement implements ICompositeDatatype {
mySystem = theValue;
}
/**
* Sets the value(s) for <b>system</b> (System that defines coded unit form)
* Sets the value for <b>system</b> (System that defines coded unit form)
*
* <p>
* <b>Definition:</b>
@ -208,6 +256,7 @@ public class QuantityDt extends BaseElement implements ICompositeDatatype {
public void setSystem( String theUri) {
mySystem = new UriDt(theUri);
}
/**
* Gets the value(s) for <b>code</b> (Coded form of the unit).
@ -238,6 +287,7 @@ public class QuantityDt extends BaseElement implements ICompositeDatatype {
myCode = theValue;
}

View File

@ -38,7 +38,8 @@ import ca.uhn.fhir.model.dstu.resource.*;
* </p>
*/
@DatatypeDef(name="Range")
public class RangeDt extends BaseElement implements ICompositeDatatype {
public class RangeDt extends BaseElement implements ICompositeDatatype {
@Child(name="low", type=QuantityDt.class, order=0, min=0, max=1)
private QuantityDt myLow;
@ -46,6 +47,12 @@ public class RangeDt extends BaseElement implements ICompositeDatatype {
@Child(name="high", type=QuantityDt.class, order=1, min=0, max=1)
private QuantityDt myHigh;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myLow, myHigh);
}
/**
* Gets the value(s) for <b>low</b> (Low limit ).
* creating it if it does
@ -75,6 +82,7 @@ public class RangeDt extends BaseElement implements ICompositeDatatype {
myLow = theValue;
}
/**
* Gets the value(s) for <b>high</b> (High limit ).
@ -105,6 +113,7 @@ public class RangeDt extends BaseElement implements ICompositeDatatype {
myHigh = theValue;
}

View File

@ -38,7 +38,8 @@ import ca.uhn.fhir.model.dstu.resource.*;
* </p>
*/
@DatatypeDef(name="Ratio")
public class RatioDt extends BaseElement implements ICompositeDatatype {
public class RatioDt extends BaseElement implements ICompositeDatatype {
@Child(name="numerator", type=QuantityDt.class, order=0, min=0, max=1)
private QuantityDt myNumerator;
@ -46,6 +47,12 @@ public class RatioDt extends BaseElement implements ICompositeDatatype {
@Child(name="denominator", type=QuantityDt.class, order=1, min=0, max=1)
private QuantityDt myDenominator;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myNumerator, myDenominator);
}
/**
* Gets the value(s) for <b>numerator</b> (Numerator value).
* creating it if it does
@ -75,6 +82,7 @@ public class RatioDt extends BaseElement implements ICompositeDatatype {
myNumerator = theValue;
}
/**
* Gets the value(s) for <b>denominator</b> (Denominator value).
@ -105,6 +113,7 @@ public class RatioDt extends BaseElement implements ICompositeDatatype {
myDenominator = theValue;
}

View File

@ -38,7 +38,8 @@ import ca.uhn.fhir.model.dstu.resource.*;
* </p>
*/
@DatatypeDef(name="ResourceReference")
public class ResourceReferenceDt extends BaseElement implements ICompositeDatatype {
public class ResourceReferenceDt extends BaseElement implements ICompositeDatatype {
@Child(name="reference", type=StringDt.class, order=0, min=0, max=1)
private StringDt myReference;
@ -46,6 +47,12 @@ public class ResourceReferenceDt extends BaseElement implements ICompositeDataty
@Child(name="display", type=StringDt.class, order=1, min=0, max=1)
private StringDt myDisplay;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myReference, myDisplay);
}
/**
* Gets the value(s) for <b>reference</b> (Relative, internal or absolute URL reference).
* creating it if it does
@ -75,8 +82,9 @@ public class ResourceReferenceDt extends BaseElement implements ICompositeDataty
myReference = theValue;
}
/**
* Sets the value(s) for <b>reference</b> (Relative, internal or absolute URL reference)
* Sets the value for <b>reference</b> (Relative, internal or absolute URL reference)
*
* <p>
* <b>Definition:</b>
@ -86,6 +94,7 @@ public class ResourceReferenceDt extends BaseElement implements ICompositeDataty
public void setReference( String theString) {
myReference = new StringDt(theString);
}
/**
* Gets the value(s) for <b>display</b> (Text alternative for the resource).
@ -116,8 +125,9 @@ public class ResourceReferenceDt extends BaseElement implements ICompositeDataty
myDisplay = theValue;
}
/**
* Sets the value(s) for <b>display</b> (Text alternative for the resource)
* Sets the value for <b>display</b> (Text alternative for the resource)
*
* <p>
* <b>Definition:</b>
@ -127,6 +137,7 @@ public class ResourceReferenceDt extends BaseElement implements ICompositeDataty
public void setDisplay( String theString) {
myDisplay = new StringDt(theString);
}

View File

@ -38,7 +38,8 @@ import ca.uhn.fhir.model.dstu.resource.*;
* </p>
*/
@DatatypeDef(name="SampledData")
public class SampledDataDt extends BaseElement implements ICompositeDatatype {
public class SampledDataDt extends BaseElement implements ICompositeDatatype {
@Child(name="origin", type=QuantityDt.class, order=0, min=1, max=1)
private QuantityDt myOrigin;
@ -61,6 +62,12 @@ public class SampledDataDt extends BaseElement implements ICompositeDatatype {
@Child(name="data", type=StringDt.class, order=6, min=1, max=1)
private StringDt myData;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myOrigin, myPeriod, myFactor, myLowerLimit, myUpperLimit, myDimensions, myData);
}
/**
* Gets the value(s) for <b>origin</b> (Zero value and units).
* creating it if it does
@ -90,6 +97,7 @@ public class SampledDataDt extends BaseElement implements ICompositeDatatype {
myOrigin = theValue;
}
/**
* Gets the value(s) for <b>period</b> (Number of milliseconds between samples).
@ -120,7 +128,44 @@ public class SampledDataDt extends BaseElement implements ICompositeDatatype {
myPeriod = theValue;
}
/**
* 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 void setPeriod( java.math.BigDecimal theValue) {
myPeriod = new DecimalDt(theValue);
}
/**
* 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 void setPeriod( double theValue) {
myPeriod = new DecimalDt(theValue);
}
/**
* 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 void setPeriod( long theValue) {
myPeriod = new DecimalDt(theValue);
}
/**
* Gets the value(s) for <b>factor</b> (Multiply data by this before adding to origin).
* creating it if it does
@ -150,7 +195,44 @@ public class SampledDataDt extends BaseElement implements ICompositeDatatype {
myFactor = theValue;
}
/**
* 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 void setFactor( java.math.BigDecimal theValue) {
myFactor = new DecimalDt(theValue);
}
/**
* 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 void setFactor( double theValue) {
myFactor = new DecimalDt(theValue);
}
/**
* 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 void setFactor( long theValue) {
myFactor = new DecimalDt(theValue);
}
/**
* Gets the value(s) for <b>lowerLimit</b> (Lower limit of detection).
* creating it if it does
@ -180,7 +262,44 @@ public class SampledDataDt extends BaseElement implements ICompositeDatatype {
myLowerLimit = theValue;
}
/**
* 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 void setLowerLimit( java.math.BigDecimal theValue) {
myLowerLimit = new DecimalDt(theValue);
}
/**
* 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 void setLowerLimit( double theValue) {
myLowerLimit = new DecimalDt(theValue);
}
/**
* 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 void setLowerLimit( long theValue) {
myLowerLimit = new DecimalDt(theValue);
}
/**
* Gets the value(s) for <b>upperLimit</b> (Upper limit of detection).
* creating it if it does
@ -210,7 +329,44 @@ public class SampledDataDt extends BaseElement implements ICompositeDatatype {
myUpperLimit = theValue;
}
/**
* 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 void setUpperLimit( java.math.BigDecimal theValue) {
myUpperLimit = new DecimalDt(theValue);
}
/**
* 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 void setUpperLimit( double theValue) {
myUpperLimit = new DecimalDt(theValue);
}
/**
* 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 void setUpperLimit( long theValue) {
myUpperLimit = new DecimalDt(theValue);
}
/**
* Gets the value(s) for <b>dimensions</b> (Number of sample points at each time point).
* creating it if it does
@ -240,7 +396,20 @@ public class SampledDataDt extends BaseElement implements ICompositeDatatype {
myDimensions = theValue;
}
/**
* 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 void setDimensions( Integer theInteger) {
myDimensions = new IntegerDt(theInteger);
}
/**
* Gets the value(s) for <b>data</b> (Decimal values with spaces, or "E" | "U" | "L").
* creating it if it does
@ -270,8 +439,9 @@ public class SampledDataDt extends BaseElement implements ICompositeDatatype {
myData = theValue;
}
/**
* Sets the value(s) for <b>data</b> (Decimal values with spaces, or "E" | "U" | "L")
* Sets the value for <b>data</b> (Decimal values with spaces, or "E" | "U" | "L")
*
* <p>
* <b>Definition:</b>
@ -281,6 +451,7 @@ public class SampledDataDt extends BaseElement implements ICompositeDatatype {
public void setData( String theString) {
myData = new StringDt(theString);
}

View File

@ -38,7 +38,8 @@ import ca.uhn.fhir.model.dstu.resource.*;
* </p>
*/
@DatatypeDef(name="Schedule")
public class ScheduleDt extends BaseElement implements ICompositeDatatype {
public class ScheduleDt extends BaseElement implements ICompositeDatatype {
@Child(name="event", type=PeriodDt.class, order=0, min=0, max=Child.MAX_UNLIMITED)
private List<PeriodDt> myEvent;
@ -46,6 +47,12 @@ public class ScheduleDt extends BaseElement implements ICompositeDatatype {
@Child(name="repeat", order=1, min=0, max=1)
private Repeat myRepeat;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myEvent, myRepeat);
}
/**
* Gets the value(s) for <b>event</b> (When the event occurs).
* creating it if it does
@ -75,6 +82,20 @@ public class ScheduleDt extends BaseElement implements ICompositeDatatype {
myEvent = theValue;
}
/**
* 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 value(s) for <b>repeat</b> (Only if there is none or one event).
@ -105,6 +126,7 @@ public class ScheduleDt extends BaseElement implements ICompositeDatatype {
myRepeat = theValue;
}
/**
* Block class for child element: <b>Schedule.repeat</b> (Only if there is none or one event)
@ -135,6 +157,12 @@ public class ScheduleDt extends BaseElement implements ICompositeDatatype {
@Child(name="end", type=DateTimeDt.class, order=5, min=0, max=1)
private DateTimeDt myEnd;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( 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
@ -164,7 +192,20 @@ public class ScheduleDt extends BaseElement implements ICompositeDatatype {
myFrequency = theValue;
}
/**
* 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 void setFrequency( Integer theInteger) {
myFrequency = new IntegerDt(theInteger);
}
/**
* 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
@ -194,6 +235,7 @@ public class ScheduleDt extends BaseElement implements ICompositeDatatype {
myWhen = theValue;
}
/**
* Sets the value(s) for <b>when</b> (HS | WAKE | AC | ACM | ACD | ACV | PC | PCM | PCD | PCV - common life events)
*
@ -236,7 +278,44 @@ public class ScheduleDt extends BaseElement implements ICompositeDatatype {
myDuration = theValue;
}
/**
* Sets the value for <b>duration</b> (Repeating or event-related duration)
*
* <p>
* <b>Definition:</b>
* How long each repetition should last
* </p>
*/
public void setDuration( java.math.BigDecimal theValue) {
myDuration = new DecimalDt(theValue);
}
/**
* Sets the value for <b>duration</b> (Repeating or event-related duration)
*
* <p>
* <b>Definition:</b>
* How long each repetition should last
* </p>
*/
public void setDuration( double theValue) {
myDuration = new DecimalDt(theValue);
}
/**
* Sets the value for <b>duration</b> (Repeating or event-related duration)
*
* <p>
* <b>Definition:</b>
* How long each repetition should last
* </p>
*/
public void setDuration( long theValue) {
myDuration = new DecimalDt(theValue);
}
/**
* Gets the value(s) for <b>units</b> (s | min | h | d | wk | mo | a - unit of time (UCUM)).
* creating it if it does
@ -266,6 +345,7 @@ public class ScheduleDt extends BaseElement implements ICompositeDatatype {
myUnits = theValue;
}
/**
* Sets the value(s) for <b>units</b> (s | min | h | d | wk | mo | a - unit of time (UCUM))
*
@ -308,7 +388,20 @@ public class ScheduleDt extends BaseElement implements ICompositeDatatype {
myCount = theValue;
}
/**
* 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 void setCount( Integer theInteger) {
myCount = new IntegerDt(theInteger);
}
/**
* Gets the value(s) for <b>end</b> (When to stop repeats).
* creating it if it does
@ -338,8 +431,9 @@ public class ScheduleDt extends BaseElement implements ICompositeDatatype {
myEnd = theValue;
}
/**
* Sets the value(s) for <b>end</b> (When to stop repeats)
* Sets the value for <b>end</b> (When to stop repeats)
*
* <p>
* <b>Definition:</b>
@ -349,6 +443,19 @@ public class ScheduleDt extends BaseElement implements ICompositeDatatype {
public void setEndWithSecondsPrecision( Date theDate) {
myEnd = new DateTimeDt(theDate);
}
/**
* Sets the value for <b>end</b> (When to stop repeats)
*
* <p>
* <b>Definition:</b>
* When to stop repeating the schedule
* </p>
*/
public void setEnd( Date theDate, TemporalPrecisionEnum thePrecision) {
myEnd = new DateTimeDt(theDate, thePrecision);
}
}

View File

@ -169,6 +169,12 @@ public class Device extends BaseResource implements IResource {
@Child(name="url", type=UriDt.class, order=12, min=0, max=1)
private UriDt myUrl;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myType, myManufacturer, myModel, myVersion, myExpiry, myUdi, myLotNumber, myOwner, myLocation, myPatient, myContact, myUrl);
}
/**
* Gets the value(s) for <b>identifier</b> (Instance id from manufacturer, owner and others).
* creating it if it does
@ -198,6 +204,20 @@ public class Device extends BaseResource implements IResource {
myIdentifier = theValue;
}
/**
* Adds and returns a new value for <b>identifier</b> (Instance id from manufacturer, owner and others)
*
* <p>
* <b>Definition:</b>
* Identifiers assigned to this device by various organizations. The most likely organizations to assign identifiers are the manufacturer and the owner, though regulatory agencies may also assign an identifier. The identifiers identify the particular device, not the kind of device
* </p>
*/
public IdentifierDt addIdentifier() {
IdentifierDt newType = new IdentifierDt();
getIdentifier().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>type</b> (What kind of device this is).
@ -228,6 +248,7 @@ public class Device extends BaseResource implements IResource {
myType = theValue;
}
/**
* Gets the value(s) for <b>manufacturer</b> (Name of device manufacturer).
@ -258,8 +279,9 @@ public class Device extends BaseResource implements IResource {
myManufacturer = theValue;
}
/**
* Sets the value(s) for <b>manufacturer</b> (Name of device manufacturer)
* Sets the value for <b>manufacturer</b> (Name of device manufacturer)
*
* <p>
* <b>Definition:</b>
@ -269,6 +291,7 @@ public class Device extends BaseResource implements IResource {
public void setManufacturer( String theString) {
myManufacturer = new StringDt(theString);
}
/**
* Gets the value(s) for <b>model</b> (Model id assigned by the manufacturer).
@ -299,8 +322,9 @@ public class Device extends BaseResource implements IResource {
myModel = theValue;
}
/**
* Sets the value(s) for <b>model</b> (Model id assigned by the manufacturer)
* Sets the value for <b>model</b> (Model id assigned by the manufacturer)
*
* <p>
* <b>Definition:</b>
@ -310,6 +334,7 @@ public class Device extends BaseResource implements IResource {
public void setModel( String theString) {
myModel = new StringDt(theString);
}
/**
* Gets the value(s) for <b>version</b> (Version number (i.e. software)).
@ -340,8 +365,9 @@ public class Device extends BaseResource implements IResource {
myVersion = theValue;
}
/**
* Sets the value(s) for <b>version</b> (Version number (i.e. software))
* Sets the value for <b>version</b> (Version number (i.e. software))
*
* <p>
* <b>Definition:</b>
@ -351,6 +377,7 @@ public class Device extends BaseResource implements IResource {
public void setVersion( String theString) {
myVersion = new StringDt(theString);
}
/**
* Gets the value(s) for <b>expiry</b> (Date of expiry of this device (if applicable)).
@ -381,7 +408,32 @@ public class Device extends BaseResource implements IResource {
myExpiry = theValue;
}
/**
* Sets the value for <b>expiry</b> (Date of expiry of this device (if applicable))
*
* <p>
* <b>Definition:</b>
* Date of expiry of this device (if applicable)
* </p>
*/
public void setExpiry( Date theDate, TemporalPrecisionEnum thePrecision) {
myExpiry = new DateDt(theDate, thePrecision);
}
/**
* Sets the value for <b>expiry</b> (Date of expiry of this device (if applicable))
*
* <p>
* <b>Definition:</b>
* Date of expiry of this device (if applicable)
* </p>
*/
public void setExpiryWithDayPrecision( Date theDate) {
myExpiry = new DateDt(theDate);
}
/**
* Gets the value(s) for <b>udi</b> (FDA Mandated Unique Device Identifier).
* creating it if it does
@ -411,8 +463,9 @@ public class Device extends BaseResource implements IResource {
myUdi = theValue;
}
/**
* Sets the value(s) for <b>udi</b> (FDA Mandated Unique Device Identifier)
* Sets the value for <b>udi</b> (FDA Mandated Unique Device Identifier)
*
* <p>
* <b>Definition:</b>
@ -422,6 +475,7 @@ public class Device extends BaseResource implements IResource {
public void setUdi( String theString) {
myUdi = new StringDt(theString);
}
/**
* Gets the value(s) for <b>lotNumber</b> (Lot number of manufacture).
@ -452,8 +506,9 @@ public class Device extends BaseResource implements IResource {
myLotNumber = theValue;
}
/**
* Sets the value(s) for <b>lotNumber</b> (Lot number of manufacture)
* Sets the value for <b>lotNumber</b> (Lot number of manufacture)
*
* <p>
* <b>Definition:</b>
@ -463,6 +518,7 @@ public class Device extends BaseResource implements IResource {
public void setLotNumber( String theString) {
myLotNumber = new StringDt(theString);
}
/**
* Gets the value(s) for <b>owner</b> (Organization responsible for device).
@ -493,6 +549,7 @@ public class Device extends BaseResource implements IResource {
myOwner = theValue;
}
/**
* Gets the value(s) for <b>location</b> (Where the resource is found).
@ -523,6 +580,7 @@ public class Device extends BaseResource implements IResource {
myLocation = theValue;
}
/**
* Gets the value(s) for <b>patient</b> (If the resource is affixed to a person).
@ -553,6 +611,7 @@ public class Device extends BaseResource implements IResource {
myPatient = theValue;
}
/**
* Gets the value(s) for <b>contact</b> (Details for human/organization for support).
@ -583,6 +642,20 @@ public class Device extends BaseResource implements IResource {
myContact = theValue;
}
/**
* Adds and returns a new value for <b>contact</b> (Details for human/organization for support)
*
* <p>
* <b>Definition:</b>
* Contact details for an organization or a particular human that is responsible for the device
* </p>
*/
public ContactDt addContact() {
ContactDt newType = new ContactDt();
getContact().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>url</b> (Network address to contact device).
@ -613,8 +686,9 @@ public class Device extends BaseResource implements IResource {
myUrl = theValue;
}
/**
* Sets the value(s) for <b>url</b> (Network address to contact device)
* Sets the value for <b>url</b> (Network address to contact device)
*
* <p>
* <b>Definition:</b>
@ -624,6 +698,7 @@ public class Device extends BaseResource implements IResource {
public void setUrl( String theUri) {
myUrl = new UriDt(theUri);
}

View File

@ -162,6 +162,12 @@ public class Group extends BaseResource implements IResource {
})
private List<ResourceReference> myMember;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myType, myActual, myCode, myName, myQuantity, myCharacteristic, myMember);
}
/**
* Gets the value(s) for <b>identifier</b> (Unique id).
* creating it if it does
@ -191,6 +197,7 @@ public class Group extends BaseResource implements IResource {
myIdentifier = theValue;
}
/**
* Gets the value(s) for <b>type</b> (person | animal | practitioner | device | medication | substance).
@ -221,6 +228,7 @@ public class Group extends BaseResource implements IResource {
myType = theValue;
}
/**
* Sets the value(s) for <b>type</b> (person | animal | practitioner | device | medication | substance)
*
@ -263,7 +271,20 @@ public class Group extends BaseResource implements IResource {
myActual = theValue;
}
/**
* Sets the value for <b>actual</b> (Descriptive or actual)
*
* <p>
* <b>Definition:</b>
* If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals
* </p>
*/
public void setActual( Boolean theBoolean) {
myActual = new BooleanDt(theBoolean);
}
/**
* Gets the value(s) for <b>code</b> (Kind of Group members).
* creating it if it does
@ -293,6 +314,7 @@ public class Group extends BaseResource implements IResource {
myCode = theValue;
}
/**
* Gets the value(s) for <b>name</b> (Label for Group).
@ -323,8 +345,9 @@ public class Group extends BaseResource implements IResource {
myName = theValue;
}
/**
* Sets the value(s) for <b>name</b> (Label for Group)
* Sets the value for <b>name</b> (Label for Group)
*
* <p>
* <b>Definition:</b>
@ -334,6 +357,7 @@ public class Group extends BaseResource implements IResource {
public void setName( String theString) {
myName = new StringDt(theString);
}
/**
* Gets the value(s) for <b>quantity</b> (Number of members).
@ -364,7 +388,20 @@ public class Group extends BaseResource implements IResource {
myQuantity = theValue;
}
/**
* Sets the value for <b>quantity</b> (Number of members)
*
* <p>
* <b>Definition:</b>
* A count of the number of resource instances that are part of the group
* </p>
*/
public void setQuantity( Integer theInteger) {
myQuantity = new IntegerDt(theInteger);
}
/**
* Gets the value(s) for <b>characteristic</b> (Trait of group members).
* creating it if it does
@ -394,6 +431,20 @@ public class Group extends BaseResource implements IResource {
myCharacteristic = theValue;
}
/**
* Adds and returns a new value for <b>characteristic</b> (Trait of group members)
*
* <p>
* <b>Definition:</b>
* Identifies the traits shared by members of the group
* </p>
*/
public Characteristic addCharacteristic() {
Characteristic newType = new Characteristic();
getCharacteristic().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>member</b> (Who is in group).
@ -421,6 +472,7 @@ public class Group extends BaseResource implements IResource {
myMember = theValue;
}
/**
* Block class for child element: <b>Group.characteristic</b> (Trait of group members)
@ -447,6 +499,12 @@ public class Group extends BaseResource implements IResource {
@Child(name="exclude", type=BooleanDt.class, order=2, min=1, max=1)
private BooleanDt myExclude;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCode, myValue, myExclude);
}
/**
* Gets the value(s) for <b>code</b> (Kind of characteristic).
* creating it if it does
@ -476,6 +534,7 @@ public class Group extends BaseResource implements IResource {
myCode = theValue;
}
/**
* Gets the value(s) for <b>value[x]</b> (Value held by characteristic).
@ -503,6 +562,7 @@ public class Group extends BaseResource implements IResource {
myValue = theValue;
}
/**
* Gets the value(s) for <b>exclude</b> (Group includes or excludes).
@ -533,7 +593,20 @@ public class Group extends BaseResource implements IResource {
myExclude = theValue;
}
/**
* Sets the value for <b>exclude</b> (Group includes or excludes)
*
* <p>
* <b>Definition:</b>
* If true, indicates the characteristic is one that is NOT held by members of the group
* </p>
*/
public void setExclude( Boolean theBoolean) {
myExclude = new BooleanDt(theBoolean);
}
}

View File

@ -163,6 +163,12 @@ public class Location extends BaseResource implements IResource {
@Child(name="mode", type=CodeDt.class, order=11, min=0, max=1)
private BoundCodeDt<LocationModeEnum> myMode;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myName, myDescription, myType, myTelecom, myAddress, myPhysicalType, myPosition, myManagingOrganization, myStatus, myPartOf, myMode);
}
/**
* Gets the value(s) for <b>identifier</b> (Unique code or number identifying the location to its users).
* creating it if it does
@ -192,6 +198,7 @@ public class Location extends BaseResource implements IResource {
myIdentifier = theValue;
}
/**
* Gets the value(s) for <b>name</b> (Name of the location as used by humans).
@ -222,8 +229,9 @@ public class Location extends BaseResource implements IResource {
myName = theValue;
}
/**
* Sets the value(s) for <b>name</b> (Name of the location as used by humans)
* Sets the value for <b>name</b> (Name of the location as used by humans)
*
* <p>
* <b>Definition:</b>
@ -233,6 +241,7 @@ public class Location extends BaseResource implements IResource {
public void setName( String theString) {
myName = new StringDt(theString);
}
/**
* Gets the value(s) for <b>description</b> (Description of the Location, which helps in finding or referencing the place).
@ -263,8 +272,9 @@ public class Location extends BaseResource implements IResource {
myDescription = theValue;
}
/**
* Sets the value(s) for <b>description</b> (Description of the Location, which helps in finding or referencing the place)
* Sets the value for <b>description</b> (Description of the Location, which helps in finding or referencing the place)
*
* <p>
* <b>Definition:</b>
@ -274,6 +284,7 @@ public class Location extends BaseResource implements IResource {
public void setDescription( String theString) {
myDescription = new StringDt(theString);
}
/**
* Gets the value(s) for <b>type</b> (Indicates the type of function performed at the location).
@ -304,6 +315,7 @@ public class Location extends BaseResource implements IResource {
myType = theValue;
}
/**
* Gets the value(s) for <b>telecom</b> (Contact details of the location).
@ -334,6 +346,20 @@ public class Location extends BaseResource implements IResource {
myTelecom = theValue;
}
/**
* Adds and returns a new value for <b>telecom</b> (Contact details of the location)
*
* <p>
* <b>Definition:</b>
* The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites
* </p>
*/
public ContactDt addTelecom() {
ContactDt newType = new ContactDt();
getTelecom().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>address</b> (Physical location).
@ -364,6 +390,7 @@ public class Location extends BaseResource implements IResource {
myAddress = theValue;
}
/**
* Gets the value(s) for <b>physicalType</b> (Physical form of the location).
@ -394,6 +421,7 @@ public class Location extends BaseResource implements IResource {
myPhysicalType = theValue;
}
/**
* Gets the value(s) for <b>position</b> (The absolute geographic location ).
@ -424,6 +452,7 @@ public class Location extends BaseResource implements IResource {
myPosition = theValue;
}
/**
* Gets the value(s) for <b>managingOrganization</b> (The organization that is responsible for the provisioning and upkeep of the location).
@ -454,6 +483,7 @@ public class Location extends BaseResource implements IResource {
myManagingOrganization = theValue;
}
/**
* Gets the value(s) for <b>status</b> (active | suspended | inactive).
@ -484,6 +514,7 @@ public class Location extends BaseResource implements IResource {
myStatus = theValue;
}
/**
* Sets the value(s) for <b>status</b> (active | suspended | inactive)
*
@ -526,6 +557,7 @@ public class Location extends BaseResource implements IResource {
myPartOf = theValue;
}
/**
* Gets the value(s) for <b>mode</b> (instance | kind).
@ -556,6 +588,7 @@ public class Location extends BaseResource implements IResource {
myMode = theValue;
}
/**
* Sets the value(s) for <b>mode</b> (instance | kind)
*
@ -589,6 +622,12 @@ public class Location extends BaseResource implements IResource {
@Child(name="altitude", type=DecimalDt.class, order=2, min=0, max=1)
private DecimalDt myAltitude;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myLongitude, myLatitude, myAltitude);
}
/**
* Gets the value(s) for <b>longitude</b> (Longitude as expressed in KML).
* creating it if it does
@ -618,7 +657,44 @@ public class Location extends BaseResource implements IResource {
myLongitude = theValue;
}
/**
* Sets the value for <b>longitude</b> (Longitude as expressed in KML)
*
* <p>
* <b>Definition:</b>
* Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below)
* </p>
*/
public void setLongitude( java.math.BigDecimal theValue) {
myLongitude = new DecimalDt(theValue);
}
/**
* Sets the value for <b>longitude</b> (Longitude as expressed in KML)
*
* <p>
* <b>Definition:</b>
* Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below)
* </p>
*/
public void setLongitude( double theValue) {
myLongitude = new DecimalDt(theValue);
}
/**
* Sets the value for <b>longitude</b> (Longitude as expressed in KML)
*
* <p>
* <b>Definition:</b>
* Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below)
* </p>
*/
public void setLongitude( long theValue) {
myLongitude = new DecimalDt(theValue);
}
/**
* Gets the value(s) for <b>latitude</b> (Latitude as expressed in KML).
* creating it if it does
@ -648,7 +724,44 @@ public class Location extends BaseResource implements IResource {
myLatitude = theValue;
}
/**
* Sets the value for <b>latitude</b> (Latitude as expressed in KML)
*
* <p>
* <b>Definition:</b>
* Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below)
* </p>
*/
public void setLatitude( java.math.BigDecimal theValue) {
myLatitude = new DecimalDt(theValue);
}
/**
* Sets the value for <b>latitude</b> (Latitude as expressed in KML)
*
* <p>
* <b>Definition:</b>
* Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below)
* </p>
*/
public void setLatitude( double theValue) {
myLatitude = new DecimalDt(theValue);
}
/**
* Sets the value for <b>latitude</b> (Latitude as expressed in KML)
*
* <p>
* <b>Definition:</b>
* Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below)
* </p>
*/
public void setLatitude( long theValue) {
myLatitude = new DecimalDt(theValue);
}
/**
* Gets the value(s) for <b>altitude</b> (Altitude as expressed in KML).
* creating it if it does
@ -678,7 +791,44 @@ public class Location extends BaseResource implements IResource {
myAltitude = theValue;
}
/**
* Sets the value for <b>altitude</b> (Altitude as expressed in KML)
*
* <p>
* <b>Definition:</b>
* Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below)
* </p>
*/
public void setAltitude( java.math.BigDecimal theValue) {
myAltitude = new DecimalDt(theValue);
}
/**
* Sets the value for <b>altitude</b> (Altitude as expressed in KML)
*
* <p>
* <b>Definition:</b>
* Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below)
* </p>
*/
public void setAltitude( double theValue) {
myAltitude = new DecimalDt(theValue);
}
/**
* Sets the value for <b>altitude</b> (Altitude as expressed in KML)
*
* <p>
* <b>Definition:</b>
* Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below)
* </p>
*/
public void setAltitude( long theValue) {
myAltitude = new DecimalDt(theValue);
}
}

View File

@ -135,6 +135,12 @@ public class Medication extends BaseResource implements IResource {
@Child(name="package", type=CodeDt.class, order=6, min=0, max=1)
private CodeDt myPackage;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myName, myCode, myIsBrand, myManufacturer, myKind, myProduct, myPackage);
}
/**
* Gets the value(s) for <b>name</b> (Common / Commercial name).
* creating it if it does
@ -164,8 +170,9 @@ public class Medication extends BaseResource implements IResource {
myName = theValue;
}
/**
* Sets the value(s) for <b>name</b> (Common / Commercial name)
* Sets the value for <b>name</b> (Common / Commercial name)
*
* <p>
* <b>Definition:</b>
@ -175,6 +182,7 @@ public class Medication extends BaseResource implements IResource {
public void setName( String theString) {
myName = new StringDt(theString);
}
/**
* Gets the value(s) for <b>code</b> (Codes that identify this medication).
@ -205,6 +213,7 @@ public class Medication extends BaseResource implements IResource {
myCode = theValue;
}
/**
* Gets the value(s) for <b>isBrand</b> (True if a brand).
@ -235,7 +244,20 @@ public class Medication extends BaseResource implements IResource {
myIsBrand = theValue;
}
/**
* Sets the value for <b>isBrand</b> (True if a brand)
*
* <p>
* <b>Definition:</b>
* Set to true if the item is attributable to a specific manufacturer (even if we don't know who that is)
* </p>
*/
public void setIsBrand( Boolean theBoolean) {
myIsBrand = new BooleanDt(theBoolean);
}
/**
* Gets the value(s) for <b>manufacturer</b> (Manufacturer of the item).
* creating it if it does
@ -265,6 +287,7 @@ public class Medication extends BaseResource implements IResource {
myManufacturer = theValue;
}
/**
* Gets the value(s) for <b>kind</b> (product | package).
@ -295,6 +318,7 @@ public class Medication extends BaseResource implements IResource {
myKind = theValue;
}
/**
* Sets the value(s) for <b>kind</b> (product | package)
*
@ -337,6 +361,7 @@ public class Medication extends BaseResource implements IResource {
myProduct = theValue;
}
/**
* Gets the value(s) for <b>package</b> (Details about packaged medications).
@ -367,6 +392,7 @@ public class Medication extends BaseResource implements IResource {
myPackage = theValue;
}
/**
* Block class for child element: <b>Medication.product</b> (Administrable medication details)
@ -385,6 +411,12 @@ public class Medication extends BaseResource implements IResource {
@Child(name="ingredient", order=1, min=0, max=Child.MAX_UNLIMITED)
private List<ProductIngredient> myIngredient;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myForm, myIngredient);
}
/**
* Gets the value(s) for <b>form</b> (powder | tablets | carton +).
* creating it if it does
@ -414,6 +446,7 @@ public class Medication extends BaseResource implements IResource {
myForm = theValue;
}
/**
* Gets the value(s) for <b>ingredient</b> (Active or inactive ingredient).
@ -444,6 +477,20 @@ public class Medication extends BaseResource implements IResource {
myIngredient = theValue;
}
/**
* Adds and returns a new value for <b>ingredient</b> (Active or inactive ingredient)
*
* <p>
* <b>Definition:</b>
* Identifies a particular constituent of interest in the product
* </p>
*/
public ProductIngredient addIngredient() {
ProductIngredient newType = new ProductIngredient();
getIngredient().add(newType);
return newType;
}
}
@ -469,6 +516,12 @@ public class Medication extends BaseResource implements IResource {
@Child(name="amount", type=RatioDt.class, order=1, min=0, max=1)
private RatioDt myAmount;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myItem, myAmount);
}
/**
* Gets the value(s) for <b>item</b> (The product contained).
* creating it if it does
@ -495,6 +548,7 @@ public class Medication extends BaseResource implements IResource {
myItem = theValue;
}
/**
* Gets the value(s) for <b>amount</b> (How much ingredient in product).
@ -525,6 +579,7 @@ public class Medication extends BaseResource implements IResource {
myAmount = theValue;
}
}

View File

@ -264,6 +264,12 @@ public class Observation extends BaseResource implements IResource {
@Child(name="related", order=15, min=0, max=Child.MAX_UNLIMITED)
private List<Related> myRelated;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myName, myValue, myInterpretation, myComments, myApplies, myIssued, myStatus, myReliability, myBodySite, myMethod, myIdentifier, mySubject, mySpecimen, myPerformer, myReferenceRange, myRelated);
}
/**
* Gets the value(s) for <b>name</b> (Type of observation (code / type)).
* creating it if it does
@ -293,6 +299,7 @@ public class Observation extends BaseResource implements IResource {
myName = theValue;
}
/**
* Gets the value(s) for <b>value[x]</b> (Actual result).
@ -320,6 +327,7 @@ public class Observation extends BaseResource implements IResource {
myValue = theValue;
}
/**
* Gets the value(s) for <b>interpretation</b> (High, low, normal, etc.).
@ -350,6 +358,7 @@ public class Observation extends BaseResource implements IResource {
myInterpretation = theValue;
}
/**
* Gets the value(s) for <b>comments</b> (Comments about result).
@ -380,8 +389,9 @@ public class Observation extends BaseResource implements IResource {
myComments = theValue;
}
/**
* Sets the value(s) for <b>comments</b> (Comments about result)
* Sets the value for <b>comments</b> (Comments about result)
*
* <p>
* <b>Definition:</b>
@ -391,6 +401,7 @@ public class Observation extends BaseResource implements IResource {
public void setComments( String theString) {
myComments = new StringDt(theString);
}
/**
* Gets the value(s) for <b>applies[x]</b> (Physiologically Relevant time/time-period for observation).
@ -418,6 +429,7 @@ public class Observation extends BaseResource implements IResource {
myApplies = theValue;
}
/**
* Gets the value(s) for <b>issued</b> (Date/Time this was made available).
@ -448,7 +460,32 @@ public class Observation extends BaseResource implements IResource {
myIssued = theValue;
}
/**
* Sets the value for <b>issued</b> (Date/Time this was made available)
*
* <p>
* <b>Definition:</b>
*
* </p>
*/
public void setIssuedWithMillisPrecision( Date theDate) {
myIssued = new InstantDt(theDate);
}
/**
* Sets the value for <b>issued</b> (Date/Time this was made available)
*
* <p>
* <b>Definition:</b>
*
* </p>
*/
public void setIssued( Date theDate, TemporalPrecisionEnum thePrecision) {
myIssued = new InstantDt(theDate, thePrecision);
}
/**
* Gets the value(s) for <b>status</b> (registered | preliminary | final | amended +).
* creating it if it does
@ -478,6 +515,7 @@ public class Observation extends BaseResource implements IResource {
myStatus = theValue;
}
/**
* Sets the value(s) for <b>status</b> (registered | preliminary | final | amended +)
*
@ -520,6 +558,7 @@ public class Observation extends BaseResource implements IResource {
myReliability = theValue;
}
/**
* Sets the value(s) for <b>reliability</b> (ok | ongoing | early | questionable | calibrating | error + )
*
@ -562,6 +601,7 @@ public class Observation extends BaseResource implements IResource {
myBodySite = theValue;
}
/**
* Gets the value(s) for <b>method</b> (How it was done).
@ -592,6 +632,7 @@ public class Observation extends BaseResource implements IResource {
myMethod = theValue;
}
/**
* Gets the value(s) for <b>identifier</b> (Unique Id for this particular observation).
@ -622,6 +663,7 @@ public class Observation extends BaseResource implements IResource {
myIdentifier = theValue;
}
/**
* Gets the value(s) for <b>subject</b> (Who and/or what this is about).
@ -649,6 +691,7 @@ public class Observation extends BaseResource implements IResource {
mySubject = theValue;
}
/**
* Gets the value(s) for <b>specimen</b> (Specimen used for this observation).
@ -679,6 +722,7 @@ public class Observation extends BaseResource implements IResource {
mySpecimen = theValue;
}
/**
* Gets the value(s) for <b>performer</b> (Who did the observation).
@ -706,6 +750,7 @@ public class Observation extends BaseResource implements IResource {
myPerformer = theValue;
}
/**
* Gets the value(s) for <b>referenceRange</b> (Provides guide for interpretation).
@ -736,6 +781,20 @@ public class Observation extends BaseResource implements IResource {
myReferenceRange = theValue;
}
/**
* Adds and returns a new value for <b>referenceRange</b> (Provides guide for interpretation)
*
* <p>
* <b>Definition:</b>
* Guidance on how to interpret the value by comparison to a normal or recommended range
* </p>
*/
public ReferenceRange addReferenceRange() {
ReferenceRange newType = new ReferenceRange();
getReferenceRange().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>related</b> (Observations related to this observation).
@ -766,6 +825,20 @@ public class Observation extends BaseResource implements IResource {
myRelated = theValue;
}
/**
* Adds and returns a new value for <b>related</b> (Observations related to this observation)
*
* <p>
* <b>Definition:</b>
* Related observations - either components, or previous observations, or statements of derivation
* </p>
*/
public Related addRelated() {
Related newType = new Related();
getRelated().add(newType);
return newType;
}
/**
* Block class for child element: <b>Observation.referenceRange</b> (Provides guide for interpretation)
@ -790,6 +863,12 @@ public class Observation extends BaseResource implements IResource {
@Child(name="age", type=RangeDt.class, order=3, min=0, max=1)
private RangeDt myAge;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myLow, myHigh, myMeaning, myAge);
}
/**
* Gets the value(s) for <b>low</b> (Low Range, if relevant).
* creating it if it does
@ -819,6 +898,7 @@ public class Observation extends BaseResource implements IResource {
myLow = theValue;
}
/**
* Gets the value(s) for <b>high</b> (High Range, if relevant).
@ -849,6 +929,7 @@ public class Observation extends BaseResource implements IResource {
myHigh = theValue;
}
/**
* Gets the value(s) for <b>meaning</b> (Indicates the meaning/use of this range of this range).
@ -879,6 +960,7 @@ public class Observation extends BaseResource implements IResource {
myMeaning = theValue;
}
/**
* Gets the value(s) for <b>age</b> (Applicable age range, if relevant).
@ -909,6 +991,7 @@ public class Observation extends BaseResource implements IResource {
myAge = theValue;
}
}
@ -934,6 +1017,12 @@ public class Observation extends BaseResource implements IResource {
})
private ResourceReference myTarget;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myType, myTarget);
}
/**
* Gets the value(s) for <b>type</b> (has-component | has-member | derived-from | sequel-to | replaces | qualified-by | interfered-by).
* creating it if it does
@ -963,6 +1052,7 @@ public class Observation extends BaseResource implements IResource {
myType = theValue;
}
/**
* Sets the value(s) for <b>type</b> (has-component | has-member | derived-from | sequel-to | replaces | qualified-by | interfered-by)
*
@ -1005,6 +1095,7 @@ public class Observation extends BaseResource implements IResource {
myTarget = theValue;
}
}

View File

@ -144,6 +144,12 @@ public class Organization extends BaseResource implements IResource {
@Child(name="active", type=BooleanDt.class, order=8, min=0, max=1)
private BooleanDt myActive;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myName, myType, myTelecom, myAddress, myPartOf, myContact, myLocation, myActive);
}
/**
* Gets the value(s) for <b>identifier</b> (Identifies this organization across multiple systems).
* creating it if it does
@ -173,6 +179,20 @@ public class Organization extends BaseResource implements IResource {
myIdentifier = theValue;
}
/**
* Adds and returns a new value for <b>identifier</b> (Identifies this organization across multiple systems)
*
* <p>
* <b>Definition:</b>
* Identifier for the organization that is used to identify the organization across multiple disparate systems
* </p>
*/
public IdentifierDt addIdentifier() {
IdentifierDt newType = new IdentifierDt();
getIdentifier().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>name</b> (Name used for the organization).
@ -203,8 +223,9 @@ public class Organization extends BaseResource implements IResource {
myName = theValue;
}
/**
* Sets the value(s) for <b>name</b> (Name used for the organization)
* Sets the value for <b>name</b> (Name used for the organization)
*
* <p>
* <b>Definition:</b>
@ -214,6 +235,7 @@ public class Organization extends BaseResource implements IResource {
public void setName( String theString) {
myName = new StringDt(theString);
}
/**
* Gets the value(s) for <b>type</b> (Kind of organization).
@ -244,6 +266,7 @@ public class Organization extends BaseResource implements IResource {
myType = theValue;
}
/**
* Gets the value(s) for <b>telecom</b> (A contact detail for the organization).
@ -274,6 +297,20 @@ public class Organization extends BaseResource implements IResource {
myTelecom = theValue;
}
/**
* Adds and returns a new value for <b>telecom</b> (A contact detail for the organization)
*
* <p>
* <b>Definition:</b>
* A contact detail for the organization
* </p>
*/
public ContactDt addTelecom() {
ContactDt newType = new ContactDt();
getTelecom().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>address</b> (An address for the organization).
@ -304,6 +341,20 @@ public class Organization extends BaseResource implements IResource {
myAddress = theValue;
}
/**
* Adds and returns a new value for <b>address</b> (An address for the organization)
*
* <p>
* <b>Definition:</b>
* An address for the organization
* </p>
*/
public AddressDt addAddress() {
AddressDt newType = new AddressDt();
getAddress().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>partOf</b> (The organization of which this organization forms a part).
@ -334,6 +385,7 @@ public class Organization extends BaseResource implements IResource {
myPartOf = theValue;
}
/**
* Gets the value(s) for <b>contact</b> (Contact for the organization for a certain purpose).
@ -364,6 +416,20 @@ public class Organization extends BaseResource implements IResource {
myContact = theValue;
}
/**
* Adds and returns a new value for <b>contact</b> (Contact for the organization for a certain purpose)
*
* <p>
* <b>Definition:</b>
*
* </p>
*/
public Contact addContact() {
Contact newType = new Contact();
getContact().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>location</b> (Location(s) the organization uses to provide services).
@ -394,6 +460,7 @@ public class Organization extends BaseResource implements IResource {
myLocation = theValue;
}
/**
* Gets the value(s) for <b>active</b> (Whether the organization's record is still in active use).
@ -424,7 +491,20 @@ public class Organization extends BaseResource implements IResource {
myActive = theValue;
}
/**
* Sets the value for <b>active</b> (Whether the organization's record is still in active use)
*
* <p>
* <b>Definition:</b>
* Whether the organization's record is still in active use
* </p>
*/
public void setActive( Boolean theBoolean) {
myActive = new BooleanDt(theBoolean);
}
/**
* Block class for child element: <b>Organization.contact</b> (Contact for the organization for a certain purpose)
*
@ -451,6 +531,12 @@ public class Organization extends BaseResource implements IResource {
@Child(name="gender", type=CodeableConceptDt.class, order=4, min=0, max=1)
private CodeableConceptDt myGender;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myPurpose, myName, myTelecom, myAddress, myGender);
}
/**
* Gets the value(s) for <b>purpose</b> (The type of contact).
* creating it if it does
@ -480,6 +566,7 @@ public class Organization extends BaseResource implements IResource {
myPurpose = theValue;
}
/**
* Gets the value(s) for <b>name</b> (A name associated with the contact).
@ -510,6 +597,7 @@ public class Organization extends BaseResource implements IResource {
myName = theValue;
}
/**
* Gets the value(s) for <b>telecom</b> (Contact details (telephone, email, etc) for a contact).
@ -540,6 +628,20 @@ public class Organization extends BaseResource implements IResource {
myTelecom = theValue;
}
/**
* Adds and returns a new value for <b>telecom</b> (Contact details (telephone, email, etc) for a contact)
*
* <p>
* <b>Definition:</b>
* A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.
* </p>
*/
public ContactDt addTelecom() {
ContactDt newType = new ContactDt();
getTelecom().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>address</b> (Visiting or postal addresses for the contact).
@ -570,6 +672,7 @@ public class Organization extends BaseResource implements IResource {
myAddress = theValue;
}
/**
* Gets the value(s) for <b>gender</b> (Gender for administrative purposes).
@ -600,6 +703,7 @@ public class Organization extends BaseResource implements IResource {
myGender = theValue;
}
}

View File

@ -255,6 +255,12 @@ public class Patient extends BaseResource implements IResource {
@Child(name="active", type=BooleanDt.class, order=16, min=0, max=1)
private BooleanDt myActive;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myName, myTelecom, myGender, myBirthDate, myDeceased, myAddress, myMaritalStatus, myMultipleBirth, myPhoto, myContact, myAnimal, myCommunication, myCareProvider, myManagingOrganization, myLink, myActive);
}
/**
* Gets the value(s) for <b>identifier</b> (An identifier for the person as this patient).
* creating it if it does
@ -284,6 +290,20 @@ public class Patient extends BaseResource implements IResource {
myIdentifier = theValue;
}
/**
* Adds and returns a new value for <b>identifier</b> (An identifier for the person as this patient)
*
* <p>
* <b>Definition:</b>
* An identifier that applies to this person as a patient
* </p>
*/
public IdentifierDt addIdentifier() {
IdentifierDt newType = new IdentifierDt();
getIdentifier().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>name</b> (A name associated with the patient).
@ -314,6 +334,20 @@ public class Patient extends BaseResource implements IResource {
myName = theValue;
}
/**
* Adds and returns a new value for <b>name</b> (A name associated with the patient)
*
* <p>
* <b>Definition:</b>
* A name associated with the individual.
* </p>
*/
public HumanNameDt addName() {
HumanNameDt newType = new HumanNameDt();
getName().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>telecom</b> (A contact detail for the individual).
@ -344,6 +378,20 @@ public class Patient extends BaseResource implements IResource {
myTelecom = theValue;
}
/**
* Adds and returns a new value for <b>telecom</b> (A contact detail for the individual)
*
* <p>
* <b>Definition:</b>
* A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.
* </p>
*/
public ContactDt addTelecom() {
ContactDt newType = new ContactDt();
getTelecom().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>gender</b> (Gender for administrative purposes).
@ -374,6 +422,7 @@ public class Patient extends BaseResource implements IResource {
myGender = theValue;
}
/**
* Gets the value(s) for <b>birthDate</b> (The date and time of birth for the individual).
@ -404,8 +453,9 @@ public class Patient extends BaseResource implements IResource {
myBirthDate = theValue;
}
/**
* Sets the value(s) for <b>birthDate</b> (The date and time of birth for the individual)
* Sets the value for <b>birthDate</b> (The date and time of birth for the individual)
*
* <p>
* <b>Definition:</b>
@ -415,6 +465,19 @@ public class Patient extends BaseResource implements IResource {
public void setBirthDateWithSecondsPrecision( Date theDate) {
myBirthDate = new DateTimeDt(theDate);
}
/**
* Sets the value for <b>birthDate</b> (The date and time of birth for the individual)
*
* <p>
* <b>Definition:</b>
* The date and time of birth for the individual
* </p>
*/
public void setBirthDate( Date theDate, TemporalPrecisionEnum thePrecision) {
myBirthDate = new DateTimeDt(theDate, thePrecision);
}
/**
* Gets the value(s) for <b>deceased[x]</b> (Indicates if the individual is deceased or not).
@ -442,6 +505,7 @@ public class Patient extends BaseResource implements IResource {
myDeceased = theValue;
}
/**
* Gets the value(s) for <b>address</b> (Addresses for the individual).
@ -472,6 +536,20 @@ public class Patient extends BaseResource implements IResource {
myAddress = theValue;
}
/**
* Adds and returns a new value for <b>address</b> (Addresses for the individual)
*
* <p>
* <b>Definition:</b>
* Addresses for the individual
* </p>
*/
public AddressDt addAddress() {
AddressDt newType = new AddressDt();
getAddress().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>maritalStatus</b> (Marital (civil) status of a person).
@ -502,6 +580,7 @@ public class Patient extends BaseResource implements IResource {
myMaritalStatus = theValue;
}
/**
* Gets the value(s) for <b>multipleBirth[x]</b> (Whether patient is part of a multiple birth).
@ -529,6 +608,7 @@ public class Patient extends BaseResource implements IResource {
myMultipleBirth = theValue;
}
/**
* Gets the value(s) for <b>photo</b> (Image of the person).
@ -559,6 +639,20 @@ public class Patient extends BaseResource implements IResource {
myPhoto = theValue;
}
/**
* Adds and returns a new value for <b>photo</b> (Image of the person)
*
* <p>
* <b>Definition:</b>
* Image of the person
* </p>
*/
public AttachmentDt addPhoto() {
AttachmentDt newType = new AttachmentDt();
getPhoto().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>contact</b> (A contact party (e.g. guardian, partner, friend) for the patient).
@ -589,6 +683,20 @@ public class Patient extends BaseResource implements IResource {
myContact = theValue;
}
/**
* Adds and returns a new value for <b>contact</b> (A contact party (e.g. guardian, partner, friend) for the patient)
*
* <p>
* <b>Definition:</b>
* A contact party (e.g. guardian, partner, friend) for the patient
* </p>
*/
public Contact addContact() {
Contact newType = new Contact();
getContact().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>animal</b> (If this patient is an animal (non-human)).
@ -619,6 +727,7 @@ public class Patient extends BaseResource implements IResource {
myAnimal = theValue;
}
/**
* Gets the value(s) for <b>communication</b> (Languages which may be used to communicate with the patient about his or her health).
@ -649,6 +758,20 @@ public class Patient extends BaseResource implements IResource {
myCommunication = theValue;
}
/**
* Adds and returns a new value for <b>communication</b> (Languages which may be used to communicate with the patient about his or her health)
*
* <p>
* <b>Definition:</b>
* Languages which may be used to communicate with the patient about his or her health
* </p>
*/
public CodeableConceptDt addCommunication() {
CodeableConceptDt newType = new CodeableConceptDt();
getCommunication().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>careProvider</b> (Patient's nominated care provider).
@ -676,6 +799,7 @@ public class Patient extends BaseResource implements IResource {
myCareProvider = theValue;
}
/**
* Gets the value(s) for <b>managingOrganization</b> (Organization that is the custodian of the patient record).
@ -706,6 +830,7 @@ public class Patient extends BaseResource implements IResource {
myManagingOrganization = theValue;
}
/**
* Gets the value(s) for <b>link</b> (Link to another patient resource that concerns the same actual person).
@ -736,6 +861,20 @@ public class Patient extends BaseResource implements IResource {
myLink = theValue;
}
/**
* Adds and returns a new value for <b>link</b> (Link to another patient resource that concerns the same actual person)
*
* <p>
* <b>Definition:</b>
* Link to another patient resource that concerns the same actual person
* </p>
*/
public Link addLink() {
Link newType = new Link();
getLink().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>active</b> (Whether this patient's record is in active use).
@ -766,7 +905,20 @@ public class Patient extends BaseResource implements IResource {
myActive = theValue;
}
/**
* Sets the value for <b>active</b> (Whether this patient's record is in active use)
*
* <p>
* <b>Definition:</b>
* Whether this patient record is in active use
* </p>
*/
public void setActive( Boolean theBoolean) {
myActive = new BooleanDt(theBoolean);
}
/**
* Block class for child element: <b>Patient.contact</b> (A contact party (e.g. guardian, partner, friend) for the patient)
*
@ -799,6 +951,12 @@ public class Patient extends BaseResource implements IResource {
})
private ResourceReference myOrganization;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myRelationship, myName, myTelecom, myAddress, myGender, myOrganization);
}
/**
* Gets the value(s) for <b>relationship</b> (The kind of relationship).
* creating it if it does
@ -828,6 +986,20 @@ public class Patient extends BaseResource implements IResource {
myRelationship = theValue;
}
/**
* Adds and returns a new value for <b>relationship</b> (The kind of relationship)
*
* <p>
* <b>Definition:</b>
* The nature of the relationship between the patient and the contact person
* </p>
*/
public CodeableConceptDt addRelationship() {
CodeableConceptDt newType = new CodeableConceptDt();
getRelationship().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>name</b> (A name associated with the person).
@ -858,6 +1030,7 @@ public class Patient extends BaseResource implements IResource {
myName = theValue;
}
/**
* Gets the value(s) for <b>telecom</b> (A contact detail for the person).
@ -888,6 +1061,20 @@ public class Patient extends BaseResource implements IResource {
myTelecom = theValue;
}
/**
* Adds and returns a new value for <b>telecom</b> (A contact detail for the person)
*
* <p>
* <b>Definition:</b>
* A contact detail for the person, e.g. a telephone number or an email address.
* </p>
*/
public ContactDt addTelecom() {
ContactDt newType = new ContactDt();
getTelecom().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>address</b> (Address for the contact person).
@ -918,6 +1105,7 @@ public class Patient extends BaseResource implements IResource {
myAddress = theValue;
}
/**
* Gets the value(s) for <b>gender</b> (Gender for administrative purposes).
@ -948,6 +1136,7 @@ public class Patient extends BaseResource implements IResource {
myGender = theValue;
}
/**
* Gets the value(s) for <b>organization</b> (Organization that is associated with the contact).
@ -978,6 +1167,7 @@ public class Patient extends BaseResource implements IResource {
myOrganization = theValue;
}
}
@ -1003,6 +1193,12 @@ public class Patient extends BaseResource implements IResource {
@Child(name="genderStatus", type=CodeableConceptDt.class, order=2, min=0, max=1)
private CodeableConceptDt myGenderStatus;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySpecies, myBreed, myGenderStatus);
}
/**
* Gets the value(s) for <b>species</b> (E.g. Dog, Cow).
* creating it if it does
@ -1032,6 +1228,7 @@ public class Patient extends BaseResource implements IResource {
mySpecies = theValue;
}
/**
* Gets the value(s) for <b>breed</b> (E.g. Poodle, Angus).
@ -1062,6 +1259,7 @@ public class Patient extends BaseResource implements IResource {
myBreed = theValue;
}
/**
* Gets the value(s) for <b>genderStatus</b> (E.g. Neutered, Intact).
@ -1092,6 +1290,7 @@ public class Patient extends BaseResource implements IResource {
myGenderStatus = theValue;
}
}
@ -1117,6 +1316,12 @@ public class Patient extends BaseResource implements IResource {
@Child(name="type", type=CodeDt.class, order=1, min=1, max=1)
private BoundCodeDt<LinkTypeEnum> myType;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myOther, myType);
}
/**
* Gets the value(s) for <b>other</b> (The other patient resource that the link refers to).
* creating it if it does
@ -1146,6 +1351,7 @@ public class Patient extends BaseResource implements IResource {
myOther = theValue;
}
/**
* Gets the value(s) for <b>type</b> (replace | refer | seealso - type of link).
@ -1176,6 +1382,7 @@ public class Patient extends BaseResource implements IResource {
myType = theValue;
}
/**
* Sets the value(s) for <b>type</b> (replace | refer | seealso - type of link)
*

View File

@ -179,6 +179,12 @@ public class Practitioner extends BaseResource implements IResource {
@Child(name="communication", type=CodeableConceptDt.class, order=13, min=0, max=Child.MAX_UNLIMITED)
private List<CodeableConceptDt> myCommunication;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myName, myTelecom, myAddress, myGender, myBirthDate, myPhoto, myOrganization, myRole, mySpecialty, myPeriod, myLocation, myQualification, myCommunication);
}
/**
* Gets the value(s) for <b>identifier</b> (A identifier for the person as this agent).
* creating it if it does
@ -208,6 +214,20 @@ public class Practitioner extends BaseResource implements IResource {
myIdentifier = theValue;
}
/**
* Adds and returns a new value for <b>identifier</b> (A identifier for the person as this agent)
*
* <p>
* <b>Definition:</b>
* An identifier that applies to this person in this role
* </p>
*/
public IdentifierDt addIdentifier() {
IdentifierDt newType = new IdentifierDt();
getIdentifier().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>name</b> (A name associated with the person).
@ -238,6 +258,7 @@ public class Practitioner extends BaseResource implements IResource {
myName = theValue;
}
/**
* Gets the value(s) for <b>telecom</b> (A contact detail for the practitioner).
@ -268,6 +289,20 @@ public class Practitioner extends BaseResource implements IResource {
myTelecom = theValue;
}
/**
* Adds and returns a new value for <b>telecom</b> (A contact detail for the practitioner)
*
* <p>
* <b>Definition:</b>
* A contact detail for the practitioner, e.g. a telephone number or an email address.
* </p>
*/
public ContactDt addTelecom() {
ContactDt newType = new ContactDt();
getTelecom().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>address</b> (Where practitioner can be found/visited).
@ -298,6 +333,7 @@ public class Practitioner extends BaseResource implements IResource {
myAddress = theValue;
}
/**
* Gets the value(s) for <b>gender</b> (Gender for administrative purposes).
@ -328,6 +364,7 @@ public class Practitioner extends BaseResource implements IResource {
myGender = theValue;
}
/**
* Gets the value(s) for <b>birthDate</b> (The date and time of birth for the practitioner).
@ -358,8 +395,9 @@ public class Practitioner extends BaseResource implements IResource {
myBirthDate = theValue;
}
/**
* Sets the value(s) for <b>birthDate</b> (The date and time of birth for the practitioner)
* Sets the value for <b>birthDate</b> (The date and time of birth for the practitioner)
*
* <p>
* <b>Definition:</b>
@ -369,6 +407,19 @@ public class Practitioner extends BaseResource implements IResource {
public void setBirthDateWithSecondsPrecision( Date theDate) {
myBirthDate = new DateTimeDt(theDate);
}
/**
* Sets the value for <b>birthDate</b> (The date and time of birth for the practitioner)
*
* <p>
* <b>Definition:</b>
* The date and time of birth for the practitioner
* </p>
*/
public void setBirthDate( Date theDate, TemporalPrecisionEnum thePrecision) {
myBirthDate = new DateTimeDt(theDate, thePrecision);
}
/**
* Gets the value(s) for <b>photo</b> (Image of the person).
@ -399,6 +450,20 @@ public class Practitioner extends BaseResource implements IResource {
myPhoto = theValue;
}
/**
* Adds and returns a new value for <b>photo</b> (Image of the person)
*
* <p>
* <b>Definition:</b>
* Image of the person
* </p>
*/
public AttachmentDt addPhoto() {
AttachmentDt newType = new AttachmentDt();
getPhoto().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>organization</b> (The represented organization).
@ -429,6 +494,7 @@ public class Practitioner extends BaseResource implements IResource {
myOrganization = theValue;
}
/**
* Gets the value(s) for <b>role</b> (Roles which this practitioner may perform).
@ -459,6 +525,20 @@ public class Practitioner extends BaseResource implements IResource {
myRole = theValue;
}
/**
* Adds and returns a new value for <b>role</b> (Roles which this practitioner may perform)
*
* <p>
* <b>Definition:</b>
* Roles which this practitioner is authorized to perform for the organization
* </p>
*/
public CodeableConceptDt addRole() {
CodeableConceptDt newType = new CodeableConceptDt();
getRole().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>specialty</b> (Specific specialty of the practitioner).
@ -489,6 +569,20 @@ public class Practitioner extends BaseResource implements IResource {
mySpecialty = theValue;
}
/**
* Adds and returns a new value for <b>specialty</b> (Specific specialty of the practitioner)
*
* <p>
* <b>Definition:</b>
* Specific specialty of the practitioner
* </p>
*/
public CodeableConceptDt addSpecialty() {
CodeableConceptDt newType = new CodeableConceptDt();
getSpecialty().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>period</b> (The period during which the practitioner is authorized to perform in these role(s)).
@ -519,6 +613,7 @@ public class Practitioner extends BaseResource implements IResource {
myPeriod = theValue;
}
/**
* Gets the value(s) for <b>location</b> (The location(s) at which this practitioner provides care).
@ -549,6 +644,7 @@ public class Practitioner extends BaseResource implements IResource {
myLocation = theValue;
}
/**
* Gets the value(s) for <b>qualification</b> (Qualifications obtained by training and certification).
@ -579,6 +675,20 @@ public class Practitioner extends BaseResource implements IResource {
myQualification = theValue;
}
/**
* Adds and returns a new value for <b>qualification</b> (Qualifications obtained by training and certification)
*
* <p>
* <b>Definition:</b>
*
* </p>
*/
public Qualification addQualification() {
Qualification newType = new Qualification();
getQualification().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>communication</b> (A language the practitioner is able to use in patient communication).
@ -609,6 +719,20 @@ public class Practitioner extends BaseResource implements IResource {
myCommunication = theValue;
}
/**
* Adds and returns a new value for <b>communication</b> (A language the practitioner is able to use in patient communication)
*
* <p>
* <b>Definition:</b>
* A language the practitioner is able to use in patient communication
* </p>
*/
public CodeableConceptDt addCommunication() {
CodeableConceptDt newType = new CodeableConceptDt();
getCommunication().add(newType);
return newType;
}
/**
* Block class for child element: <b>Practitioner.qualification</b> (Qualifications obtained by training and certification)
@ -633,6 +757,12 @@ public class Practitioner extends BaseResource implements IResource {
})
private ResourceReference myIssuer;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCode, myPeriod, myIssuer);
}
/**
* Gets the value(s) for <b>code</b> (Coded representation of the qualification).
* creating it if it does
@ -662,6 +792,7 @@ public class Practitioner extends BaseResource implements IResource {
myCode = theValue;
}
/**
* Gets the value(s) for <b>period</b> (Period during which the qualification is valid).
@ -692,6 +823,7 @@ public class Practitioner extends BaseResource implements IResource {
myPeriod = theValue;
}
/**
* Gets the value(s) for <b>issuer</b> (Organization that regulates and issues the qualification).
@ -722,6 +854,7 @@ public class Practitioner extends BaseResource implements IResource {
myIssuer = theValue;
}
}

View File

@ -84,6 +84,12 @@ public class Specimen extends BaseResource implements IResource {
@Child(name="container", order=8, min=0, max=Child.MAX_UNLIMITED)
private List<Container> myContainer;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myType, mySource, mySubject, myAccessionIdentifier, myReceivedTime, myCollection, myTreatment, myContainer);
}
/**
* Gets the value(s) for <b>identifier</b> (External Identifier).
* creating it if it does
@ -113,6 +119,20 @@ public class Specimen extends BaseResource implements IResource {
myIdentifier = theValue;
}
/**
* Adds and returns a new value for <b>identifier</b> (External Identifier)
*
* <p>
* <b>Definition:</b>
* Id for specimen
* </p>
*/
public IdentifierDt addIdentifier() {
IdentifierDt newType = new IdentifierDt();
getIdentifier().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>type</b> (Kind of material that forms the specimen).
@ -143,6 +163,7 @@ public class Specimen extends BaseResource implements IResource {
myType = theValue;
}
/**
* Gets the value(s) for <b>source</b> (Parent of specimen).
@ -173,6 +194,20 @@ public class Specimen extends BaseResource implements IResource {
mySource = theValue;
}
/**
* Adds and returns a new value for <b>source</b> (Parent of specimen)
*
* <p>
* <b>Definition:</b>
* Parent specimen from which the focal specimen was a component
* </p>
*/
public Source addSource() {
Source newType = new Source();
getSource().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>subject</b> (Where the specimen came from. This may be the patient(s) or from the environment or a device).
@ -200,6 +235,7 @@ public class Specimen extends BaseResource implements IResource {
mySubject = theValue;
}
/**
* Gets the value(s) for <b>accessionIdentifier</b> (Identifier assigned by the lab).
@ -230,6 +266,7 @@ public class Specimen extends BaseResource implements IResource {
myAccessionIdentifier = theValue;
}
/**
* Gets the value(s) for <b>receivedTime</b> (The time when specimen was received for processing).
@ -260,8 +297,9 @@ public class Specimen extends BaseResource implements IResource {
myReceivedTime = theValue;
}
/**
* Sets the value(s) for <b>receivedTime</b> (The time when specimen was received for processing)
* Sets the value for <b>receivedTime</b> (The time when specimen was received for processing)
*
* <p>
* <b>Definition:</b>
@ -271,6 +309,19 @@ public class Specimen extends BaseResource implements IResource {
public void setReceivedTimeWithSecondsPrecision( Date theDate) {
myReceivedTime = new DateTimeDt(theDate);
}
/**
* Sets the value for <b>receivedTime</b> (The time when specimen was received for processing)
*
* <p>
* <b>Definition:</b>
* Time when specimen was received for processing or testing
* </p>
*/
public void setReceivedTime( Date theDate, TemporalPrecisionEnum thePrecision) {
myReceivedTime = new DateTimeDt(theDate, thePrecision);
}
/**
* Gets the value(s) for <b>collection</b> (Collection details).
@ -301,6 +352,7 @@ public class Specimen extends BaseResource implements IResource {
myCollection = theValue;
}
/**
* Gets the value(s) for <b>treatment</b> (Treatment and processing step details).
@ -331,6 +383,20 @@ public class Specimen extends BaseResource implements IResource {
myTreatment = theValue;
}
/**
* Adds and returns a new value for <b>treatment</b> (Treatment and processing step details)
*
* <p>
* <b>Definition:</b>
* Details concerning treatment and processing steps for the specimen
* </p>
*/
public Treatment addTreatment() {
Treatment newType = new Treatment();
getTreatment().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>container</b> (Direct container of specimen (tube/slide, etc)).
@ -361,6 +427,20 @@ public class Specimen extends BaseResource implements IResource {
myContainer = theValue;
}
/**
* Adds and returns a new value for <b>container</b> (Direct container of specimen (tube/slide, etc))
*
* <p>
* <b>Definition:</b>
* The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here.
* </p>
*/
public Container addContainer() {
Container newType = new Container();
getContainer().add(newType);
return newType;
}
/**
* Block class for child element: <b>Specimen.source</b> (Parent of specimen)
@ -382,6 +462,12 @@ public class Specimen extends BaseResource implements IResource {
})
private List<ResourceReference> myTarget;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myRelationship, myTarget);
}
/**
* Gets the value(s) for <b>relationship</b> (parent | child).
* creating it if it does
@ -411,6 +497,7 @@ public class Specimen extends BaseResource implements IResource {
myRelationship = theValue;
}
/**
* Sets the value(s) for <b>relationship</b> (parent | child)
*
@ -453,6 +540,7 @@ public class Specimen extends BaseResource implements IResource {
myTarget = theValue;
}
}
@ -493,6 +581,12 @@ public class Specimen extends BaseResource implements IResource {
@Child(name="sourceSite", type=CodeableConceptDt.class, order=5, min=0, max=1)
private CodeableConceptDt mySourceSite;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCollector, myComment, myCollected, myQuantity, myMethod, mySourceSite);
}
/**
* Gets the value(s) for <b>collector</b> (Who collected the specimen).
* creating it if it does
@ -522,6 +616,7 @@ public class Specimen extends BaseResource implements IResource {
myCollector = theValue;
}
/**
* Gets the value(s) for <b>comment</b> (Collector comments).
@ -552,8 +647,22 @@ public class Specimen extends BaseResource implements IResource {
myComment = theValue;
}
/**
* Adds and returns a new value for <b>comment</b> (Collector comments)
*
* <p>
* <b>Definition:</b>
* To communicate any details or issues encountered during the specimen collection procedure.
* </p>
*/
public StringDt addComment() {
StringDt newType = new StringDt();
getComment().add(newType);
return newType;
}
/**
* Sets the value(s) for <b>comment</b> (Collector comments)
* Adds a new value for <b>comment</b> (Collector comments)
*
* <p>
* <b>Definition:</b>
@ -566,6 +675,7 @@ public class Specimen extends BaseResource implements IResource {
}
myComment.add(new StringDt(theString));
}
/**
* Gets the value(s) for <b>collected[x]</b> (Collection time).
@ -593,6 +703,7 @@ public class Specimen extends BaseResource implements IResource {
myCollected = theValue;
}
/**
* Gets the value(s) for <b>quantity</b> (The quantity of specimen collected).
@ -623,6 +734,7 @@ public class Specimen extends BaseResource implements IResource {
myQuantity = theValue;
}
/**
* Gets the value(s) for <b>method</b> (Technique used to perform collection).
@ -653,6 +765,7 @@ public class Specimen extends BaseResource implements IResource {
myMethod = theValue;
}
/**
* Gets the value(s) for <b>sourceSite</b> (Anatomical collection site).
@ -683,6 +796,7 @@ public class Specimen extends BaseResource implements IResource {
mySourceSite = theValue;
}
}
@ -711,6 +825,12 @@ public class Specimen extends BaseResource implements IResource {
})
private List<ResourceReference> myAdditive;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myDescription, myProcedure, myAdditive);
}
/**
* Gets the value(s) for <b>description</b> (Textual description of procedure).
* creating it if it does
@ -740,8 +860,9 @@ public class Specimen extends BaseResource implements IResource {
myDescription = theValue;
}
/**
* Sets the value(s) for <b>description</b> (Textual description of procedure)
* Sets the value for <b>description</b> (Textual description of procedure)
*
* <p>
* <b>Definition:</b>
@ -751,6 +872,7 @@ public class Specimen extends BaseResource implements IResource {
public void setDescription( String theString) {
myDescription = new StringDt(theString);
}
/**
* Gets the value(s) for <b>procedure</b> (Indicates the treatment or processing step applied to the specimen).
@ -781,6 +903,7 @@ public class Specimen extends BaseResource implements IResource {
myProcedure = theValue;
}
/**
* Gets the value(s) for <b>additive</b> (Material used in the processing step).
@ -811,6 +934,7 @@ public class Specimen extends BaseResource implements IResource {
myAdditive = theValue;
}
}
@ -848,6 +972,12 @@ public class Specimen extends BaseResource implements IResource {
})
private ResourceReference myAdditive;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myDescription, myType, myCapacity, mySpecimenQuantity, myAdditive);
}
/**
* Gets the value(s) for <b>identifier</b> (Id for the container).
* creating it if it does
@ -877,6 +1007,20 @@ public class Specimen extends BaseResource implements IResource {
myIdentifier = theValue;
}
/**
* Adds and returns a new value for <b>identifier</b> (Id for the container)
*
* <p>
* <b>Definition:</b>
* Id for container. There may be multiple; a manufacturer's bar code, lab assigned identifier, etc. The container ID may differ from the specimen id in some circumstances
* </p>
*/
public IdentifierDt addIdentifier() {
IdentifierDt newType = new IdentifierDt();
getIdentifier().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>description</b> (Textual description of the container).
@ -907,8 +1051,9 @@ public class Specimen extends BaseResource implements IResource {
myDescription = theValue;
}
/**
* Sets the value(s) for <b>description</b> (Textual description of the container)
* Sets the value for <b>description</b> (Textual description of the container)
*
* <p>
* <b>Definition:</b>
@ -918,6 +1063,7 @@ public class Specimen extends BaseResource implements IResource {
public void setDescription( String theString) {
myDescription = new StringDt(theString);
}
/**
* Gets the value(s) for <b>type</b> (Kind of container directly associated with specimen).
@ -948,6 +1094,7 @@ public class Specimen extends BaseResource implements IResource {
myType = theValue;
}
/**
* Gets the value(s) for <b>capacity</b> (Container volume or size).
@ -978,6 +1125,7 @@ public class Specimen extends BaseResource implements IResource {
myCapacity = theValue;
}
/**
* Gets the value(s) for <b>specimenQuantity</b> (Quantity of specimen within container).
@ -1008,6 +1156,7 @@ public class Specimen extends BaseResource implements IResource {
mySpecimenQuantity = theValue;
}
/**
* Gets the value(s) for <b>additive</b> (Additive associated with container ).
@ -1038,6 +1187,7 @@ public class Specimen extends BaseResource implements IResource {
myAdditive = theValue;
}
}

View File

@ -103,6 +103,12 @@ public class Substance extends BaseResource implements IResource {
@Child(name="ingredient", order=3, min=0, max=Child.MAX_UNLIMITED)
private List<Ingredient> myIngredient;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myType, myDescription, myInstance, myIngredient);
}
/**
* Gets the value(s) for <b>type</b> (What kind of substance this is).
* creating it if it does
@ -132,6 +138,7 @@ public class Substance extends BaseResource implements IResource {
myType = theValue;
}
/**
* Gets the value(s) for <b>description</b> (Textual description of the substance, comments).
@ -162,8 +169,9 @@ public class Substance extends BaseResource implements IResource {
myDescription = theValue;
}
/**
* Sets the value(s) for <b>description</b> (Textual description of the substance, comments)
* Sets the value for <b>description</b> (Textual description of the substance, comments)
*
* <p>
* <b>Definition:</b>
@ -173,6 +181,7 @@ public class Substance extends BaseResource implements IResource {
public void setDescription( String theString) {
myDescription = new StringDt(theString);
}
/**
* Gets the value(s) for <b>instance</b> (If this describes a specific package/container of the substance).
@ -203,6 +212,7 @@ public class Substance extends BaseResource implements IResource {
myInstance = theValue;
}
/**
* Gets the value(s) for <b>ingredient</b> (Composition information about the substance).
@ -233,6 +243,20 @@ public class Substance extends BaseResource implements IResource {
myIngredient = theValue;
}
/**
* Adds and returns a new value for <b>ingredient</b> (Composition information about the substance)
*
* <p>
* <b>Definition:</b>
* A substance can be composed of other substances
* </p>
*/
public Ingredient addIngredient() {
Ingredient newType = new Ingredient();
getIngredient().add(newType);
return newType;
}
/**
* Block class for child element: <b>Substance.instance</b> (If this describes a specific package/container of the substance)
@ -254,6 +278,12 @@ public class Substance extends BaseResource implements IResource {
@Child(name="quantity", type=QuantityDt.class, order=2, min=0, max=1)
private QuantityDt myQuantity;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myExpiry, myQuantity);
}
/**
* Gets the value(s) for <b>identifier</b> (Identifier of the package/container).
* creating it if it does
@ -283,6 +313,7 @@ public class Substance extends BaseResource implements IResource {
myIdentifier = theValue;
}
/**
* Gets the value(s) for <b>expiry</b> (When no longer valid to use).
@ -313,8 +344,9 @@ public class Substance extends BaseResource implements IResource {
myExpiry = theValue;
}
/**
* Sets the value(s) for <b>expiry</b> (When no longer valid to use)
* Sets the value for <b>expiry</b> (When no longer valid to use)
*
* <p>
* <b>Definition:</b>
@ -324,6 +356,19 @@ public class Substance extends BaseResource implements IResource {
public void setExpiryWithSecondsPrecision( Date theDate) {
myExpiry = new DateTimeDt(theDate);
}
/**
* Sets the value for <b>expiry</b> (When no longer valid to use)
*
* <p>
* <b>Definition:</b>
* When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.
* </p>
*/
public void setExpiry( Date theDate, TemporalPrecisionEnum thePrecision) {
myExpiry = new DateTimeDt(theDate, thePrecision);
}
/**
* Gets the value(s) for <b>quantity</b> (Amount of substance in the package).
@ -354,6 +399,7 @@ public class Substance extends BaseResource implements IResource {
myQuantity = theValue;
}
}
@ -379,6 +425,12 @@ public class Substance extends BaseResource implements IResource {
})
private ResourceReference mySubstance;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myQuantity, mySubstance);
}
/**
* Gets the value(s) for <b>quantity</b> (Optional amount (concentration)).
* creating it if it does
@ -408,6 +460,7 @@ public class Substance extends BaseResource implements IResource {
myQuantity = theValue;
}
/**
* Gets the value(s) for <b>substance</b> (A component of the substance).
@ -438,6 +491,7 @@ public class Substance extends BaseResource implements IResource {
mySubstance = theValue;
}
}

View File

@ -193,6 +193,12 @@ public class ValueSet extends BaseResource implements IResource {
@Child(name="expansion", order=13, min=0, max=1)
private Expansion myExpansion;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myVersion, myName, myPublisher, myTelecom, myDescription, myCopyright, myStatus, myExperimental, myExtensible, myDate, myDefine, myCompose, myExpansion);
}
/**
* Gets the value(s) for <b>identifier</b> (Logical id to reference this value set).
* creating it if it does
@ -222,8 +228,9 @@ public class ValueSet extends BaseResource implements IResource {
myIdentifier = theValue;
}
/**
* Sets the value(s) for <b>identifier</b> (Logical id to reference this value set)
* Sets the value for <b>identifier</b> (Logical id to reference this value set)
*
* <p>
* <b>Definition:</b>
@ -233,6 +240,7 @@ public class ValueSet extends BaseResource implements IResource {
public void setIdentifier( String theString) {
myIdentifier = new StringDt(theString);
}
/**
* Gets the value(s) for <b>version</b> (Logical id for this version of the value set).
@ -263,8 +271,9 @@ public class ValueSet extends BaseResource implements IResource {
myVersion = theValue;
}
/**
* Sets the value(s) for <b>version</b> (Logical id for this version of the value set)
* Sets the value for <b>version</b> (Logical id for this version of the value set)
*
* <p>
* <b>Definition:</b>
@ -274,6 +283,7 @@ public class ValueSet extends BaseResource implements IResource {
public void setVersion( String theString) {
myVersion = new StringDt(theString);
}
/**
* Gets the value(s) for <b>name</b> (Informal name for this value set).
@ -304,8 +314,9 @@ public class ValueSet extends BaseResource implements IResource {
myName = theValue;
}
/**
* Sets the value(s) for <b>name</b> (Informal name for this value set)
* Sets the value for <b>name</b> (Informal name for this value set)
*
* <p>
* <b>Definition:</b>
@ -315,6 +326,7 @@ public class ValueSet extends BaseResource implements IResource {
public void setName( String theString) {
myName = new StringDt(theString);
}
/**
* Gets the value(s) for <b>publisher</b> (Name of the publisher (Organization or individual)).
@ -345,8 +357,9 @@ public class ValueSet extends BaseResource implements IResource {
myPublisher = theValue;
}
/**
* Sets the value(s) for <b>publisher</b> (Name of the publisher (Organization or individual))
* Sets the value for <b>publisher</b> (Name of the publisher (Organization or individual))
*
* <p>
* <b>Definition:</b>
@ -356,6 +369,7 @@ public class ValueSet extends BaseResource implements IResource {
public void setPublisher( String theString) {
myPublisher = new StringDt(theString);
}
/**
* Gets the value(s) for <b>telecom</b> (Contact information of the publisher).
@ -386,6 +400,20 @@ public class ValueSet extends BaseResource implements IResource {
myTelecom = theValue;
}
/**
* Adds and returns a new value for <b>telecom</b> (Contact information of the publisher)
*
* <p>
* <b>Definition:</b>
* Contacts of the publisher to assist a user in finding and communicating with the publisher
* </p>
*/
public ContactDt addTelecom() {
ContactDt newType = new ContactDt();
getTelecom().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>description</b> (Human language description of the value set).
@ -416,8 +444,9 @@ public class ValueSet extends BaseResource implements IResource {
myDescription = theValue;
}
/**
* Sets the value(s) for <b>description</b> (Human language description of the value set)
* Sets the value for <b>description</b> (Human language description of the value set)
*
* <p>
* <b>Definition:</b>
@ -427,6 +456,7 @@ public class ValueSet extends BaseResource implements IResource {
public void setDescription( String theString) {
myDescription = new StringDt(theString);
}
/**
* Gets the value(s) for <b>copyright</b> (About the value set or its content).
@ -457,8 +487,9 @@ public class ValueSet extends BaseResource implements IResource {
myCopyright = theValue;
}
/**
* Sets the value(s) for <b>copyright</b> (About the value set or its content)
* Sets the value for <b>copyright</b> (About the value set or its content)
*
* <p>
* <b>Definition:</b>
@ -468,6 +499,7 @@ public class ValueSet extends BaseResource implements IResource {
public void setCopyright( String theString) {
myCopyright = new StringDt(theString);
}
/**
* Gets the value(s) for <b>status</b> (draft | active | retired
@ -500,6 +532,7 @@ public class ValueSet extends BaseResource implements IResource {
myStatus = theValue;
}
/**
* Sets the value(s) for <b>status</b> (draft | active | retired
)
@ -543,7 +576,20 @@ public class ValueSet extends BaseResource implements IResource {
myExperimental = theValue;
}
/**
* Sets the value for <b>experimental</b> (If for testing purposes, not real usage)
*
* <p>
* <b>Definition:</b>
* This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage
* </p>
*/
public void setExperimental( Boolean theBoolean) {
myExperimental = new BooleanDt(theBoolean);
}
/**
* Gets the value(s) for <b>extensible</b> (Whether this is intended to be used with an extensible binding).
* creating it if it does
@ -573,7 +619,20 @@ public class ValueSet extends BaseResource implements IResource {
myExtensible = theValue;
}
/**
* Sets the value for <b>extensible</b> (Whether this is intended to be used with an extensible binding)
*
* <p>
* <b>Definition:</b>
* Whether this is intended to be used with an extensible binding or not
* </p>
*/
public void setExtensible( Boolean theBoolean) {
myExtensible = new BooleanDt(theBoolean);
}
/**
* Gets the value(s) for <b>date</b> (Date for given status).
* creating it if it does
@ -603,8 +662,9 @@ public class ValueSet extends BaseResource implements IResource {
myDate = theValue;
}
/**
* Sets the value(s) for <b>date</b> (Date for given status)
* Sets the value for <b>date</b> (Date for given status)
*
* <p>
* <b>Definition:</b>
@ -614,6 +674,19 @@ public class ValueSet extends BaseResource implements IResource {
public void setDateWithSecondsPrecision( Date theDate) {
myDate = new DateTimeDt(theDate);
}
/**
* Sets the value for <b>date</b> (Date for given status)
*
* <p>
* <b>Definition:</b>
* The date that the value set status was last changed
* </p>
*/
public void setDate( Date theDate, TemporalPrecisionEnum thePrecision) {
myDate = new DateTimeDt(theDate, thePrecision);
}
/**
* Gets the value(s) for <b>define</b> (When value set defines its own codes).
@ -644,6 +717,7 @@ public class ValueSet extends BaseResource implements IResource {
myDefine = theValue;
}
/**
* Gets the value(s) for <b>compose</b> (When value set includes codes from elsewhere).
@ -674,6 +748,7 @@ public class ValueSet extends BaseResource implements IResource {
myCompose = theValue;
}
/**
* Gets the value(s) for <b>expansion</b> (When value set is an expansion).
@ -704,6 +779,7 @@ public class ValueSet extends BaseResource implements IResource {
myExpansion = theValue;
}
/**
* Block class for child element: <b>ValueSet.define</b> (When value set defines its own codes)
@ -728,6 +804,12 @@ public class ValueSet extends BaseResource implements IResource {
@Child(name="concept", order=3, min=0, max=Child.MAX_UNLIMITED)
private List<DefineConcept> myConcept;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySystem, myVersion, myCaseSensitive, myConcept);
}
/**
* Gets the value(s) for <b>system</b> (URI to identify the code system).
* creating it if it does
@ -757,8 +839,9 @@ public class ValueSet extends BaseResource implements IResource {
mySystem = theValue;
}
/**
* Sets the value(s) for <b>system</b> (URI to identify the code system)
* Sets the value for <b>system</b> (URI to identify the code system)
*
* <p>
* <b>Definition:</b>
@ -768,6 +851,7 @@ public class ValueSet extends BaseResource implements IResource {
public void setSystem( String theUri) {
mySystem = new UriDt(theUri);
}
/**
* Gets the value(s) for <b>version</b> (Version of this system).
@ -798,8 +882,9 @@ public class ValueSet extends BaseResource implements IResource {
myVersion = theValue;
}
/**
* Sets the value(s) for <b>version</b> (Version of this system)
* Sets the value for <b>version</b> (Version of this system)
*
* <p>
* <b>Definition:</b>
@ -809,6 +894,7 @@ public class ValueSet extends BaseResource implements IResource {
public void setVersion( String theString) {
myVersion = new StringDt(theString);
}
/**
* Gets the value(s) for <b>caseSensitive</b> (If code comparison is case sensitive).
@ -839,7 +925,20 @@ public class ValueSet extends BaseResource implements IResource {
myCaseSensitive = theValue;
}
/**
* Sets the value for <b>caseSensitive</b> (If code comparison is case sensitive)
*
* <p>
* <b>Definition:</b>
* If code comparison is case sensitive when codes within this system are compared to each other
* </p>
*/
public void setCaseSensitive( Boolean theBoolean) {
myCaseSensitive = new BooleanDt(theBoolean);
}
/**
* Gets the value(s) for <b>concept</b> (Concepts in the code system).
* creating it if it does
@ -869,6 +968,20 @@ public class ValueSet extends BaseResource implements IResource {
myConcept = theValue;
}
/**
* Adds and returns a new value for <b>concept</b> (Concepts in the code system)
*
* <p>
* <b>Definition:</b>
*
* </p>
*/
public DefineConcept addConcept() {
DefineConcept newType = new DefineConcept();
getConcept().add(newType);
return newType;
}
}
@ -899,6 +1012,12 @@ public class ValueSet extends BaseResource implements IResource {
@Child(name="concept", type=DefineConcept.class, order=4, min=0, max=Child.MAX_UNLIMITED)
private List<DefineConcept> myConcept;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myCode, myAbstract, myDisplay, myDefinition, myConcept);
}
/**
* Gets the value(s) for <b>code</b> (Code that identifies concept).
* creating it if it does
@ -928,6 +1047,7 @@ public class ValueSet extends BaseResource implements IResource {
myCode = theValue;
}
/**
* Gets the value(s) for <b>abstract</b> (If this code is not for use as a real concept).
@ -958,7 +1078,20 @@ public class ValueSet extends BaseResource implements IResource {
myAbstract = theValue;
}
/**
* Sets the value for <b>abstract</b> (If this code is not for use as a real concept)
*
* <p>
* <b>Definition:</b>
* If this code is not for use as a real concept
* </p>
*/
public void setAbstract( Boolean theBoolean) {
myAbstract = new BooleanDt(theBoolean);
}
/**
* Gets the value(s) for <b>display</b> (Text to Display to the user).
* creating it if it does
@ -988,8 +1121,9 @@ public class ValueSet extends BaseResource implements IResource {
myDisplay = theValue;
}
/**
* Sets the value(s) for <b>display</b> (Text to Display to the user)
* Sets the value for <b>display</b> (Text to Display to the user)
*
* <p>
* <b>Definition:</b>
@ -999,6 +1133,7 @@ public class ValueSet extends BaseResource implements IResource {
public void setDisplay( String theString) {
myDisplay = new StringDt(theString);
}
/**
* Gets the value(s) for <b>definition</b> (Formal Definition).
@ -1029,8 +1164,9 @@ public class ValueSet extends BaseResource implements IResource {
myDefinition = theValue;
}
/**
* Sets the value(s) for <b>definition</b> (Formal Definition)
* Sets the value for <b>definition</b> (Formal Definition)
*
* <p>
* <b>Definition:</b>
@ -1040,6 +1176,7 @@ public class ValueSet extends BaseResource implements IResource {
public void setDefinition( String theString) {
myDefinition = new StringDt(theString);
}
/**
* Gets the value(s) for <b>concept</b> (Child Concepts (is-a / contains)).
@ -1070,6 +1207,20 @@ public class ValueSet extends BaseResource implements IResource {
myConcept = theValue;
}
/**
* Adds and returns a new value for <b>concept</b> (Child Concepts (is-a / contains))
*
* <p>
* <b>Definition:</b>
*
* </p>
*/
public DefineConcept addConcept() {
DefineConcept newType = new DefineConcept();
getConcept().add(newType);
return newType;
}
}
@ -1096,6 +1247,12 @@ public class ValueSet extends BaseResource implements IResource {
@Child(name="exclude", type=ComposeInclude.class, order=2, min=0, max=Child.MAX_UNLIMITED)
private List<ComposeInclude> myExclude;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myImport, myInclude, myExclude);
}
/**
* Gets the value(s) for <b>import</b> (Import the contents of another value set).
* creating it if it does
@ -1125,8 +1282,22 @@ public class ValueSet extends BaseResource implements IResource {
myImport = theValue;
}
/**
* Adds and returns a new value for <b>import</b> (Import the contents of another value set)
*
* <p>
* <b>Definition:</b>
* Includes the contents of the referenced value set as a part of the contents of this value set
* </p>
*/
public UriDt addImport() {
UriDt newType = new UriDt();
getImport().add(newType);
return newType;
}
/**
* Sets the value(s) for <b>import</b> (Import the contents of another value set)
* Adds a new value for <b>import</b> (Import the contents of another value set)
*
* <p>
* <b>Definition:</b>
@ -1139,6 +1310,7 @@ public class ValueSet extends BaseResource implements IResource {
}
myImport.add(new UriDt(theUri));
}
/**
* Gets the value(s) for <b>include</b> (Include one or more codes from a code system).
@ -1169,6 +1341,20 @@ public class ValueSet extends BaseResource implements IResource {
myInclude = theValue;
}
/**
* Adds and returns a new value for <b>include</b> (Include one or more codes from a code system)
*
* <p>
* <b>Definition:</b>
* Include one or more codes from a code system
* </p>
*/
public ComposeInclude addInclude() {
ComposeInclude newType = new ComposeInclude();
getInclude().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>exclude</b> (Explicitly exclude codes).
@ -1199,6 +1385,20 @@ public class ValueSet extends BaseResource implements IResource {
myExclude = theValue;
}
/**
* Adds and returns a new value for <b>exclude</b> (Explicitly exclude codes)
*
* <p>
* <b>Definition:</b>
* Exclude one or more codes from the value set
* </p>
*/
public ComposeInclude addExclude() {
ComposeInclude newType = new ComposeInclude();
getExclude().add(newType);
return newType;
}
}
@ -1226,6 +1426,12 @@ public class ValueSet extends BaseResource implements IResource {
@Child(name="filter", order=3, min=0, max=Child.MAX_UNLIMITED)
private List<ComposeIncludeFilter> myFilter;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySystem, myVersion, myCode, myFilter);
}
/**
* Gets the value(s) for <b>system</b> (The system the codes come from).
* creating it if it does
@ -1255,8 +1461,9 @@ public class ValueSet extends BaseResource implements IResource {
mySystem = theValue;
}
/**
* Sets the value(s) for <b>system</b> (The system the codes come from)
* Sets the value for <b>system</b> (The system the codes come from)
*
* <p>
* <b>Definition:</b>
@ -1266,6 +1473,7 @@ public class ValueSet extends BaseResource implements IResource {
public void setSystem( String theUri) {
mySystem = new UriDt(theUri);
}
/**
* Gets the value(s) for <b>version</b> (Specific version of the code system referred to).
@ -1296,8 +1504,9 @@ public class ValueSet extends BaseResource implements IResource {
myVersion = theValue;
}
/**
* Sets the value(s) for <b>version</b> (Specific version of the code system referred to)
* Sets the value for <b>version</b> (Specific version of the code system referred to)
*
* <p>
* <b>Definition:</b>
@ -1307,6 +1516,7 @@ public class ValueSet extends BaseResource implements IResource {
public void setVersion( String theString) {
myVersion = new StringDt(theString);
}
/**
* Gets the value(s) for <b>code</b> (Code or concept from system).
@ -1337,6 +1547,20 @@ public class ValueSet extends BaseResource implements IResource {
myCode = theValue;
}
/**
* Adds and returns a new value for <b>code</b> (Code or concept from system)
*
* <p>
* <b>Definition:</b>
* Specifies a code or concept to be included or excluded. The list of codes is considered ordered, though the order may not have any particular significance
* </p>
*/
public CodeDt addCode() {
CodeDt newType = new CodeDt();
getCode().add(newType);
return newType;
}
/**
* Gets the value(s) for <b>filter</b> (Select codes/concepts by their properties (including relationships)).
@ -1367,6 +1591,20 @@ public class ValueSet extends BaseResource implements IResource {
myFilter = theValue;
}
/**
* Adds and returns a new value for <b>filter</b> (Select codes/concepts by their properties (including relationships))
*
* <p>
* <b>Definition:</b>
* Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.
* </p>
*/
public ComposeIncludeFilter addFilter() {
ComposeIncludeFilter newType = new ComposeIncludeFilter();
getFilter().add(newType);
return newType;
}
}
@ -1391,6 +1629,12 @@ public class ValueSet extends BaseResource implements IResource {
@Child(name="value", type=CodeDt.class, order=2, min=1, max=1)
private CodeDt myValue;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myProperty, myOp, myValue);
}
/**
* Gets the value(s) for <b>property</b> ().
* creating it if it does
@ -1420,6 +1664,7 @@ public class ValueSet extends BaseResource implements IResource {
myProperty = theValue;
}
/**
* Gets the value(s) for <b>op</b> (= | is-a | is-not-a | regex | in | not in).
@ -1450,6 +1695,7 @@ public class ValueSet extends BaseResource implements IResource {
myOp = theValue;
}
/**
* Sets the value(s) for <b>op</b> (= | is-a | is-not-a | regex | in | not in)
*
@ -1492,6 +1738,7 @@ public class ValueSet extends BaseResource implements IResource {
myValue = theValue;
}
}
@ -1519,6 +1766,12 @@ public class ValueSet extends BaseResource implements IResource {
@Child(name="contains", order=2, min=0, max=Child.MAX_UNLIMITED)
private List<ExpansionContains> myContains;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myIdentifier, myTimestamp, myContains);
}
/**
* Gets the value(s) for <b>identifier</b> (Uniquely identifies this expansion).
* creating it if it does
@ -1548,6 +1801,7 @@ public class ValueSet extends BaseResource implements IResource {
myIdentifier = theValue;
}
/**
* Gets the value(s) for <b>timestamp</b> (Time valueset expansion happened).
@ -1578,7 +1832,32 @@ public class ValueSet extends BaseResource implements IResource {
myTimestamp = theValue;
}
/**
* Sets the value for <b>timestamp</b> (Time valueset expansion happened)
*
* <p>
* <b>Definition:</b>
*
* </p>
*/
public void setTimestampWithMillisPrecision( Date theDate) {
myTimestamp = new InstantDt(theDate);
}
/**
* Sets the value for <b>timestamp</b> (Time valueset expansion happened)
*
* <p>
* <b>Definition:</b>
*
* </p>
*/
public void setTimestamp( Date theDate, TemporalPrecisionEnum thePrecision) {
myTimestamp = new InstantDt(theDate, thePrecision);
}
/**
* Gets the value(s) for <b>contains</b> (Codes in the value set).
* creating it if it does
@ -1608,6 +1887,20 @@ public class ValueSet extends BaseResource implements IResource {
myContains = theValue;
}
/**
* Adds and returns a new value for <b>contains</b> (Codes in the value set)
*
* <p>
* <b>Definition:</b>
*
* </p>
*/
public ExpansionContains addContains() {
ExpansionContains newType = new ExpansionContains();
getContains().add(newType);
return newType;
}
}
@ -1635,6 +1928,12 @@ public class ValueSet extends BaseResource implements IResource {
@Child(name="contains", type=ExpansionContains.class, order=3, min=0, max=Child.MAX_UNLIMITED)
private List<ExpansionContains> myContains;
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySystem, myCode, myDisplay, myContains);
}
/**
* Gets the value(s) for <b>system</b> (System value for the code).
* creating it if it does
@ -1664,8 +1963,9 @@ public class ValueSet extends BaseResource implements IResource {
mySystem = theValue;
}
/**
* Sets the value(s) for <b>system</b> (System value for the code)
* Sets the value for <b>system</b> (System value for the code)
*
* <p>
* <b>Definition:</b>
@ -1675,6 +1975,7 @@ public class ValueSet extends BaseResource implements IResource {
public void setSystem( String theUri) {
mySystem = new UriDt(theUri);
}
/**
* Gets the value(s) for <b>code</b> (Code - if blank, this is not a choosable code).
@ -1705,6 +2006,7 @@ public class ValueSet extends BaseResource implements IResource {
myCode = theValue;
}
/**
* Gets the value(s) for <b>display</b> (User display for the concept).
@ -1735,8 +2037,9 @@ public class ValueSet extends BaseResource implements IResource {
myDisplay = theValue;
}
/**
* Sets the value(s) for <b>display</b> (User display for the concept)
* Sets the value for <b>display</b> (User display for the concept)
*
* <p>
* <b>Definition:</b>
@ -1746,6 +2049,7 @@ public class ValueSet extends BaseResource implements IResource {
public void setDisplay( String theString) {
myDisplay = new StringDt(theString);
}
/**
* Gets the value(s) for <b>contains</b> (Codes contained in this concept).
@ -1776,6 +2080,20 @@ public class ValueSet extends BaseResource implements IResource {
myContains = theValue;
}
/**
* Adds and returns a new value for <b>contains</b> (Codes contained in this concept)
*
* <p>
* <b>Definition:</b>
*
* </p>
*/
public ExpansionContains addContains() {
ExpansionContains newType = new ExpansionContains();
getContains().add(newType);
return newType;
}
}

View File

@ -2,12 +2,12 @@ package ca.uhn.fhir.model.primitive;
import org.apache.commons.codec.binary.Base64;
import ca.uhn.fhir.model.api.BaseElement;
import ca.uhn.fhir.model.api.IPrimitiveDatatype;
import ca.uhn.fhir.model.api.BasePrimitive;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.SimpleSetter;
@DatatypeDef(name = "base64Binary")
public class Base64BinaryDt extends BaseElement implements IPrimitiveDatatype<byte[]> {
public class Base64BinaryDt extends BasePrimitive<byte[]> {
private byte[] myValue;
@ -17,12 +17,13 @@ public class Base64BinaryDt extends BaseElement implements IPrimitiveDatatype<by
public Base64BinaryDt() {
super();
}
/**
* Constructor
*/
public Base64BinaryDt(byte[] theValue) {
myValue=theValue;
@SimpleSetter
public Base64BinaryDt(@SimpleSetter.Parameter(name="theBytes") byte[] theBytes) {
setValue(theBytes);
}
@Override

View File

@ -13,11 +13,12 @@ import javax.xml.bind.DatatypeConverter;
import org.apache.commons.lang3.time.FastDateFormat;
import ca.uhn.fhir.model.api.BaseElement;
import ca.uhn.fhir.model.api.BasePrimitive;
import ca.uhn.fhir.model.api.IPrimitiveDatatype;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.parser.DataFormatException;
public abstract class BaseDateTimeDt extends BaseElement implements IPrimitiveDatatype<Date> {
public abstract class BaseDateTimeDt extends BasePrimitive<Date> {
private static final FastDateFormat ourYearFormat = FastDateFormat.getInstance("yyyy");
private static final FastDateFormat ourYearMonthDayFormat = FastDateFormat.getInstance("yyyy-MM-dd");

View File

@ -1,15 +1,31 @@
package ca.uhn.fhir.model.primitive;
import ca.uhn.fhir.model.api.BaseElement;
import ca.uhn.fhir.model.api.IPrimitiveDatatype;
import ca.uhn.fhir.model.api.BasePrimitive;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.SimpleSetter;
import ca.uhn.fhir.parser.DataFormatException;
@DatatypeDef(name = "boolean")
public class BooleanDt extends BaseElement implements IPrimitiveDatatype<Boolean> {
public class BooleanDt extends BasePrimitive<Boolean> {
private Boolean myValue;
/**
* Constructor
*/
public BooleanDt() {
super();
}
/**
* Constructor
*/
@SimpleSetter
public BooleanDt(@SimpleSetter.Parameter(name="theBoolean") Boolean theBoolean) {
setValue(theBoolean);
}
@Override
public void setValueAsString(String theValue) throws DataFormatException {
if ("true".equals(theValue)) {

View File

@ -1,12 +1,13 @@
package ca.uhn.fhir.model.primitive;
import ca.uhn.fhir.model.api.BaseElement;
import ca.uhn.fhir.model.api.BasePrimitive;
import ca.uhn.fhir.model.api.IPrimitiveDatatype;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.parser.DataFormatException;
@DatatypeDef(name = "code")
public class CodeDt extends BaseElement implements IPrimitiveDatatype<String>, ICodedDatatype {
public class CodeDt extends BasePrimitive<String> implements ICodedDatatype {
private String myValue;

View File

@ -1,11 +1,48 @@
package ca.uhn.fhir.model.primitive;
import java.util.Date;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.SimpleSetter;
@DatatypeDef(name = "date")
public class DateDt extends BaseDateTimeDt {
/**
* The default precision for this type
*/
public static final TemporalPrecisionEnum DEFAULT_PRECISION = TemporalPrecisionEnum.DAY;
/**
* Constructor
*/
public DateDt() {
super();
}
/**
* Constructor which accepts a date value and uses the {@link #DEFAULT_PRECISION} for this type
*/
@SimpleSetter(suffix="WithDayPrecision")
public DateDt(@SimpleSetter.Parameter(name = "theDate") Date theDate) {
setValue(theDate);
}
/**
* Constructor which accepts a date value and a precision value. Valid precisions values for this type are:
* <ul>
* <li>{@link TemporalPrecisionEnum#YEAR}
* <li>{@link TemporalPrecisionEnum#MONTH}
* <li>{@link TemporalPrecisionEnum#DAY}
* </ul>
*/
@SimpleSetter
public DateDt(@SimpleSetter.Parameter(name = "theDate") Date theDate, @SimpleSetter.Parameter(name = "thePrecision") TemporalPrecisionEnum thePrecision) {
setValue(theDate);
setPrecision(thePrecision);
}
@Override
boolean isPrecisionAllowed(TemporalPrecisionEnum thePrecision) {
switch (thePrecision) {
@ -18,5 +55,4 @@ public class DateDt extends BaseDateTimeDt {
}
}
}

View File

@ -10,19 +10,40 @@ import ca.uhn.fhir.model.api.annotation.SimpleSetter;
public class DateTimeDt extends BaseDateTimeDt {
/**
* Create a new DateTimeDt
* The default precision for this type
*/
public static final TemporalPrecisionEnum DEFAULT_PRECISION = TemporalPrecisionEnum.SECOND;
/**
* Constructor
*/
public DateTimeDt() {
super();
}
/**
* Constructor which accepts a date value and a precision value. Valid precisions values for this type are:
* <ul>
* <li>{@link TemporalPrecisionEnum#YEAR}
* <li>{@link TemporalPrecisionEnum#MONTH}
* <li>{@link TemporalPrecisionEnum#DAY}
* <li>{@link TemporalPrecisionEnum#SECOND}
* <li>{@link TemporalPrecisionEnum#MILLI}
* </ul>
*/
@SimpleSetter
public DateTimeDt(@SimpleSetter.Parameter(name = "theDate") Date theDate, @SimpleSetter.Parameter(name = "thePrecision") TemporalPrecisionEnum thePrecision) {
setValue(theDate);
setPrecision(thePrecision);
}
/**
* Create a new DateTimeDt
*/
@SimpleSetter(suffix="WithSecondsPrecision")
public DateTimeDt(@SimpleSetter.Parameter(name="theDate") Date theDate) {
setValue(theDate);
setPrecision(TemporalPrecisionEnum.SECOND);
setPrecision(DEFAULT_PRECISION);
}
@Override

View File

@ -3,15 +3,48 @@ package ca.uhn.fhir.model.primitive;
import java.math.BigDecimal;
import ca.uhn.fhir.model.api.BaseElement;
import ca.uhn.fhir.model.api.BasePrimitive;
import ca.uhn.fhir.model.api.IPrimitiveDatatype;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.SimpleSetter;
import ca.uhn.fhir.parser.DataFormatException;
@DatatypeDef(name = "decimal")
public class DecimalDt extends BaseElement implements IPrimitiveDatatype<BigDecimal> {
public class DecimalDt extends BasePrimitive<BigDecimal> {
private BigDecimal myValue;
/**
* Constructor
*/
public DecimalDt() {
super();
}
/**
* Constructor
*/
@SimpleSetter
public DecimalDt(@SimpleSetter.Parameter(name = "theValue") BigDecimal theValue) {
setValue(theValue);
}
/**
* Constructor
*/
@SimpleSetter
public DecimalDt(@SimpleSetter.Parameter(name = "theValue") double theValue) {
setValue(new BigDecimal(theValue));
}
/**
* Constructor
*/
@SimpleSetter
public DecimalDt(@SimpleSetter.Parameter(name = "theValue") long theValue) {
setValue(new BigDecimal(theValue));
}
@Override
public void setValueAsString(String theValue) throws DataFormatException {
if (theValue == null) {
@ -39,10 +72,16 @@ public class DecimalDt extends BaseElement implements IPrimitiveDatatype<BigDec
myValue = theValue;
}
/**
* Sets a new value using an integer
*/
public void setValueAsInteger(int theValue) {
myValue = new BigDecimal(theValue);
}
/**
* Gets the value as an integer, using {@link BigDecimal#intValue()}
*/
public int getValueAsInteger() {
return myValue.intValue();
}

View File

@ -1,13 +1,14 @@
package ca.uhn.fhir.model.primitive;
import ca.uhn.fhir.model.api.BaseElement;
import ca.uhn.fhir.model.api.BasePrimitive;
import ca.uhn.fhir.model.api.IPrimitiveDatatype;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.SimpleSetter;
import ca.uhn.fhir.parser.DataFormatException;
@DatatypeDef(name = "id")
public class IdDt extends BaseElement implements IPrimitiveDatatype<String> {
public class IdDt extends BasePrimitive<String> {
private String myValue;

View File

@ -5,10 +5,45 @@ import java.util.TimeZone;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.SimpleSetter;
@DatatypeDef(name="instant")
public class InstantDt extends BaseDateTimeDt {
/**
* The default precision for this type
*/
public static final TemporalPrecisionEnum DEFAULT_PRECISION = TemporalPrecisionEnum.MILLI;
/**
* Constructor
*/
public InstantDt() {
super();
}
/**
* Constructor which accepts a date value and a precision value. Valid precisions values for this type are:
* <ul>
* <li>{@link TemporalPrecisionEnum#SECOND}
* <li>{@link TemporalPrecisionEnum#MILLI}
* </ul>
*/
@SimpleSetter
public InstantDt(@SimpleSetter.Parameter(name = "theDate") Date theDate, @SimpleSetter.Parameter(name = "thePrecision") TemporalPrecisionEnum thePrecision) {
setValue(theDate);
setPrecision(thePrecision);
}
/**
* Create a new DateTimeDt
*/
@SimpleSetter(suffix="WithMillisPrecision")
public InstantDt(@SimpleSetter.Parameter(name="theDate") Date theDate) {
setValue(theDate);
setPrecision(DEFAULT_PRECISION);
}
@Override
boolean isPrecisionAllowed(TemporalPrecisionEnum thePrecision) {
switch (thePrecision) {

View File

@ -1,19 +1,38 @@
package ca.uhn.fhir.model.primitive;
import ca.uhn.fhir.model.api.BaseElement;
import ca.uhn.fhir.model.api.BasePrimitive;
import ca.uhn.fhir.model.api.IPrimitiveDatatype;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.SimpleSetter;
import ca.uhn.fhir.parser.DataFormatException;
@DatatypeDef(name="integer")
public class IntegerDt extends BaseElement implements IPrimitiveDatatype<Integer> {
public class IntegerDt extends BasePrimitive<Integer> {
private Integer myValue;
/**
* Constructor
*/
public IntegerDt() {
// nothing
}
/**
* Constructor
*/
@SimpleSetter
public IntegerDt(@SimpleSetter.Parameter(name = "theInteger") Integer theInteger) {
setValue(theInteger);
}
@Override
public Integer getValue() {
return myValue;
}
@Override
public void setValue(Integer theValue) {
myValue = theValue;
}

View File

@ -3,6 +3,7 @@ package ca.uhn.fhir.model.primitive;
import org.apache.commons.lang3.StringUtils;
import ca.uhn.fhir.model.api.BaseElement;
import ca.uhn.fhir.model.api.BasePrimitive;
import ca.uhn.fhir.model.api.IPrimitiveDatatype;
import ca.uhn.fhir.model.api.IQueryParameterType;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
@ -10,7 +11,7 @@ import ca.uhn.fhir.model.api.annotation.SimpleSetter;
import ca.uhn.fhir.parser.DataFormatException;
@DatatypeDef(name = "string")
public class StringDt extends BaseElement implements IPrimitiveDatatype<String>, IQueryParameterType {
public class StringDt extends BasePrimitive<String> implements IQueryParameterType {
private String myValue;

View File

@ -6,13 +6,14 @@ import java.net.URISyntaxException;
import org.apache.commons.lang3.StringUtils;
import ca.uhn.fhir.model.api.BaseElement;
import ca.uhn.fhir.model.api.BasePrimitive;
import ca.uhn.fhir.model.api.IPrimitiveDatatype;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.model.api.annotation.SimpleSetter;
import ca.uhn.fhir.parser.DataFormatException;
@DatatypeDef(name = "uri")
public class UriDt extends BaseElement implements IPrimitiveDatatype<URI> {
public class UriDt extends BasePrimitive<URI> {
private URI myValue;

View File

@ -14,12 +14,12 @@ import javax.xml.stream.XMLStreamException;
import javax.xml.stream.events.XMLEvent;
import ca.uhn.fhir.context.ConfigurationException;
import ca.uhn.fhir.model.api.IPrimitiveDatatype;
import ca.uhn.fhir.model.api.BasePrimitive;
import ca.uhn.fhir.model.api.annotation.DatatypeDef;
import ca.uhn.fhir.parser.DataFormatException;
@DatatypeDef(name = "xhtml")
public class XhtmlDt implements IPrimitiveDatatype<List<XMLEvent>> {
public class XhtmlDt extends BasePrimitive<List<XMLEvent>> {
private List<XMLEvent> myValue;

View File

@ -25,12 +25,16 @@ public interface IParser {
Bundle parseBundle(Reader theReader);
Bundle parseBundle(String theXml) throws ConfigurationException, DataFormatException;
Bundle parseBundle(String theMessageString) throws ConfigurationException, DataFormatException;
IResource parseResource(String theXml) throws ConfigurationException, DataFormatException;
IResource parseResource(String theMessageString) throws ConfigurationException, DataFormatException;
IResource parseResource(Reader theReader) throws ConfigurationException, DataFormatException;
IResource parseResource(XMLEventReader theStreamReader);
<T extends IResource> T parseResource(Class<T> theResourceType, String theMessageString);
IResource parseResource(Class<? extends IResource> theResourceType, Reader theReader);
}

View File

@ -3,7 +3,6 @@ package ca.uhn.fhir.parser;
import java.util.ArrayList;
import java.util.List;
import javax.xml.namespace.QName;
import javax.xml.stream.events.EndElement;
import javax.xml.stream.events.StartElement;
import javax.xml.stream.events.XMLEvent;
@ -37,10 +36,6 @@ import ca.uhn.fhir.model.primitive.XhtmlDt;
class ParserState<T extends IElement> {
private static final QName ATOM_LINK_HREF_ATTRIBUTE = new QName("href");
private static final QName ATOM_LINK_REL_ATTRIBUTE = new QName("rel");
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ParserState.class);
private FhirContext myContext;
private T myObject;
@ -106,9 +101,13 @@ class ParserState<T extends IElement> {
return retVal;
}
public static ParserState<IResource> getPreResourceInstance(FhirContext theContext) throws DataFormatException {
/**
* @param theResourceType
* May be null
*/
public static ParserState<IResource> getPreResourceInstance(Class<? extends IResource> theResourceType, FhirContext theContext) throws DataFormatException {
ParserState<IResource> retVal = new ParserState<IResource>(theContext);
retVal.push(retVal.new PreResourceState());
retVal.push(retVal.new PreResourceState(theResourceType));
return retVal;
}
@ -683,9 +682,14 @@ class ParserState<T extends IElement> {
private IResource myInstance;
private BundleEntry myEntry;
private Class<? extends IResource> myResourceType;
public PreResourceState() {
// nothing
/**
* @param theResourceType
* May be null
*/
public PreResourceState(Class<? extends IResource> theResourceType) {
myResourceType = theResourceType;
}
public PreResourceState(BundleEntry theEntry) {
@ -699,9 +703,17 @@ class ParserState<T extends IElement> {
@Override
public void enteringNewElement(String theNamespaceURI, String theLocalPart) throws DataFormatException {
BaseRuntimeElementDefinition<?> definition = myContext.getNameToResourceDefinition().get(theLocalPart);
if (!(definition instanceof RuntimeResourceDefinition)) {
throw new DataFormatException("Element '" + theLocalPart + "' is not a resource, expected a resource at this position");
BaseRuntimeElementDefinition<?> definition;
if (myResourceType == null) {
definition = myContext.getResourceDefinition(theLocalPart);
if (!(definition instanceof RuntimeResourceDefinition)) {
throw new DataFormatException("Element '" + theLocalPart + "' is not a resource, expected a resource at this position");
}
} else {
definition = myContext.getResourceDefinition(myResourceType);
if (!StringUtils.equals(theLocalPart, definition.getName())) {
throw new DataFormatException("Incorrect resource root element '" + theLocalPart + "', expected: '" + definition.getName() + "'");
}
}
RuntimeResourceDefinition def = (RuntimeResourceDefinition) definition;

View File

@ -213,7 +213,11 @@ public class XmlParser implements IParser {
private boolean encodeChildElementToStreamWriter(XMLStreamWriter theEventWriter, IElement nextValue, String childName, BaseRuntimeElementDefinition<?> childDef, String theExtensionUrl) throws XMLStreamException, DataFormatException {
private void encodeChildElementToStreamWriter(XMLStreamWriter theEventWriter, IElement nextValue, String childName, BaseRuntimeElementDefinition<?> childDef, String theExtensionUrl) throws XMLStreamException, DataFormatException {
if (nextValue.isEmpty()) {
return;
}
switch (childDef.getChildType()) {
case PRIMITIVE_DATATYPE: {
IPrimitiveDatatype<?> pd = (IPrimitiveDatatype<?>) nextValue;
@ -223,10 +227,8 @@ public class XmlParser implements IParser {
theEventWriter.writeAttribute("value", value);
encodeExtensionsIfPresent(theEventWriter, nextValue);
theEventWriter.writeEndElement();
return true;
} else {
return false;
}
break;
}
case RESOURCE_BLOCK:
case COMPOSITE_DATATYPE: {
@ -238,18 +240,16 @@ public class XmlParser implements IParser {
encodeCompositeElementToStreamWriter(nextValue, theEventWriter, childCompositeDef);
encodeExtensionsIfPresent(theEventWriter, nextValue);
theEventWriter.writeEndElement();
return true;
break;
}
case RESOURCE_REF: {
ResourceReference ref = (ResourceReference) nextValue;
if (ref.hasContent()) {
if (!ref.isEmpty()) {
theEventWriter.writeStartElement(childName);
encodeResourceReferenceToStreamWriter(theEventWriter, ref);
theEventWriter.writeEndElement();
return true;
} else {
return false;
}
break;
}
case RESOURCE: {
throw new IllegalStateException(); // should not happen
@ -258,17 +258,14 @@ public class XmlParser implements IParser {
XhtmlDt dt = (XhtmlDt) nextValue;
if (dt.hasContent()) {
encodeXhtml(dt, theEventWriter);
return true;
} else {
return false;
}
break;
}
case UNDECL_EXT: {
throw new IllegalStateException("should not happen");
}
}
return false;
}
private void encodeCompositeElementChildrenToStreamWriter(IElement theElement, XMLStreamWriter theEventWriter, List<? extends BaseRuntimeChildDefinition> children) throws XMLStreamException, DataFormatException {
@ -485,9 +482,8 @@ public class XmlParser implements IParser {
* @see ca.uhn.fhir.parser.IParser#parseResource(java.lang.String)
*/
@Override
public IResource parseResource(String theXml) throws ConfigurationException, DataFormatException {
StringReader reader = new StringReader(theXml);
return parseResource(reader);
public IResource parseResource(String theMessageString) throws ConfigurationException, DataFormatException {
return parseResource(null, theMessageString);
}
/* (non-Javadoc)
@ -495,7 +491,11 @@ public class XmlParser implements IParser {
*/
@Override
public IResource parseResource(XMLEventReader theStreamReader) {
ParserState<IResource> parserState = ParserState.getPreResourceInstance(myContext);
return parseResource(null, theStreamReader);
}
private IResource parseResource(Class<? extends IResource> theResourceType, XMLEventReader theStreamReader) {
ParserState<IResource> parserState = ParserState.getPreResourceInstance(theResourceType, myContext);
return doXmlLoop(theStreamReader, parserState);
}
@ -547,6 +547,11 @@ public class XmlParser implements IParser {
@Override
public IResource parseResource(Reader theReader) throws ConfigurationException, DataFormatException {
return parseResource(null, theReader);
}
@Override
public IResource parseResource(Class<? extends IResource> theResourceType, Reader theReader) {
XMLEventReader streamReader;
try {
streamReader = myXmlInputFactory.createXMLEventReader(theReader);
@ -556,6 +561,13 @@ public class XmlParser implements IParser {
throw new ConfigurationException("Failed to initialize STaX event factory", e);
}
return parseResource(streamReader);
return parseResource(theResourceType, streamReader);
}
@SuppressWarnings("unchecked")
@Override
public <T extends IResource> T parseResource(Class<T> theResourceType, String theMessageString) {
StringReader reader = new StringReader(theMessageString);
return (T) parseResource(theResourceType, reader);
}
}

View File

@ -0,0 +1,33 @@
package ca.uhn.fhir.rest.client;
import org.apache.http.client.HttpClient;
import ca.uhn.fhir.context.ConfigurationException;
import ca.uhn.fhir.rest.client.api.IRestfulClient;
public interface IRestfulClientFactory {
/**
* Instantiates a new client instance
*
* @param theClientType
* The client type, which is an interface type to be instantiated
* @param theServerBase
* The URL of the base for the restful FHIR server to connect to
* @return A newly created client
* @throws ConfigurationException
* If the interface type is not an interface
*/
public <T extends IRestfulClient> T newClient(Class<T> theClientType, String theServerBase);
/**
* Sets the Apache HTTP client instance to be used by any new restful clients created by
* this factory. If set to <code>null</code>, which is the default, a new HTTP client with
* default settings will be created.
*
* @param theHttpClient An HTTP client instance to use, or <code>null</code>
*/
public void setHttpClient(HttpClient theHttpClient);
}

View File

@ -6,22 +6,18 @@ import java.lang.reflect.Proxy;
import java.util.concurrent.TimeUnit;
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.conn.PoolingClientConnectionManager;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.apache.http.impl.conn.SchemeRegistryFactory;
import ca.uhn.fhir.context.ConfigurationException;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.rest.client.api.IRestfulClient;
import ca.uhn.fhir.rest.common.BaseMethodBinding;
public class RestfulClientFactory {
public class RestfulClientFactory implements IRestfulClientFactory {
private FhirContext myContext;
private HttpClient myHttpClient;
/**
* Constructor
@ -33,6 +29,12 @@ public class RestfulClientFactory {
myContext = theContext;
}
@SuppressWarnings("unchecked")
private <T extends IRestfulClient> T instantiateProxy(Class<T> theClientType, InvocationHandler theInvocationHandler) {
T proxy = (T) Proxy.newProxyInstance(RestfulClientFactory.class.getClassLoader(), new Class[] { theClientType }, theInvocationHandler);
return proxy;
}
/**
* Instantiates a new client instance
*
@ -44,17 +46,28 @@ public class RestfulClientFactory {
* @throws ConfigurationException
* If the interface type is not an interface
*/
@Override
public <T extends IRestfulClient> T newClient(Class<T> theClientType, String theServerBase){
if (!theClientType.isInterface()) {
throw new ConfigurationException(theClientType.getCanonicalName() + " is not an interface");
}
PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS);
HttpClientBuilder builder = HttpClientBuilder.create();
builder.setConnectionManager(connectionManager);
CloseableHttpClient client = builder.build();
HttpClient client;
if (myHttpClient != null) {
client = myHttpClient;
}else {
PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(5000, TimeUnit.MILLISECONDS);
HttpClientBuilder builder = HttpClientBuilder.create();
builder.setConnectionManager(connectionManager);
client = builder.build();
}
ClientInvocationHandler theInvocationHandler = new ClientInvocationHandler(client, myContext, theServerBase);
String serverBase = theServerBase;
if (!serverBase.endsWith("/")) {
serverBase = serverBase + "/";
}
ClientInvocationHandler theInvocationHandler = new ClientInvocationHandler(client, myContext, serverBase);
for (Method nextMethod : theClientType.getMethods()) {
BaseMethodBinding binding = BaseMethodBinding.bindMethod(nextMethod);
@ -67,11 +80,16 @@ public class RestfulClientFactory {
}
@SuppressWarnings("unchecked")
private <T extends IRestfulClient> T instantiateProxy(Class<T> theClientType, InvocationHandler theInvocationHandler) {
T proxy = (T) Proxy.newProxyInstance(RestfulClientFactory.class.getClassLoader(), new Class[] { theClientType }, theInvocationHandler);
return proxy;
/**
* Sets the Apache HTTP client instance to be used by any new restful clients created by
* this factory. If set to <code>null</code>, which is the default, a new HTTP client with
* default settings will be created.
*
* @param theHttpClient An HTTP client instance to use, or <code>null</code>
*/
@Override
public void setHttpClient(HttpClient theHttpClient) {
myHttpClient = theHttpClient;
}
}

View File

@ -51,7 +51,9 @@ public abstract class BaseMethodBinding {
public static BaseMethodBinding bindMethod(Method theMethod) {
Read read = theMethod.getAnnotation(Read.class);
Search search = theMethod.getAnnotation(Search.class);
verifyExactlyOneValued(theMethod, read, search);
if (!verifyMethodHasZeroOrOneOperationAnnotation(theMethod, read, search)) {
return null;
}
Class<? extends IResource> annotatedResourceType;
if (read != null) {
@ -102,7 +104,7 @@ public abstract class BaseMethodBinding {
// return sm;
}
public static void verifyExactlyOneValued(Method theNextMethod, Object... theAnnotations) {
public static boolean verifyMethodHasZeroOrOneOperationAnnotation(Method theNextMethod, Object... theAnnotations) {
Object obj1 = null;
for (Object object : theAnnotations) {
if (object != null) {
@ -116,8 +118,10 @@ public abstract class BaseMethodBinding {
}
}
if (obj1 == null) {
throw new ConfigurationException("Method " + theNextMethod.getName() + " on type '" + theNextMethod.getDeclaringClass().getSimpleName() + " has no FHIR method annotations.");
return false;
// throw new ConfigurationException("Method '" + theNextMethod.getName() + "' on type '" + theNextMethod.getDeclaringClass().getSimpleName() + " has no FHIR method annotations.");
}
return true;
}
protected static List<IResource> toResourceList(Object response) throws InternalErrorException {

View File

@ -0,0 +1,54 @@
package ca.uhn.fhir.util;
import java.util.List;
import ca.uhn.fhir.model.api.IElement;
public class ElementUtil {
@SuppressWarnings("unchecked")
public static boolean isEmpty(Object... theElements) {
if (theElements ==null) {
return true;
}
for (int i = 0; i < theElements.length; i++) {
Object next = theElements[i];
if (next instanceof List) {
if (!isEmpty((List<? extends IElement>)next)) {
return false;
}
}
if (next != null && !((IElement)next).isEmpty()) {
return false;
}
}
return true;
}
public static boolean isEmpty(IElement... theElements) {
if (theElements ==null) {
return true;
}
for (int i = 0; i < theElements.length; i++) {
IElement next = theElements[i];
if (next != null && !next.isEmpty()) {
return false;
}
}
return true;
}
public static boolean isEmpty(List<? extends IElement> theElements) {
if (theElements ==null) {
return true;
}
for (int i = 0; i < theElements.size(); i++) {
IElement next = theElements.get(i);
if (next != null && !next.isEmpty()) {
return false;
}
}
return true;
}
}

View File

@ -89,6 +89,11 @@ public class ResourceWithExtensionsA implements IResource {
@Extension(url = "http://bar/1/2")
private List<Bar2> myBar12;
@Override
public boolean isEmpty() {
return false; // TODO: implement
}
public List<DateDt> getBar11() {
return myBar11;
}
@ -118,6 +123,11 @@ public class ResourceWithExtensionsA implements IResource {
@Extension(url = "http://bar/1/2/2")
private List<DateDt> myBar122;
@Override
public boolean isEmpty() {
return false; // TODO: implement
}
public List<DateDt> getBar121() {
return myBar121;
}
@ -136,4 +146,9 @@ public class ResourceWithExtensionsA implements IResource {
}
@Override
public boolean isEmpty() {
return false; // TODO: implement
}
}

View File

@ -22,6 +22,7 @@ import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.dstu.resource.Observation;
import ca.uhn.fhir.model.dstu.resource.Patient;
import ca.uhn.fhir.model.dstu.resource.ValueSet;
import ca.uhn.fhir.model.dstu.valueset.NarrativeStatusEnum;
public class XmlParserTest {
@ -32,6 +33,9 @@ public class XmlParserTest {
IParser p = new FhirContext(Patient.class).newXmlParser();
Bundle bundle = p.parseBundle(msg);
assertEquals("http://spark.furore.com/fhir/_snapshot?id=327d6bb9-83b0-4929-aa91-6dd9c41e587b&start=0&_count=20", bundle.getLinkSelf().getValue());
assertEquals("Patient resource with id 3216379", bundle.getEntries().get(0).getTitle().getValue());
}
@Test
@ -112,6 +116,35 @@ public class XmlParserTest {
assertEquals(summaryText.trim(), entry.getSummary().getValueAsString().trim());
}
@Test
public void testLoadAndAncodeMessage() throws SAXException, IOException {
//@formatter:off
String msg = "<Patient xmlns=\"http://hl7.org/fhir\">"
+ "<text><status value=\"generated\" /><div xmlns=\"http://www.w3.org/1999/xhtml\">John Cardinal: 444333333 </div></text>"
+ "<identifier><label value=\"SSN\" /><system value=\"http://orionhealth.com/mrn\" /><value value=\"PRP1660\" /></identifier>"
+ "<name><use value=\"official\" /><family value=\"Cardinal\" /><given value=\"John\" /></name>"
+ "<name><family value=\"Kramer\" /><given value=\"Doe\" /></name>"
+ "<telecom><system value=\"phone\" /><value value=\"555-555-2004\" /><use value=\"work\" /></telecom>"
+ "<gender><coding><system value=\"http://hl7.org/fhir/v3/AdministrativeGender\" /><code value=\"M\" /></coding></gender>"
+ "<address><use value=\"home\" /><line value=\"2222 Home Street\" /></address><active value=\"true\" />"
+ "</Patient>";
//@formatter:on
FhirContext ctx = new FhirContext(Patient.class);
Patient patient = ctx.newXmlParser().parseResource(Patient.class, msg);
assertEquals(NarrativeStatusEnum.GENERATED, patient.getText().getStatus().getValueAsEnum());
assertEquals("<div xmlns=\"http://www.w3.org/1999/xhtml\">John Cardinal: 444333333 </div>", patient.getText().getDiv().getValueAsString());
assertEquals("PRP1660", patient.getIdentifier().get(0).getValue().getValueAsString());
String encoded = ctx.newXmlParser().encodeResourceToString(patient);
Diff d = new Diff(new StringReader(msg), new StringReader(encoded));
assertTrue(d.toString(), d.identical());
}
@Test
public void testLoadAndEncodeExtensions() throws ConfigurationException, DataFormatException, SAXException, IOException {
FhirContext ctx = new FhirContext(ResourceWithExtensionsA.class);
@ -146,7 +179,6 @@ public class XmlParserTest {
" </extension>\n" +
" <identifier>\n" +
" <label value=\"IdentifierLabel\"/>\n" +
" <period />\n" + // this line can be removed once the parser encoding doesn't spit it out
" </identifier>\n" +
"</ResourceWithExtensionsA>";
//@formatter:on
@ -181,7 +213,8 @@ public class XmlParserTest {
FhirContext ctx = new FhirContext(Observation.class);
IParser p = new XmlParser(ctx);
IResource resource = p.parseResource(IOUtils.toString(XmlParserTest.class.getResourceAsStream("/observation-example-eeg.xml")));
String string = IOUtils.toString(XmlParserTest.class.getResourceAsStream("/observation-example-eeg.xml"));
IResource resource = p.parseResource(string);
String result = p.encodeResourceToString(resource);
ourLog.info(result);

View File

@ -1,11 +1,76 @@
package ca.uhn.fhir.rest.client;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.io.StringReader;
import java.nio.charset.Charset;
import org.apache.commons.io.input.ReaderInputStream;
import org.apache.http.HttpResponse;
import org.apache.http.ProtocolVersion;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.message.BasicHeader;
import org.apache.http.message.BasicStatusLine;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.internal.stubbing.defaultanswers.ReturnsDeepStubs;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.model.dstu.resource.Patient;
import ca.uhn.fhir.model.primitive.IdDt;
import ca.uhn.fhir.rest.server.Constants;
public class ClientTest {
private HttpClient httpClient;
private HttpResponse httpResponse;
private FhirContext ctx;
private IRestfulClientFactory clientFactory;
// atom-document-large.xml
@Before
public void before() {
ctx = new FhirContext(Patient.class);
clientFactory = ctx.newRestfulClientFactory();
httpClient = mock(HttpClient.class, new ReturnsDeepStubs());
clientFactory.setHttpClient(httpClient);
httpResponse = mock(HttpResponse.class, new ReturnsDeepStubs());
}
@Test
public void testClient() {
public void testRead() throws Exception {
//@formatter:off
String msg = "<Patient xmlns=\"http://hl7.org/fhir\">"
+ "<text><status value=\"generated\" /><div xmlns=\"http://www.w3.org/1999/xhtml\">John Cardinal: 444333333 </div></text>"
+ "<identifier><label value=\"SSN\" /><system value=\"http://orionhealth.com/mrn\" /><value value=\"PRP1660\" /></identifier>"
+ "<name><use value=\"official\" /><family value=\"Cardinal\" /><given value=\"John\" /></name>"
+ "<name><family value=\"Kramer\" /><given value=\"Doe\" /></name>"
+ "<telecom><system value=\"phone\" /><value value=\"555-555-2004\" /><use value=\"work\" /></telecom>"
+ "<gender><coding><system value=\"http://hl7.org/fhir/v3/AdministrativeGender\" /><code value=\"M\" /></coding></gender>"
+ "<address><use value=\"home\" /><line value=\"2222 Home Street\" /></address><active value=\"true\" />"
+ "</Patient>";
//@formatter:on
ArgumentCaptor<HttpUriRequest> capt = ArgumentCaptor.forClass(HttpUriRequest.class);
when(httpClient.execute(capt.capture())).thenReturn(httpResponse);
when(httpResponse.getStatusLine()).thenReturn(new BasicStatusLine(new ProtocolVersion("HTTP",1,1), 200, "OK"));
when(httpResponse.getEntity().getContentType()).thenReturn(new BasicHeader("content-type", Constants.CT_FHIR_XML + "; charset=UTF-8"));
when(httpResponse.getEntity().getContent()).thenReturn(new ReaderInputStream(new StringReader(msg), Charset.forName("UTF-8")));
ITestClient client = clientFactory.newClient(ITestClient.class, "http://foo");
// Patient response = client.findPatientByMrn(new IdentifierDt("urn:foo", "123"));
Patient response = client.getPatientById(new IdDt("111"));
assertEquals("http://foo/Patient/111", capt.getValue().getURI().toString());
assertEquals("PRP1660", response.getIdentifier().get(0).getValue().getValue());
}

View File

@ -13,14 +13,14 @@ public class Tester {
try {
FhirContext ctx = new FhirContext(Patient.class);
RestfulClientFactory factory = ctx.newClientFactory();
IRestfulClientFactory factory = ctx.newRestfulClientFactory();
ITestClient client = factory.newClient(ITestClient.class, "http://spark.furore.com/fhir/");
// Patient patient = client.getPatientById(new IdDt("1"));
// System.out.println(ctx.newXmlParser().encodeResourceToString(patient));
Patient patient = client.getPatientById(new IdDt("1"));
System.out.println(ctx.newXmlParser().encodeResourceToString(patient));
Patient patient2 = client.findPatientByMrn(new IdentifierDt("http://orionhealth.com/mrn", "PRP1660"));
System.out.println(ctx.newXmlParser().encodeResourceToString(patient2));
// Patient patient2 = client.findPatientByMrn(new IdentifierDt("http://orionhealth.com/mrn", "PRP1660"));
// System.out.println(ctx.newXmlParser().encodeResourceToString(patient2));
} catch (NonFhirResponseException e) {
e.printStackTrace();

View File

@ -52,7 +52,7 @@ public class DummyPatientResourceProvider implements IResourceProvider {
}
@Search(Patient.class)
public Patient getPatient(@Required(name = "identifier") IdentifierDt theIdentifier) {
public Patient getPatient(@Required(name = Patient.SP_IDENTIFIER) IdentifierDt theIdentifier) {
for (Patient next : myIdToPatient.values()) {
for (IdentifierDt nextId : next.getIdentifier()) {
if (nextId.matchesSystemAndValue(theIdentifier)) {

View File

@ -38,7 +38,7 @@ public class ResourceMethodTest {
inputParams.add("firstName");
inputParams.add("lastName");
assertEquals(false, rm.matches("ResName", null, null, inputParams)); // False
assertEquals(false, rm.matches("Patient", null, null, inputParams)); // False
}
@Test
@ -53,7 +53,7 @@ public class ResourceMethodTest {
Set<String> inputParams = new HashSet<String>();
inputParams.add("mrn");
assertEquals(true, rm.matches("ResName", null, null, inputParams)); // True
assertEquals(true, rm.matches("Patient", null, null, inputParams)); // True
}
@Test
@ -70,7 +70,7 @@ public class ResourceMethodTest {
inputParams.add("firstName");
inputParams.add("mrn");
assertEquals(true, rm.matches("ResName", null, null, inputParams)); // True
assertEquals(true, rm.matches("Patient", null, null, inputParams)); // True
}
@Test
@ -88,7 +88,7 @@ public class ResourceMethodTest {
inputParams.add("lastName");
inputParams.add("mrn");
assertEquals(true, rm.matches("ResName", null, null, inputParams)); // True
assertEquals(true, rm.matches("Patient", null, null, inputParams)); // True
}
@Test
@ -107,6 +107,6 @@ public class ResourceMethodTest {
inputParams.add("mrn");
inputParams.add("foo");
assertEquals(false, rm.matches("ResName", null, null, inputParams)); // False
assertEquals(false, rm.matches("Patient", null, null, inputParams)); // False
}
}

View File

@ -85,7 +85,11 @@ public abstract class BaseStructureParser {
Class<?>[] paramTypes = nextConstructor.getParameterTypes();
for (int i = 0; i < paramTypes.length; i++) {
Parameter p = new Parameter();
p.setDatatype(paramTypes[0].getSimpleName());
if (paramTypes[i].getCanonicalName().startsWith("java.math")) {
p.setDatatype(paramTypes[i].getCanonicalName());
}else {
p.setDatatype(paramTypes[i].getSimpleName());
}
p.setParameter(findAnnotation(childDt, paramAnn[i], SimpleSetter.Parameter.class).name());
ss.getParameters().add(p);
}

View File

@ -24,10 +24,7 @@ import ${packageBase}.resource.*;
* </p>
*/
@DatatypeDef(name="${className}")
public class ${className}Dt extends BaseElement implements ICompositeDatatype
#if ( ${className} == "Identifier" )
, IQueryParameter
#end
public class ${className}Dt extends BaseElement implements ICompositeDatatype #{if}( ${className} == "Identifier" ), IQueryParameterType #{end}
{
#########################

View File

@ -36,6 +36,12 @@
##################################################################
#macro ( childAccessors $childElements )
@Override
public boolean isEmpty() {
return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( #{foreach}($child in $childElements) ${child.variableName}#{if}($foreach.hasNext), #{end}#{end});
}
#foreach ( $child in $childElements )
/**
* Gets the value(s) for <b>${child.elementName}</b> (${child.shortName}).
@ -157,6 +163,7 @@
${child.variableName} = new ${ss.datatype}(#{foreach}($param in $ss.parameters)${param.parameter}#{if}( $foreach.hasNext ), #{end}#{end});
}
#end
#end ##foreach-child-in-simplesetters
#end