public static DvDateTime getDvDateTime(Calendar cal) { return new DvDateTime( cal.get(Calendar.YEAR), cal.get(Calendar.MONTH) + 1, cal.get(Calendar.DAY_OF_MONTH), cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE), cal.get(Calendar.SECOND), cal.getTimeZone()); }
public static DvDateTime toDvDateTime(Calendar cal) { return new DvDateTime(new DateTime(cal.getTimeInMillis()).toString()); }
public static DvDateTime valueOf(String value) { DateTime datetime = DvDateTimeParser.parseDateTime(value); return new DvDateTime(datetime); }
public static DvDateTime valueOf(String value) { DateTime datetime = DvDateTimeParser.parseDateTime(value); return new DvDateTime(datetime); }
public static Double calculateDuration(String value, String symbol) { return calculateDurationAgainstDvTemporal(value, new DvDateTime(), symbol); }
public static Calendar getCalendarFromDVDataTimeDef(String dvDefinition) { dvDefinition = dvDefinition.replace(":", ""); DvDateTime dv = new DvDateTime(dvDefinition); Calendar cal = Calendar.getInstance(); cal.set( dv.getYear(), dv.getMonth() - 1, dv.getDay(), dv.getHour(), dv.getMinute(), dv.getSecond()); //TODO TIMEZONE return cal; }
valueMap.put(ORIGIN, new DvDateTime()); valueMap.put(TIME, new DvDateTime()); } valueMap.put(TIME, new DvDateTime()); valueMap.put(START_TIME, new DvDateTime()); valueMap.put("time", new DvDateTime());
public static DataValue getDataValue(ConstantExpression constantExpression) { if (constantExpression instanceof CodedTextConstant) { return ((CodedTextConstant) constantExpression).getCodedText(); } else if (constantExpression instanceof QuantityConstant) { return ((QuantityConstant) constantExpression).getQuantity(); } else if (constantExpression instanceof StringConstant) { return new DvText(((StringConstant) constantExpression).getString()); } else if (constantExpression instanceof OrdinalConstant) { return ((OrdinalConstant) constantExpression).getOrdinal(); } else if (constantExpression instanceof DateTimeConstant) { return new DvDateTime(constantExpression.getValue()); } else if ("true".equals(constantExpression.getValue()) || "false".equals(constantExpression.getValue())) { return new DvBoolean(constantExpression.getValue()); } else if (constantExpression.getValue().startsWith("openehr::")) { return DataValue.parseValue("DV_CODED_TEXT," + constantExpression.getValue()); } else if (isParsableInteger(constantExpression.getValue())) { int count = Integer.parseInt(constantExpression.getValue()); return new DvCount(count); } else { LoggerFactory.getLogger(GuideUtil.class).warn("Unknown data value for constant expression '{}'", constantExpression); return null; } }
@Override public DvDateTime add(DvDuration q) { if (!getDiffType().isInstance(q)) { throw new IllegalArgumentException("invalid difference type"); } DvDuration d = (DvDuration) q; MutableDateTime mdate = getDateTime().toMutableDateTimeISO(); mdate.add(d.getPeriod()); return new DvDateTime(getOtherReferenceRanges(), getNormalRange(), getNormalStatus(), getAccuracy(), getMagnitudeStatus(), mdate .toDateTimeISO(), this.toString()); }
@Override public DvDateTime add(DvDuration q) { if (!getDiffType().isInstance(q)) { throw new IllegalArgumentException("invalid difference type"); } DvDuration d = (DvDuration) q; MutableDateTime mdate = getDateTime().toMutableDateTimeISO(); mdate.add(d.getPeriod()); return new DvDateTime(getOtherReferenceRanges(), getNormalRange(), getNormalStatus(), getAccuracy(), getMagnitudeStatus(), mdate .toDateTimeISO(), this.toString()); }
{if (true) return new DvDateTime(t.image);} } catch(Exception e) { {if (true) throw new ParseException("wrong datetime format: " + t.image);}
{if (true) return new DvDateTime(t.image);} } catch(Exception e) { {if (true) throw new ParseException("wrong datetime format: " + t.image);}
{if (true) return new DvDateTime(t.image);}
{if (true) return new DvDateTime(t.image);}