This commit is contained in:
Ross
2021-11-21 20:39:08 +00:00
parent 8f50dabb5a
commit 2bdc41278c
4 changed files with 44 additions and 0 deletions
+27
View File
@@ -446,6 +446,7 @@
ocr2(url, el);
checkHash(hash);
$("#drop-filenames").append(
`<span data-input-id='${el.id}'><span>${n}: ${el.files[0].name}</span><img class='uploading${extra_class}' data-input-id='${el.id}' src=${url}></span>`
@@ -468,6 +469,7 @@
let hash = CryptoJS.MD5(pixel_data).toString();
console.log(element, "HASH", hash)
checkHash(hash);
});
@@ -630,6 +632,31 @@
}
function checkHash(hash) {
$.ajax({
url: "{% url 'rapids:rapid_question_by_hash' %}",
data: {
csrfmiddlewaretoken: csrf,
hash: hash
},
type: "POST",
dataType: "json",
})
// $.ajax().done(), $.ajax().fail(), $ajax().always() are upto you. Add/change accordingly
.done(function (data) {
console.log(data);
if (data.status == "success") {
console.log("success");
console.log(data.id)
toastr.info(f'id {data.id}')
}
})
.always(function () {
console.log('[Done]');
})
}
function extractDicomStudyDescription(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)