Creating timepoint browser
This commit is contained in:
1 parent
eb372bed03
commit
fd9cfed8e9
23 files changed
+204
-132
No files matched your search
@@ -9,8 +9,8 @@
|
||||
<div class="study-modality-text" style="{{modalityStyle}}">{{instance.modalities}}</div>
|
||||
</div>
|
||||
<div class="study-text">
|
||||
<div class="study-date">{{formatDA this.studyInformation.date 'D-MMM-YYYY'}}</div>
|
||||
<div class="study-description">{{this.studyInformation.description}}</div>
|
||||
<div class="study-date">{{formatDA this.studyInformation.studyDate 'D-MMM-YYYY'}}</div>
|
||||
<div class="study-description">{{this.studyInformation.studyDescription}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -9,8 +9,8 @@ Template.studyBrowserItem.onCreated(() => {
|
||||
instance.loaded = false;
|
||||
instance.loading = new ReactiveVar(false);
|
||||
|
||||
const modality = instance.data.studyInformation.modality || 'UN';
|
||||
instance.modalities = modality.replace(/\\/g, ' ');
|
||||
const modalities = instance.data.studyInformation.modalities || 'UN';
|
||||
instance.modalities = modalities.replace(/\\/g, ' ');
|
||||
});
|
||||
|
||||
Template.studyBrowserItem.events({
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { moment } from 'meteor/momentjs:moment';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
/**
|
||||
@@ -7,10 +8,10 @@ import { OHIF } from 'meteor/ohif:core';
|
||||
* @returns {Array} An array of Study MetaData objects
|
||||
*/
|
||||
function resultDataToStudies(resultData) {
|
||||
var studies = [];
|
||||
const studies = [];
|
||||
|
||||
resultData.forEach(function(studyRaw) {
|
||||
var study = studyRaw.toObject();
|
||||
const study = studyRaw.toObject();
|
||||
studies.push({
|
||||
studyInstanceUid: study[0x0020000D],
|
||||
// 00080005 = SpecificCharacterSet
|
||||
@@ -43,7 +44,15 @@ OHIF.studies.services.DIMSE.Studies = function(filter) {
|
||||
filterStudyDate = `${dateFrom}-${dateTo}`;
|
||||
}
|
||||
|
||||
var parameters = {
|
||||
// Build the StudyInstanceUID parameter
|
||||
let studyUids = filter.studyInstanceUid || '';
|
||||
if (studyUids) {
|
||||
studyUids = Array.isArray(studyUids) ? studyUids.join() : studyUids;
|
||||
studyUids = studyUids.replace(/[^0-9.]+/g, '\\');
|
||||
}
|
||||
|
||||
const parameters = {
|
||||
0x0020000D: studyUids,
|
||||
0x00100010: filter.patientName,
|
||||
0x00100020: filter.patientId,
|
||||
0x00080050: filter.accessionNumber,
|
||||
@@ -54,6 +63,6 @@ OHIF.studies.services.DIMSE.Studies = function(filter) {
|
||||
0x00080061: filter.modalitiesInStudy
|
||||
};
|
||||
|
||||
var results = DIMSE.retrieveStudies(parameters);
|
||||
const results = DIMSE.retrieveStudies(parameters);
|
||||
return resultDataToStudies(results);
|
||||
};
|
||||
@@ -8,14 +8,14 @@ import { OHIF } from 'meteor/ohif:core';
|
||||
* @returns {string} The formatted date string
|
||||
*/
|
||||
function dateToString(date) {
|
||||
if(!date) return "";
|
||||
var year = date.getFullYear().toString();
|
||||
var month = (date.getMonth() + 1).toString();
|
||||
var day = date.getDate().toString();
|
||||
year = "0".repeat(4-year.length).concat(year);
|
||||
month= "0".repeat(2-month.length).concat(month);
|
||||
day = "0".repeat(2-day.length).concat(day);
|
||||
return "".concat(year,month,day);
|
||||
if (!date) return '';
|
||||
let year = date.getFullYear().toString();
|
||||
let month = (date.getMonth() + 1).toString();
|
||||
let day = date.getDate().toString();
|
||||
year = '0'.repeat(4 - year.length).concat(year);
|
||||
month = '0'.repeat(2 - month.length).concat(month);
|
||||
day = '0'.repeat(2 - day.length).concat(day);
|
||||
return ''.concat(year, month, day);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -27,13 +27,13 @@ function dateToString(date) {
|
||||
* @returns {string} The URL with encoded filter query data
|
||||
*/
|
||||
function filterToQIDOURL(server, filter) {
|
||||
var commaSeparatedFields = [
|
||||
const commaSeparatedFields = [
|
||||
'00081030', // Study Description
|
||||
'00080060' //Modality
|
||||
// Add more fields here if you want them in the Study List
|
||||
// Add more fields here if you want them in the result
|
||||
].join(',');
|
||||
|
||||
var parameters = {
|
||||
const parameters = {
|
||||
PatientName: filter.patientName,
|
||||
PatientID: filter.patientId,
|
||||
AccessionNumber: filter.accessionNumber,
|
||||
@@ -45,8 +45,17 @@ function filterToQIDOURL(server, filter) {
|
||||
|
||||
// build the StudyDate range parameter
|
||||
if (filter.studyDateFrom || filter.studyDateTo) {
|
||||
var date = "".concat(dateToString(new Date(filter.studyDateFrom)), "-", dateToString(new Date(filter.studyDateTo)));
|
||||
parameters.StudyDate = date;
|
||||
const dateFrom = dateToString(new Date(filter.studyDateFrom));
|
||||
const dateTo = dateToString(new Date(filter.studyDateTo));
|
||||
parameters.StudyDate = `${dateFrom}-${dateTo}`;
|
||||
}
|
||||
|
||||
// Build the StudyInstanceUID parameter
|
||||
if (filter.studyInstanceUid) {
|
||||
let studyUids = filter.studyInstanceUid;
|
||||
studyUids = Array.isArray(studyUids) ? studyUids.join() : studyUids;
|
||||
studyUids = studyUids.replace(/[^0-9.]+/g, '\\');
|
||||
parameters.StudyInstanceUID = studyUids;
|
||||
}
|
||||
|
||||
return server.qidoRoot + '/studies?' + encodeQueryData(parameters);
|
||||
@@ -59,43 +68,39 @@ function filterToQIDOURL(server, filter) {
|
||||
* @returns {Array} An array of Study MetaData objects
|
||||
*/
|
||||
function resultDataToStudies(resultData) {
|
||||
var studies = [];
|
||||
const studies = [];
|
||||
|
||||
if (!resultData || !resultData.length) {
|
||||
return;
|
||||
}
|
||||
if (!resultData || !resultData.length) return;
|
||||
|
||||
resultData.forEach(function(study) {
|
||||
studies.push({
|
||||
studyInstanceUid: DICOMWeb.getString(study['0020000D']),
|
||||
// 00080005 = SpecificCharacterSet
|
||||
studyDate: DICOMWeb.getString(study['00080020']),
|
||||
studyTime: DICOMWeb.getString(study['00080030']),
|
||||
accessionNumber: DICOMWeb.getString(study['00080050']),
|
||||
referringPhysicianName: DICOMWeb.getString(study['00080090']),
|
||||
// 00081190 = URL
|
||||
patientName: DICOMWeb.getName(study['00100010']),
|
||||
patientId: DICOMWeb.getString(study['00100020']),
|
||||
patientBirthdate: DICOMWeb.getString(study['00100030']),
|
||||
patientSex: DICOMWeb.getString(study['00100040']),
|
||||
studyId: DICOMWeb.getString(study['00200010']),
|
||||
numberOfStudyRelatedSeries: DICOMWeb.getString(study['00201206']),
|
||||
numberOfStudyRelatedInstances: DICOMWeb.getString(study['00201208']),
|
||||
studyDescription: DICOMWeb.getString(study['00081030']),
|
||||
// modality: DICOMWeb.getString(study['00080060']),
|
||||
// modalitiesInStudy: DICOMWeb.getString(study['00080061']),
|
||||
modalities: DICOMWeb.getString(DICOMWeb.getModalities(study['00080060'], study['00080061']))
|
||||
});
|
||||
});
|
||||
resultData.forEach(study => studies.push({
|
||||
studyInstanceUid: DICOMWeb.getString(study['0020000D']),
|
||||
// 00080005 = SpecificCharacterSet
|
||||
studyDate: DICOMWeb.getString(study['00080020']),
|
||||
studyTime: DICOMWeb.getString(study['00080030']),
|
||||
accessionNumber: DICOMWeb.getString(study['00080050']),
|
||||
referringPhysicianName: DICOMWeb.getString(study['00080090']),
|
||||
// 00081190 = URL
|
||||
patientName: DICOMWeb.getName(study['00100010']),
|
||||
patientId: DICOMWeb.getString(study['00100020']),
|
||||
patientBirthdate: DICOMWeb.getString(study['00100030']),
|
||||
patientSex: DICOMWeb.getString(study['00100040']),
|
||||
studyId: DICOMWeb.getString(study['00200010']),
|
||||
numberOfStudyRelatedSeries: DICOMWeb.getString(study['00201206']),
|
||||
numberOfStudyRelatedInstances: DICOMWeb.getString(study['00201208']),
|
||||
studyDescription: DICOMWeb.getString(study['00081030']),
|
||||
// modality: DICOMWeb.getString(study['00080060']),
|
||||
// modalitiesInStudy: DICOMWeb.getString(study['00080061']),
|
||||
modalities: DICOMWeb.getString(DICOMWeb.getModalities(study['00080060'], study['00080061']))
|
||||
}));
|
||||
|
||||
return studies;
|
||||
}
|
||||
|
||||
OHIF.studies.services.QIDO.Studies = function(server, filter) {
|
||||
var url = filterToQIDOURL(server, filter);
|
||||
OHIF.studies.services.QIDO.Studies = (server, filter) => {
|
||||
const url = filterToQIDOURL(server, filter);
|
||||
|
||||
try {
|
||||
var result = DICOMWeb.getJSON(url, server.requestOptions);
|
||||
const result = DICOMWeb.getJSON(url, server.requestOptions);
|
||||
|
||||
return resultDataToStudies(result.data);
|
||||
} catch (error) {
|
||||
|
||||
@@ -2,49 +2,52 @@ import { OHIF } from 'meteor/ohif:core';
|
||||
import { remoteGetValue } from '../../lib/remoteGetValue';
|
||||
|
||||
function resultDataToStudies(resultData) {
|
||||
var studies = [];
|
||||
const studies = [];
|
||||
|
||||
resultData.forEach(function(study) {
|
||||
studies.push({
|
||||
studyInstanceUid: remoteGetValue(study['0020,000d']),
|
||||
// 00080005 = SpecificCharacterSet
|
||||
studyDate: remoteGetValue(study['0008,0020']),
|
||||
studyTime: remoteGetValue(study['0008,0030']),
|
||||
accessionNumber: remoteGetValue(study['0008,0050']),
|
||||
referringPhysicianName: remoteGetValue(study['0008,0090']),
|
||||
// 00081190 = URL
|
||||
patientName: remoteGetValue(study['0010,0010']),
|
||||
patientId: remoteGetValue(study['0010,0020']),
|
||||
patientBirthdate: remoteGetValue(study['0010,0030']),
|
||||
patientSex: remoteGetValue(study['0010,0040']),
|
||||
studyId: remoteGetValue(study['0020,0010']),
|
||||
numberOfStudyRelatedSeries: parseFloat(remoteGetValue(study['0020,1206'])),
|
||||
numberOfStudyRelatedInstances: parseFloat(remoteGetValue(study['0020,1208'])),
|
||||
studyDescription: remoteGetValue(study['0008,1030']),
|
||||
modalities: remoteGetValue(study['0008,0061'])
|
||||
resultData.forEach(function(study) {
|
||||
studies.push({
|
||||
studyInstanceUid: remoteGetValue(study['0020,000d']),
|
||||
// 00080005 = SpecificCharacterSet
|
||||
studyDate: remoteGetValue(study['0008,0020']),
|
||||
studyTime: remoteGetValue(study['0008,0030']),
|
||||
accessionNumber: remoteGetValue(study['0008,0050']),
|
||||
referringPhysicianName: remoteGetValue(study['0008,0090']),
|
||||
// 00081190 = URL
|
||||
patientName: remoteGetValue(study['0010,0010']),
|
||||
patientId: remoteGetValue(study['0010,0020']),
|
||||
patientBirthdate: remoteGetValue(study['0010,0030']),
|
||||
patientSex: remoteGetValue(study['0010,0040']),
|
||||
studyId: remoteGetValue(study['0020,0010']),
|
||||
numberOfStudyRelatedSeries: parseFloat(remoteGetValue(study['0020,1206'])),
|
||||
numberOfStudyRelatedInstances: parseFloat(remoteGetValue(study['0020,1208'])),
|
||||
studyDescription: remoteGetValue(study['0008,1030']),
|
||||
modalities: remoteGetValue(study['0008,0061'])
|
||||
});
|
||||
});
|
||||
});
|
||||
return studies;
|
||||
|
||||
return studies;
|
||||
}
|
||||
|
||||
OHIF.studies.services.REMOTE.Studies = function(server, filter) {
|
||||
var parameters = {
|
||||
PatientName: filter.patientName ? filter.patientName : "",
|
||||
const parameters = {
|
||||
studyInstanceUID: filter.studyInstanceUid || '',
|
||||
PatientName: filter.patientName ? filter.patientName : '',
|
||||
PatientID: filter.patientId,
|
||||
AccessionNumber: filter.accessionNumber ? filter.accessionNumber : "",
|
||||
StudyDescription: "",
|
||||
StudyDate : "",
|
||||
StudyTime : "",
|
||||
ReferringPhysicianName : "",
|
||||
PatientBirthDate : "",
|
||||
PatientSex : "",
|
||||
StudyID : "",
|
||||
NumberOfStudyRelatedSeries : "",
|
||||
NumberOfStudyRelatedInstances : "",
|
||||
ModalitiesInStudy : ""
|
||||
AccessionNumber: filter.accessionNumber ? filter.accessionNumber : '',
|
||||
StudyDescription: '',
|
||||
StudyDate: '',
|
||||
StudyTime: '',
|
||||
ReferringPhysicianName: '',
|
||||
PatientBirthDate: '',
|
||||
PatientSex: '',
|
||||
StudyID: '',
|
||||
NumberOfStudyRelatedSeries: '',
|
||||
NumberOfStudyRelatedInstances: '',
|
||||
ModalitiesInStudy: ''
|
||||
};
|
||||
var remote = new OrthancRemote(server.root, server.sourceAE);
|
||||
var data = remote.findStudies(server.modality, parameters);
|
||||
|
||||
const remote = new OrthancRemote(server.root, server.sourceAE);
|
||||
const data = remote.findStudies(server.modality, parameters);
|
||||
|
||||
return resultDataToStudies(data.results);
|
||||
};
|
||||
Reference in new issue
Block a user