Ejemplo n.º 1
0
  public Vector getMappingCodingSchemesEntityParticipatesIn(String code, String namespace) {
    Vector v = new Vector();
    try {
      MappingExtension mappingExtension =
          (MappingExtension) lbSvc.getGenericExtension("MappingExtension");

      AbsoluteCodingSchemeVersionReferenceList mappingSchemes =
          mappingExtension.getMappingCodingSchemesEntityParticipatesIn(code, namespace);

      // output is all of the mapping ontologies that this code participates in.
      for (AbsoluteCodingSchemeVersionReference ref :
          mappingSchemes.getAbsoluteCodingSchemeVersionReference()) {
        v.add(ref.getCodingSchemeURN() + "|" + ref.getCodingSchemeVersion());
      }

    } catch (Exception ex) {
      ex.printStackTrace();
    }
    return v;
  }
Ejemplo n.º 2
0
  public ResolvedConceptReferencesIterator getMappingDataIterator(
      String scheme, String version, List<MappingSortOption> sortOptionList) {
    CodingSchemeVersionOrTag versionOrTag = new CodingSchemeVersionOrTag();
    if (version != null) {
      versionOrTag.setVersion(version);
    }
    String relationsContainerName = null;
    try {

      CodingScheme cs = lbSvc.resolveCodingScheme(scheme, versionOrTag);
      if (cs == null) return null;

      java.util.Enumeration<? extends Relations> relations = cs.enumerateRelations();
      while (relations.hasMoreElements()) {
        Relations relation = (Relations) relations.nextElement();
        Boolean isMapping = relation.getIsMapping();
        if (isMapping != null && isMapping.equals(Boolean.TRUE)) {
          relationsContainerName = relation.getContainerName();
          break;
        }
      }
      if (relationsContainerName == null) {
        return null;
      }

      MappingExtension mappingExtension =
          (MappingExtension) lbSvc.getGenericExtension("MappingExtension");

      ResolvedConceptReferencesIterator itr =
          mappingExtension.resolveMapping(
              scheme, versionOrTag, relationsContainerName, sortOptionList);

      return itr;

    } catch (Exception ex) {
      ex.printStackTrace();
    }
    return null;
  }