public static org.hl7.fhir.dstu3.model.InstantType convertInstant(org.hl7.fhir.dstu2016may.model.InstantType src) throws FHIRException { org.hl7.fhir.dstu3.model.InstantType tgt = new org.hl7.fhir.dstu3.model.InstantType(); if (src.hasValue()) tgt.setValue(src.getValue()); copyElement(src, tgt); return tgt; }
public org.hl7.fhir.instance.model.InstantType convertInstant(org.hl7.fhir.dstu3.model.InstantType src) throws FHIRException { org.hl7.fhir.instance.model.InstantType tgt = new org.hl7.fhir.instance.model.InstantType(src.getValue()); copyElement(src, tgt); return tgt; }
@Override public InstantType copy() { return new InstantType(getValueAsString()); }
public static org.hl7.fhir.dstu2016may.model.InstantType convertInstant(org.hl7.fhir.dstu3.model.InstantType src) throws FHIRException { org.hl7.fhir.dstu2016may.model.InstantType tgt = new org.hl7.fhir.dstu2016may.model.InstantType(); if (src.hasValue()) tgt.setValue(src.getValue()); copyElement(src, tgt); return tgt; }
/** * Creates a new instance by parsing an HL7 v3 format date time string */ public static InstantType parseV3(String theV3String) { InstantType retVal = new InstantType(); retVal.setValueAsV3String(theV3String); return retVal; }
public org.hl7.fhir.dstu3.model.InstantType convertInstant(org.hl7.fhir.instance.model.InstantType src) throws FHIRException { org.hl7.fhir.dstu3.model.InstantType tgt = new org.hl7.fhir.dstu3.model.InstantType(src.getValue()); copyElement(src, tgt); return tgt; }
"Value is '" + value + "' but must be '" + ((org.hl7.fhir.dstu3.model.Base64BinaryType) fixed).asStringValue() + "'"); else if (fixed instanceof org.hl7.fhir.dstu3.model.InstantType) rule(errors, IssueType.VALUE, focus.line(), focus.col(), path, check(((org.hl7.fhir.dstu3.model.InstantType) fixed).getValue().toString(), value), "Value is '" + value + "' but must be '" + ((org.hl7.fhir.dstu3.model.InstantType) fixed).asStringValue() + "'"); else if (fixed instanceof org.hl7.fhir.dstu3.model.StringType) rule(errors, IssueType.VALUE, focus.line(), focus.col(), path, check(((org.hl7.fhir.dstu3.model.StringType) fixed).getValue(), value),
/** * 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> */ public InstantType(Date theDate, TemporalPrecisionEnum thePrecision) { setValue(theDate); setPrecision(thePrecision); setTimeZone(TimeZone.getDefault()); }
public boolean hasTimestampElement() { return this.timestamp != null && !this.timestamp.isEmpty(); }
public Meta copy() { Meta dst = new Meta(); copyValues(dst); dst.versionId = versionId == null ? null : versionId.copy(); dst.lastUpdated = lastUpdated == null ? null : lastUpdated.copy(); if (profile != null) { dst.profile = new ArrayList<UriType>(); for (UriType i : profile) dst.profile.add(i.copy()); }; if (security != null) { dst.security = new ArrayList<Coding>(); for (Coding i : security) dst.security.add(i.copy()); }; if (tag != null) { dst.tag = new ArrayList<Coding>(); for (Coding i : tag) dst.tag.add(i.copy()); }; return dst; }
/** * Sets the value of this instant to the current time (from the system * clock) and the local/default timezone (as retrieved using * {@link TimeZone#getDefault()}. This TimeZone is generally obtained from * the underlying OS. */ public void setToCurrentTimeInLocalTimeZone() { setValue(new Date()); setTimeZone(TimeZone.getDefault()); }
protected String addReference(DomainResource r, String title, String id) throws Exception { if (r.getText() == null) r.setText(new Narrative()); if (r.getText().getDiv() == null) { r.getText().setStatus(NarrativeStatus.GENERATED); new NarrativeGenerator("", "", context).generate(r); } r.setMeta(new Meta().setLastUpdatedElement(InstantType.now())); r.setId(id); feed.getEntry().add(new BundleEntryComponent().setResource(r)); return id; }
ourLog.info("Searching for searches which are before {} - now is {}", new InstantType(cutoff), new InstantType(new Date(now())));
public static org.hl7.fhir.dstu2016may.model.InstantType convertInstant(org.hl7.fhir.dstu3.model.InstantType src) throws FHIRException { org.hl7.fhir.dstu2016may.model.InstantType tgt = new org.hl7.fhir.dstu2016may.model.InstantType(); if (src.hasValue()) tgt.setValue(src.getValue()); copyElement(src, tgt); return tgt; }
"Value is '" + value + "' but must be '" + ((org.hl7.fhir.dstu3.model.Base64BinaryType) fixed).asStringValue() + "'"); else if (fixed instanceof org.hl7.fhir.dstu3.model.InstantType) rule(errors, IssueType.VALUE, focus.line(), focus.col(), path, check(((org.hl7.fhir.dstu3.model.InstantType) fixed).getValue().toString(), value), "Value is '" + value + "' but must be '" + ((org.hl7.fhir.dstu3.model.InstantType) fixed).asStringValue() + "'"); else if (fixed instanceof org.hl7.fhir.dstu3.model.StringType) rule(errors, IssueType.VALUE, focus.line(), focus.col(), path, check(((org.hl7.fhir.dstu3.model.StringType) fixed).getValue(), value),
/** * Create a new DateTimeDt using an existing value. <b>Use this constructor with caution</b>, * as it may create more precision than warranted (since for example it is possible to pass in * a DateTime with only a year, and this constructor will convert to an InstantDt with * milliseconds precision). */ public InstantType(BaseDateTimeType theDateTime) { // Do not call super(foo) here, we don't want to trigger a DataFormatException setValue(theDateTime.getValue()); setPrecision(DEFAULT_PRECISION); setTimeZone(theDateTime.getTimeZone()); }
public boolean hasTimestamp() { return this.timestamp != null && !this.timestamp.isEmpty(); }
public AppointmentResponse copy() { AppointmentResponse dst = new AppointmentResponse(); copyValues(dst); if (identifier != null) { dst.identifier = new ArrayList<Identifier>(); for (Identifier i : identifier) dst.identifier.add(i.copy()); }; dst.appointment = appointment == null ? null : appointment.copy(); dst.start = start == null ? null : start.copy(); dst.end = end == null ? null : end.copy(); if (participantType != null) { dst.participantType = new ArrayList<CodeableConcept>(); for (CodeableConcept i : participantType) dst.participantType.add(i.copy()); }; dst.actor = actor == null ? null : actor.copy(); dst.participantStatus = participantStatus == null ? null : participantStatus.copy(); dst.comment = comment == null ? null : comment.copy(); return dst; }
public Bundle convert(InputStream stream) throws Exception { cda = new CDAUtilities(stream); doc = cda.getElement(); cda.checkTemplateId(doc, "2.16.840.1.113883.10.20.22.1.1"); convert = new Convert(cda, ucumSvc, "Z"); // check it's a CDA/CCD feed = new Bundle(); feed.setMeta(new Meta().setLastUpdatedElement(InstantType.now())); feed.setId(makeUUIDReference()); feed.getMeta().getTag().add(new Coding()); // todo-bundle ("http://hl7.org/fhir/tag", "http://hl7.org/fhir/tag/document", "Document")); // process the header makeDocument(); composition.setSubject(Factory.makeReference(makeSubject())); for (Element e : cda.getChildren(doc, "author")) composition.getAuthor().add(Factory.makeReference(makeAuthor(e))); // todo: data enterer & informant goes in provenance composition.setCustodian(Factory.makeReference(makeOrganization( cda.getDescendent(doc, "custodian/assignedCustodian/representedCustodianOrganization"), "Custodian"))); // todo: informationRecipient for (Element e : cda.getChildren(doc, "legalAuthenticator")) composition.getAttester().add(makeAttester(e, CompositionAttestationMode.LEGAL, "Legal Authenticator")); for (Element e : cda.getChildren(doc, "authenticator")) composition.getAttester().add(makeAttester(e, CompositionAttestationMode.PROFESSIONAL, "Authenticator")); // process the contents // we do this by section - keep the original section order Element body = cda.getDescendent(doc, "component/structuredBody"); processComponentSections(composition.getSection(), body); return feed; }
/** * @param value The time that the message was sent. */ public MessageHeader setTimestamp(Date value) { if (this.timestamp == null) this.timestamp = new InstantType(); this.timestamp.setValue(value); return this; }