@Override
  public AnonymousEntityDescription convertTo(
      ResolvedConceptReference source, AnonymousEntityDescription target) {
    if (StringUtils.isBlank(source.getCode()) || StringUtils.isBlank(source.getCodeNamespace())) {
      return target;
    }
    CodingScheme cs =
        codingSchemeService.getCodingSchemeByUriAndVersion(
            source.getCodingSchemeURI(), source.getCodingSchemeVersion());

    for (org.LexGrid.concepts.Comment c : source.getEntity().getComment()) {
      org.cts2.core.Comment comment = this.baseDozerBeanMapper.map(c, org.cts2.core.Comment.class);

      // process supported mappings
      if (cs != null) {
        if (comment.getFormat() != null && !StringUtils.isEmpty(comment.getFormat().getContent())) {
          SupportedDataType supportedDataType =
              DaoUtility.getURIMap(cs, SupportedDataType.class, comment.getFormat().getContent());
          if (supportedDataType != null) comment.getFormat().setMeaning(supportedDataType.getUri());
        }

        if (comment.getLanguage() != null
            && !StringUtils.isEmpty(comment.getLanguage().getContent())) {
          SupportedLanguage supportedLanguage =
              DaoUtility.getURIMap(cs, SupportedLanguage.class, comment.getLanguage().getContent());
          if (supportedLanguage != null)
            comment.getLanguage().setMeaning(supportedLanguage.getUri());
        }
      }
      target.addNote(comment);
    }
    return target;
  }
コード例 #2
0
  public void run() throws LBException {
    ValueSetDefinition vsd = Util.promptForValueSetDefinition(message);
    if (vsd != null) {
      AbsoluteCodingSchemeVersionReferenceList acsvList = null;
      Util.displayMessage("Now select Code System to use to resolve Value Set Definition");
      CodingSchemeSummary css = Util.promptForCodeSystem();
      if (css != null) {
        acsvList = new AbsoluteCodingSchemeVersionReferenceList();
        acsvList.addAbsoluteCodingSchemeVersionReference(
            Constructors.createAbsoluteCodingSchemeVersionReference(
                css.getCodingSchemeURI(), css.getRepresentsVersion()));
      }

      LexEVSValueSetDefinitionServices vsdServ =
          LexEVSValueSetDefinitionServicesImpl.defaultInstance();
      ResolvedValueSetDefinition rVSD = null;
      try {
        rVSD =
            vsdServ.resolveValueSetDefinition(
                new URI(vsd.getValueSetDefinitionURI()), null, acsvList, null, null);
      } catch (URISyntaxException e) {
        e.printStackTrace();
      }

      if (rVSD != null) {
        Util.displayMessage(
            "Member of Value Set Definition (" + vsd.getValueSetDefinitionURI() + ") are :");
        ResolvedConceptReferencesIterator conceptItr = rVSD.getResolvedConceptReferenceIterator();
        while (conceptItr.hasNext()) {
          ResolvedConceptReference concept = conceptItr.next();
          Util.displayMessage("Concept code : " + concept.getCode());
          Util.displayMessage("\tCoding Scheme Name...: " + concept.getCodingSchemeName());
          Util.displayMessage("\tCoding Scheme URI....: " + concept.getCodingSchemeURI());
          Util.displayMessage("\tCoding Scheme Version: " + concept.getCodingSchemeVersion());
        }
      } else {
        Util.displayMessage(
            "No members found for Value Set Definition : '" + vsd.getValueSetDefinitionURI() + "'");
      }
    }
  }