All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ca.uhn.fhir.model.dstu2.composite.PeriodDt Maven / Gradle / Ivy

The newest version!
















package ca.uhn.fhir.model.dstu2.composite;

import java.net.URI;
import java.math.BigDecimal;
import org.apache.commons.lang3.StringUtils;
import java.util.*;
import ca.uhn.fhir.model.api.*;
import ca.uhn.fhir.model.primitive.*;
import ca.uhn.fhir.model.api.annotation.*;
import ca.uhn.fhir.model.base.composite.*;

import ca.uhn.fhir.model.dstu2.valueset.AddressTypeEnum;
import ca.uhn.fhir.model.dstu2.valueset.AddressUseEnum;
import ca.uhn.fhir.model.dstu2.valueset.AggregationModeEnum;
import ca.uhn.fhir.model.dstu2.valueset.BindingStrengthEnum;
import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt;
import ca.uhn.fhir.model.dstu2.composite.CodingDt;
import ca.uhn.fhir.model.dstu2.valueset.ConstraintSeverityEnum;
import ca.uhn.fhir.model.dstu2.valueset.ContactPointSystemEnum;
import ca.uhn.fhir.model.dstu2.valueset.ContactPointUseEnum;
import ca.uhn.fhir.model.dstu2.resource.Device;
import ca.uhn.fhir.model.dstu2.valueset.EventTimingEnum;
import ca.uhn.fhir.model.dstu2.valueset.IdentifierTypeCodesEnum;
import ca.uhn.fhir.model.dstu2.valueset.IdentifierUseEnum;
import ca.uhn.fhir.model.dstu2.valueset.NameUseEnum;
import ca.uhn.fhir.model.dstu2.resource.Organization;
import ca.uhn.fhir.model.dstu2.resource.Patient;
import ca.uhn.fhir.model.dstu2.composite.PeriodDt;
import ca.uhn.fhir.model.dstu2.resource.Practitioner;
import ca.uhn.fhir.model.dstu2.valueset.PropertyRepresentationEnum;
import ca.uhn.fhir.model.dstu2.valueset.QuantityComparatorEnum;
import ca.uhn.fhir.model.dstu2.composite.QuantityDt;
import ca.uhn.fhir.model.dstu2.composite.RangeDt;
import ca.uhn.fhir.model.dstu2.resource.RelatedPerson;
import ca.uhn.fhir.model.dstu2.valueset.SignatureTypeCodesEnum;
import ca.uhn.fhir.model.dstu2.valueset.SlicingRulesEnum;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.model.dstu2.valueset.TimingAbbreviationEnum;
import ca.uhn.fhir.model.dstu2.valueset.UnitsOfTimeEnum;
import ca.uhn.fhir.model.dstu2.resource.ValueSet;
import ca.uhn.fhir.model.dstu2.composite.BoundCodeableConceptDt;
import ca.uhn.fhir.model.dstu2.composite.DurationDt;
import ca.uhn.fhir.model.dstu2.composite.ResourceReferenceDt;
import ca.uhn.fhir.model.dstu2.composite.SimpleQuantityDt;
import ca.uhn.fhir.model.primitive.Base64BinaryDt;
import ca.uhn.fhir.model.primitive.BooleanDt;
import ca.uhn.fhir.model.primitive.BoundCodeDt;
import ca.uhn.fhir.model.primitive.CodeDt;
import ca.uhn.fhir.model.primitive.DateTimeDt;
import ca.uhn.fhir.model.primitive.DecimalDt;
import ca.uhn.fhir.model.primitive.IdDt;
import ca.uhn.fhir.model.primitive.InstantDt;
import ca.uhn.fhir.model.primitive.IntegerDt;
import ca.uhn.fhir.model.primitive.MarkdownDt;
import ca.uhn.fhir.model.primitive.PositiveIntDt;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.model.primitive.UnsignedIntDt;
import ca.uhn.fhir.model.primitive.UriDt;

/**
 * HAPI/FHIR PeriodDt Datatype
 * ()
 *
 * 

* Definition: * A time period defined by a start and end date and optionally time. *

* *

* Requirements: * *

*/ @DatatypeDef(name="Period") public class PeriodDt extends BaseIdentifiableElement implements ICompositeDatatype { /** * Constructor */ public PeriodDt() { // nothing } @Child(name="start", type=DateTimeDt.class, order=0, min=0, max=1, summary=true, modifier=false) @Description( shortDefinition="", formalDefinition="The start of the period. The boundary is inclusive." ) private DateTimeDt myStart; @Child(name="end", type=DateTimeDt.class, order=1, min=0, max=1, summary=true, modifier=false) @Description( shortDefinition="", formalDefinition="The end of the period. If the end of the period is missing, it means that the period is ongoing. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time" ) private DateTimeDt myEnd; @Override public boolean isEmpty() { return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myStart, myEnd); } @Override public List getAllPopulatedChildElementsOfType(Class theType) { return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myStart, myEnd); } /** * Gets the value(s) for start (). * creating it if it does * not exist. Will not return null. * *

* Definition: * The start of the period. The boundary is inclusive. *

*/ public DateTimeDt getStartElement() { if (myStart == null) { myStart = new DateTimeDt(); } return myStart; } /** * Gets the value(s) for start (). * creating it if it does * not exist. This method may return null. * *

* Definition: * The start of the period. The boundary is inclusive. *

*/ public Date getStart() { return getStartElement().getValue(); } /** * Sets the value(s) for start () * *

* Definition: * The start of the period. The boundary is inclusive. *

*/ public PeriodDt setStart(DateTimeDt theValue) { myStart = theValue; return this; } /** * Sets the value for start () * *

* Definition: * The start of the period. The boundary is inclusive. *

*/ public PeriodDt setStartWithSecondsPrecision( Date theDate) { myStart = new DateTimeDt(theDate); return this; } /** * Sets the value for start () * *

* Definition: * The start of the period. The boundary is inclusive. *

*/ public PeriodDt setStart( Date theDate, TemporalPrecisionEnum thePrecision) { myStart = new DateTimeDt(theDate, thePrecision); return this; } /** * Gets the value(s) for end (). * creating it if it does * not exist. Will not return null. * *

* Definition: * The end of the period. If the end of the period is missing, it means that the period is ongoing. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time *

*/ public DateTimeDt getEndElement() { if (myEnd == null) { myEnd = new DateTimeDt(); } return myEnd; } /** * Gets the value(s) for end (). * creating it if it does * not exist. This method may return null. * *

* Definition: * The end of the period. If the end of the period is missing, it means that the period is ongoing. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time *

*/ public Date getEnd() { return getEndElement().getValue(); } /** * Sets the value(s) for end () * *

* Definition: * The end of the period. If the end of the period is missing, it means that the period is ongoing. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time *

*/ public PeriodDt setEnd(DateTimeDt theValue) { myEnd = theValue; return this; } /** * Sets the value for end () * *

* Definition: * The end of the period. If the end of the period is missing, it means that the period is ongoing. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time *

*/ public PeriodDt setEndWithSecondsPrecision( Date theDate) { myEnd = new DateTimeDt(theDate); return this; } /** * Sets the value for end () * *

* Definition: * The end of the period. If the end of the period is missing, it means that the period is ongoing. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time *

*/ public PeriodDt setEnd( Date theDate, TemporalPrecisionEnum thePrecision) { myEnd = new DateTimeDt(theDate, thePrecision); return this; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy