Skip to content

Commit

Permalink
fix: fix some bugs - Ref gestion-de-projet#2642 gestion-de-projet#2588
Browse files Browse the repository at this point in the history
  • Loading branch information
Mehdi-BOUYAHIA committed Jun 19, 2024
1 parent 0e681c0 commit 3e89436
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ const ControlPanel: React.FC<{
} catch (error) {
setReportLoading(LoadingStatus.IDDLE)
setReportError(true)
console.log(error)
}
}

Expand Down
13 changes: 10 additions & 3 deletions src/components/Dashboard/ExportModal/ExportModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const initialState: ExportCSVForm = {
conditions: false,
tables: export_table.map<ExportCSVTable>((table) => ({
...table,
checked: false,
checked: table.label === 'person' ? true : false,
fhir_filter: null,
respect_table_relationships: true
}))
Expand Down Expand Up @@ -87,7 +87,7 @@ const ExportModal: React.FC<ExportModalProps> = ({ cohortId, open, handleClose }
'tables',
settings.tables.map<ExportCSVTable>((table) => ({
...table,
checked: checkedTables.length !== settings.tables.length
checked: table.label !== 'person' ? settings.tables.length !== checkedTables.length : true
}))
)
}
Expand Down Expand Up @@ -183,6 +183,7 @@ const ExportModal: React.FC<ExportModalProps> = ({ cohortId, open, handleClose }
style={resourceType === ResourceType.UNKNOWN ? { cursor: 'default' } : {}}
expandIcon={
<Checkbox
disabled={label === 'person'}
color="secondary"
checked={checked}
className={classes.checkbox}
Expand Down Expand Up @@ -439,7 +440,13 @@ const ExportModal: React.FC<ExportModalProps> = ({ cohortId, open, handleClose }
</Button>
{exportResponse === null && (
<Button
disabled={loading || !cohortId || !settings.motif || !settings.conditions || !settings.tables.length}
disabled={
loading ||
!cohortId ||
!settings.motif ||
!settings.conditions ||
!settings.tables.filter((table) => table.checked).length
}
onClick={handleSubmit}
>
{loading ? <CircularProgress size={20} /> : 'Exporter les données'}
Expand Down
7 changes: 4 additions & 3 deletions src/components/Patient/PatientPMSI/PatientPMSI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,10 @@ const PatientPMSI = ({ groupId }: PatientPMSIProps) => {
{(selectedTab.id === ResourceType.PROCEDURE || selectedTab.id === ResourceType.CONDITION) && (
<BlockWrapper item xs={12}>
<AlertWrapper severity="warning">
Attention : Les données AREM sont disponibles uniquement pour la période du 07/12/2009 au 31/12/2022. Seuls
les diagnostics rattachés à une visite Orbis (avec un Dossier Administratif - NDA) sont actuellement
disponibles.
{`Attention : Les données AREM sont disponibles uniquement pour la période du 07/12/2009 au 31/12/2022. Seuls
les ${
selectedTab.id === ResourceType.CONDITION ? 'diagnostics' : 'actes'
} rattachés à une visite Orbis (avec un Dossier Administratif - NDA) sont actuellement disponibles.`}
</AlertWrapper>
</BlockWrapper>
)}
Expand Down

0 comments on commit 3e89436

Please sign in to comment.