The system has detected files that do not appear to be annonymised. These have been highlighted below.
+
+
If you believe this is a false positive please contact ross.kruger@nhs.net with details about the file that has been flagged.
+
+ Override annonymisation check
+
By clicking the button below you can override the annonymisation check and upload the files anyway. Only do this if you are sure this is a false positive.
+
+
Selected files:
@@ -116,15 +125,12 @@
}
function uploadFiles(files_to_upload, current_chunk, total_chunks){
- console.log("uploading", files_to_upload)
-
// Create a FormData object to store the form data
const formData = new FormData();
// Append each selected file to the FormData object
for (let i = 0; i < files_to_upload.length; i++) {
formData.append("files", files_to_upload[i]);
}
- console.log("formdata", formData)
const xhr = new XMLHttpRequest();
xhr.open("POST", "{% url 'api-1:upload_dicom' %}", true);
xhr.setRequestHeader("X-CSRFToken", "{{ csrf_token }}");
@@ -134,8 +140,6 @@
window.upload_count += 1;
if (xhr.status === 200) {
// Handle successful response from the server
- console.log('Files uploaded successfully!');
- console.log(xhr.response);
window.upload_results["uploaded"].push(...JSON.parse(xhr.response)["uploaded"]);
window.upload_results["duplicates"].push(...JSON.parse(xhr.response)["duplicates"]);
window.upload_results["failed"].push(...JSON.parse(xhr.response)["failed"]);
@@ -180,14 +184,12 @@
xhr.send(formData);
}
- function checkAnnonymisation(byteArray) {
+ function checkAnnonymisation(byteArray, file) {
// 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 {
- console.log("bytearray", byteArray)
// parse byteArray into a DataSet object using the parseDicom library
var dataSet = dicomParser.parseDicom(byteArray);
- console.log("ds", dataSet)
// dataSet contains the parsed elements. Each element is available via a property
// in the dataSet.elements object. The property name is based on the elements group
@@ -200,24 +202,25 @@
var study_description = dataSet.string('x00081030');
var accession_number = dataSet.string('x00080050').toLowerCase();
var patient_id = dataSet.string('x00100020').toLowerCase();
- console.log("STUDY", study_description);
- console.log("acc", accession_number);
- console.log("pid", patient_id);
-
not_anon = false;
site_codes = ["ref", "rk9", "ra9", "rh8", "rbz", "rba"]
+ errors = []
for (let i = 0; i < site_codes.length; i++) {
- if (
- accession_number.startsWith(site_codes[i]) ||
- patient_id.startsWith(site_codes[i])
- )
+ if ( accession_number.startsWith(site_codes[i]))
{
not_anon = true;
+ errors.push(`Accession number starts with ${site_codes[i]} (${accession_number})`);
+ }
+ if ( patient_id.startsWith(site_codes[i]))
+ {
+ not_anon = true;
+ errors.push(`Patient ID starts with ${site_codes[i]} (${patient_id})`);
}
}
+ console.log(errors)
if (not_anon) {
toastr.warning(`File does not appear to be annonymised Accession: ${accession_number} Patient ID: ${patient_id} `, 'Anonymisation warning', {
@@ -237,7 +240,16 @@
"showMethod": "fadeIn",
"hideMethod": "fadeOut",
});
- $("uploadButton").prop("disabled", true);
+ $("#uploadButton").prop("disabled", true);
+ $(".anon-alert").show();
+
+ setTimeout(
+ function(errors) {
+ console.log(errors)
+ // We delay this a few seconds otherwise it does not work
+ $(`.dicom-file[data-path='${file.webkitRelativePath}']`).addClass("image-ident-warning").append($(`