Instance metadata/metadata providers overhaul (#1481)
* Instance metadata plus metadata provider overhaul. Fix consumption of wado-uri urls fallbacks + datatype agnosticism. WIP DICOMify things. fix various issues with naturalized variable naming migration. Remove metadata provider. Fix consumption of multiframe images and addition of CWIL metadata. Fix strange build issues. Fix CWIL style windowWidth to array from naturalized DICOM. Fix PT, CT, CR and DX issues for cornerstone + DX issues for vtkjs. Move color palette fetching down to the natuaralized JSON level. Remove unused StudyMetadataSummary Remove redundant dicom metadata dictionary. Working local + json routes. Fix SR read. Finished first round of testing + cleaned up debugging etc. * data => metadata for instance naturalizedJSON * Update dcmjs version * Correct github isssues. * Fix erroneously replaced files. * Danny's recommended changes. * Instance metadata plus metadata provider overhaul. Fix consumption of wado-uri urls fallbacks + datatype agnosticism. WIP DICOMify things. fix various issues with naturalized variable naming migration. Remove metadata provider. Fix consumption of multiframe images and addition of CWIL metadata. Fix strange build issues. Fix CWIL style windowWidth to array from naturalized DICOM. Fix PT, CT, CR and DX issues for cornerstone + DX issues for vtkjs. Move color palette fetching down to the natuaralized JSON level. Remove unused StudyMetadataSummary Remove redundant dicom metadata dictionary. Working local + json routes. Fix SR read. Finished first round of testing + cleaned up debugging etc. * data => metadata for instance naturalizedJSON * Update dcmjs version * Correct github isssues. * Fix erroneously replaced files. * Danny's recommended changes. * Update JSON CI * Update casing of import. * Fix jump for SR. * Fix unit tests for measurements service * Fix json CI test. * fix: update yarn lock * Fix local non-encapsulated pdf view * CI updated to new sucess message. Co-authored-by: Danny <danny.ri.brown@gmail.com>
This commit is contained in:
1 parent
8833731ad3
commit
1d85f7a74e
142 files changed
+5322
-8570
No files matched your search
@@ -29,18 +29,18 @@ function StudyListRoute(props) {
|
||||
const [t] = useTranslation('Common');
|
||||
// ~~ STATE
|
||||
const [sort, setSort] = useState({
|
||||
fieldName: 'patientName',
|
||||
fieldName: 'PatientName',
|
||||
direction: 'desc',
|
||||
});
|
||||
const [filterValues, setFilterValues] = useState({
|
||||
studyDateTo: null,
|
||||
studyDateFrom: null,
|
||||
patientName: '',
|
||||
patientId: '',
|
||||
accessionNumber: '',
|
||||
studyDate: '',
|
||||
PatientName: '',
|
||||
PatientID: '',
|
||||
AccessionNumber: '',
|
||||
StudyDate: '',
|
||||
modalities: '',
|
||||
studyDescription: '',
|
||||
StudyDescription: '',
|
||||
//
|
||||
patientNameOrId: '',
|
||||
accessionOrModalityOrDescription: '',
|
||||
@@ -251,7 +251,7 @@ function StudyListRoute(props) {
|
||||
studies={studies}
|
||||
onSelectItem={studyInstanceUID => {
|
||||
const viewerPath = RoutesUtil.parseViewerPath(appConfig, server, {
|
||||
studyInstanceUids: studyInstanceUID,
|
||||
studyInstanceUIDs: studyInstanceUID,
|
||||
});
|
||||
history.push(viewerPath);
|
||||
}}
|
||||
@@ -268,7 +268,7 @@ function StudyListRoute(props) {
|
||||
currentPage={pageNumber}
|
||||
nextPageFunc={() => setPageNumber(pageNumber + 1)}
|
||||
prevPageFunc={() => setPageNumber(pageNumber - 1)}
|
||||
onRowsPerPageChange={rows => setRowsPerPage(rows)}
|
||||
onRowsPerPageChange={Rows => setRowsPerPage(Rows)}
|
||||
rowsPerPage={rowsPerPage}
|
||||
recordCount={studies.length}
|
||||
/>
|
||||
@@ -279,7 +279,7 @@ function StudyListRoute(props) {
|
||||
|
||||
StudyListRoute.propTypes = {
|
||||
filters: PropTypes.object,
|
||||
patientId: PropTypes.string,
|
||||
PatientID: PropTypes.string,
|
||||
server: PropTypes.object,
|
||||
user: PropTypes.object,
|
||||
history: PropTypes.object,
|
||||
@@ -332,7 +332,7 @@ async function getStudyList(
|
||||
patientNameOrId,
|
||||
accessionOrModalityOrDescription,
|
||||
} = filters;
|
||||
const sortFieldName = sort.fieldName || 'patientName';
|
||||
const sortFieldName = sort.fieldName || 'PatientName';
|
||||
const sortDirection = sort.direction || 'desc';
|
||||
const studyDateFrom =
|
||||
filters.studyDateFrom ||
|
||||
@@ -342,11 +342,11 @@ async function getStudyList(
|
||||
const studyDateTo = filters.studyDateTo || new Date();
|
||||
|
||||
const mappedFilters = {
|
||||
patientId: filters.patientId,
|
||||
patientName: filters.patientName,
|
||||
accessionNumber: filters.accessionNumber,
|
||||
studyDescription: filters.studyDescription,
|
||||
modalitiesInStudy: filters.modalities,
|
||||
PatientID: filters.PatientID,
|
||||
PatientName: filters.PatientName,
|
||||
AccessionNumber: filters.AccessionNumber,
|
||||
StudyDescription: filters.StudyDescription,
|
||||
ModalitiesInStudy: filters.modalities,
|
||||
// NEVER CHANGE
|
||||
studyDateFrom,
|
||||
studyDateTo,
|
||||
@@ -363,32 +363,32 @@ async function getStudyList(
|
||||
|
||||
// Only the fields we use
|
||||
const mappedStudies = studies.map(study => {
|
||||
const patientName =
|
||||
typeof study.patientName === 'string' ? study.patientName : undefined;
|
||||
const PatientName =
|
||||
typeof study.PatientName === 'string' ? study.PatientName : undefined;
|
||||
|
||||
return {
|
||||
accessionNumber: study.accessionNumber, // "1"
|
||||
AccessionNumber: study.AccessionNumber, // "1"
|
||||
modalities: study.modalities, // "SEG\\MR"
|
||||
// numberOfStudyRelatedInstances: "3"
|
||||
// numberOfStudyRelatedSeries: "3"
|
||||
// patientBirthdate: undefined
|
||||
patientId: study.patientId, // "NOID"
|
||||
patientName, // "NAME^NONE"
|
||||
// patientSex: "M"
|
||||
// PatientBirthdate: undefined
|
||||
PatientID: study.PatientID, // "NOID"
|
||||
PatientName, // "NAME^NONE"
|
||||
// PatientSex: "M"
|
||||
// referringPhysicianName: undefined
|
||||
studyDate: study.studyDate, // "Jun 28, 2002"
|
||||
studyDescription: study.studyDescription, // "BRAIN"
|
||||
StudyDate: study.StudyDate, // "Jun 28, 2002"
|
||||
StudyDescription: study.StudyDescription, // "BRAIN"
|
||||
// studyId: "No Study ID"
|
||||
studyInstanceUid: study.studyInstanceUid, // "1.3.6.1.4.1.5962.99.1.3814087073.479799962.1489872804257.3.0"
|
||||
// studyTime: "160956.0"
|
||||
StudyInstanceUID: study.StudyInstanceUID, // "1.3.6.1.4.1.5962.99.1.3814087073.479799962.1489872804257.3.0"
|
||||
// StudyTime: "160956.0"
|
||||
};
|
||||
});
|
||||
|
||||
// For our smaller displays, map our field name to a single
|
||||
// field we can actually sort by.
|
||||
const sortFieldNameMapping = {
|
||||
allFields: 'patientName',
|
||||
patientNameOrId: 'patientName',
|
||||
allFields: 'PatientName',
|
||||
patientNameOrId: 'PatientName',
|
||||
accessionOrModalityOrDescription: 'modalities',
|
||||
};
|
||||
const mappedSortFieldName =
|
||||
@@ -401,7 +401,7 @@ async function getStudyList(
|
||||
);
|
||||
|
||||
// Because we've merged multiple requests, we may have more than
|
||||
// our rows per page. Let's `take` that number from our sorted array.
|
||||
// our Rows per page. Let's `take` that number from our sorted array.
|
||||
// This "might" cause paging issues.
|
||||
const numToTake =
|
||||
sortedStudies.length < rowsPerPage ? sortedStudies.length : rowsPerPage;
|
||||
@@ -414,16 +414,16 @@ async function getStudyList(
|
||||
*
|
||||
*
|
||||
* @param {object[]} studies - Array of studies to sort
|
||||
* @param {string} studies.studyDate - Date in 'MMM DD, YYYY' format
|
||||
* @param {string} studies.StudyDate - Date in 'MMM DD, YYYY' format
|
||||
* @param {string} field - name of properties on study to sort by
|
||||
* @param {string} order - 'asc' or 'desc'
|
||||
* @returns
|
||||
*/
|
||||
function _sortStudies(studies, field, order) {
|
||||
// Make sure our studyDate is in a valid format and create copy of studies array
|
||||
// Make sure our StudyDate is in a valid format and create copy of studies array
|
||||
const sortedStudies = studies.map(study => {
|
||||
if (!moment(study.studyDate, 'MMM DD, YYYY', true).isValid()) {
|
||||
study.studyDate = moment(study.studyDate, 'YYYYMMDD').format(
|
||||
if (!moment(study.StudyDate, 'MMM DD, YYYY', true).isValid()) {
|
||||
study.StudyDate = moment(study.StudyDate, 'YYYYMMDD').format(
|
||||
'MMM DD, YYYY'
|
||||
);
|
||||
}
|
||||
@@ -434,7 +434,7 @@ function _sortStudies(studies, field, order) {
|
||||
sortedStudies.sort(function(a, b) {
|
||||
let fieldA = a[field];
|
||||
let fieldB = b[field];
|
||||
if (field === 'studyDate') {
|
||||
if (field === 'StudyDate') {
|
||||
fieldA = moment(fieldA).toISOString();
|
||||
fieldB = moment(fieldB).toISOString();
|
||||
}
|
||||
@@ -486,11 +486,11 @@ async function _fetchStudies(
|
||||
const firstSet = _getQueryFiltersForValue(
|
||||
filters,
|
||||
[
|
||||
'patientId',
|
||||
'patientName',
|
||||
'accessionNumber',
|
||||
'studyDescription',
|
||||
'modalitiesInStudy',
|
||||
'PatientID',
|
||||
'PatientName',
|
||||
'AccessionNumber',
|
||||
'StudyDescription',
|
||||
'ModalitiesInStudy',
|
||||
],
|
||||
allFields
|
||||
);
|
||||
@@ -501,13 +501,13 @@ async function _fetchStudies(
|
||||
} else if (displaySize === 'medium') {
|
||||
const firstSet = _getQueryFiltersForValue(
|
||||
filters,
|
||||
['patientId', 'patientName'],
|
||||
['PatientID', 'PatientName'],
|
||||
patientNameOrId
|
||||
);
|
||||
|
||||
const secondSet = _getQueryFiltersForValue(
|
||||
filters,
|
||||
['accessionNumber', 'studyDescription', 'modalitiesInStudy'],
|
||||
['AccessionNumber', 'StudyDescription', 'ModalitiesInStudy'],
|
||||
accessionOrModalityOrDescription
|
||||
);
|
||||
|
||||
@@ -530,7 +530,7 @@ async function _fetchStudies(
|
||||
lotsOfStudies.forEach(arrayOfStudies => {
|
||||
if (arrayOfStudies) {
|
||||
arrayOfStudies.forEach(study => {
|
||||
if (!studies.some(s => s.studyInstanceUid === study.studyInstanceUid)) {
|
||||
if (!studies.some(s => s.StudyInstanceUID === study.StudyInstanceUID)) {
|
||||
studies.push(study);
|
||||
}
|
||||
});
|
||||
@@ -557,11 +557,11 @@ function _getQueryFiltersForValue(filters, fields, value) {
|
||||
fields.forEach(field => {
|
||||
const filter = Object.assign(
|
||||
{
|
||||
patientId: '',
|
||||
patientName: '',
|
||||
accessionNumber: '',
|
||||
studyDescription: '',
|
||||
modalitiesInStudy: '',
|
||||
PatientID: '',
|
||||
PatientName: '',
|
||||
AccessionNumber: '',
|
||||
StudyDescription: '',
|
||||
ModalitiesInStudy: '',
|
||||
},
|
||||
filters
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user