Skip to content

Commit

Permalink
Merge pull request #35 from salimkanoun/dev
Browse files Browse the repository at this point in the history
GaelO 1.1.1
  • Loading branch information
salimkanoun authored May 4, 2020
2 parents 1139ade + 2916f5a commit b42bb50
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 5 deletions.
17 changes: 17 additions & 0 deletions src/assets/javascripts/dicomupload/DicomFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ class DicomFile {

retrieveHeaderData(byteArray) {
let pxData = this.dataSet.elements.x7fe00010;
//If no pixel data return the full byte array
if(pxData === undefined){
return byteArray.slice()
}
//if pixel data here return only header
return byteArray.slice(0, pxData.dataOffset-1);
}

Expand Down Expand Up @@ -192,6 +197,11 @@ class DicomFile {
getSOPClassUID() {
return this.get("00080016");
}
//SK A TESTER : On ne pourrait utiliser que le 0002,0222
//Ce tag est un duplicat de 00080016 cf https://stackoverflow.com/questions/32689446/is-it-true-that-dicom-media-storage-sop-instance-uid-sop-instance-uid-why
getMediaStorageSOP(){
return this.get("00020002")
}
getSeriesNumber() {
return this.get("00200011");
}
Expand Down Expand Up @@ -256,6 +266,13 @@ class DicomFile {
return secondaryCaptureImgValues.includes(this.getSOPClassUID());
}

isDicomDir(){
const dicomDirSopValues = [
'1.2.840.10008.1.3.10'
]
return dicomDirSopValues.includes(this.getMediaStorageSOP());
}

clearData() {
this.header = null;
this.dataSet = null;
Expand Down
7 changes: 4 additions & 3 deletions src/assets/javascripts/dicomupload/DicomUpload.js
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,10 @@ class DicomUpload {

} catch (e) {
console.warn(e)
// Only catch error from dicomParser, if not a dicom try to read as ZIP
//If not error from dicomParser (known instance...) add to ignore list
if(e.includes('dicomParser')) {
// Only catch String error from dicomParser, if not a dicom try to read as ZIP
// For dicomdir dicom file dicomParser trigger a type error (this is why we only look at string type error)
// If not error from dicomParser (known instance...) add to ignore list
if( e.includes('dicomParser')) {
// Try to parse as zip file
this.readAsZipFile(file, byteArray)
}else{
Expand Down
4 changes: 4 additions & 0 deletions src/assets/javascripts/dicomupload/DicomUploadModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ class DicomUploadModel {
throw 'Secondary Capture Image Storage are not allowed.';
}

if(dicomFile.isDicomDir()){
throw 'Dicomdir File, ignoring'
}

// Check if the study has already been registered (on client-side)
if (!this.isKnownStudy(dicomFile)) {
let st = new Study(
Expand Down
1 change: 1 addition & 0 deletions src/controllers/investigator/specific_form_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
if ($permissionResults) {
//Determine if calling local or reviewer form
$local=($_SESSION['role'] == User::REVIEWER) ? false : true;
//SK ICI PRODUIT UNE ERREUR SI LE FORMULAIRE LOCAL N EXISTE PAS => A respecter pour eviter les effets de bords
$formProcessorObject=$visitObject->getFromProcessor($local, $username);

if (!empty($_POST['draft']) || !empty($_POST['validate'])) {
Expand Down
2 changes: 1 addition & 1 deletion src/includes/jsLibrairies.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@

<script src="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.1.0/papaparse.min.js"></script>

<?php $uploaderVersion="2.8"?>
<?php $uploaderVersion="3.0"?>
<!-- JavaScript CustomJS/CSS -->
<script type="text/javascript" src="assets/javascripts/dicomupload/_browserSupport.js?version=<?= $uploaderVersion?>" defer></script>
<script type="text/javascript" src="assets/javascripts/dicomupload/CheckPatientPanel.js?version=<?= $uploaderVersion?>" defer></script>
Expand Down
2 changes: 1 addition & 1 deletion src/includes/jsLibrairies_main.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@

<script src="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.1.0/papaparse.min.js"></script>

<?php $uploaderVersion="2.8"?>
<?php $uploaderVersion="3.0"?>
<!-- JavaScript CustomJS/CSS -->
<script type="text/javascript" src="assets/javascripts/dicomupload/_browserSupport.js?version=<?= $uploaderVersion?>" ></script>
<script type="text/javascript" src="assets/javascripts/dicomupload/CheckPatientPanel.js?version=<?= $uploaderVersion?>" ></script>
Expand Down

0 comments on commit b42bb50

Please sign in to comment.