
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>ContactPointDt</b> Datatype 078 * () 079 * 080 * <p> 081 * <b>Definition:</b> 082 * Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc. 083 * </p> 084 * 085 * <p> 086 * <b>Requirements:</b> 087 * Need to track phone, fax, mobile, sms numbers, email addresses, twitter tags, etc. 088 * </p> 089 */ 090@DatatypeDef(name="ContactPoint") 091public class ContactPointDt 092 extends BaseIdentifiableElement implements ICompositeDatatype{ 093 094 /** 095 * Constructor 096 */ 097 public ContactPointDt() { 098 // nothing 099 } 100 101 102 @Child(name="system", type=CodeDt.class, order=0, min=0, max=1, summary=true, modifier=false) 103 @Description( 104 shortDefinition="", 105 formalDefinition="Telecommunications form for contact point - what communications system is required to make use of the contact" 106 ) 107 @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/contact-point-system") 108 private BoundCodeDt<ContactPointSystemEnum> mySystem; 109 110 @Child(name="value", type=StringDt.class, order=1, min=0, max=1, summary=true, modifier=false) 111 @Description( 112 shortDefinition="", 113 formalDefinition="The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address)." 114 ) 115 private StringDt myValue; 116 117 @Child(name="use", type=CodeDt.class, order=2, min=0, max=1, summary=true, modifier=true) 118 @Description( 119 shortDefinition="", 120 formalDefinition="Identifies the purpose for the contact point" 121 ) 122 @ca.uhn.fhir.model.api.annotation.Binding(valueSet = "http://hl7.org/fhir/ValueSet/contact-point-use") 123 private BoundCodeDt<ContactPointUseEnum> myUse; 124 125 @Child(name="rank", type=PositiveIntDt.class, order=3, min=0, max=1, summary=true, modifier=false) 126 @Description( 127 shortDefinition="", 128 formalDefinition="Specifies a preferred order in which to use a set of contacts. Contacts are ranked with lower values coming before higher values" 129 ) 130 private PositiveIntDt myRank; 131 132 @Child(name="period", type=PeriodDt.class, order=4, min=0, max=1, summary=true, modifier=false) 133 @Description( 134 shortDefinition="", 135 formalDefinition="Time period when the contact point was/is in use" 136 ) 137 private PeriodDt myPeriod; 138 139 140 @Override 141 public boolean isEmpty() { 142 return super.isBaseEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty( mySystem, myValue, myUse, myRank, myPeriod); 143 } 144 145 @Override 146 public <T extends IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType) { 147 return ca.uhn.fhir.util.ElementUtil.allPopulatedChildElements(theType, mySystem, myValue, myUse, myRank, myPeriod); 148 } 149 150 /** 151 * Gets the value(s) for <b>system</b> (). 152 * creating it if it does 153 * not exist. Will not return <code>null</code>. 154 * 155 * <p> 156 * <b>Definition:</b> 157 * Telecommunications form for contact point - what communications system is required to make use of the contact 158 * </p> 159 */ 160 public BoundCodeDt<ContactPointSystemEnum> getSystemElement() { 161 if (mySystem == null) { 162 mySystem = new BoundCodeDt<ContactPointSystemEnum>(ContactPointSystemEnum.VALUESET_BINDER); 163 } 164 return mySystem; 165 } 166 167 168 /** 169 * Gets the value(s) for <b>system</b> (). 170 * creating it if it does 171 * not exist. This method may return <code>null</code>. 172 * 173 * <p> 174 * <b>Definition:</b> 175 * Telecommunications form for contact point - what communications system is required to make use of the contact 176 * </p> 177 */ 178 public String getSystem() { 179 return getSystemElement().getValue(); 180 } 181 182 /** 183 * Sets the value(s) for <b>system</b> () 184 * 185 * <p> 186 * <b>Definition:</b> 187 * Telecommunications form for contact point - what communications system is required to make use of the contact 188 * </p> 189 */ 190 public ContactPointDt setSystem(BoundCodeDt<ContactPointSystemEnum> theValue) { 191 mySystem = theValue; 192 return this; 193 } 194 195 196 197 /** 198 * Sets the value(s) for <b>system</b> () 199 * 200 * <p> 201 * <b>Definition:</b> 202 * Telecommunications form for contact point - what communications system is required to make use of the contact 203 * </p> 204 */ 205 public ContactPointDt setSystem(ContactPointSystemEnum theValue) { 206 setSystem(new BoundCodeDt<ContactPointSystemEnum>(ContactPointSystemEnum.VALUESET_BINDER, theValue)); 207 208/* 209 getSystemElement().setValueAsEnum(theValue); 210*/ 211 return this; 212 } 213 214 215 /** 216 * Gets the value(s) for <b>value</b> (). 217 * creating it if it does 218 * not exist. Will not return <code>null</code>. 219 * 220 * <p> 221 * <b>Definition:</b> 222 * The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). 223 * </p> 224 */ 225 public StringDt getValueElement() { 226 if (myValue == null) { 227 myValue = new StringDt(); 228 } 229 return myValue; 230 } 231 232 233 /** 234 * Gets the value(s) for <b>value</b> (). 235 * creating it if it does 236 * not exist. This method may return <code>null</code>. 237 * 238 * <p> 239 * <b>Definition:</b> 240 * The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). 241 * </p> 242 */ 243 public String getValue() { 244 return getValueElement().getValue(); 245 } 246 247 /** 248 * Sets the value(s) for <b>value</b> () 249 * 250 * <p> 251 * <b>Definition:</b> 252 * The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). 253 * </p> 254 */ 255 public ContactPointDt setValue(StringDt theValue) { 256 myValue = theValue; 257 return this; 258 } 259 260 261 262 /** 263 * Sets the value for <b>value</b> () 264 * 265 * <p> 266 * <b>Definition:</b> 267 * The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). 268 * </p> 269 */ 270 public ContactPointDt setValue( String theString) { 271 myValue = new StringDt(theString); 272 return this; 273 } 274 275 276 /** 277 * Gets the value(s) for <b>use</b> (). 278 * creating it if it does 279 * not exist. Will not return <code>null</code>. 280 * 281 * <p> 282 * <b>Definition:</b> 283 * Identifies the purpose for the contact point 284 * </p> 285 */ 286 public BoundCodeDt<ContactPointUseEnum> getUseElement() { 287 if (myUse == null) { 288 myUse = new BoundCodeDt<ContactPointUseEnum>(ContactPointUseEnum.VALUESET_BINDER); 289 } 290 return myUse; 291 } 292 293 294 /** 295 * Gets the value(s) for <b>use</b> (). 296 * creating it if it does 297 * not exist. This method may return <code>null</code>. 298 * 299 * <p> 300 * <b>Definition:</b> 301 * Identifies the purpose for the contact point 302 * </p> 303 */ 304 public String getUse() { 305 return getUseElement().getValue(); 306 } 307 308 /** 309 * Sets the value(s) for <b>use</b> () 310 * 311 * <p> 312 * <b>Definition:</b> 313 * Identifies the purpose for the contact point 314 * </p> 315 */ 316 public ContactPointDt setUse(BoundCodeDt<ContactPointUseEnum> theValue) { 317 myUse = theValue; 318 return this; 319 } 320 321 322 323 /** 324 * Sets the value(s) for <b>use</b> () 325 * 326 * <p> 327 * <b>Definition:</b> 328 * Identifies the purpose for the contact point 329 * </p> 330 */ 331 public ContactPointDt setUse(ContactPointUseEnum theValue) { 332 setUse(new BoundCodeDt<ContactPointUseEnum>(ContactPointUseEnum.VALUESET_BINDER, theValue)); 333 334/* 335 getUseElement().setValueAsEnum(theValue); 336*/ 337 return this; 338 } 339 340 341 /** 342 * Gets the value(s) for <b>rank</b> (). 343 * creating it if it does 344 * not exist. Will not return <code>null</code>. 345 * 346 * <p> 347 * <b>Definition:</b> 348 * Specifies a preferred order in which to use a set of contacts. Contacts are ranked with lower values coming before higher values 349 * </p> 350 */ 351 public PositiveIntDt getRankElement() { 352 if (myRank == null) { 353 myRank = new PositiveIntDt(); 354 } 355 return myRank; 356 } 357 358 359 /** 360 * Gets the value(s) for <b>rank</b> (). 361 * creating it if it does 362 * not exist. This method may return <code>null</code>. 363 * 364 * <p> 365 * <b>Definition:</b> 366 * Specifies a preferred order in which to use a set of contacts. Contacts are ranked with lower values coming before higher values 367 * </p> 368 */ 369 public Integer getRank() { 370 return getRankElement().getValue(); 371 } 372 373 /** 374 * Sets the value(s) for <b>rank</b> () 375 * 376 * <p> 377 * <b>Definition:</b> 378 * Specifies a preferred order in which to use a set of contacts. Contacts are ranked with lower values coming before higher values 379 * </p> 380 */ 381 public ContactPointDt setRank(PositiveIntDt theValue) { 382 myRank = theValue; 383 return this; 384 } 385 386 387 388 /** 389 * Sets the value for <b>rank</b> () 390 * 391 * <p> 392 * <b>Definition:</b> 393 * Specifies a preferred order in which to use a set of contacts. Contacts are ranked with lower values coming before higher values 394 * </p> 395 */ 396 public ContactPointDt setRank( int theInteger) { 397 myRank = new PositiveIntDt(theInteger); 398 return this; 399 } 400 401 402 /** 403 * Gets the value(s) for <b>period</b> (). 404 * creating it if it does 405 * not exist. Will not return <code>null</code>. 406 * 407 * <p> 408 * <b>Definition:</b> 409 * Time period when the contact point was/is in use 410 * </p> 411 */ 412 public PeriodDt getPeriod() { 413 if (myPeriod == null) { 414 myPeriod = new PeriodDt(); 415 } 416 return myPeriod; 417 } 418 419 /** 420 * Sets the value(s) for <b>period</b> () 421 * 422 * <p> 423 * <b>Definition:</b> 424 * Time period when the contact point was/is in use 425 * </p> 426 */ 427 public ContactPointDt setPeriod(PeriodDt theValue) { 428 myPeriod = theValue; 429 return this; 430 } 431 432 433 434 435 436 437}