Пример #1
0
  private void selectCodeInTree(Tree tree, Treeitem treeItem, String code) {
    // tree.setSelectedItem(null);
    // Collection<Treeitem> items = null;

    if (treeItem != null) {
      // items = treeItem.getChildren();
      /*TODO for (Component comp : treeItem.getChildren())
      {
        logger.debug("Component, comp: " + comp.getClass().getCanonicalName());

      }*/
    } else {
      if (tree != null) {
        logger.debug("selectCodeInTree, code: " + code);
        // items = tree.getItems();
        for (Treeitem ti : tree.getItems()) {
          logger.debug("Treeitem, value: " + ti.getValue().getClass().getCanonicalName());
          CodeSystemEntityVersion csev = ti.getValue();
          if (csev.getCodeSystemConcepts().get(0).getCode().equals(code)) {
            // item found
            tree.setSelectedItem(ti);

            return;
          }

          selectCodeInTree(tree, ti, code);
        }
      }
    }
  }
Пример #2
0
  private boolean associationExists(CodeSystemEntityVersionAssociation cseva) {
    long csvId1 = cseva.getCodeSystemEntityVersionByCodeSystemEntityVersionId1().getVersionId();
    ListConceptAssociationsRequestType request = new ListConceptAssociationsRequestType();
    request.setDirectionBoth(true);
    request.setCodeSystemEntity(new CodeSystemEntity());
    CodeSystemEntityVersion csev = new CodeSystemEntityVersion();
    csev.setVersionId(csvId1);
    request.getCodeSystemEntity().getCodeSystemEntityVersions().add(csev);

    ListConceptAssociationsResponse.Return response =
        WebServiceHelper.listConceptAssociations(request);
    if (response.getReturnInfos().getStatus()
        == de.fhdo.terminologie.ws.conceptassociation.Status.OK) {
      for (CodeSystemEntityVersionAssociation _cseva :
          response.getCodeSystemEntityVersionAssociation()) {
        long csvId2 = 0;

        if (_cseva.getCodeSystemEntityVersionByCodeSystemEntityVersionId1() != null)
          csvId2 = _cseva.getCodeSystemEntityVersionByCodeSystemEntityVersionId1().getVersionId();
        else if (_cseva.getCodeSystemEntityVersionByCodeSystemEntityVersionId2() != null)
          csvId2 = _cseva.getCodeSystemEntityVersionByCodeSystemEntityVersionId2().getVersionId();

        if (csvId2 > 0
            && csvId2
                == cseva.getCodeSystemEntityVersionByCodeSystemEntityVersionId2().getVersionId()) {
          return true;
        }

        /*if((_cseva.getCodeSystemEntityVersionByCodeSystemEntityVersionId1().getVersionId().longValue() ==
            cseva.getCodeSystemEntityVersionByCodeSystemEntityVersionId1().getVersionId() &&
           _cseva.getCodeSystemEntityVersionByCodeSystemEntityVersionId2().getVersionId().longValue() ==
            cseva.getCodeSystemEntityVersionByCodeSystemEntityVersionId2().getVersionId()) ||
            (_cseva.getCodeSystemEntityVersionByCodeSystemEntityVersionId2().getVersionId().longValue() ==
            cseva.getCodeSystemEntityVersionByCodeSystemEntityVersionId1().getVersionId() &&
           _cseva.getCodeSystemEntityVersionByCodeSystemEntityVersionId1().getVersionId().longValue() ==
            cseva.getCodeSystemEntityVersionByCodeSystemEntityVersionId2().getVersionId()))
        {
          // exists
          return true;
        }*/
      }
    }

    return false;
  }