Mercurial > hg > orthanc
comparison PalantirExplorer/explorer.js @ 40:a08b085190e1
simplifications
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 30 Aug 2012 14:52:33 +0200 |
parents | 2cefaf5b3c2e |
children | c1097a676eca |
comparison
equal
deleted
inserted
replaced
39:741efcd39682 | 40:a08b085190e1 |
---|---|
205 { | 205 { |
206 if (tagsToIgnore.indexOf(i) == -1) | 206 if (tagsToIgnore.indexOf(i) == -1) |
207 { | 207 { |
208 var v = tags[i]; | 208 var v = tags[i]; |
209 | 209 |
210 if (v == "PatientBirthDate") | 210 if (i == "PatientBirthDate" || |
211 i == "StudyDate" || | |
212 i == "SeriesDate") | |
211 { | 213 { |
212 v = FormatDicomDate(v); | 214 v = FormatDicomDate(v); |
213 } | 215 } |
214 else if (v == "DicomStudyInstanceUID") | 216 else if (i == "DicomStudyInstanceUID" || |
217 i == "DicomSeriesInstanceUID") | |
215 { | 218 { |
216 v = SplitLongUid(v); | 219 v = SplitLongUid(v); |
217 } | 220 } |
218 | 221 |
219 | 222 |
225 } | 228 } |
226 | 229 |
227 | 230 |
228 function FormatPatient(patient, link, isReverse) | 231 function FormatPatient(patient, link, isReverse) |
229 { | 232 { |
230 var s = ('<h3>{0}</h3>' + | 233 var s = ('<h3>{0}</h3>{1}' + |
231 '<p>Patient ID: <strong>{1}</strong></p>' + | 234 '<span class="ui-li-count">{2}</span>' |
232 '<p>Accession aaNumber: <strong>{2}</strong></p>' + | |
233 '<p>Date of Birth: <strong>{3}</strong></p>' + | |
234 '<p>Sex: <strong>{4}</strong></p>' + | |
235 '<span class="ui-li-count">{5}</span>' | |
236 ).format | 235 ).format |
237 (patient.MainDicomTags.PatientName, | 236 (patient.MainDicomTags.PatientName, |
238 patient.DicomPatientID, | 237 FormatMainDicomTags(patient.MainDicomTags, [ |
239 patient.MainDicomTags.AccessionNumber, | 238 "PatientName", |
240 FormatDicomDate(patient.MainDicomTags.PatientBirthDate), | 239 "OtherPatientIDs" |
241 patient.MainDicomTags.PatientSex, | 240 ]), |
242 patient.Studies.length | 241 patient.Studies.length |
243 ); | 242 ); |
244 | 243 |
245 return CompleteFormatting(s, link, isReverse); | 244 return CompleteFormatting(s, link, isReverse); |
246 } | 245 } |
247 | 246 |
248 | 247 |
249 | 248 |
250 function FormatStudy(study, link, isReverse) | 249 function FormatStudy(study, link, isReverse) |
251 { | 250 { |
252 var s = ('<h3>{0}</h3>' + | 251 var s = ('<h3>{0}</h3>{1}' + |
253 //'<p>Study Instance UID: <strong>{1}</strong></p>' + | |
254 '{1}' + | |
255 '<span class="ui-li-count">{2}</span>' | 252 '<span class="ui-li-count">{2}</span>' |
256 ).format | 253 ).format |
257 (study.MainDicomTags.StudyDescription, | 254 (study.MainDicomTags.StudyDescription, |
258 //SplitLongUid(study.DicomStudyInstanceUID), | 255 FormatMainDicomTags(study.MainDicomTags, [ |
259 FormatMainDicomTags(study.MainDicomTags, [ "StudyDescription", "StudyTime" ]), | 256 "StudyDescription", |
257 "StudyTime" | |
258 ]), | |
260 study.Series.length | 259 study.Series.length |
261 ); | 260 ); |
262 | 261 |
263 return CompleteFormatting(s, link, isReverse); | 262 return CompleteFormatting(s, link, isReverse); |
264 } | 263 } |
265 | 264 |
266 | 265 |
267 | 266 |
268 function FormatSeries(series, link, isReverse) | 267 function FormatSeries(series, link, isReverse) |
269 { | 268 { |
270 var s = ('<h3>{0}</h3>' + | 269 var s = ('<h3>{0}</h3>{1}' + |
271 '<p>Modality: <strong>{1}</strong></p>' + | 270 '<span class="ui-li-count">{2}</span>').format |
272 '<p>Protocol: <strong>{2}</strong></p>' + | |
273 '<p>Station name: <strong>{3}</strong></p>' + | |
274 '<p>Series Instance UID: <strong>{4}</strong></p>' + | |
275 '<span class="ui-li-count">{5}</span>').format | |
276 (series.MainDicomTags.SeriesDescription, | 271 (series.MainDicomTags.SeriesDescription, |
277 series.MainDicomTags.Modality, | 272 FormatMainDicomTags(series.MainDicomTags, [ |
278 series.MainDicomTags.ProtocolName, | 273 "SeriesDescription", |
279 series.MainDicomTags.StationName, | 274 "SeriesTime", |
280 SplitLongUid(series.DicomSeriesInstanceUID), | 275 "Manufacturer", |
276 "SeriesDate" | |
277 ]), | |
281 series.Instances.length | 278 series.Instances.length |
282 ); | 279 ); |
283 | 280 |
284 return CompleteFormatting(s, link, isReverse); | 281 return CompleteFormatting(s, link, isReverse); |
285 } | 282 } |
286 | 283 |
287 | 284 |
288 function FormatInstance(instance, link, isReverse) | 285 function FormatInstance(instance, link, isReverse) |
289 { | 286 { |
290 var s = ('<h3>Instance {0}</h3>' + | 287 var s = ('<h3>Instance {0}</h3>{1}').format |
291 '<p>SOP Instance UID: <strong>{1}</strong></p>' | |
292 ).format | |
293 (instance.MainDicomTags.InstanceNumber, | 288 (instance.MainDicomTags.InstanceNumber, |
294 instance.DicomSOPInstanceUID | 289 FormatMainDicomTags(instance.MainDicomTags, [ |
290 "AcquisitionNumber", | |
291 "InstanceNumber", | |
292 "InstanceCreationDate", | |
293 "InstanceCreationTime" | |
294 ]) | |
295 ); | 295 ); |
296 | 296 |
297 return CompleteFormatting(s, link, isReverse); | 297 return CompleteFormatting(s, link, isReverse); |
298 } | 298 } |
299 | 299 |