return (getValueDatetime() == null ? "" : dateFormat.format(getValueDatetime())); } else if ("TM".equals(abbrev)) { return (getValueDatetime() == null ? "" : Format.format(getValueDatetime(), locale, FORMAT_TYPE.TIME)); } else if ("TS".equals(abbrev)) { return (getValueDatetime() == null ? "" : Format.format(getValueDatetime(), locale, FORMAT_TYPE.TIMESTAMP)); } else if ("ST".equals(abbrev)) { return getValueText(); } else if (getValueDatetime() != null) { return Format.format(getValueDatetime(), locale, FORMAT_TYPE.DATE); } else if (getValueText() != null) { return getValueText();
cal.setTime(firstObs.getValueDatetime()); Date firstObsValueDatetime = cal.getTime(); assertEquals("The date should be the 29th", returnVisitDate.toString(), firstObsValueDatetime.toString());
Obs firstObs = (Obs) returnVisitDateObsForPatient2.toArray()[0]; cal.setTime(firstObs.getValueDatetime()); cal.clear(Calendar.HOUR); cal.clear(Calendar.MINUTE);
this(obs.getObsDatetime(), null, obs.getValueAsBoolean(), obs.getValueCoded(), obs.getValueDatetime(), obs .getValueNumeric(), obs.getValueText(), obs);
public Date getActivePregnancyDueDate(Integer patientId) { Obs pregnancy = getActivePregnancy(patientId); Obs dueDateObs = getActivePregnancyDueDateObs(patientId, pregnancy); if (dueDateObs != null) { return dueDateObs.getValueDatetime(); } return null; }
/** * * format the obs value * * @param locale * @param o * @return */ public static String getObsValueAsString(Locale locale, Obs o){ String ret = ""; if (o.getConcept() != null){ String abbrev = o.getConcept().getDatatype().getHl7Abbreviation(); if (abbrev.equals("DT")){ return (o.getValueDatetime() == null ? "" : Context.getDateFormat().format(o.getValueDatetime())); } else if (abbrev.equals("TS") && o.getValueDatetime() != null){ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); return sdf.format(o.getValueDatetime()); } else { ret = o.getValueAsString(locale); } } return ret; }
public Patient[] dueDatesToWebServicePatients(List<Obs> dueDates) { List<Patient> wsPatients = new ArrayList<Patient>(); for (Obs dueDate : dueDates) { Integer patientId = dueDate.getPersonId(); org.openmrs.Patient patient = registrarBean.getPatientById(patientId); if (patient != null) { Patient wsPatient = patientToWebService(patient, true); wsPatient.setEstimateDueDate(dueDate.getValueDatetime()); wsPatients.add(wsPatient); } } return wsPatients.toArray(new Patient[wsPatients.size()]); }
if (obs.getValueDatetime() != null) { errors.rejectValue("valueDatetime", "error.not.null"); && obs.getValueComplex() == null && obs.getValueDatetime() == null && obs.getValueDrug() == null && obs.getValueModifier() == null && obs.getValueNumeric() == null && obs.getValueText() == null && obs.getComplexData() == null) { errors.rejectValue("groupMembers", "Obs.error.inGroupMember"); } else if ((dt.isDateTime() || dt.isDate() || dt.isTime()) && obs.getValueDatetime() == null) { if (atRootNode) { errors.rejectValue("valueDatetime", "error.null");
assertEquals(location, saved.getLocation()); assertEquals(valueGroupId, saved.getValueGroupId()); assertEquals(DateUtil.truncateToSeconds(valueDatetime), saved.getValueDatetime()); assertEquals(valueCoded, saved.getValueCoded()); assertEquals(valueNumeric, saved.getValueNumeric());
newObs.setValueDrug(obsToCopy.getValueDrug()); newObs.setValueGroupId(obsToCopy.getValueGroupId()); newObs.setValueDatetime(obsToCopy.getValueDatetime()); newObs.setValueNumeric(obsToCopy.getValueNumeric()); newObs.setValueModifier(obsToCopy.getValueModifier());
valueWidget.setInitialValue(existingObs.getValueDatetime()); } else if (defaultValue != null && Mode.ENTER.equals(context.getMode())) { valueWidget.setInitialValue(HtmlFormEntryUtil
for (Obs encounterObs : encounterObsSet) { if (encounterObs.getConcept().isNamed(obsConceptName)) { nextANCDate = encounterObs.getValueDatetime(); break;
return null; if (obs.getValueDatetime() != null) { return ConversionUtil.convert(obs.getValueDatetime(), Date.class);
MRSObservation convertOpenMRSToMRSObservation(Obs obs) { ConceptDatatype datatype = obs.getConcept().getDatatype(); if (datatype.isAnswerOnly()) { return createMRSObservation(obs, null); } else if (datatype.isBoolean()) { return createMRSObservation(obs, obs.getValueAsBoolean()); } else if (datatype.isDateTime()) { return createMRSObservation(obs, obs.getValueDatetime()); } else if (datatype.isNumeric()) { return createMRSObservation(obs, obs.getValueNumeric()); } else if (datatype.isText()) { return createMRSObservation(obs, obs.getValueText()); } else if (datatype.isCoded()) { return createMRSObservation(obs, new OpenMRSConcept(new OpenMRSConceptName(obs.getValueCoded().getName().getName()))); } else { throw new IllegalArgumentException("Invalid value of the createMRSObservation from DB-" + obs); } }
if (o.getValueCoded() != null || o.getValueComplex() != null || o.getValueDatetime() != null || o.getValueDrug() != null || o.getValueNumeric() != null || o.getValueText() != null) { Assert