org.openmrs.Obs.getValueText()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(10.3k)|赞(0)|评价(0)|浏览(137)

本文整理了Java中org.openmrs.Obs.getValueText()方法的一些代码示例,展示了Obs.getValueText()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Obs.getValueText()方法的具体详情如下:
包路径:org.openmrs.Obs
类名称:Obs
方法名:getValueText

Obs.getValueText介绍

暂无

代码示例

代码示例来源:origin: openmrs/openmrs-core

return (getValueDatetime() == null ? "" : Format.format(getValueDatetime(), locale, FORMAT_TYPE.TIMESTAMP));
  } else if ("ST".equals(abbrev)) {
    return getValueText();
  } else if ("ED".equals(abbrev) && getValueComplex() != null) {
    String[] valuesComplex = getValueComplex().split("\\|");
} else if (getValueText() != null) {
  return getValueText();
} else if (hasGroupMembers()) {

代码示例来源:origin: openmrs/openmrs-core

/**
 * @see Encounter#getObs()
 */
@Test
public void getObs_shouldGetObsInTheSameOrderObsIsAddedToTheEncounter() {
  Encounter encounter = new Encounter();
  Obs obs1= new Obs();
  obs1.setValueText("first obs");
  encounter.addObs(obs1);
  Obs obs2= new Obs();
  obs2.setValueText("second obs");
  encounter.addObs(obs2);
  Obs obs3= new Obs();
  obs3.setValueText("third obs");
  encounter.addObs(obs3);
  Set<Obs> obs = encounter.getObs();
  assertNotNull(obs);
  assertEquals(3, obs.size());
  Iterator<Obs> obsIterator = obs.iterator();
  assertEquals("first obs", obsIterator.next().getValueText());
  assertEquals("second obs", obsIterator.next().getValueText());
  assertEquals("third obs", obsIterator.next().getValueText());
}

代码示例来源:origin: openmrs/openmrs-core

/**
 * @see Encounter#getAllObs(null)
 */
@Test
public void getAllObs_shouldGetObsInTheSameOrderObsIsAddedToTheEncounter() {
  Encounter encounter = new Encounter();
  Obs obs1= new Obs();
  obs1.setValueText("first obs");
  encounter.addObs(obs1);
  Obs obs2= new Obs();
  obs2.setValueText("second obs");
  encounter.addObs(obs2);
  Obs obs3= new Obs();
  obs3.setValueText("third obs");
  encounter.addObs(obs3);
  Set<Obs> allObs = encounter.getAllObs(true);
  assertNotNull(allObs);
  assertEquals(3, allObs.size());
  Iterator<Obs> obsIterator = allObs.iterator();
  assertEquals("first obs", obsIterator.next().getValueText());
  assertEquals("second obs", obsIterator.next().getValueText());
  assertEquals("third obs", obsIterator.next().getValueText());
}

代码示例来源:origin: openmrs/openmrs-core

/**
 * @see Encounter#getObsAtTopLevel(boolean)
 */
@Test
public void getObsAtTopLevel_shouldGetObsInTheSameOrderObsIsAddedToTheEncounter() {
  Encounter encounter = new Encounter();
  Obs obs1= new Obs();
  obs1.setValueText("first obs");
  encounter.addObs(obs1);
  Obs obs2= new Obs();
  obs2.setValueText("second obs");
  encounter.addObs(obs2);
  Obs obs3= new Obs();
  obs3.setValueText("third obs");
  encounter.addObs(obs3);
  Set<Obs> obsAtTopLevel = encounter.getObsAtTopLevel(true);
  assertNotNull(obsAtTopLevel);
  assertEquals(3, obsAtTopLevel.size());
  Iterator<Obs> obsIterator = obsAtTopLevel.iterator();
  assertEquals("first obs", obsIterator.next().getValueText());
  assertEquals("second obs", obsIterator.next().getValueText());
  assertEquals("third obs", obsIterator.next().getValueText());
}

代码示例来源:origin: openmrs/openmrs-core

.getValueNumeric(), obs.getValueText(), obs);

代码示例来源:origin: openmrs/openmrs-core

if (memberChild.getValueText()!= null && memberChild.getValueText().equals("NewObs Value")) {
  count++;

代码示例来源:origin: openmrs/openmrs-core

if (obs.getValueText() != null) {
  errors.rejectValue("valueText", "error.not.null");
  && obs.getValueModifier() == null && obs.getValueNumeric() == null && obs.getValueText() == null
  && obs.getComplexData() == null) {
errors.reject("error.noValue");
  } else if (dt.isText() && obs.getValueText() == null) {
    if (atRootNode) {
      errors.rejectValue("valueText", "error.null");
  if (dt.isText() && obs.getValueText() != null && obs.getValueText().length() > VALUE_TEXT_MAX_LENGTH) {
    if (atRootNode) {
      errors.rejectValue("valueText", "error.exceededMaxLengthOfField");

代码示例来源:origin: openmrs/openmrs-core

assertTrue(encounter.getAllObs(true).contains(unVoidedObsToUpdate));
assertTrue(encounter.getAllObs(true).contains(unVoidedObs));
assertNotEquals(newValueText, alreadyVoidedObs.getValueText());
assertNotEquals(newValueText, toBeVoidedObs.getValueText());
assertNotEquals(newValueText, unVoidedObsToUpdate.getValueText());
assertNotEquals(newValueText, unVoidedObs.getValueText());
assertEquals(newValueText, alreadyVoidedObs.getValueText());
assertEquals(newValueText, toBeVoidedObs.getValueText());
assertNotEquals(newValueText, unVoidedObsToUpdate.getValueText());

代码示例来源:origin: openmrs/openmrs-core

@Test
public void saveEncounter_shouldUpdateExistingEncounterWhenAChildObsIsEdited() {
  executeDataSet(ENC_OBS_HIERARCHY_DATA_XML);
  EncounterService es = Context.getEncounterService();
  ObsService os = Context.getObsService();
  Encounter enc = es.getEncounter(100);
  Obs o = os.getObs(101);
  o.setValueText("Obs value updated");
  es.saveEncounter(enc);
  Context.flushSession();
  Context.clearSession();
  updateSearchIndex();
  enc = es.getEncounter(100);
  Set<Obs> obsAtTopLevelUpdated = enc.getObsAtTopLevel(true);
  Obs oParent = os.getObs(100);
  final Obs editedObs = os.getObs(101);
  Obs o2 = os.getObs(102);
  Obs o3 = getNewVersionOfEditedObs(oParent,editedObs);
  assertEquals(1,obsAtTopLevelUpdated.size());
  assertEquals(3, oParent.getGroupMembers(true).size());
  assertTrue(editedObs.getVoided());
  assertFalse(oParent.getVoided());
  assertFalse(o2.getVoided());
  assertNotNull(o3);
  assertFalse(o3.getVoided());
  assertEquals("Obs value updated", o3.getValueText());
}

代码示例来源:origin: openmrs/openmrs-core

int i = 0;
for (Obs child : parent.getGroupMembers()) {
  assertEquals("testingUpdate", child.getValueText());

代码示例来源:origin: openmrs/openmrs-core

assertEquals(valueNumeric, saved.getValueNumeric());
assertEquals(valueModifier, saved.getValueModifier());
assertEquals(valueText, saved.getValueText());

代码示例来源:origin: openmrs/openmrs-core

newObs.setValueNumeric(obsToCopy.getValueNumeric());
newObs.setValueModifier(obsToCopy.getValueModifier());
newObs.setValueText(obsToCopy.getValueText());
newObs.setComment(obsToCopy.getComment());
newObs.setEncounter(obsToCopy.getEncounter());

代码示例来源:origin: openmrs/openmrs-module-webservices.rest

if (obs.getValueText() != null) {
  if ("org.openmrs.Location".equals(obs.getComment())) { // string first to make it null-safe
    try {
      return Context.getLocationService().getLocation(new Integer(obs.getValueText()));
      return Context.getLocationService().getLocationByUuid(obs.getValueText());
    return obs.getValueText();

代码示例来源:origin: openmrs/openmrs-module-htmlformentry

@Override
public void testResults(SubmissionResults results) {
  results.assertNoErrors();
  List<Obs> obsList = os.getObservationsByPersonAndConcept(results.getPatient(), cs.getConcept("4200"));
  List<Obs> obsDeathList = os.getObservationsByPersonAndConcept(results.getPatient(), cs.getConcept("4300"));
  Assert.assertEquals(obsList.size(),1);
  Assert.assertEquals(obsDeathList.size(),1);
  Assert.assertEquals("PATIENT DIED",obsList.get(0).getValueCoded().getDisplayString());
  Assert.assertEquals(dateAsString(date),dateAsString(obsList.get(0).getObsDatetime()));
  Assert.assertEquals("OTHER NON-CODED",obsDeathList.get(0).getValueCoded().getDisplayString());
  Assert.assertEquals("Died from cancer",obsDeathList.get(0).getValueText());
}

代码示例来源:origin: openmrs/openmrs-module-htmlformentry

@Override
public void testResults(SubmissionResults results) {
  results.assertNoErrors();
  List<Obs> obsList = os.getObservationsByPersonAndConcept(results.getPatient(), cs.getConcept("4200"));
  List<Obs> obsDeathList = os.getObservationsByPersonAndConcept(results.getPatient(), cs.getConcept("4300"));
  Assert.assertEquals(obsList.size(),1);
  Assert.assertEquals(obsDeathList.size(),1);
  Assert.assertEquals("PATIENT DIED",obsList.get(0).getValueCoded().getDisplayString());
  Assert.assertEquals(dateAsString(date),dateAsString(obsList.get(0).getObsDatetime()));
  Assert.assertEquals("STROKE",obsDeathList.get(0).getValueCoded().getDisplayString());
  Assert.assertEquals(null,obsList.get(0).getValueText());
}

代码示例来源:origin: openmrs/openmrs-module-htmlformentry

@Override
public void testEditedResults(SubmissionResults results) {
  results.assertNoErrors();;
  results.assertProvider(502);
  results.assertLocation(2);
  results.assertObsCreatedCount(1);
  Obs locationObs = results.getEncounterCreated().getObs().iterator().next();
  Assert.assertEquals("3", locationObs.getValueText());
  Assert.assertNull(locationObs.getValueCoded());
  Assert.assertEquals("org.openmrs.Location", locationObs.getComment());
};

代码示例来源:origin: openmrs/openmrs-module-htmlformentry

@Override
  public void testResults(SubmissionResults results) {
    results.assertNoErrors();
    results.assertEncounterCreated();
    results.assertProvider(502);
    results.assertLocation(2);
    results.assertObsCreatedCount(1);
    Obs locationObs = results.getEncounterCreated().getObs().iterator().next();
    Assert.assertEquals("2", locationObs.getValueText());
    Assert.assertNull(locationObs.getValueCoded());
    Assert.assertEquals("org.openmrs.Location", locationObs.getComment());
  }
}.run();

代码示例来源:origin: openmrs/openmrs-module-htmlformentry

value = locationService.getLocation(new Integer(field.getExistingObs().getValueText())).getName();
value = field.getExistingObs().getValueText();

代码示例来源:origin: org.motechproject/motech-openmrs-api

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);
  }
}

代码示例来源:origin: openmrs/openmrs-module-htmlformentry

if (o.getConcept().getConceptId() == groupingConceptId) {
  if (o.getValueCoded() != null || o.getValueComplex() != null || o.getValueDatetime() != null
      || o.getValueDrug() != null || o.getValueNumeric() != null || o.getValueText() != null) {
    Assert
        .fail("Obs group with groupingConceptId " + groupingConceptId

相关文章

微信公众号

最新文章

更多