/** * @param value Date/Time that the slot is to begin. */ public Slot setStart(Date value) { if (this.start == null) this.start = new InstantType(); this.start.setValue(value); return this; }
/** * @return This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time. */ public Date getEnd() { return this.end == null ? null : this.end.getValue(); }
@Override public InstantType copy() { InstantType ret = new InstantType(getValueAsString()); copyValues(ret); return ret; }
/** * 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; }
/** * Returns a new instance of DateTimeType with the current system time and MILLI precision and the system local time * zone */ public static InstantType now() { return new InstantType(new Date(), TemporalPrecisionEnum.MILLI, TimeZone.getDefault()); }
@Override public IBaseResource readByPid(Long thePid) { StopWatch w = new StopWatch(); Optional<ResourceTable> entity = myResourceTableDao.findById(thePid); if (!entity.isPresent()) { throw new ResourceNotFoundException("No resource found with PID " + thePid); } if (entity.get().getDeleted() != null) { throw new ResourceGoneException("Resource was deleted at " + new InstantType(entity.get().getDeleted()).getValueAsString()); } T retVal = toResource(myResourceType, entity.get(), null, false); ourLog.debug("Processed read on {} in {}ms", thePid, w.getMillis()); return retVal; }
/** * 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()); }
"Value is '" + value + "' but must be '" + ((org.hl7.fhir.r4.model.Base64BinaryType) fixed).asStringValue() + "'"); else if (fixed instanceof org.hl7.fhir.r4.model.InstantType) rule(errors, IssueType.VALUE, focus.line(), focus.col(), path, check(((org.hl7.fhir.r4.model.InstantType) fixed).getValue().toString(), value), "Value is '" + value + "' but must be '" + ((org.hl7.fhir.r4.model.InstantType) fixed).asStringValue() + "'"); else if (fixed instanceof org.hl7.fhir.r4.model.StringType) rule(errors, IssueType.VALUE, focus.line(), focus.col(), path, check(((org.hl7.fhir.r4.model.StringType) fixed).getValue(), value),
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 static org.hl7.fhir.dstu2016may.model.InstantType convertInstant(org.hl7.fhir.r4.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; }
/** * 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()); }
/** * Factory method which creates a new InstantDt with millisecond precision and initializes it with the * current time and the system local timezone. */ public static InstantType withCurrentTime() { return new InstantType(new Date(), TemporalPrecisionEnum.MILLI, TimeZone.getDefault()); }
@Override public T read(IIdType theId, RequestDetails theRequestDetails, boolean theDeletedOk) { validateResourceTypeAndThrowIllegalArgumentException(theId); // Notify interceptors if (theRequestDetails != null) { ActionRequestDetails requestDetails = new ActionRequestDetails(theRequestDetails, getResourceName(), theId); RestOperationTypeEnum operationType = theId.hasVersionIdPart() ? RestOperationTypeEnum.VREAD : RestOperationTypeEnum.READ; notifyInterceptors(operationType, requestDetails); } StopWatch w = new StopWatch(); BaseHasResource entity = readEntity(theId); validateResourceType(entity); T retVal = toResource(myResourceType, entity, null, false); if (theDeletedOk == false) { if (entity.getDeleted() != null) { throw new ResourceGoneException("Resource was deleted at " + new InstantType(entity.getDeleted()).getValueAsString()); } } ourLog.debug("Processed read on {} in {}ms", theId.getValue(), w.getMillisAndRestart()); return retVal; }
/** * 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()); }
"Value is '" + value + "' but must be '" + ((org.hl7.fhir.r4.model.Base64BinaryType) fixed).asStringValue() + "'"); else if (fixed instanceof org.hl7.fhir.r4.model.InstantType) rule(errors, IssueType.VALUE, focus.line(), focus.col(), path, check(((org.hl7.fhir.r4.model.InstantType) fixed).getValue().toString(), value), "Value is '" + value + "' but must be '" + ((org.hl7.fhir.r4.model.InstantType) fixed).asStringValue() + "'"); else if (fixed instanceof org.hl7.fhir.r4.model.StringType) rule(errors, IssueType.VALUE, focus.line(), focus.col(), path, check(((org.hl7.fhir.r4.model.StringType) fixed).getValue(), value),
public Meta copy() { Meta dst = new Meta(); copyValues(dst); dst.versionId = versionId == null ? null : versionId.copy(); dst.lastUpdated = lastUpdated == null ? null : lastUpdated.copy(); dst.source = source == null ? null : source.copy(); if (profile != null) { dst.profile = new ArrayList<CanonicalType>(); for (CanonicalType 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; }
/** * @param value Date/Time that the slot is to conclude. */ public Slot setEnd(Date value) { if (this.end == null) this.end = new InstantType(); this.end.setValue(value); return this; }
/** * @return {@link #effective} (The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the "physiologically relevant time". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.) */ public InstantType getEffectiveInstantType() throws FHIRException { if (this.effective == null) this.effective = new InstantType(); if (!(this.effective instanceof InstantType)) throw new FHIRException("Type mismatch: the type InstantType was expected, but "+this.effective.getClass().getName()+" was encountered"); return (InstantType) this.effective; }
/** * @return The instant of time at which the activity was recorded. */ public Date getRecorded() { return this.recorded == null ? null : this.recorded.getValue(); }
@Override public IBaseResource readByPid(Long thePid) { StopWatch w = new StopWatch(); Optional<ResourceTable> entity = myResourceTableDao.findById(thePid); if (!entity.isPresent()) { throw new ResourceNotFoundException("No resource found with PID " + thePid); } if (entity.get().getDeleted() != null) { throw new ResourceGoneException("Resource was deleted at " + new InstantType(entity.get().getDeleted()).getValueAsString()); } T retVal = toResource(myResourceType, entity.get(), null, false); ourLog.debug("Processed read on {} in {}ms", thePid, w.getMillis()); return retVal; }