public Obs getNextUnmatchedObsGroup(String path) { Obs ret = null; int unmatchedContenterCount = 0; for (Map.Entry<Obs, Set<Obs>> e : existingObsInGroups.entrySet() ) { if (path.equals(ObsGroupComponent.getObsGroupPath(e.getKey()))) { if (ret == null) ret = e.getKey(); unmatchedContenterCount++; } } if (ret != null){ if (unmatchedContenterCount > 1) { guessingInd = true; } existingObsInGroups.remove(ret); existingObs.remove(ret); return ret; } return null; }
log.debug("Comparing obsVal " + ObsGroupComponent.getObsGroupPath(e.getKey()) + " to xmlval " + path); if (path.equals(ObsGroupComponent.getObsGroupPath(e.getKey())) ) { contenders.add(e.getKey());
private Obs findObsGroup(FormEntrySession session, Node node, String parentGroupingConceptId) { String path = ObsGroupComponent.getObsGroupPath(node); if (session.getContext().isUnmatchedMode()) { return session.getContext().getNextUnmatchedObsGroup(path); } else { List<ObsGroupComponent> questionsAndAnswers = ObsGroupComponent.findQuestionsAndAnswersForGroup(parentGroupingConceptId, node); return session.getContext().findBestMatchingObsGroup(questionsAndAnswers, parentGroupingConceptId, path); } }
obsGroupEntity.setPath(ObsGroupComponent.getObsGroupPath(node)); obsGroupEntity.setQuestionsAndAnswers(ObsGroupComponent.findQuestionsAndAnswersForGroup(attributes.get("groupingConceptId"), node)); obsGroupEntity.setXmlObsGroupConcept(attributes.get("groupingConceptId"));