feat(fuzzyMatching): fuzzymatching for query parameters if server config indicates support

This commit is contained in:
Egor Lezhnin 2019-07-29 16:56:07 +03:00 committed by Danny Brown
parent 02c732aa15
commit 40bf1a2efd
4 changed files with 26 additions and 16 deletions

View File

@ -94,7 +94,7 @@
"i18next-browser-languagedetector": "^3.0.1", "i18next-browser-languagedetector": "^3.0.1",
"lodash.isequal": "4.5.0", "lodash.isequal": "4.5.0",
"moment": "^2.24.0", "moment": "^2.24.0",
"ohif-core": "0.10.6", "ohif-core": "0.11.0",
"oidc-client": "1.8.x", "oidc-client": "1.8.x",
"prop-types": "^15.7.2", "prop-types": "^15.7.2",
"react": "^16.8.6", "react": "^16.8.6",

View File

@ -30,6 +30,7 @@ class DicomStorePickerModal extends Component {
wadoRoot: data.wadoRoot, wadoRoot: data.wadoRoot,
wadoUriRoot: data.wadoUriRoot, wadoUriRoot: data.wadoUriRoot,
active: true, active: true,
supportsFuzzyMatching: false,
}, },
]; ];

View File

@ -27,11 +27,11 @@ class StudyListWithData extends Component {
server: PropTypes.object, server: PropTypes.object,
user: PropTypes.object, user: PropTypes.object,
history: PropTypes.object, history: PropTypes.object,
studyListFunctionsEnabled: PropTypes.bool studyListFunctionsEnabled: PropTypes.bool,
}; };
static defaultProps = { static defaultProps = {
studyListFunctionsEnabled: true studyListFunctionsEnabled: true,
}; };
static rowsPerPage = 25; static rowsPerPage = 25;
@ -92,6 +92,10 @@ class StudyListWithData extends Component {
offset: searchData.currentPage * searchData.rowsPerPage, offset: searchData.currentPage * searchData.rowsPerPage,
}; };
if (server.supportsFuzzyMatching) {
filter.fuzzymatching = true;
}
// TODO: add sorting // TODO: add sorting
const promise = OHIF.studies.searchStudies(server, filter); const promise = OHIF.studies.searchStudies(server, filter);
@ -152,7 +156,7 @@ class StudyListWithData extends Component {
}; };
onImport = () => { onImport = () => {
this.openModal('DicomFilesUploader') this.openModal('DicomFilesUploader');
}; };
openModal = modalComponentId => { openModal = modalComponentId => {
@ -238,10 +242,12 @@ class StudyListWithData extends Component {
} }
onSearch={this.onSearch} onSearch={this.onSearch}
> >
{this.props.studyListFunctionsEnabled ? <ConnectedDicomFilesUploader {this.props.studyListFunctionsEnabled ? (
<ConnectedDicomFilesUploader
isOpen={this.state.modalComponentId === 'DicomFilesUploader'} isOpen={this.state.modalComponentId === 'DicomFilesUploader'}
onClose={this.closeModals} onClose={this.closeModals}
/> : null} />
) : null}
{healthCareApiButtons} {healthCareApiButtons}
{healthCareApiWindows} {healthCareApiWindows}
</StudyList> </StudyList>
@ -269,12 +275,15 @@ class StudyListWithData extends Component {
<WhiteLabellingContext.Consumer> <WhiteLabellingContext.Consumer>
{whiteLabelling => ( {whiteLabelling => (
<UserManagerContext.Consumer> <UserManagerContext.Consumer>
{ userManager => ( {userManager => (
<ConnectedHeader home={true} user={this.props.user} userManager={userManager}> <ConnectedHeader
home={true}
user={this.props.user}
userManager={userManager}
>
{whiteLabelling.logoComponent} {whiteLabelling.logoComponent}
</ConnectedHeader> </ConnectedHeader>
) )}
}
</UserManagerContext.Consumer> </UserManagerContext.Consumer>
)} )}
</WhiteLabellingContext.Consumer> </WhiteLabellingContext.Consumer>

View File

@ -10501,10 +10501,10 @@ octokit-pagination-methods@^1.1.0:
resolved "https://registry.yarnpkg.com/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz#cf472edc9d551055f9ef73f6e42b4dbb4c80bea4" resolved "https://registry.yarnpkg.com/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz#cf472edc9d551055f9ef73f6e42b4dbb4c80bea4"
integrity sha512-fZ4qZdQ2nxJvtcasX7Ghl+WlWS/d9IgnBIwFZXVNNZUmzpno91SX5bc5vuxiuKoCtK78XxGGNuSCrDC7xYB3OQ== integrity sha512-fZ4qZdQ2nxJvtcasX7Ghl+WlWS/d9IgnBIwFZXVNNZUmzpno91SX5bc5vuxiuKoCtK78XxGGNuSCrDC7xYB3OQ==
ohif-core@0.10.6: ohif-core@0.11.0:
version "0.10.6" version "0.11.0"
resolved "https://registry.yarnpkg.com/ohif-core/-/ohif-core-0.10.6.tgz#5dc08ae5986fd56caca4401cd8b2d8ee0740fab0" resolved "https://registry.yarnpkg.com/ohif-core/-/ohif-core-0.11.0.tgz#7abd1e62c037209f3029aa8fc7cc5ecd5788dada"
integrity sha512-u0otTi6jJ+rhxKCEltrhg23kzD5YYQaLgcXp89SFh8o4bQeWR13gVUFSPGuVEQUVeRXXQnR/SZx5eqaaGAav9Q== integrity sha512-SeJ/w+j2CIsv7dbFsnZXtdshbR6AZM13MJKv7nFtrSUnYX6O8nG5TBFm/61Qj4fN/uZ3Nq0I45NB7GD0slOZ4A==
dependencies: dependencies:
"@babel/runtime" "^7.2.0" "@babel/runtime" "^7.2.0"
ajv "^6.10.0" ajv "^6.10.0"