Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ locales:
msgfmt -o modules/data_release/locale/hi/LC_MESSAGES/data_release.mo modules/data_release/locale/hi/LC_MESSAGES/data_release.po
npx i18next-conv -l hi -s modules/data_release/locale/hi/LC_MESSAGES/data_release.po -t modules/data_release/locale/hi/LC_MESSAGES/data_release.json
msgfmt -o modules/dicom_archive/locale/ja/LC_MESSAGES/dicom_archive.mo modules/dicom_archive/locale/ja/LC_MESSAGES/dicom_archive.po
msgfmt -o modules/dicom_archive/locale/hi/LC_MESSAGES/dicom_archive.mo modules/dicom_archive/locale/hi/LC_MESSAGES/dicom_archive.po
npx i18next-conv -l hi -s modules/dicom_archive/locale/hi/LC_MESSAGES/dicom_archive.po -t modules/dicom_archive/locale/hi/LC_MESSAGES/dicom_archive.json
msgfmt -o modules/dictionary/locale/ja/LC_MESSAGES/dictionary.mo modules/dictionary/locale/ja/LC_MESSAGES/dictionary.po
msgfmt -o modules/document_repository/locale/ja/LC_MESSAGES/document_repository.mo modules/document_repository/locale/ja/LC_MESSAGES/document_repository.po
msgfmt -o modules/dqt/locale/ja/LC_MESSAGES/dqt.mo modules/dqt/locale/ja/LC_MESSAGES/dqt.po
Expand Down
65 changes: 36 additions & 29 deletions modules/dicom_archive/jsx/dicom_archive.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {withTranslation} from 'react-i18next';
import Loader from 'Loader';
import FilterableDataTable from 'FilterableDataTable';

import hiStrings from '../locale/hi/LC_MESSAGES/dicom_archive.json';
/**
* DICOM Archive Page.
*
Expand Down Expand Up @@ -70,11 +71,12 @@ class DicomArchive extends Component {
* @return {*} a formated table cell for a given column
*/
formatColumn(column, cell, row) {
const {t} = this.props;
let result = <td>{cell}</td>;
switch (column) {
case 'Archive Location': {
case t('Archive Location', {ns: 'dicom_archive'}): {
const downloadURL = '/mri/jiv/get_file.php?file=' + cell
+ '&patientName=' + row['Patient Name'];
+ '&patientName=' + row[t('Patient Name', {ns: 'dicom_archive'})];
result =
<td>
<a href={downloadURL}>
Expand All @@ -83,15 +85,15 @@ class DicomArchive extends Component {
{cell}
</a>
</td>;
}
break;
case 'Metadata': {
}
case t('Metadata', {ns: 'dicom_archive'}): {
const metadataURL = loris.BaseURL +
'/dicom_archive/viewDetails/?tarchiveID=' + row.TarchiveID;
result = <td><a href={metadataURL}>{cell}</a></td>;
}
break;
case 'MRI Browser': {
}
case t('MRI Browser', {ns: 'dicom_archive'}): {
if (row.SessionID === null || row.SessionID === '') {
result = <td>&nbsp;</td>;
} else {
Expand All @@ -116,10 +118,12 @@ class DicomArchive extends Component {
* @return {JSX} - React markup for the component
*/
render() {
const {t} = this.props;
// If error occurs, return a message.
// XXX: Replace this with a UI component for 500 errors.
if (this.state.error) {
return <h3>An error occured while loading the page.</h3>;
return <h3>{t('An error occured while loading the page.',
{ns: 'loris'})}</h3>;
}

// Waiting for async data to load
Expand All @@ -133,52 +137,54 @@ class DicomArchive extends Component {
*/
const options = this.state.data.fieldOptions;
const fields = [
{label: 'Patient ID', show: true, filter: {
{label: t('Patient ID', {ns: 'dicom_archive'}), show: true, filter: {
name: 'patientID',
type: 'text',
}},
{label: 'Patient Name', show: true, filter: {
{label: t('Patient Name', {ns: 'dicom_archive'}), show: true, filter: {
name: 'patientName',
type: 'text',
}},
{label: 'Sex', show: true, filter: {
{label: t('Sex', {ns: 'loris'}), show: true, filter: {
name: 'sex',
type: 'select',
options: {M: 'M', F: 'F', O: 'O'},
}},
{label: 'Date of Birth', show: true, filter: {
{label: t('Date of Birth', {ns: 'loris'}), show: true, filter: {
name: 'dateOfBirth',
type: 'date',
}},
{label: 'Acquisition Date', show: true, filter: {
name: 'acquisitionDate',
type: 'date',
}},
{label: 'Archive Location', show: true, filter: {
name: 'archiveLocation',
type: 'text',
}},
{label: 'Metadata', show: true},
{label: 'MRI Browser', show: true},
{label: 'Series UID', show: false, filter: {
{label: t('Acquisition Date', {ns: 'dicom_archive'}),
show: true, filter: {
name: 'acquisitionDate',
type: 'date',
}},
{label: t('Archive Location', {ns: 'dicom_archive'}),
show: true, filter: {
name: 'archiveLocation',
type: 'text',
}},
{label: t('Metadata', {ns: 'dicom_archive'}), show: true},
{label: t('MRI Browser', {ns: 'dicom_archive'}), show: true},
{label: t('Series UID', {ns: 'dicom_archive'}), show: false, filter: {
name: 'seriesUID',
type: 'text',
}},
{label: 'Site', show: false, filter: {
{label: t('Site', {ns: 'loris'}), show: false, filter: {
name: 'site',
type: 'select',
options: options.sites,
}},
{label: 'TarchiveID', show: false},
{label: 'SessionID', show: false},
{label: 'CenterID', show: false},
{label: 'IsPhantom', show: false},
{label: t('TarchiveID', {ns: 'dicom_archive'}), show: false},
{label: t('SessionID', {ns: 'dicom_archive'}), show: false},
{label: t('CenterID', {ns: 'dicom_archive'}), show: false},
{label: t('IsPhantom', {ns: 'dicom_archive'}), show: false},
];

return (
<FilterableDataTable
name="dicom_filter"
title='Dicom Archive'
title={t('DICOM Archive', {ns: 'dicom_archive'})}
data={this.state.data.Data}
fields={fields}
getFormattedCell={this.formatColumn}
Expand All @@ -189,10 +195,11 @@ class DicomArchive extends Component {

DicomArchive.propTypes = {
dataURL: PropTypes.string.isRequired,
t: PropTypes.func,
};

window.addEventListener('load', () => {
i18n.addResourceBundle('ja', 'dicom_archive', {});
i18n.addResourceBundle('hi', 'dicom_archive', hiStrings);
const Index = withTranslation(
['dicom_archive', 'loris']
)(DicomArchive);
Expand Down
153 changes: 153 additions & 0 deletions modules/dicom_archive/locale/dicom_archive.pot
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,156 @@ msgstr ""
msgid "DICOM Archive"
msgstr ""

msgid "Patient ID"
msgstr ""

msgid "Patient Name"
msgstr ""

msgid "Acquisition Date"
msgstr ""

msgid "Archive Location"
msgstr ""

msgid "Metadata"
msgstr ""

msgid "MRI Browser"
msgstr ""

msgid "Series UID"
msgstr ""

msgid "TarchiveID"
msgstr ""

msgid "SessionID"
msgstr ""

msgid "CenterID"
msgstr ""

msgid "IsPhantom"
msgstr ""

msgid "Tarchive Metadata"
msgstr ""

msgid "Acquisition ID"
msgstr ""

msgid "Patient Birthdate"
msgstr ""

msgid "Patient Biological Sex"
msgstr ""

msgid "Date acquired"
msgstr ""

msgid "Scanner Model"
msgstr ""

msgid "Serial Number"
msgstr ""

msgid "Scanner Software Version"
msgstr ""

msgid "Acquired at"
msgstr ""

msgid "Number of Acquisitions"
msgstr ""

msgid "Archived by"
msgstr ""

msgid "Last update"
msgstr ""

msgid "Never"
msgstr ""

msgid "Summary type version"
msgstr ""

msgid "Source location"
msgstr ""

msgid "Archive type version"
msgstr ""

msgid "Archive location"
msgstr ""

msgid "Archiving log"
msgstr ""

msgid "md5sum of Archive"
msgstr ""

msgid "md5sum of Dicom unzipped"
msgstr ""

msgid "Series"
msgstr ""

msgid "Show/Hide series"
msgstr ""

msgid "Series Number"
msgstr ""

msgid "Series Description"
msgstr ""

msgid "Protocol Name"
msgstr ""

msgid "Sequence Name"
msgstr ""

msgid "Echo Time"
msgstr ""

msgid "Repetition Time"
msgstr ""

msgid "Inversion Time"
msgstr ""

msgid "Slice Thickness"
msgstr ""

msgid "Phase Encoding"
msgstr ""

msgid "Number of Files"
msgstr ""

msgid "SeriesUID"
msgstr ""

msgid "Files"
msgstr ""

msgid "Show/Hide files"
msgstr ""

msgid "SeriesNumber"
msgstr ""

msgid "FileNumber"
msgstr ""

msgid "EchoNumber"
msgstr ""

msgid "Md5Sum"
msgstr ""

msgid "FileName"
msgstr ""

Loading
Loading