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

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

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

Obs.getLocation介绍

暂无

代码示例

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

o.setPerson(getPatient());
if (o.getLocation() == null) {
  o.setLocation(getLocation());

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

/**
 * @see Encounter#addObs(Obs)
 */
@Test
public void addObs_shouldAddEncounterAttrsToObsIfAttributesAreNull() {
  /// an encounter that will hav the date/location/patient on it
  Encounter encounter = new Encounter();
  
  Date date = new Date();
  encounter.setEncounterDatetime(date);
  
  Location location = new Location(1);
  encounter.setLocation(location);
  
  Patient patient = new Patient(1);
  encounter.setPatient(patient);
  
  // add an obs that doesn't have date/location/patient set on it.
  Obs obs = new Obs(123);
  encounter.addObs(obs);
  
  // make sure it was added
  assertEquals(1, encounter.getAllObs(true).size());
  
  // check the values of the obs attrs to see if they were added
  assertTrue(obs.getObsDatetime().equals(date));
  assertTrue(obs.getLocation().equals(location));
  assertTrue(obs.getPerson().equals(patient));
}

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

if (!OpenmrsUtil.nullSafeEquals(newLocation, originalLocation) && obs.getLocation().equals(originalLocation)) {
  obs.setLocation(newLocation);

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

assertTrue(childObs.getLocation().equals(location));
assertTrue(childObs.getPerson().equals(patient));
assertTrue(childObs2.getObsDatetime().equals(date));
assertTrue(childObs2.getLocation().equals(location));
assertTrue(childObs2.getPerson().equals(patient));

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

/**
 * When you save the encounter with a changed location, the location change should not be
 * cascaded to all the obs associated with the encounter that had a different location from
 * encounter's location.
 *
 * @see EncounterService#saveEncounter(Encounter)
 */
@Test
public void saveEncounter_shouldNotCascadeLocationChangeForDifferentInitialLocations() {
  EncounterService es = Context.getEncounterService();
  
  // First, create a new Encounter
  Encounter enc = buildEncounter();
  es.saveEncounter(enc);
  
  // Now add an obs to it
  Obs newObs = buildObs();
  
  enc.addObs(newObs);
  es.saveEncounter(enc);
  
  enc.setLocation(new Location(2));
  es.saveEncounter(enc);
  assertNotSame(enc.getLocation(), newObs.getLocation());
}

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

/**
 * When you save the encounter with a changed location, the location change should be cascaded
 * to all the obs associated with the encounter that had the same location as the encounter.
 *
 * @see EncounterService#saveEncounter(Encounter)
 */
@Test
public void saveEncounter_shouldCascadeChangeOfLocationInEncounterToContainedObs() {
  EncounterService es = Context.getEncounterService();
  Encounter enc = buildEncounter();
  
  es.saveEncounter(enc);
  
  // Now add an obs to it
  Obs newObs = new Obs();
  newObs.setConcept(Context.getConceptService().getConcept(1));
  newObs.setValueNumeric(50d);
  Location location = new Location(1);
  newObs.setLocation(location);
  
  enc.addObs(newObs);
  es.saveEncounter(enc);
  
  enc.setLocation(location);
  es.saveEncounter(enc);
  assertEquals(enc.getLocation(), newObs.getLocation());
}

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

assertEquals(encounter, saved.getEncounter());
assertEquals(DateUtil.truncateToSeconds(datetime), saved.getObsDatetime());
assertEquals(location, saved.getLocation());
assertEquals(valueGroupId, saved.getValueGroupId());
assertEquals(DateUtil.truncateToSeconds(valueDatetime), saved.getValueDatetime());

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

obsToCopy.getLocation());

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

+ o.getConcept().getName(Context.getLocale()));
if (o.getLocation() == null && o.getEncounter() != null) {
  o.setLocation(o.getEncounter().getLocation());

相关文章

微信公众号

最新文章

更多