001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017package ca.uhn.fhir.model.dstu2.composite; 018 019import java.net.URI; 020import java.math.BigDecimal; 021import org.apache.commons.lang3.StringUtils; 022import java.util.*; 023import ca.uhn.fhir.model.api.*; 024import ca.uhn.fhir.model.primitive.*; 025import ca.uhn.fhir.model.api.annotation.*; 026import ca.uhn.fhir.model.base.composite.*; 027 028import ca.uhn.fhir.model.dstu2.valueset.AddressTypeEnum; 029import ca.uhn.fhir.model.dstu2.valueset.AddressUseEnum; 030import ca.uhn.fhir.model.dstu2.valueset.AggregationModeEnum; 031import ca.uhn.fhir.model.dstu2.valueset.BindingStrengthEnum; 032import ca.uhn.fhir.model.dstu2.composite.CodeableConceptDt; 033import ca.uhn.fhir.model.dstu2.composite.CodingDt; 034import ca.uhn.fhir.model.dstu2.valueset.ConstraintSeverityEnum; 035import ca.uhn.fhir.model.dstu2.valueset.ContactPointSystemEnum; 036import ca.uhn.fhir.model.dstu2.valueset.ContactPointUseEnum; 037import ca.uhn.fhir.model.dstu2.resource.Device; 038import ca.uhn.fhir.model.dstu2.valueset.EventTimingEnum; 039import ca.uhn.fhir.model.dstu2.valueset.IdentifierTypeCodesEnum; 040import ca.uhn.fhir.model.dstu2.valueset.IdentifierUseEnum; 041import ca.uhn.fhir.model.dstu2.valueset.NameUseEnum; 042import ca.uhn.fhir.model.dstu2.resource.Organization; 043import ca.uhn.fhir.model.dstu2.resource.Patient; 044import ca.uhn.fhir.model.dstu2.composite.PeriodDt; 045import ca.uhn.fhir.model.dstu2.resource.Practitioner; 046import ca.uhn.fhir.model.dstu2.valueset.PropertyRepresentationEnum; 047import ca.uhn.fhir.model.dstu2.valueset.QuantityComparatorEnum; 048import ca.uhn.fhir.model.dstu2.composite.QuantityDt; 049import ca.uhn.fhir.model.dstu2.composite.RangeDt; 050import ca.uhn.fhir.model.dstu2.resource.RelatedPerson; 051import ca.uhn.fhir.model.dstu2.valueset.SignatureTypeCodesEnum; 052import ca.uhn.fhir.model.dstu2.valueset.SlicingRulesEnum; 053import ca.uhn.fhir.model.api.TemporalPrecisionEnum; 054import ca.uhn.fhir.model.dstu2.valueset.TimingAbbreviationEnum; 055import ca.uhn.fhir.model.dstu2.valueset.UnitsOfTimeEnum; 056import ca.uhn.fhir.model.dstu2.resource.ValueSet; 057import ca.uhn.fhir.model.dstu2.composite.BoundCodeableConceptDt; 058import ca.uhn.fhir.model.dstu2.composite.DurationDt; 059import ca.uhn.fhir.model.dstu2.composite.ResourceReferenceDt; 060import ca.uhn.fhir.model.dstu2.composite.SimpleQuantityDt; 061import ca.uhn.fhir.model.primitive.Base64BinaryDt; 062import ca.uhn.fhir.model.primitive.BooleanDt; 063import ca.uhn.fhir.model.primitive.BoundCodeDt; 064import ca.uhn.fhir.model.primitive.CodeDt; 065import ca.uhn.fhir.model.primitive.DateTimeDt; 066import ca.uhn.fhir.model.primitive.DecimalDt; 067import ca.uhn.fhir.model.primitive.IdDt; 068import ca.uhn.fhir.model.primitive.InstantDt; 069import ca.uhn.fhir.model.primitive.IntegerDt; 070import ca.uhn.fhir.model.primitive.MarkdownDt; 071import ca.uhn.fhir.model.primitive.PositiveIntDt; 072import ca.uhn.fhir.model.primitive.StringDt; 073import ca.uhn.fhir.model.primitive.UnsignedIntDt; 074import ca.uhn.fhir.model.primitive.UriDt; 075 076/** 077 * HAPI/FHIR <b>RangeDt</b> Datatype 078 * () 079 * 080 * <p> 081 * <b>Definition:</b> 082 * A set of ordered Quantities defined by a low and high limit. 083 * </p> 084 * 085 * <p> 086 * <b>Requirements:</b> 087 * Need to be able to specify ranges of values 088 * </p> 089 */ 090@DatatypeDef(name="Range") 091public class RangeDt 092 extends BaseIdentifiableElement implements ICompositeDatatype{ 093 094 /** 095 * Constructor 096 */ 097 public RangeDt() { 098 // nothing 099 } 100 101 102 @Child(name="low", type=SimpleQuantityDt.class, order=0, min=0, max=1, summary=true, modifier=false) 103 @Description( 104 shortDefinition="", 105 formalDefinition="The low limit. The boundary is inclusive." 106 ) 107 private SimpleQuantityDt myLow; 108 109 @Child(name="high", type=SimpleQuantityDt.class, order=1, min=0, max=1, summary=true, modifier=false) 110 @Description( 111 shortDefinition="", 112 formalDefinition="The high limit. The boundary is inclusive." 113 ) 114 private SimpleQuantityDt myHigh; 115 116 117 @Override 118 public boolean isEmpty() { 119 return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( myLow, myHigh); 120 } 121 122 @Override 123 public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) { 124 return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, myLow, myHigh); 125 } 126 127 /** 128 * Gets the value(s) for <b>low</b> (). 129 * creating it if it does 130 * not exist. Will not return <code>null</code>. 131 * 132 * <p> 133 * <b>Definition:</b> 134 * The low limit. The boundary is inclusive. 135 * </p> 136 */ 137 public SimpleQuantityDt getLow() { 138 if (myLow == null) { 139 myLow = new SimpleQuantityDt(); 140 } 141 return myLow; 142 } 143 144 /** 145 * Sets the value(s) for <b>low</b> () 146 * 147 * <p> 148 * <b>Definition:</b> 149 * The low limit. The boundary is inclusive. 150 * </p> 151 */ 152 public RangeDt setLow(SimpleQuantityDt theValue) { 153 myLow = theValue; 154 return this; 155 } 156 157 158 159 160 /** 161 * Gets the value(s) for <b>high</b> (). 162 * creating it if it does 163 * not exist. Will not return <code>null</code>. 164 * 165 * <p> 166 * <b>Definition:</b> 167 * The high limit. The boundary is inclusive. 168 * </p> 169 */ 170 public SimpleQuantityDt getHigh() { 171 if (myHigh == null) { 172 myHigh = new SimpleQuantityDt(); 173 } 174 return myHigh; 175 } 176 177 /** 178 * Sets the value(s) for <b>high</b> () 179 * 180 * <p> 181 * <b>Definition:</b> 182 * The high limit. The boundary is inclusive. 183 * </p> 184 */ 185 public RangeDt setHigh(SimpleQuantityDt theValue) { 186 myHigh = theValue; 187 return this; 188 } 189 190 191 192 193 194 195}