コード例 #1
0
 /**
  * Render the mappings column
  */
 protected function _renderColumn_Mappings(ConceptSearchResultsGroup $csrg, Concept $c, $group_i, $concept_i)
 {
     echo "\n<td class=\"col_4\">\n\t";
     echo '<div class="content">';
     // Get the search terms
     $arr_term_type = array(MCL_SEARCH_TERM_TYPE_MAP_CODE);
     $arr_search_term = $csrg->csg->getSearchTermCollection()->getSearchTerms($arr_term_type, null, true);
     // Concept Mappings
     echo "<div style=\"margin-bottom:6px;\">";
     foreach ($c->getConceptMappingIds() as $_mapping_i) {
         // Setup display of mapping
         $url_mapcode = '';
         $target = '';
         $cm = $c->getConceptMapping($_mapping_i);
         $url_mapsource = 'search.php?q=' . urlencode("source:'" . $cm->source_name . "'") . '&source=' . urlencode($c->css_dict->dict_db);
         // SNOMED
         if ($cm->source_name == 'SNOMED CT' || $cm->source_name == 'SNOMED NP') {
             $url_mapcode = 'http://nciterms.nci.nih.gov/ncitbrowser/ConceptReport.jsp?dictionary=' . 'SNOMED%20Clinical%20Terms' . '&amp;type=all' . '&amp;code=' . urlencode($cm->source_code);
             $target = '_blank';
         } elseif (substr($cm->source_name, 0, 10) == 'ICD-10-WHO') {
             //$url_mapcode = 'http://www.icd10data.com/Search.aspx?codebook=AllCodes&search=' . urlencode($cm->source_code);
             $url_mapcode = 'http://apps.who.int/classifications/icd10/browse/2010/en#/' . urlencode($cm->source_code);
             $target = '_blank';
         } elseif ($cm->source_name == 'PIH') {
             $url_mapcode = $this->getSearchUrl('id:' . $cm->source_code, array('source' => 'pih_concept_dict'));
         } elseif ($cm->source_name == 'AMPATH') {
             $url_mapcode = $this->getSearchUrl('id:' . $cm->source_code, array('source' => 'ampath_concept_dict'));
         } elseif ($cm->source_name == 'LOINC') {
             $url_mapcode = 'http://search.loinc.org/LOINC/regular/' . trim($cm->source_code) . '.html';
             $target = '_blank';
         }
         // Display the mapping
         echo '<strong><a href="' . $url_mapsource . '">' . htmlentities($cm->source_name) . '</a></strong>: ';
         // Display the source code
         if ($url_mapcode) {
             echo '<a href="' . $url_mapcode . '"';
             if ($target) {
                 echo ' target="' . $target . '"';
             }
             echo '>';
         }
         $source_code = htmlentities($cm->source_code);
         foreach ($arr_search_term as $search_term) {
             $source_code = preg_replace('/\\b(' . addslashes($search_term->needle) . ')/i', '<span class="h">$1</span>', $source_code);
         }
         echo $source_code;
         if ($url_mapcode) {
             echo '</a>';
         }
         echo "<br />";
     }
     echo "</div>";
     // Concept lists
     if ($c->hasConceptLists()) {
         echo "<div style=\"margin-bottom:6px;\">Member of: ";
         $i = 0;
         foreach ($c->getConceptListIds() as $_concept_list_id) {
             if ($i) {
                 echo ', ';
             }
             //$_list_name = $this->cc->getConceptListName($_concept_list_id);
             if ($css_list = $this->csr->cs->getAllSources()->getConceptList($_concept_list_id)) {
                 $_list_name = $css_list->list_name;
             } else {
                 $_list_name = $_concept_list_id;
             }
             $_url = "search.php?q=" . urlencode("list:'" . $_list_name . "'");
             echo '<a href="' . $_url . '">' . htmlentities($_list_name) . '</a>';
             $i++;
         }
         echo "</div>";
     }
     echo "</div>\n";
     echo "\n</td>\n";
 }