Skip to content

Commit

Permalink
fix: SKFP-1322 restore imaging technique and sequence type
Browse files Browse the repository at this point in the history
  • Loading branch information
aperron-ferlab committed Oct 8, 2024
1 parent 5cb9660 commit e596638
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 21 deletions.
4 changes: 2 additions & 2 deletions src/graphql/files/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ export interface IFileEntity {
file_name: string;
};
is_harmonized: boolean;
imaging_sequence_type?: string[];
imaging_technique?: string[];
imaging_sequence_types?: string[];
imaging_techniques?: string[];
imaging?: IImagingData;
nb_participants: number;
nb_biospecimens: number;
Expand Down
4 changes: 2 additions & 2 deletions src/store/passport/thunks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ describe(`${extractMetadata.name}()`, () => {
nb_participants: 1,
nb_biospecimens: 2,
fhir_document_reference: 'http://localhost:8000/DocumentReference?identifier=GF_000G102V',
imaging_technique: ['Special technique'],
imaging_sequence_type: ['a sequence'],
imaging_techniques: ['Special technique'],
imaging_sequence_types: ['a sequence'],
imaging: {
acquisition_number: 'acq-0-session-1-PurrPurr',
device: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,24 +342,24 @@ export const getDefaultColumns = (
render: (imaging?: IImagingData) => imaging?.modality || TABLE_EMPTY_PLACE_HOLDER,
},
{
key: 'imaging_sequence_type',
key: 'imaging_sequence_types',
title: intl.get('entities.file.imaging.sequence_type'),
dataIndex: 'imaging_sequence_type',
dataIndex: 'imaging_sequence_types',
defaultHidden: activePreset !== PresetOptions.Imaging,
sorter: { multiple: 1 },
render: (imaging_sequence_type?: string[]) =>
imaging_sequence_type
? joinUniqueCleanWords(imaging_sequence_type)
render: (imaging_sequence_types?: string[]) =>
imaging_sequence_types
? joinUniqueCleanWords(imaging_sequence_types)
: TABLE_EMPTY_PLACE_HOLDER,
},
{
key: 'imaging_technique',
key: 'imaging_techniques',
title: intl.get('entities.file.imaging.technique'),
dataIndex: 'imaging_technique',
dataIndex: 'imaging_techniques',
defaultHidden: activePreset !== PresetOptions.Imaging,
sorter: { multiple: 1 },
render: (imaging_technique?: string[]) =>
imaging_technique ? joinUniqueCleanWords(imaging_technique) : TABLE_EMPTY_PLACE_HOLDER,
render: (imaging_techniques?: string[]) =>
imaging_techniques ? joinUniqueCleanWords(imaging_techniques) : TABLE_EMPTY_PLACE_HOLDER,
},
{
key: 'imaging.info_body_part_examined',
Expand Down
7 changes: 4 additions & 3 deletions src/views/FileEntity/Imaging/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ interface OwnProps {
}

const Imaging = ({ file, loading }: OwnProps) => {
console.log(file);
const imagingData: Partial<IImagingData> &
Pick<IFileEntity, 'imaging_sequence_type' | 'imaging_technique' | 'flywheel_url'> = {
Pick<IFileEntity, 'imaging_sequence_types' | 'imaging_techniques' | 'flywheel_url'> = {
...file?.imaging,
imaging_sequence_type: file?.imaging_sequence_type,
imaging_technique: file?.imaging_technique,
imaging_sequence_types: file?.imaging_sequence_types,
imaging_techniques: file?.imaging_techniques,
flywheel_url: file?.flywheel_url,
};

Expand Down
10 changes: 5 additions & 5 deletions src/views/FileEntity/utils/getImagingItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import styles from '../index.module.css';

const getImagingItems = (
imagingData?: Partial<IImagingData> &
Pick<IFileEntity, 'imaging_sequence_type' | 'imaging_technique' | 'flywheel_url'>,
Pick<IFileEntity, 'imaging_sequence_types' | 'imaging_techniques' | 'flywheel_url'>,
): IEntityDescriptionsItem[] => [
{
label: (
Expand All @@ -26,14 +26,14 @@ const getImagingItems = (
},
{
label: intl.get('entities.file.imaging.sequence_type'),
value: imagingData?.imaging_sequence_type
? joinUniqueCleanWords(imagingData?.imaging_sequence_type)
value: imagingData?.imaging_sequence_types
? joinUniqueCleanWords(imagingData?.imaging_sequence_types)
: TABLE_EMPTY_PLACE_HOLDER,
},
{
label: intl.get('entities.file.imaging.technique'),
value: imagingData?.imaging_technique
? joinUniqueCleanWords(imagingData?.imaging_technique)
value: imagingData?.imaging_techniques
? joinUniqueCleanWords(imagingData?.imaging_techniques)
: TABLE_EMPTY_PLACE_HOLDER,
},
{
Expand Down

0 comments on commit e596638

Please sign in to comment.