From 719cc4e88483824259c6b668fdb6ee4cae452e03 Mon Sep 17 00:00:00 2001 From: Ross Date: Wed, 6 Apr 2022 22:36:02 +0100 Subject: [PATCH] . --- atlas/templates/atlas/series_form.html | 36 ++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/atlas/templates/atlas/series_form.html b/atlas/templates/atlas/series_form.html index 94ed82dd..5bbc25ab 100755 --- a/atlas/templates/atlas/series_form.html +++ b/atlas/templates/atlas/series_form.html @@ -237,7 +237,7 @@ if ($("#id_examination").find(":selected")[0].dataset.select2Id == "2") { var byteArray = new Uint8Array(reader.result); console.log("etrxact", reader) - extractDicomStudyDescription(byteArray); + extractDicomDetails(byteArray); } }); } @@ -313,7 +313,7 @@ } - function extractDicomStudyDescription(byteArray) { + function extractDicomDetails(byteArray) { // We need to setup a try/catch block because parseDicom will throw an exception // if you attempt to parse a non dicom part 10 file (or one that is corrupted) try { @@ -337,6 +337,38 @@ console.log("acc", accession_number); console.log("pid", patient_id); + not_anon = false; + + site_codes = ["ref", "rk9", "ra9", "rh8", "rbz", "rba"] + + for (let i = 0; i < site_codes.length; i++) { + if (study_description.startsWith(site_codes[i]) + || accession_number.startsWith(site_codes[i]) + || patient_id.startsWith(site_codes[i])) { + not_anon = true; + } + } + + if (not_anon) { + toastr.warning(`Submiting question... please wait`, '', { + "closeButton": false, + "debug": false, + "newestOnTop": false, + "progressBar": true, + "positionClass": "toast-top-full-width", + "preventDuplicates": false, + "onclick": null, + "showDuration": "0", + "hideDuration": "0", + "timeOut": "0", + "extendedTimeOut": "1000", + "showEasing": "swing", + "hideEasing": "linear", + "showMethod": "fadeIn", + "hideMethod": "fadeOut" + }); + } + $.ajax({ url: `{% url 'generic:examination-autocomplete' %}/${encodeURI(study_description)}`, //context: document.body,