public org.hl7.fhir.dstu3.model.DateType convertDate(org.hl7.fhir.instance.model.DateType src) throws FHIRException { org.hl7.fhir.dstu3.model.DateType tgt = new org.hl7.fhir.dstu3.model.DateType(src.getValue()); copyElement(src, tgt); return tgt; }
public org.hl7.fhir.dstu3.model.DateType convertDate(org.hl7.fhir.instance.model.DateTimeType src) throws FHIRException { org.hl7.fhir.dstu3.model.DateType tgt = new org.hl7.fhir.dstu3.model.DateType(src.getValue()); copyElement(src, tgt); return tgt; }
public static org.hl7.fhir.dstu3.model.DateType convertDate(org.hl7.fhir.dstu2016may.model.DateType src) throws FHIRException { org.hl7.fhir.dstu3.model.DateType tgt = new org.hl7.fhir.dstu3.model.DateType(); if (src.hasValue()) tgt.setValue(src.getValue()); copyElement(src, tgt); return tgt; }
public static void main(String[] args) { // START SNIPPET: usage // Create a context. Note that we declare the custom types we'll be using // on the context before actually using them FhirContext ctx = FhirContext.forDstu3(); ctx.registerCustomType(CustomResource.class); ctx.registerCustomType(CustomDatatype.class); // Now let's create an instance of our custom resource type // and populate it with some data CustomResource res = new CustomResource(); // Add some values, including our custom datatype DateType value0 = new DateType("2015-01-01"); res.getTelevision().add(value0); CustomDatatype value1 = new CustomDatatype(); value1.setDate(new DateTimeType(new Date())); value1.setKittens(new StringType("FOO")); res.getTelevision().add(value1); res.setDogs(new StringType("Some Dogs")); // Now let's serialize our instance String output = ctx.newXmlParser().setPrettyPrint(true).encodeResourceToString(res); System.out.println(output); // END SNIPPET: usage }
private List<Base> funcToday(ExecutionContext context, List<Base> focus, ExpressionNode exp) { List<Base> result = new ArrayList<Base>(); result.add(new DateType(new Date(), TemporalPrecisionEnum.DAY)); return result; }
/** * @param value Date of an accident which these services are addressing. */ public AccidentComponent setDate(Date value) { if (this.date == null) this.date = new DateType(); this.date.setValue(value); return this; }
/** * @return {@link #lastReviewDate} (The date on which the resource content was last reviewed. Review happens periodically after approval, but doesn't change the original approval date.). This is the underlying object with id, value and extensions. The accessor "getLastReviewDate" gives direct access to the value */ public DateType getLastReviewDateElement() { if (this.lastReviewDate == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create Library.lastReviewDate"); else if (Configuration.doAutoCreate()) this.lastReviewDate = new DateType(); // bb return this.lastReviewDate; }
/** * @return {@link #approvalDate} (The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.). This is the underlying object with id, value and extensions. The accessor "getApprovalDate" gives direct access to the value */ public DateType getApprovalDateElement() { if (this.approvalDate == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create PlanDefinition.approvalDate"); else if (Configuration.doAutoCreate()) this.approvalDate = new DateType(); // bb return this.approvalDate; }
*/ public DateType getBirthDateElement() { if (this.birthDate == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create Practitioner.birthDate"); else if (Configuration.doAutoCreate()) this.birthDate = new DateType(); // bb return this.birthDate; } public boolean hasBirthDateElement() { return this.birthDate != null && !this.birthDate.isEmpty();
/** * @return {@link #expirationDate} (Date vaccine batch expires.). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value */ public DateType getExpirationDateElement() { if (this.expirationDate == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create Immunization.expirationDate"); else if (Configuration.doAutoCreate()) this.expirationDate = new DateType(); // bb return this.expirationDate; }
/** * @return {@link #approvalDate} (The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.). This is the underlying object with id, value and extensions. The accessor "getApprovalDate" gives direct access to the value */ public DateType getApprovalDateElement() { if (this.approvalDate == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create ServiceDefinition.approvalDate"); else if (Configuration.doAutoCreate()) this.approvalDate = new DateType(); // bb return this.approvalDate; }
/** * @return {@link #birthDate} (The date on which the related person was born.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value */ public DateType getBirthDateElement() { if (this.birthDate == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create RelatedPerson.birthDate"); else if (Configuration.doAutoCreate()) this.birthDate = new DateType(); // bb return this.birthDate; }
/** * @return {@link #statusDate} (The date when the above payment action occurrred.). This is the underlying object with id, value and extensions. The accessor "getStatusDate" gives direct access to the value */ public DateType getStatusDateElement() { if (this.statusDate == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create PaymentNotice.statusDate"); else if (Configuration.doAutoCreate()) this.statusDate = new DateType(); // bb return this.statusDate; }
/** * @return {@link #approvalDate} (The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.). This is the underlying object with id, value and extensions. The accessor "getApprovalDate" gives direct access to the value */ public DateType getApprovalDateElement() { if (this.approvalDate == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create Questionnaire.approvalDate"); else if (Configuration.doAutoCreate()) this.approvalDate = new DateType(); // bb return this.approvalDate; }
/** * @return {@link #lockedDate} (If a locked date is defined, then the Content Logical Definition must be evaluated using the current version as of the locked date for referenced code system(s) and value set instances where ValueSet.compose.include.version is not defined.). This is the underlying object with id, value and extensions. The accessor "getLockedDate" gives direct access to the value */ public DateType getLockedDateElement() { if (this.lockedDate == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create ValueSetComposeComponent.lockedDate"); else if (Configuration.doAutoCreate()) this.lockedDate = new DateType(); // bb return this.lockedDate; }
/** * @return {@link #approvalDate} (The date on which the resource content was approved by the publisher. Approval happens once when the content is officially approved for usage.). This is the underlying object with id, value and extensions. The accessor "getApprovalDate" gives direct access to the value */ public DateType getApprovalDateElement() { if (this.approvalDate == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create Measure.approvalDate"); else if (Configuration.doAutoCreate()) this.approvalDate = new DateType(); // bb return this.approvalDate; }
/** * @return {@link #lastReviewDate} (The date on which the resource content was last reviewed. Review happens periodically after approval, but doesn't change the original approval date.). This is the underlying object with id, value and extensions. The accessor "getLastReviewDate" gives direct access to the value */ public DateType getLastReviewDateElement() { if (this.lastReviewDate == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create ServiceDefinition.lastReviewDate"); else if (Configuration.doAutoCreate()) this.lastReviewDate = new DateType(); // bb return this.lastReviewDate; }
*/ public DateType getApprovalDateElement() { if (this.approvalDate == null) if (Configuration.errorOnAutoCreate()) throw new Error("Attempt to auto-create ActivityDefinition.approvalDate"); else if (Configuration.doAutoCreate()) this.approvalDate = new DateType(); // bb return this.approvalDate; } public boolean hasApprovalDateElement() { return this.approvalDate != null && !this.approvalDate.isEmpty();
public org.hl7.fhir.dstu3.model.DateType convertDate(org.hl7.fhir.instance.model.DateType src) throws FHIRException { org.hl7.fhir.dstu3.model.DateType tgt = new org.hl7.fhir.dstu3.model.DateType(src.getValue()); copyElement(src, tgt); return tgt; }
public DateType castToDate(Base b) throws FHIRException { if (b instanceof DateType) return (DateType) b; else if (b.hasPrimitiveValue()) return new DateType(b.primitiveValue()); else throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Date"); }