Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shanoir-issue#2132: add modality radiobutton in import from pacs #2153

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
Open
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</legend>
<p>The maximum number of patients returned is limited to 10, please optimize your query to find relevant results.</p>
<li>
<label>Patient Name</label>
<label>Patient Name</label>
<span class="right-col">
<input type="text" id="patientName" formControlName="patientName" maxlength="64" [(ngModel)]="dicomQuery.patientName" />
<label *ngIf="hasError('patientName', ['maxlength'])" [@slideDown]="hasError('patientName', ['maxlength'])" class="form-validation-alert">Length must not exceed 64!</label>
Expand All @@ -34,7 +34,7 @@
<tool-tip>Enter the exact value, case sensitive, the wildcard character is not allowed. Ex: TITI^TOTO won't match titi'toto</tool-tip>
</li>
<li>
<label>Patient ID</label>
<label>Patient ID</label>
<span class="right-col">
<input type="text" id="patientID" formControlName="patientID" maxlength="64" [(ngModel)]="dicomQuery.patientID" />
<label *ngIf="hasError('patientID', ['maxlength'])" [@slideDown]="hasError('patientID', ['maxlength'])" class="form-validation-alert">Length must not exceed 64!</label>
Expand All @@ -43,29 +43,40 @@
<tool-tip>Enter the exact value, the wildcard character is not allowed.</tool-tip>
</li>
<li>
<label>Patient Birth Date</label>
<label>Patient Birth Date</label>
<span class="right-col">
<input type="text" id="patientBirthDate" placeholder="yyyyMMdd" [(ngModel)]="dicomQuery.patientBirthDate" formControlName="patientBirthDate" />
<label *ngIf="hasError('patientBirthDate', ['pattern'])" class="form-validation-alert">Date format required by the PACS: yyyyMMdd</label>
</span>
<tool-tip>Date format required by the PACS: yyyyMMdd</tool-tip>
</li>
<li>
<label>Study Description</label>
<label>Study Description</label>
<span class="right-col">
<input type="text" id="studyDescription" formControlName="studyDescription" maxlength="64" minlength="4" [(ngModel)]="dicomQuery.studyDescription" />
<label *ngIf="hasError('studyDescription', ['maxlength', 'minlength'])" [@slideDown]="hasError('studyDescription', ['maxlength', 'minlength'])" class="form-validation-alert">Length must be between 4 and 64!</label>
</span>
<tool-tip>The wildcard character is allowed. For instance, you can enter STUDY* to find STUDY^NEURO</tool-tip>
</li>
<li>
<label>Study Date</label>
<label>Study Date</label>
<span class="right-col">
<input type="text" id="studyDate" placeholder="yyyyMMdd" [(ngModel)]="dicomQuery.studyDate" formControlName="studyDate" />
<label *ngIf="hasError('studyDate', ['pattern'])" class="form-validation-alert">Date format required by the PACS: yyyyMMdd</label>
</span>
<tool-tip>Date format required by the PACS: yyyyMMdd</tool-tip>
</li>
<li>
<label>Modality</label>
<span class="right-col">
<input type="radio" formControlName="modality" [(ngModel)]="dicomQuery.modality" value="MR">MR
<input type="radio" formControlName="modality" [(ngModel)]="dicomQuery.modality" value="CT">CT
<input type="radio" formControlName="modality" [(ngModel)]="dicomQuery.modality" value="PT">PT
<input type="radio" formControlName="modality" [(ngModel)]="dicomQuery.modality" value="NM">NM
<input type="radio" formControlName="modality" [(ngModel)]="dicomQuery.modality" value="XA">XA
<input type="radio" formControlName="modality" [(ngModel)]="dicomQuery.modality" value="None">None
</span>
</li>
</ol>
</fieldset>
<button class="next" [disabled]="!form.valid" (click)="queryPACS()">Query</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
* Shanoir NG - Import, manage and share neuroimaging data
* Copyright (C) 2009-2019 Inria - https://www.inria.fr/
* Contact us on https://project.inria.fr/shanoir/
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see https://www.gnu.org/licenses/gpl-3.0.html
*/
Expand Down Expand Up @@ -60,7 +60,7 @@ export class QueryPacsComponent{
this.importDataService.patientList = importJob;
this.router.navigate(['imports/series']);
} else {
this.consoleService.log('warn', 'Nothing found. Please change your query parameters.', ['query : ' + JSON.stringify(this.dicomQuery)]);
this.consoleService.log('warn', 'Nothing found. Please change your query parameters.', ['query : ' + JSON.stringify(this.dicomQuery)]);
}
})
}
Expand All @@ -74,7 +74,8 @@ export class QueryPacsComponent{
'patientID': [this.dicomQuery.patientID, [Validators.maxLength(64), Validators.pattern(noWildcardPattern)]],
'patientBirthDate': [this.dicomQuery.patientBirthDate, Validators.pattern(pacsDatePattern)],
'studyDescription': [this.dicomQuery.studyDescription, [Validators.maxLength(64), Validators.minLength(4)]],
'studyDate': [this.dicomQuery.studyDate, Validators.pattern(pacsDatePattern)]
'studyDate': [this.dicomQuery.studyDate, Validators.pattern(pacsDatePattern)],
'modality': [this.dicomQuery.modality]
}, { validator: atLeastOneNotBlank(Validators.required) });
}

Expand All @@ -95,4 +96,4 @@ export class QueryPacsComponent{
}
return false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

<div class="header command-zone">2. Select series</div>
<fieldset class="step">
<p>Please select only the series useful for your study, to save precious disk space.</p>
<p *ngIf="patients.length > 0">Please select only the series useful for your study, to save precious disk space.</p>
<p *ngIf="patients.length == 0">No series found with chosen filters.</p>
<div class="tree">
<node
*ngFor="let patient of patients"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,21 @@ export class SelectSeriesComponent {
return;
}
breadcrumbsService.nameStep('2. Series');

this.patients = this.importDataService.patientList.patients;

if (this.importService.dicomQuery != null) {
this.patients = this.patients.map(patient => {
patient.studies = patient.studies.filter(study =>
study.series.length > 0 &&
study.series.every(serie => serie.modality === this.importService.dicomQuery.modality)
);
return patient;
});
}
this.workFolder = this.importDataService.patientList.workFolder;
}


showSerieDetails(serie: SerieDicom): void {
this.detailedPatient = null;
this.detailedStudy = null;
Expand Down
1 change: 1 addition & 0 deletions shanoir-ng-front/src/app/import/shared/dicom-data.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,5 @@ export class DicomQuery {
patientBirthDate: string = "";
studyDescription: string = "";
studyDate: string = "";
modality: 'MR' | 'CT' | 'PT' | 'NM' | 'XA' | 'None' = 'MR';
}
6 changes: 6 additions & 0 deletions shanoir-ng-front/src/app/import/shared/import.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { Observable } from 'rxjs';

@Injectable()
export class ImportService {
private _dicomQuery: DicomQuery;

constructor(private http: HttpClient) { }

Expand Down Expand Up @@ -106,7 +107,12 @@ export class ImportService {
.then(response => response.body);
}

public get dicomQuery(): DicomQuery {
return this._dicomQuery;
}

queryPACS(dicomQuery: DicomQuery): Promise<ImportJob> {
this._dicomQuery = dicomQuery;
return this.http.post<ImportJob>(AppUtils.BACKEND_API_QUERY_PACS, dicomQuery)
.toPromise();
}
Expand Down
Loading