Mercurial > hg > orthanc
comparison PalantirExplorer/explorer.js @ 38:2cefaf5b3c2e
improvements
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 30 Aug 2012 14:35:13 +0200 |
parents | dfb159a079ea |
children | a08b085190e1 |
comparison
equal
deleted
inserted
replaced
37:88f537ca35a5 | 38:2cefaf5b3c2e |
---|---|
195 else | 195 else |
196 return '<li>' + s + '</li>'; | 196 return '<li>' + s + '</li>'; |
197 } | 197 } |
198 | 198 |
199 | 199 |
200 function FormatMainDicomTags(tags, tagsToIgnore) | |
201 { | |
202 var s = ''; | |
203 | |
204 for (var i in tags) | |
205 { | |
206 if (tagsToIgnore.indexOf(i) == -1) | |
207 { | |
208 var v = tags[i]; | |
209 | |
210 if (v == "PatientBirthDate") | |
211 { | |
212 v = FormatDicomDate(v); | |
213 } | |
214 else if (v == "DicomStudyInstanceUID") | |
215 { | |
216 v = SplitLongUid(v); | |
217 } | |
218 | |
219 | |
220 s += ('<p>{0}: <strong>{1}</strong></p>').format(i, v); | |
221 } | |
222 } | |
223 | |
224 return s; | |
225 } | |
226 | |
200 | 227 |
201 function FormatPatient(patient, link, isReverse) | 228 function FormatPatient(patient, link, isReverse) |
202 { | 229 { |
203 var s = ('<h3>{1}</h3>' + | 230 var s = ('<h3>{0}</h3>' + |
204 '<p>Patient ID: <strong>{2}</strong></p>' + | 231 '<p>Patient ID: <strong>{1}</strong></p>' + |
205 '<p>Accession Number: <strong>{3}</strong></p>' + | 232 '<p>Accession aaNumber: <strong>{2}</strong></p>' + |
206 '<p>Date of Birth: <strong>{4}</strong></p>' + | 233 '<p>Date of Birth: <strong>{3}</strong></p>' + |
207 '<p>Sex: <strong>{5}</strong></p>' + | 234 '<p>Sex: <strong>{4}</strong></p>' + |
208 '<span class="ui-li-count">{6}</span>' | 235 '<span class="ui-li-count">{5}</span>' |
209 ).format | 236 ).format |
210 (link, | 237 (patient.MainDicomTags.PatientName, |
211 patient.MainDicomTags.PatientName, | |
212 patient.DicomPatientID, | 238 patient.DicomPatientID, |
213 patient.MainDicomTags.AccessionNumber, | 239 patient.MainDicomTags.AccessionNumber, |
214 FormatDicomDate(patient.MainDicomTags.PatientBirthDate), | 240 FormatDicomDate(patient.MainDicomTags.PatientBirthDate), |
215 patient.MainDicomTags.PatientSex, | 241 patient.MainDicomTags.PatientSex, |
216 patient.Studies.length | 242 patient.Studies.length |
222 | 248 |
223 | 249 |
224 function FormatStudy(study, link, isReverse) | 250 function FormatStudy(study, link, isReverse) |
225 { | 251 { |
226 var s = ('<h3>{0}</h3>' + | 252 var s = ('<h3>{0}</h3>' + |
227 '<p>Study Instance UID: <strong>{1}</strong></p>' + | 253 //'<p>Study Instance UID: <strong>{1}</strong></p>' + |
254 '{1}' + | |
228 '<span class="ui-li-count">{2}</span>' | 255 '<span class="ui-li-count">{2}</span>' |
229 ).format | 256 ).format |
230 (study.MainDicomTags.StudyDescription, | 257 (study.MainDicomTags.StudyDescription, |
231 SplitLongUid(study.DicomStudyInstanceUID), | 258 //SplitLongUid(study.DicomStudyInstanceUID), |
259 FormatMainDicomTags(study.MainDicomTags, [ "StudyDescription", "StudyTime" ]), | |
232 study.Series.length | 260 study.Series.length |
233 ); | 261 ); |
234 | 262 |
235 return CompleteFormatting(s, link, isReverse); | 263 return CompleteFormatting(s, link, isReverse); |
236 } | 264 } |