changeset 40:a08b085190e1

simplifications
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 30 Aug 2012 14:52:33 +0200
parents 741efcd39682
children c1097a676eca
files PalantirExplorer/explorer.js PalantirServer/ServerIndex.cpp
diffstat 2 files changed, 31 insertions(+), 35 deletions(-) [+]
line wrap: on
line diff
--- a/PalantirExplorer/explorer.js	Thu Aug 30 14:38:05 2012 +0200
+++ b/PalantirExplorer/explorer.js	Thu Aug 30 14:52:33 2012 +0200
@@ -207,11 +207,14 @@
     {
       var v = tags[i];
 
-      if (v == "PatientBirthDate")
+      if (i == "PatientBirthDate" ||
+          i == "StudyDate" ||
+          i == "SeriesDate")
       {
         v = FormatDicomDate(v);
       }
-      else if (v == "DicomStudyInstanceUID")
+      else if (i == "DicomStudyInstanceUID" ||
+               i == "DicomSeriesInstanceUID")
       {
         v = SplitLongUid(v);
       }
@@ -227,18 +230,14 @@
 
 function FormatPatient(patient, link, isReverse)
 {
-  var s = ('<h3>{0}</h3>' + 
-           '<p>Patient ID: <strong>{1}</strong></p>' +
-           '<p>Accession aaNumber: <strong>{2}</strong></p>' +
-           '<p>Date of Birth: <strong>{3}</strong></p>' +
-           '<p>Sex: <strong>{4}</strong></p>' +
-           '<span class="ui-li-count">{5}</span>'
+  var s = ('<h3>{0}</h3>{1}' + 
+           '<span class="ui-li-count">{2}</span>'
           ).format
   (patient.MainDicomTags.PatientName,
-   patient.DicomPatientID,
-   patient.MainDicomTags.AccessionNumber,
-   FormatDicomDate(patient.MainDicomTags.PatientBirthDate),
-   patient.MainDicomTags.PatientSex,
+   FormatMainDicomTags(patient.MainDicomTags, [ 
+     "PatientName", 
+     "OtherPatientIDs" 
+   ]),
    patient.Studies.length
   );
 
@@ -249,14 +248,14 @@
 
 function FormatStudy(study, link, isReverse)
 {
-  var s = ('<h3>{0}</h3>' +
-           //'<p>Study Instance UID: <strong>{1}</strong></p>' +
-           '{1}' +
+  var s = ('<h3>{0}</h3>{1}' +
            '<span class="ui-li-count">{2}</span>'
            ).format
   (study.MainDicomTags.StudyDescription,
-   //SplitLongUid(study.DicomStudyInstanceUID),
-   FormatMainDicomTags(study.MainDicomTags, [ "StudyDescription", "StudyTime" ]),
+   FormatMainDicomTags(study.MainDicomTags, [
+     "StudyDescription", 
+     "StudyTime" 
+   ]),
    study.Series.length
   );
 
@@ -267,17 +266,15 @@
 
 function FormatSeries(series, link, isReverse)
 {
-  var s = ('<h3>{0}</h3>' +
-           '<p>Modality: <strong>{1}</strong></p>' +
-           '<p>Protocol: <strong>{2}</strong></p>' +
-           '<p>Station name: <strong>{3}</strong></p>' +
-           '<p>Series Instance UID: <strong>{4}</strong></p>' +
-           '<span class="ui-li-count">{5}</span>').format
+  var s = ('<h3>{0}</h3>{1}' +
+           '<span class="ui-li-count">{2}</span>').format
   (series.MainDicomTags.SeriesDescription,
-   series.MainDicomTags.Modality,
-   series.MainDicomTags.ProtocolName,
-   series.MainDicomTags.StationName,
-   SplitLongUid(series.DicomSeriesInstanceUID),
+   FormatMainDicomTags(series.MainDicomTags, [
+     "SeriesDescription", 
+     "SeriesTime", 
+     "Manufacturer", 
+     "SeriesDate"
+   ]),
    series.Instances.length
   );
 
@@ -287,11 +284,14 @@
 
 function FormatInstance(instance, link, isReverse)
 {
-  var s = ('<h3>Instance {0}</h3>' +
-           '<p>SOP Instance UID: <strong>{1}</strong></p>'
-          ).format
+  var s = ('<h3>Instance {0}</h3>{1}').format
   (instance.MainDicomTags.InstanceNumber,
-   instance.DicomSOPInstanceUID
+   FormatMainDicomTags(instance.MainDicomTags, [
+     "AcquisitionNumber", 
+     "InstanceNumber", 
+     "InstanceCreationDate", 
+     "InstanceCreationTime"
+   ])
   );
 
   return CompleteFormatting(s, link, isReverse);
--- a/PalantirServer/ServerIndex.cpp	Thu Aug 30 14:38:05 2012 +0200
+++ b/PalantirServer/ServerIndex.cpp	Thu Aug 30 14:52:33 2012 +0200
@@ -617,7 +617,6 @@
     {
       result["ID"] = instanceUuid;
       result["ParentSeries"] = s.ColumnString(0);
-      result["DicomSOPInstanceUID"] = s.ColumnString(1);
       result["FileSize"] = s.ColumnInt(2);   // TODO switch to 64bit with JsonCpp 0.6?
       result["FileUuid"] = s.ColumnString(3);
       MainDicomTagsToJson(result, instanceUuid);
@@ -641,7 +640,6 @@
 
     result["ID"] = seriesUuid;
     result["ParentStudy"] = s1.ColumnString(0);
-    result["DicomSeriesInstanceUID"] = s1.ColumnString(1);
     MainDicomTagsToJson(result, seriesUuid);
 
     Json::Value instances(Json::arrayValue);
@@ -673,7 +671,6 @@
 
     result["ID"] = studyUuid;
     result["ParentPatient"] = s1.ColumnString(0);
-    result["DicomStudyInstanceUID"] = s1.ColumnString(1);
     MainDicomTagsToJson(result, studyUuid);
 
     Json::Value series(Json::arrayValue);
@@ -703,7 +700,6 @@
     }
 
     result["ID"] = patientUuid;
-    result["DicomPatientID"] = s1.ColumnString(0);
     MainDicomTagsToJson(result, patientUuid);
 
     Json::Value studies(Json::arrayValue);