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

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

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

Obs.getObsGroup介绍

[英]An obs grouping occurs when the question (#getConcept()) is a set. (@link org.openmrs.Concept#isSet()) If this is non-null, it means the current Obs is in the list returned by obsGroup. #getGroupMembers()
[中]当问题(#getConcept())是一个集合时,会发生obs分组。(@link org.openmrs.Concept#isSet())如果该值为非空,则表示当前Obs位于obsGroup返回的列表中#getGroupMembers()

代码示例

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

/**
 * Returns a Set<Obs> of all root-level Obs of an Encounter, including obsGroups
 *
 * @param includeVoided specifies whether or not to include voided Obs
 * @return Returns all obs at top level -- will not be null
 * @should not return null with null obs set
 * @should get obs
 * @should not get voided obs
 * @should only get parents obs
 * @should only return the grouped top level obs
 * @should get both child and parent obs after removing child from parent grouping
 */
public Set<Obs> getObsAtTopLevel(boolean includeVoided) {

  return getAllObs(includeVoided).stream()
      .filter(o -> o.getObsGroup() == null)
      .collect(Collectors.toCollection(LinkedHashSet::new));
}

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

ret.addAll(this.getGroupMembers());
  Obs parentObs = this;
  while (parentObs.getObsGroup() != null) {
    for (Obs obsSibling : parentObs.getObsGroup().getGroupMembers()) {
      if (!obsSibling.isObsGrouping()) {
        ret.add(obsSibling);
    parentObs = parentObs.getObsGroup();
} else if (this.getObsGroup() != null) {
  for (Obs obsSibling : this.getObsGroup().getGroupMembers()) {
    if (!obsSibling.isObsGrouping()) {
      ret.add(obsSibling);

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

Obs obsGroup = firstContactMethodObs.getObsGroup();
assertNotNull("Their should be a grouping obs", obsGroup);
assertNotNull("Their should be an associated encounter", firstContactMethodObs.getEncounter());
  if (groupedConceptIds.contains(obs.getConcept().getConceptId())) {
    groupedObsCount += 1;
    assertEquals("All of the parent groups should match", obsGroup, obs.getObsGroup());

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

public static String getObsGroupPath(Obs o){
  StringBuilder st = new StringBuilder(EMPTY);
  if (o != null)
    while (o.getObsGroup() != null){
      o = o.getObsGroup();
      st.insert(0, o.getObsId() + "|");
    }
  return st.toString();
}

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

groupMember.setValueNumeric(50d);
origParentObs.addGroupMember(groupMember);
assertNotNull(groupMember.getObsGroup());

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

/**
 * 
 * returns the obsgroup hierarchy path of an obsgroup Obs, including itself
 * 
 * @param o
 * @return
 */
public static String getObsGroupPath(Obs o){
  StringBuilder st = new StringBuilder("/" + o.getConcept().getConceptId());
  while (o.getObsGroup() != null){
    o = o.getObsGroup();
    st.insert(0, "/" + o.getConcept().getConceptId());
  }
  return st.toString();
}

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

while (i.hasNext()) {
  Obs o = i.next();
  if (o.getObsGroup() == null
      || !groupingConceptUuids.contains(o.getObsGroup().getConcept().getUuid())) {
    i.remove();

代码示例来源: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-module-htmlformentry

/**
 * Returns true if group is an obs group that has no unvoided members.
 *
 * @param group
 * @return
 */
private void voidObsGroupIfAllChildObsVoided(Obs group) {
  if (group != null) {
    // probably should be able to just tet if group.getGroupMembers() == 0 since
    // getGroupMembers only returns non-voided members?
    boolean allObsVoided = true;
    for (Obs member : group.getGroupMembers()) {
      allObsVoided = allObsVoided && member.isVoided();
    }
    if (allObsVoided) {
      Context.getObsService().voidObs(group, "htmlformentry");
    }
    voidObsGroupIfAllChildObsVoided(group.getObsGroup());
  }
}

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

obsToCopy.getLocation());
newObs.setObsGroup(obsToCopy.getObsGroup());
newObs.setAccessionNumber(obsToCopy.getAccessionNumber());
newObs.setValueCoded(obsToCopy.getValueCoded());

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

obsService.voidObs(o, "htmlformentry");
voidObsGroupIfAllChildObsVoided(o.getObsGroup());

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

@Override
public void validateDefaultRepresentation() throws Exception {
  super.validateDefaultRepresentation();
  assertPropPresent("person");
  assertPropPresent("concept");
  assertPropPresent("value");
  assertPropEquals("obsDatetime", getObject().getObsDatetime());
  assertPropEquals("accessionNumber", getObject().getAccessionNumber());
  assertPropEquals("obsGroup", getObject().getObsGroup());
  assertPropPresent("groupMembers");
  assertPropEquals("comment", getObject().getComment());
  assertPropPresent("location");
  assertPropPresent("order");
  assertPropPresent("encounter");
  assertPropEquals("voided", getObject().getVoided());
}

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

@Override
public void validateFullRepresentation() throws Exception {
  super.validateFullRepresentation();
  assertPropPresent("person");
  assertPropPresent("concept");
  assertPropPresent("value");
  assertPropEquals("obsDatetime", getObject().getObsDatetime());
  assertPropEquals("accessionNumber", getObject().getAccessionNumber());
  assertPropEquals("obsGroup", getObject().getObsGroup());
  assertPropPresent("groupMembers");
  assertPropEquals("comment", getObject().getComment());
  assertPropPresent("location");
  assertPropPresent("order");
  assertPropPresent("encounter");
  assertPropEquals("voided", getObject().getVoided());
  assertPropPresent("auditInfo");
}

相关文章