Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const [searchStatus, setSearchStatus] = useState({
isSearchingForStudies: false,
error: null,
});
const [activeModalId, setActiveModalId] = useState(null);
const [rowsPerPage, setRowsPerPage] = useState(25);
const [pageNumber, setPageNumber] = useState(0);
const appContext = useContext(AppContext);
// ~~ RESPONSIVE
const displaySize = useMedia(
['(min-width: 1750px)', '(min-width: 1000px)', '(min-width: 768px)'],
['large', 'medium', 'small'],
'small'
);
// ~~ DEBOUNCED INPUT
const debouncedSort = useDebounce(sort, 200);
const debouncedFilters = useDebounce(filterValues, 250);
// Google Cloud Adapter for DICOM Store Picking
const { appConfig = {} } = appContext;
const isGoogleCHAIntegrationEnabled =
!server && appConfig.enableGoogleCloudAdapter;
if (isGoogleCHAIntegrationEnabled && activeModalId !== 'DicomStorePicker') {
setActiveModalId('DicomStorePicker');
}
// Called when relevant state/props are updated
// Watches filters and sort, debounced
useEffect(
() => {
const fetchStudies = async () => {
try {
isSearchingForStudies: false,
error: null,
});
const [activeModalId, setActiveModalId] = useState(null);
const [rowsPerPage, setRowsPerPage] = useState(25);
const [pageNumber, setPageNumber] = useState(0);
const appContext = useContext(AppContext);
// ~~ RESPONSIVE
const displaySize = useMedia(
['(min-width: 1750px)', '(min-width: 1000px)', '(min-width: 768px)'],
['large', 'medium', 'small'],
'small'
);
// ~~ DEBOUNCED INPUT
const debouncedSort = useDebounce(sort, 200);
const debouncedFilters = useDebounce(filterValues, 250);
// Google Cloud Adapter for DICOM Store Picking
const { appConfig = {} } = appContext;
const isGoogleCHAIntegrationEnabled =
!server && appConfig.enableGoogleCloudAdapter;
if (isGoogleCHAIntegrationEnabled && activeModalId !== 'DicomStorePicker') {
setActiveModalId('DicomStorePicker');
}
// Called when relevant state/props are updated
// Watches filters and sort, debounced
useEffect(
() => {
const fetchStudies = async () => {
try {
setSearchStatus({ error: null, isSearchingForStudies: true });
function ViewerRetrieveStudyData({
server,
studyInstanceUids,
seriesInstanceUids,
clearViewportSpecificData,
}) {
// hooks
const [error, setError] = useState(false);
const [studies, setStudies] = useState([]);
const [isStudyLoaded, setIsStudyLoaded] = useState(false);
const snackbarContext = useSnackbarContext();
const { appConfig = {} } = useContext(AppContext);
const { filterQueryParam: isFilterStrategy = false } = appConfig;
let cancelableSeriesPromises;
let cancelableStudiesPromises;
/**
* Callback method when study is totally loaded
* @param {object} study study loaded
* @param {object} studyMetadata studyMetadata for given study
* @param {Object} [filters] - Object containing filters to be applied
* @param {string} [filter.seriesInstanceUID] - series instance uid to filter results against
*/
const studyDidLoad = (study, studyMetadata, filters) => {
// User message
const promoted = _promoteList(
study,
{/* RIGHT */}
{VisiblePanelRight && (
)}
);
}
}
export default withDialog(Viewer);
/**
* What types are these? Why do we have "mapping" dropped in here instead of in
* a mapping layer?
*
* TODO[react]:
* - Add sorting of display sets
* - Add showStackLoadingProgressBar option
*
* @param {Study[]} studies
* @param {DisplaySet[]} studies[].displaySets
*/
const _mapStudiesToThumbnails = function(studies) {
return studies.map(study => {
const { studyInstanceUid } = study;
patientNameOrId: '',
accessionOrModalityOrDescription: '',
//
allFields: '',
});
const [studies, setStudies] = useState([]);
const [searchStatus, setSearchStatus] = useState({
isSearchingForStudies: false,
error: null,
});
const [activeModalId, setActiveModalId] = useState(null);
const [rowsPerPage, setRowsPerPage] = useState(25);
const [pageNumber, setPageNumber] = useState(0);
const appContext = useContext(AppContext);
// ~~ RESPONSIVE
const displaySize = useMedia(
['(min-width: 1750px)', '(min-width: 1000px)', '(min-width: 768px)'],
['large', 'medium', 'small'],
'small'
);
// ~~ DEBOUNCED INPUT
const debouncedSort = useDebounce(sort, 200);
const debouncedFilters = useDebounce(filterValues, 250);
// Google Cloud Adapter for DICOM Store Picking
const { appConfig = {} } = appContext;
const isGoogleCHAIntegrationEnabled =
!server && appConfig.enableGoogleCloudAdapter;
if (isGoogleCHAIntegrationEnabled && activeModalId !== 'DicomStorePicker') {
setActiveModalId('DicomStorePicker');
}
hidden: true,
},
]);
const [tabsState, setTabsState] = useState({
Hotkeys: { hotkeyDefinitions, hotkeyRecord },
'Window Level': { windowLevelData },
General: { generalPreferences },
});
const [tabsError, setTabsError] = useState(
tabs.reduce((acc, tab) => {
acc[tab.name] = false;
return acc;
}, {})
);
const snackbar = useSnackbarContext();
const { t, ready: translationsAreReady } = useTranslation(
'UserPreferencesModal'
);
const onTabStateChanged = (tabName, newState) => {
setTabsState({ ...tabsState, [tabName]: newState });
};
const onTabErrorChanged = (tabName, hasError) => {
setTabsError({ ...tabsError, [tabName]: hasError });
};
const hasAnyError = () => {
return Object.values(tabsError).reduce((acc, value) => acc || value);
};
this.setState(state => ({
dialogId: newDialogId,
activeButtons: [...state.activeButtons, button],
}));
}
}
if (options.behavior === 'DOWNLOAD_SCREEN_SHOT') {
commandsManager.runCommand('showDownloadViewportModal', {
title: t('Download High Quality Image'),
});
}
}
export default withTranslation(['Common', 'ViewportDownloadForm'])(
withModal(withDialog(ToolbarRow))
);
<div>
<span>
{t('INVESTIGATIONAL USE ONLY')}
</span>
</div>
);
}
}
export default withTranslation(['Header', 'AboutModal'])(
withRouter(withModal(Header))
);
const callInputDialog = (data, event, callback) => {
const { UIDialogService } = servicesManager.services;
if (UIDialogService) {
let dialogId = UIDialogService.create({
centralize: true,
isDraggable: false,
content: SimpleDialog.InputDialog,
useLastPosition: false,
showOverlay: true,
contentProps: {
title: 'Enter your annotation',
label: 'New label',
measurementData: data ? { description: data.text } : {},
onClose: () => UIDialogService.dismiss({ id: dialogId }),
onSubmit: value => {
callback(value);
UIDialogService.dismiss({ id: dialogId });
},
},
});
}
};
);
}
}
const mapStateToProps = state => {
return {
user: state.oidc.user,
};
};
const ConnectedOHIFStandaloneViewer = connect(
mapStateToProps,
null
)(OHIFStandaloneViewer);
export default ViewerbaseDragDropContext(
withRouter(ConnectedOHIFStandaloneViewer)
);