Mercurial > hg > orthanc
comparison OrthancExplorer/explorer.js @ 2594:7fbe3f024ac9
new screen in OrthancExplorer to list studies
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 16 May 2018 14:32:16 +0200 |
parents | a95beca72e99 |
children | ef7ba1b21d58 |
comparison
equal
deleted
inserted
replaced
2588:1f7b459b247b | 2594:7fbe3f024ac9 |
---|---|
262 return CompleteFormatting(node, link, isReverse, patient.Studies.length); | 262 return CompleteFormatting(node, link, isReverse, patient.Studies.length); |
263 } | 263 } |
264 | 264 |
265 | 265 |
266 | 266 |
267 function FormatStudy(study, link, isReverse) | 267 function FormatStudy(study, link, isReverse, includePatient) |
268 { | 268 { |
269 var node = $('<div>').append($('<h3>').text(study.MainDicomTags.StudyDescription)); | 269 var label; |
270 | 270 |
271 if (includePatient) { | |
272 label = study.Label; | |
273 } else { | |
274 label = study.MainDicomTags.StudyDescription; | |
275 } | |
276 | |
277 var node = $('<div>').append($('<h3>').text(label)); | |
278 | |
279 if (includePatient) { | |
280 FormatMainDicomTags(node, study.PatientMainDicomTags, [ | |
281 'PatientName' | |
282 ]); | |
283 } | |
284 | |
271 FormatMainDicomTags(node, study.MainDicomTags, [ | 285 FormatMainDicomTags(node, study.MainDicomTags, [ |
272 "StudyDescription", | 286 'StudyDescription', |
273 "StudyTime" | 287 'StudyTime' |
274 ]); | 288 ]); |
275 | 289 |
276 return CompleteFormatting(node, link, isReverse, study.Series.length); | 290 return CompleteFormatting(node, link, isReverse, study.Series.length); |
277 } | 291 } |
278 | 292 |
279 | 293 |
280 | 294 |
346 | 360 |
347 | 361 |
348 | 362 |
349 $('#find-patients').live('pagebeforeshow', function() { | 363 $('#find-patients').live('pagebeforeshow', function() { |
350 GetResource('/patients?expand', function(patients) { | 364 GetResource('/patients?expand', function(patients) { |
351 var target = $('#all-patients'); | 365 var target = $('#all-patients'); |
352 $('li', target).remove(); | 366 $('li', target).remove(); |
353 | 367 |
354 SortOnDicomTag(patients, 'PatientName', false, false); | 368 SortOnDicomTag(patients, 'PatientName', false, false); |
355 | 369 |
356 for (var i = 0; i < patients.length; i++) { | 370 for (var i = 0; i < patients.length; i++) { |
357 var p = FormatPatient(patients[i], '#patient?uuid=' + patients[i].ID); | 371 var p = FormatPatient(patients[i], '#patient?uuid=' + patients[i].ID); |
358 target.append(p); | 372 target.append(p); |
359 } | 373 } |
360 | 374 |
361 target.listview('refresh'); | 375 target.listview('refresh'); |
376 }); | |
377 }); | |
378 | |
379 | |
380 | |
381 $('#find-studies').live('pagebeforeshow', function() { | |
382 GetResource('/studies?expand', function(studies) { | |
383 var target = $('#all-studies'); | |
384 $('li', target).remove(); | |
385 | |
386 for (var i = 0; i < studies.length; i++) { | |
387 var patient = studies[i].PatientMainDicomTags.PatientName; | |
388 var study = studies[i].MainDicomTags.StudyDescription; | |
389 | |
390 var s; | |
391 if (typeof patient === 'string') { | |
392 s = patient; | |
393 } | |
394 | |
395 if (typeof study === 'string') { | |
396 if (s.length > 0) { | |
397 s += ' - '; | |
398 } | |
399 | |
400 s += study; | |
401 } | |
402 | |
403 studies[i]['Label'] = s; | |
404 } | |
405 | |
406 Sort(studies, function(a) { return a.Label }, false, false); | |
407 | |
408 for (var i = 0; i < studies.length; i++) { | |
409 var p = FormatStudy(studies[i], '#study?uuid=' + studies[i].ID, false, true); | |
410 target.append(p); | |
411 } | |
412 | |
413 target.listview('refresh'); | |
362 }); | 414 }); |
363 }); | 415 }); |
364 | 416 |
365 | 417 |
366 | 418 |