Skip to content

Commit

Permalink
fix: fix bugs n6 n8 and n16 - Ref gestion-de-projet#2330
Browse files Browse the repository at this point in the history
Co-authored-by: manelleg <manelle.gueriouz@aphp.fr>
  • Loading branch information
Mehdi-BOUYAHIA and ManelleG authored Oct 13, 2023
1 parent 3c74578 commit 742eec3
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/components/DataTable/DataTablePatient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ const DataTablePatient: React.FC<DataTablePatientProps> = ({
const { classes } = useStyles()

const columns: Column[] = [
{ label: `Sexe`, code: 'gender', align: 'center', sortableColumn: true },
{ label: `Sexe`, code: 'gender,id', align: 'center', sortableColumn: true },
{ label: 'Prénom', code: 'name', align: 'center', sortableColumn: !deidentified },
{ label: 'Nom', code: 'family', align: 'left', sortableColumn: !deidentified },
{
label: !deidentified ? 'Date de naissance' : 'Âge',
code: 'birthdate',
code: 'birthdate,id',
align: 'center',
sortableColumn: !deidentified
},
Expand Down
2 changes: 2 additions & 0 deletions src/components/Patient/PatientBiology/PatientBiology.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ const PatientBiology: React.FC<PatientBiologyTypes> = ({ groupId }) => {
} catch (error) {
if (error instanceof CanceledError) {
setLoadingStatus(LoadingStatus.FETCHING)
} else {
setLoadingStatus(LoadingStatus.SUCCESS)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ const PatientMedication: React.FC<PatientMedicationTypes> = ({ groupId }) => {
} catch (error) {
if (error instanceof CanceledError) {
setLoadingStatus(LoadingStatus.FETCHING)
} else {
setLoadingStatus(LoadingStatus.SUCCESS)
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/components/Patient/PatientPMSI/PatientPMSI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ const PatientPMSI: React.FC<PatientPMSITypes> = ({ groupId }) => {
} catch (error) {
if (error instanceof CanceledError) {
setLoadingStatus(LoadingStatus.FETCHING)
} else {
setLoadingStatus(LoadingStatus.SUCCESS)
}
}
}
Expand Down
9 changes: 7 additions & 2 deletions src/services/aphp/serviceCohorts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,13 @@ const servicesCohorts: IServiceCohorts = {
.trim() // Remove space before/after search
.split(' ') // Split by space (= ['mot1', 'mot2' ...])
.filter((elem: string) => elem) // Filter if you have ['mot1', '', 'mot2'] (double space)
for (const _search of searches) {
_searchInput = _searchInput ? `${_searchInput} AND "${_search}"` : `"${_search}"`

if (searchBy === SearchByTypes.identifier) {
_searchInput = searches.join()
} else {
for (const _search of searches) {
_searchInput = _searchInput ? `${_searchInput} AND "${_search}"` : `"${_search}"`
}
}

// convert birthdates into days or months depending of if it's a deidentified perimeter or not
Expand Down
7 changes: 6 additions & 1 deletion src/state/patient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,10 @@ const fetchPmsi = createAsyncThunk<FetchPmsiReturn, FetchPmsiParams, { state: Ro
return { ghm: pmsiReturn as IPatientPmsi<Claim> }
}
} catch (error) {
console.error(error)
if (error instanceof CanceledError) {
return thunkApi.rejectWithValue({ error })
} else {
throw error
}
}
}
Expand Down Expand Up @@ -243,6 +244,8 @@ const fetchBiology = createAsyncThunk<FetchBiologyReturn, FetchBiologyParams, {
console.error(error)
if (error instanceof CanceledError) {
return thunkApi.rejectWithValue({ error })
} else {
throw error
}
}
}
Expand Down Expand Up @@ -350,6 +353,8 @@ const fetchMedication = createAsyncThunk<
console.error(error)
if (error instanceof CanceledError) {
return thunkApi.rejectWithValue({ error })
} else {
throw error
}
}
})
Expand Down

0 comments on commit 742eec3

Please sign in to comment.