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

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

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

Obs.getEncounter介绍

暂无

代码示例

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

private void setPersonFromEncounter(Obs obs) {
  Encounter encounter = obs.getEncounter();
  if (encounter != null) {
    obs.setPerson(encounter.getPatient());
  }
}

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

private void mergeObservationsNotContainedInEncounters(Patient preferred, Patient notPreferred,
    PersonMergeLogData mergedData) {
  // move all obs that weren't contained in encounters
  // TODO: this should be a copy, not a move
  ObsService obsService = Context.getObsService();
  for (Obs obs : obsService.getObservationsByPerson(notPreferred)) {
    if (obs.getEncounter() == null && !obs.getVoided()) {
      obs.setPerson(preferred);
      Obs persisted = obsService.saveObs(obs, "Merged from patient #" + notPreferred.getPatientId());
      mergedData.addMovedIndependentObservation(persisted.getUuid());
    }
  }
}

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

/**
 * @see Encounter#addObs(Obs)
 */
@Test
public void addObs_shouldSetEncounterAttributeOnObs() {
  Encounter encounter = new Encounter();
  Obs obs = new Obs();
  encounter.addObs(obs);
  assertTrue(obs.getEncounter().equals(encounter));
}

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

assertNotNull("Their should be an associated encounter", firstContactMethodObs.getEncounter());

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

@Test
public void saveObs_shouldOverwriteObsPersonValueWithEncounterPatient() {
  String changeMessage = "Testing TRUNK-3283";
  
  executeDataSet(ENCOUNTER_OBS_XML);
  ObsService obsService = Context.getObsService();
  Obs obs = obsService.getObs(13);
  //overwrite ObsPerson with EncounterPatient
  Obs obsSaved = obsService.saveObs(obs, changeMessage);
  
  assertEquals(obs.getPerson(), obsSaved.getEncounter().getPatient());
}

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

assertEquals(1, obsForPatient.size()); // there should be 1 obs now for
assertEquals(3, obsForPatient.get(0).getEncounter().getId().intValue());

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

private List<Encounter> getEncountersForObs(Iterator<Obs> obsIterator) {
  List<Encounter> encounters = new ArrayList<Encounter>();
  Encounter currEncounter;
  while (obsIterator.hasNext()) {
    currEncounter = obsIterator.next().getEncounter();
    if (!this.containsEncounter(encounters, currEncounter)) {
      encounters.add(currEncounter);
    }
  }
  
  return encounters;
}

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

assertEquals("encounter id propogated", groupObs.getEncounter().getId(), enc.getId());
assertEquals("encounter time propogated", groupObs.getObsDatetime(), enc.getEncounterDatetime());
assertNotNull("obs save succeeds", childObs.getObsId());
assertEquals("encounter id propogated", childObs.getEncounter().getId(), enc.getId());
assertEquals("encounter time propogated", childObs.getObsDatetime(), enc.getEncounterDatetime());

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

/**
 * Removes any Obs that are empty or which have only empty children
 */
public static void removeEmptyObs(Collection<Obs> obsList) {
  if (obsList != null) {
    Set<Obs> obsToRemove = new HashSet<Obs>();
    for (Obs o : obsList) {
      removeEmptyObs(o.getGroupMembers());
      boolean valueEmpty = StringUtils.isEmpty(o.getValueAsString(Context.getLocale()));
      boolean membersEmpty = o.getGroupMembers() == null || o.getGroupMembers().isEmpty();
      if (valueEmpty && membersEmpty) {
        obsToRemove.add(o);
      }
    }
    for (Obs o : obsToRemove) {
      if (o.getObsGroup() != null) {
        o.getObsGroup().removeGroupMember(o);
        o.setObsGroup(null);
      }
      if (o.getEncounter() != null) {
        o.getEncounter().removeObs(o);
        o.setEncounter(null);
      }
      obsList.remove(o);
    }
  }
}

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

assertEquals(comment, saved.getComment());
assertEquals(concept, saved.getConcept());
assertEquals(encounter, saved.getEncounter());
assertEquals(DateUtil.truncateToSeconds(datetime), saved.getObsDatetime());
assertEquals(location, saved.getLocation());

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

newObs.setValueText(obsToCopy.getValueText());
newObs.setComment(obsToCopy.getComment());
newObs.setEncounter(obsToCopy.getEncounter());
newObs.setCreator(obsToCopy.getCreator());
newObs.setDateCreated(obsToCopy.getDateCreated());

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

while (toCheck.size() > 0) {
  Obs o = toCheck.remove(toCheck.size() - 1);
  if (o.getObsDatetime() == null && o.getEncounter() != null) {
    o.setObsDatetime(o.getEncounter().getEncounterDatetime());
    if (log.isDebugEnabled())
      log.debug("Set obsDatetime to " + o.getObsDatetime() + " for "
          + o.getConcept().getName(Context.getLocale()));
  if (o.getLocation() == null && o.getEncounter() != null) {
    o.setLocation(o.getEncounter().getLocation());

相关文章