src/hg/instinct/hgDetails/hgDetails.c 1.2
1.2 2010/04/11 01:46:55 jsanborn
updated
Index: src/hg/instinct/hgDetails/hgDetails.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/instinct/hgDetails/hgDetails.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -b -B -U 4 -r1.1 -r1.2
--- src/hg/instinct/hgDetails/hgDetails.c 11 Apr 2010 01:22:59 -0000 1.1
+++ src/hg/instinct/hgDetails/hgDetails.c 11 Apr 2010 01:46:55 -0000 1.2
@@ -149,8 +149,30 @@
cgbSectionEnd();
cgbFooter();
}
+char *getClinicalFields(struct raDb *ra)
+{
+struct hash *raHash, *raHashList = readRa(ra->raFile);
+
+struct slName *sl, *slList = NULL;
+for (raHash = raHashList; raHash; raHash = raHash->next)
+ {
+ char *name = hashMustFindVal(raHash, "longLabel");
+ slNameAddHead(&slList, name);
+ }
+slNameSort(&slList);
+
+struct dyString *dy = newDyString(1000);
+for (sl = slList; sl; sl = sl->next)
+ {
+ dyStringPrintf(dy, "%s", sl->name);
+ if (sl->next)
+ dyStringPrintf(dy, "<BR>");
+ }
+return dyStringCannibalize(&dy);
+}
+
void cgbDetails(struct raDb *ra)
{
char title[512];
safef(title, sizeof(title), "Dataset Details: %s", ra->shortLabel);
@@ -161,9 +183,9 @@
/* Print out info in a table */
printf("<TR VALIGN=\"TOP\"><TD><B>Name:</B></TD><TD>%s</TD></TR>\n", ra->longLabel);
if (ra->article_title)
- printf("<TR VALIGN=\"TOP\"><TD><B>Title:</B></TD><TD>%s</TD></TR>\n", ra->article_title);
+ printf("<TR VALIGN=\"TOP\"><TD><B>Title:</B></TD><TD><I>%s</I></TD></TR>\n", ra->article_title);
if (ra->author_list)
printf("<TR VALIGN=\"TOP\"><TD><B>Authors:</B></TD><TD>%s</TD></TR>\n", ra->author_list);
if (ra->citation)
printf("<TR VALIGN=\"TOP\"><TD><B>Citation:</B></TD><TD>%s</TD></TR>\n", ra->citation);
@@ -180,8 +202,12 @@
printf("<TR VALIGN=\"TOP\"><TD><B>Wrangled by:</B></TD><TD>%s</TD></TR>\n", ra->wrangler);
if (ra->wrangling_procedure)
printf("<TR VALIGN=\"TOP\"><TD><B>Wrangling Procedure:</B></TD><TD>%s</TD></TR>\n", ra->wrangling_procedure);
+char *clinicalFields = getClinicalFields(ra);
+if (clinicalFields)
+ printf("<TR VALIGN=\"TOP\"><TD><B>Clinical Fields:</B></TD><TD><FONT SIZE=\"2\">%s</FONT></TD></TR>\n", clinicalFields);
+
puts("</TABLE>");
cgbSectionEnd();
cgbFooter();