diff --git a/public/config.local.json b/public/config.local.json new file mode 100644 index 000000000..4e901fadd --- /dev/null +++ b/public/config.local.json @@ -0,0 +1,250 @@ +{ + "core": { + "codeSystems": { + "docStatus": "http://hl7.org/fhir/CodeSystem/composition-status" + }, + "extensions": { + "codeHierarchy": "https://terminology.eds.aphp.fr/fhir/profile/valueSet/extension/hierarchy-path-id", + "conceptMapHierarchy": "https://terminology.eds.aphp.fr/fhir/profile/conceptMap/extension/group-source-hierarchy-path", + "patientLastEnconterUrl": "https://terminology.eds.aphp.fr/fhir/profile/patient/extension/last-encounter", + "patientTotalAgeDaysExtensionUrl": "https://terminology.eds.aphp.fr/fhir/profile/patient/extension/total-age-day", + "patientTotalAgeMonthsExtensionUrl": "https://terminology.eds.aphp.fr/fhir/profile/patient/extension/total-age-month" + }, + "perimeterSourceTypeHierarchy": [ + "AP-HP", + "Groupe hospitalier (GH)", + "GHU", + "Hôpital", + "Pôle/DMU", + "Unité Fonctionnelle (UF)" + ], + "valueSets": { + "demographicGender": { + "url": "https://terminology.eds.aphp.fr/aphp-orbis-patient-genre" + }, + "encounterAdmission": { + "url": "https://terminology.eds.aphp.fr/aphp-orbis-visit-type-admission" + }, + "encounterAdmissionMode": { + "url": "https://terminology.eds.aphp.fr/aphp-orbis-visit-motif-admission" + }, + "encounterDestination": { + "url": "https://terminology.eds.aphp.fr/aphp-orbis-visit-destination" + }, + "encounterEntryMode": { + "url": "https://terminology.eds.aphp.fr/aphp-orbis-visit-mode-entree" + }, + "encounterExitMode": { + "url": "https://terminology.eds.aphp.fr/aphp-orbis-visit-mode-sortie" + }, + "encounterExitType": { + "url": "https://terminology.eds.aphp.fr/aphp-orbis-visit-type-sortie" + }, + "encounterFileStatus": { + "url": "https://terminology.eds.aphp.fr/aphp-orbis-visite-status" + }, + "encounterProvenance": { + "url": "https://terminology.eds.aphp.fr/aphp-orbis-visit-provenance" + }, + "encounterSejourType": { + "url": "https://terminology.eds.aphp.fr/aphp-orbis-type-sejour" + }, + "encounterStatus": { + "url": "http://hl7.org/fhir/CodeSystem/encounter-status" + }, + "encounterVisitType": { + "url": "https://terminology.eds.aphp.fr/aphp-orbis-visit-type" + } + } + }, + "features": { + "claim": { + "enabled": true, + "valueSets": { + "claimHierarchy": { + "url": "https://terminology.eds.aphp.fr/aphp-orbis-ghm" + } + } + }, + "cohort": { + "enabled": true, + "shortCohortLimit": 2000 + }, + "condition": { + "enabled": true, + "valueSets": { + "conditionHierarchy": { + "url": "https://smt.esante.gouv.fr/terminologie-cim-10/" + }, + "conditionStatus": { + "url": "https://terminology.eds.aphp.fr/aphp-orbis-condition-status" + } + } + }, + "contact": { + "enabled": false + }, + "export": { + "enabled": true, + "exportLinesLimit": 300000 + }, + "feasabilityReport": { + "enabled": true + }, + "imaging": { + "enabled": true, + "extensions": { + "imagingStudyUid": "https://terminology.eds.aphp.fr/imaging/studyUid" + }, + "valueSets": { + "imagingModalities": { + "url": "https://dicom.nema.org/medical/dicom/current/output/chtml/part16/sect_CID_33.html" + } + } + }, + "locationMap": { + "enabled": true + }, + "medication": { + "enabled": true, + "valueSets": { + "medicationAdministrations": { + "url": "https://terminology.eds.aphp.fr/aphp-orbis-medicament-voie-administration" + }, + "medicationAtc": { + "url": "https://terminology.eds.aphp.fr/atc" + }, + "medicationAtcOrbis": { + "url": "https://terminology.eds.aphp.fr/aphp-orbis-medicament-atc-article" + }, + "medicationPrescriptionTypes": { + "url": "https://terminology.eds.aphp.fr/aphp-medicament-type-prescription" + }, + "medicationUcd": { + "url": "https://terminology.eds.aphp.fr/smt-medicament-ucd" + } + } + }, + "observation": { + "enabled": true, + "valueSets": { + "biologyHierarchyAnabio": { + "url": "https://terminology.eds.aphp.fr/aphp-itm-anabio" + }, + "biologyHierarchyLoinc": { + "url": "https://terminology.eds.aphp.fr/aphp-itm-loinc" + } + } + }, + "procedure": { + "enabled": true, + "valueSets": { + "procedureHierarchy": { + "url": "https://www.atih.sante.fr/plateformes-de-transmission-et-logiciels/logiciels-espace-de-telechargement/id_lot/3550" + } + } + }, + "questionnaires": { + "enabled": true, + "valueSets": { + "analgesieType": { + "url": "https://aphp.fr/ig/fhir/eds/ValueSet/aphp-eds-aph-mat-type-anesth-vs" + }, + "birthDeliveryWay": { + "url": "https://aphp.fr/ig/fhir/eds/ValueSet/aphp-eds-aph-mat-voie-acc-vs" + }, + "cSectionModality": { + "url": "https://aphp.fr/ig/fhir/eds/ValueSet/aphp-eds-aph-mat-cesarienne-vs" + }, + "childBirthMode": { + "url": "https://aphp.fr/ig/fhir/eds/ValueSet/aphp-eds-aph-mat-mode-travail2-vs" + }, + "chirurgicalGesture": { + "url": "https://aphp.fr/ig/fhir/eds/ValueSet/aphp-eds-aph-mat-hos-type-geste-chir-fo-vs" + }, + "conditionPerineum": { + "url": "https://aphp.fr/ig/fhir/eds/ValueSet/aphp-eds-aph-mat-perinee-vs" + }, + "exitDiagnostic": { + "url": "https://aphp.fr/ig/fhir/eds/ValueSet/aphp-eds-aph-mat-hos-diagnostic-sortie-vs" + }, + "exitFeedingMode": { + "url": "https://aphp.fr/ig/fhir/eds/ValueSet/aphp-eds-aph-mat-allaitement-vs" + }, + "exitPlaceType": { + "url": "https://aphp.fr/ig/fhir/eds/ValueSet/aphp-eds-aph-mat-hos-lieu-sortie-sn-vs" + }, + "feedingType": { + "url": "https://aphp.fr/ig/fhir/eds/ValueSet/aphp-eds-aph-mat-allaitement-vs" + }, + "imgIndication": { + "url": "https://aphp.fr/ig/fhir/eds/ValueSet/aphp-eds-aph-mat-indications-img-vs" + }, + "instrumentType": { + "url": "https://aphp.fr/ig/fhir/eds/ValueSet/aphp-eds-aph-mat-type-instru-vs" + }, + "laborOrCesareanEntry": { + "url": "https://aphp.fr/ig/fhir/eds/ValueSet/aphp-eds-aph-mat-hos-pres-entree-trav-vs" + }, + "maternalRisks": { + "url": "https://aphp.fr/ig/fhir/eds/ValueSet/aphp-eds-aph-mat-risq-atcd-mat-vs" + }, + "maturationModality": { + "url": "https://aphp.fr/ig/fhir/eds/ValueSet/aphp-eds-aph-mat-hos-mod-mat-cervicale-vs" + }, + "maturationReason": { + "url": "https://aphp.fr/ig/fhir/eds/ValueSet/aphp-eds-aph-mat-maturation-vs" + }, + "obstetricalGestureDuringLabor": { + "url": "https://aphp.fr/ig/fhir/eds/ValueSet/aphp-eds-aph-mat-hos-geste-manoeuv-obst-vs" + }, + "pathologyDuringLabor": { + "url": "https://aphp.fr/ig/fhir/eds/ValueSet/aphp-eds-aph-mat-patho-vs" + }, + "pregnancyMode": { + "url": "https://aphp.fr/ig/fhir/eds/ValueSet/aphp-eds-aph-mat-obt-gross-vs" + }, + "presentationAtDelivery": { + "url": "https://aphp.fr/ig/fhir/eds/ValueSet/aphp-eds-aph-mat-hos-present-accoucheme-vs" + }, + "risksOrComplicationsOfPregnancy": { + "url": "https://aphp.fr/ig/fhir/eds/ValueSet/aphp-eds-aph-mat-risq-gross-vs" + }, + "risksRelatedToObstetricHistory": { + "url": "https://aphp.fr/ig/fhir/eds/ValueSet/aphp-eds-aph-mat-risq-atcd-obs-vs" + } + } + } + }, + "fhir": { + "baseUrl": "http://localhost:8001/api/fhir", + "codeSystems": { + "docStatus": "http://hl7.org/fhir/CodeSystem/composition-status" + }, + "extensions": { + "codeHierarchy": "https://terminology.eds.aphp.fr/fhir/profile/valueSet/extension/hierarchy-path-id", + "conceptMapHierarchy": "https://terminology.eds.aphp.fr/fhir/profile/conceptMap/extension/group-source-hierarchy-path" + }, + "valueSets": {} + }, + "labels": { + "exploration": "Exploration", + "search": "Recherche" + }, + "system": { + "backendUrl": "/api/back", + "codeDisplayJWT": "ArrowUp,ArrowUp,ArrowDown,ArrowDown", + "jToolUsers": [], + "mailSupport": "", + "oidc": { + "clientId": "cohort360", + "issuer": "http://172.26.0.17:8080/realms/cohort/protocol/openid-connect/auth", + "redirectUri": "http://localhost:8085", + "responseType": "code", + "scope": "openid", + "state": "mlTPASu3bwdFmFUSK4G4ImecrsKW9pQ7SDdf7uB" + }, + "userTrackingBlacklist": [], + "wsProtocol": "ws://" + } +} \ No newline at end of file diff --git a/src/components/Dashboard/BiologyList/index.tsx b/src/components/Dashboard/BiologyList/index.tsx index 34a4947aa..0ee02d980 100644 --- a/src/components/Dashboard/BiologyList/index.tsx +++ b/src/components/Dashboard/BiologyList/index.tsx @@ -8,12 +8,9 @@ import { BlockWrapper } from 'components/ui/Layout' import Button from 'components/ui/Button' import DatesRangeFilter from 'components/Filters/DatesRangeFilter' import DisplayDigits from 'components/ui/Display/DisplayDigits' -import EncounterStatusFilter from 'components/Filters/EncounterStatusFilter' import ExecutiveUnitsFilter from 'components/Filters/ExecutiveUnitsFilter' -import IppFilter from 'components/Filters/IppFilter' import List from 'components/ui/List' import Modal from 'components/ui/Modal' -import NdaFilter from 'components/Filters/NdaFilter' import SearchInput from 'components/ui/Searchbar/SearchInput' import TextInput from 'components/Filters/TextInput' @@ -37,6 +34,7 @@ import { fetchAnabioCodes as fetchAnabioCodesApi } from 'services/aphp/serviceBiology' import { checkIfPageAvailable, cleanSearchParams, handlePageError } from 'utils/paginationUtils' +import SelectInput from 'components/Filters/SelectInput' type BiologyListProps = { deidentified?: boolean @@ -317,8 +315,17 @@ const BiologyList = ({ deidentified }: BiologyListProps) => { onClose={() => setToggleFilterByModal(false)} onSubmit={(newFilters) => addFilters({ ...filters, ...newFilters })} > - {!deidentified && } - {!deidentified && } + {!deidentified && ( + + )} + {!deidentified && ( + + )} @@ -327,10 +334,11 @@ const BiologyList = ({ deidentified }: BiologyListProps) => { value={executiveUnits} name={FilterKeys.EXECUTIVE_UNITS} /> - { {!deidentified && ( - )} {!deidentified && ( - )} @@ -479,11 +491,12 @@ const BiologyList = ({ deidentified }: BiologyListProps) => { /> - diff --git a/src/components/Dashboard/Documents/Documents.tsx b/src/components/Dashboard/Documents/Documents.tsx index 49bd8fc98..cda4f8ef1 100644 --- a/src/components/Dashboard/Documents/Documents.tsx +++ b/src/components/Dashboard/Documents/Documents.tsx @@ -30,8 +30,6 @@ import DatesRangeFilter from 'components/Filters/DatesRangeFilter' import DocTypesFilter from 'components/Filters/DocTypesFilter' import DocStatusFilter from 'components/Filters/DocStatusFilter' import ExecutiveUnitsFilter from 'components/Filters/ExecutiveUnitsFilter' -import IppFilter from 'components/Filters/IppFilter' -import NdaFilter from 'components/Filters/NdaFilter' import { ResourceType } from 'types/requestCriterias' import { Save, SavedSearch } from '@mui/icons-material' import TextInput from 'components/Filters/TextInput' @@ -39,13 +37,13 @@ import { useSavedFilters } from 'hooks/filters/useSavedFilters' import List from 'components/ui/List' import { useAppDispatch, useAppSelector } from 'state' import Modal from 'components/ui/Modal' -import EncounterStatusFilter from 'components/Filters/EncounterStatusFilter' import { SourceType } from 'types/scope' import { Hierarchy } from 'types/hierarchy' import { useSearchParams } from 'react-router-dom' import { checkIfPageAvailable, cleanSearchParams, handlePageError } from 'utils/paginationUtils' import { CanceledError } from 'axios' import { DocumentReference } from 'fhir/r4' +import SelectInput from 'components/Filters/SelectInput' type DocumentsProps = { deidentified: boolean @@ -382,8 +380,17 @@ const Documents: React.FC = ({ deidentified }) => { onSubmit={(newFilters) => addFilters({ ...filters, ...newFilters })} color="secondary" > - {!deidentified && } - {!deidentified && } + {!deidentified && ( + + )} + {!deidentified && ( + + )} @@ -392,10 +399,11 @@ const Documents: React.FC = ({ deidentified }) => { value={executiveUnits} name={FilterKeys.EXECUTIVE_UNITS} /> - = ({ deidentified }) => { {!deidentified && ( - )} {!deidentified && ( - )} @@ -556,11 +568,12 @@ const Documents: React.FC = ({ deidentified }) => { /> - diff --git a/src/components/Dashboard/FormsList/index.tsx b/src/components/Dashboard/FormsList/index.tsx index 289ec9748..b61f90879 100644 --- a/src/components/Dashboard/FormsList/index.tsx +++ b/src/components/Dashboard/FormsList/index.tsx @@ -5,9 +5,7 @@ import { CircularProgress, Grid, useMediaQuery, useTheme } from '@mui/material' import { FilterList } from '@mui/icons-material' import Button from 'components/ui/Button' import DisplayDigits from 'components/ui/Display/DisplayDigits' -import EncounterStatusFilter from 'components/Filters/EncounterStatusFilter' import ExecutiveUnitsFilter from 'components/Filters/ExecutiveUnitsFilter' -import IppFilter from 'components/Filters/IppFilter' import Modal from 'components/ui/Modal' import { Hierarchy } from 'types/hierarchy' import { DTTB_ResultsType as ResultsType, LoadingStatus } from 'types' @@ -24,6 +22,8 @@ import DataTableForms from 'components/DataTable/DataTableForms' import { useSearchParams } from 'react-router-dom' import { checkIfPageAvailable, cleanSearchParams, handlePageError } from 'utils/paginationUtils' import Chip from 'components/ui/Chip' +import TextInput from 'components/Filters/TextInput' +import SelectInput from 'components/Filters/SelectInput' const FormsList = () => { const theme = useTheme() @@ -206,17 +206,23 @@ const FormsList = () => { onClose={() => setToggleFilterByModal(false)} onSubmit={(newFilters) => addFilters({ ...filters, ...newFilters })} > - + - diff --git a/src/components/Dashboard/ImagingList/index.tsx b/src/components/Dashboard/ImagingList/index.tsx index cf9d350a8..5e3596c05 100644 --- a/src/components/Dashboard/ImagingList/index.tsx +++ b/src/components/Dashboard/ImagingList/index.tsx @@ -11,10 +11,8 @@ import DataTableImaging from 'components/DataTable/DataTableImaging' import DatesRangeFilter from 'components/Filters/DatesRangeFilter' import DisplayDigits from 'components/ui/Display/DisplayDigits' import ExecutiveUnitsFilter from 'components/Filters/ExecutiveUnitsFilter' -import IppFilter from 'components/Filters/IppFilter' import Modal from 'components/ui/Modal' import ModalityFilter from 'components/Filters/ModalityFilter/ModalityFilter' -import NdaFilter from 'components/Filters/NdaFilter' import SearchInput from 'components/ui/Searchbar/SearchInput' import { CohortImaging, LoadingStatus, DTTB_ResultsType as ResultsType } from 'types' @@ -31,12 +29,12 @@ import TextInput from 'components/Filters/TextInput' import List from 'components/ui/List' import { useAppDispatch, useAppSelector } from 'state' import { BlockWrapper } from 'components/ui/Layout' -import EncounterStatusFilter from 'components/Filters/EncounterStatusFilter' import { SourceType } from 'types/scope' import { Hierarchy } from 'types/hierarchy' import { AppConfig } from 'config' import { useSearchParams } from 'react-router-dom' import { checkIfPageAvailable, cleanSearchParams, handlePageError } from 'utils/paginationUtils' +import SelectInput from 'components/Filters/SelectInput' type ImagingListProps = { deidentified?: boolean @@ -290,8 +288,17 @@ const ImagingList = ({ deidentified }: ImagingListProps) => { onClose={() => setToggleFilterByModal(false)} onSubmit={(newFilters) => addFilters({ ...filters, ...newFilters })} > - {!deidentified && } - {!deidentified && } + {!deidentified && ( + + )} + {!deidentified && ( + + )} { value={executiveUnits} name={FilterKeys.EXECUTIVE_UNITS} /> - { )} {!deidentified && ( - )} { onSubmit={(newFilters) => addFilters({ ...filters, ...newFilters })} onClean={triggerClean} > - {!deidentified && } - {!deidentified && } + {!deidentified && ( + + )} + {!deidentified && ( + + )} {selectedTab.id === ResourceType.MEDICATION_REQUEST && prescriptionTypes && ( - )} {selectedTab.id === ResourceType.MEDICATION_ADMINISTRATION && administrationRoutes && ( @@ -377,10 +384,11 @@ const MedicationList = ({ deidentified }: MedicationListProps) => { value={executiveUnits} name={FilterKeys.EXECUTIVE_UNITS} /> - { )} {!deidentified && ( - )} {!deidentified && ( - )} {selectedTab.id === ResourceType.MEDICATION_REQUEST && ( - )} @@ -522,11 +535,12 @@ const MedicationList = ({ deidentified }: MedicationListProps) => { value={selectedSavedFilter?.filterParams.filters.executiveUnits || []} name={FilterKeys.EXECUTIVE_UNITS} /> - diff --git a/src/components/Dashboard/PMSIList/index.tsx b/src/components/Dashboard/PMSIList/index.tsx index 77777b9e6..4340d66d0 100644 --- a/src/components/Dashboard/PMSIList/index.tsx +++ b/src/components/Dashboard/PMSIList/index.tsx @@ -11,12 +11,9 @@ import DatesRangeFilter from 'components/Filters/DatesRangeFilter' import DataTablePmsi from 'components/DataTable/DataTablePmsi' import DiagnosticTypesFilter from 'components/Filters/DiagnosticTypesFilter' import DisplayDigits from 'components/ui/Display/DisplayDigits' -import EncounterStatusFilter from 'components/Filters/EncounterStatusFilter' import ExecutiveUnitsFilter from 'components/Filters/ExecutiveUnitsFilter' -import IppFilter from 'components/Filters/IppFilter' import List from 'components/ui/List' import Modal from 'components/ui/Modal' -import NdaFilter from 'components/Filters/NdaFilter' import { PMSITabs } from 'components/Patient/PatientPMSI/PatientPMSI' import SourceFilter from 'components/Filters/SourceFilter' import Searchbar from 'components/ui/Searchbar' @@ -41,6 +38,7 @@ import { mapToLabel, mapToSourceType } from 'mappers/pmsi' import { useSearchParams } from 'react-router-dom' import { checkIfPageAvailable, cleanSearchParams, handlePageError } from 'utils/paginationUtils' import { getPMSITab } from 'utils/tabsUtils' +import SelectInput from 'components/Filters/SelectInput' type PMSIListProps = { deidentified?: boolean @@ -369,8 +367,17 @@ const PMSIList = ({ deidentified }: PMSIListProps) => { onSubmit={(newFilters) => addFilters({ ...filters, ...newFilters })} onClean={triggerClean} > - {!deidentified && } - {!deidentified && } + {!deidentified && ( + + )} + {!deidentified && ( + + )} {selectedTab.id === ResourceType.CONDITION && ( { {selectedTab.id !== ResourceType.CLAIM && } - @@ -484,19 +492,23 @@ const PMSIList = ({ deidentified }: PMSIListProps) => { {!deidentified && ( - )} {!deidentified && ( - )} @@ -546,11 +558,12 @@ const PMSIList = ({ deidentified }: PMSIListProps) => { /> - diff --git a/src/components/Filters/EncounterStatusFilter/index.tsx b/src/components/Filters/EncounterStatusFilter/index.tsx deleted file mode 100644 index 94c5ed380..000000000 --- a/src/components/Filters/EncounterStatusFilter/index.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import React, { useContext, useEffect, useState } from 'react' -import { Autocomplete, TextField, Typography } from '@mui/material' -import { FormContext } from 'components/ui/Modal' -import { LabelObject } from 'types/searchCriterias' -import { InputWrapper } from 'components/ui/Inputs' - -type EncounterStatusFilterProps = { - name: string - encounterStatusList: LabelObject[] - value: LabelObject[] - disabled?: boolean -} - -const EncounterStatusFilter = ({ name, value, encounterStatusList, disabled = false }: EncounterStatusFilterProps) => { - const context = useContext(FormContext) - const [encounterStatus, setEncounterStatus] = useState(value) - - useEffect(() => { - if (context?.updateFormData) context.updateFormData(name, encounterStatus) - }, [encounterStatus]) - - return ( - - Statut de la visite associée : - { - setEncounterStatus(value) - }} - options={encounterStatusList} - value={encounterStatus} - disableCloseOnSelect - getOptionLabel={(encounterStatus: LabelObject) => encounterStatus.label} - renderOption={(props, encounterStatus: LabelObject) =>
  • {encounterStatus.label}
  • } - renderInput={(params) => ( - - )} - /> -
    - ) -} - -export default EncounterStatusFilter diff --git a/src/components/Filters/IppFilter/index.tsx b/src/components/Filters/IppFilter/index.tsx deleted file mode 100644 index 755b89f6e..000000000 --- a/src/components/Filters/IppFilter/index.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import { TextField, Typography } from '@mui/material' -import { InputWrapper } from 'components/ui/Inputs' -import { FormContext } from 'components/ui/Modal' -import React, { useContext, useEffect, useState } from 'react' - -type IppFilterProps = { - value: string - name: string - disabled?: boolean -} - -const IppFilter = ({ name, value, disabled = false }: IppFilterProps) => { - const context = useContext(FormContext) - const [ipp, setIpp] = useState(value) - - useEffect(() => { - if (context?.updateFormData) context.updateFormData(name, ipp) - }, [ipp]) - - return ( - - IPP : - setIpp(event.target.value)} - /> - - ) -} - -export default IppFilter diff --git a/src/components/Filters/NdaFilter/index.tsx b/src/components/Filters/NdaFilter/index.tsx deleted file mode 100644 index 3efaff883..000000000 --- a/src/components/Filters/NdaFilter/index.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import { TextField, Typography } from '@mui/material' -import { InputWrapper } from 'components/ui/Inputs' -import { FormContext } from 'components/ui/Modal' -import React, { useContext, useEffect, useState } from 'react' - -type NdaFilterProps = { - value: string - name: string - disabled?: boolean -} - -const NdaFilter = ({ name, value, disabled = false }: NdaFilterProps) => { - const context = useContext(FormContext) - const [nda, setNda] = useState(value) - - useEffect(() => { - if (context?.updateFormData) context.updateFormData(name, nda) - }, [nda]) - - return ( - - NDA : - setNda(event.target.value)} - /> - - ) -} - -export default NdaFilter diff --git a/src/components/Filters/PrescriptionTypesFilter/index.tsx b/src/components/Filters/PrescriptionTypesFilter/index.tsx deleted file mode 100644 index 4aaea8bfe..000000000 --- a/src/components/Filters/PrescriptionTypesFilter/index.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import { Autocomplete, TextField, Typography } from '@mui/material' -import { InputWrapper } from 'components/ui/Inputs' -import { FormContext } from 'components/ui/Modal' -import React, { useContext, useEffect, useState } from 'react' -import { Hierarchy } from 'types/hierarchy' -import { LabelObject } from 'types/searchCriterias' -import { capitalizeFirstLetter } from 'utils/capitalize' - -type PrescriptionTypesFilterProps = { - value: LabelObject[] - name: string - allPrescriptionTypes: Hierarchy[] - disabled?: boolean -} - -const PrescriptionTypesFilter = ({ - name, - value, - allPrescriptionTypes, - disabled = false -}: PrescriptionTypesFilterProps) => { - const context = useContext(FormContext) - const [prescriptionTypes, setPrescriptionTypes] = useState(value) - - useEffect(() => { - if (context?.updateFormData) context.updateFormData(name, prescriptionTypes) - }, [prescriptionTypes]) - - return ( - - Type de prescriptions : - { - setPrescriptionTypes(value) - }} - options={allPrescriptionTypes} - value={prescriptionTypes} - disableCloseOnSelect - getOptionLabel={(prescriptionType) => capitalizeFirstLetter(prescriptionType.label)} - renderOption={(props, prescriptionType) =>
  • {capitalizeFirstLetter(prescriptionType.label)}
  • } - renderInput={(params) => ( - - )} - /> -
    - ) -} - -export default PrescriptionTypesFilter diff --git a/src/components/Filters/SelectInput/index.tsx b/src/components/Filters/SelectInput/index.tsx new file mode 100644 index 000000000..5b8733be6 --- /dev/null +++ b/src/components/Filters/SelectInput/index.tsx @@ -0,0 +1,44 @@ +import { Autocomplete, TextField, Typography } from '@mui/material' +import { InputWrapper } from 'components/ui/Inputs' +import { FormContext } from 'components/ui/Modal' +import React, { useContext, useEffect, useState } from 'react' +import { LabelObject } from 'types/searchCriterias' +import { capitalizeFirstLetter } from 'utils/capitalize' + +type PrescriptionTypesFilterProps = { + value: LabelObject[] + name: string + label?: string + options: LabelObject[] + disabled?: boolean +} + +const SelectInput = ({ name, value, label, options, disabled = false }: PrescriptionTypesFilterProps) => { + const context = useContext(FormContext) + const [input, setInput] = useState(value) + + useEffect(() => { + if (context?.updateFormData) context.updateFormData(name, input) + }, [input]) + + return ( + + {label && {label}} + { + setInput(value) + }} + options={options} + value={input} + disableCloseOnSelect + getOptionLabel={(elem) => capitalizeFirstLetter(elem.label)} + renderOption={(props, elem) =>
  • {capitalizeFirstLetter(elem.label)}
  • } + renderInput={(params) => } + /> +
    + ) +} + +export default SelectInput diff --git a/src/components/Patient/PatientBiology/PatientBiology.tsx b/src/components/Patient/PatientBiology/PatientBiology.tsx index a42bd3348..431a9c8bf 100644 --- a/src/components/Patient/PatientBiology/PatientBiology.tsx +++ b/src/components/Patient/PatientBiology/PatientBiology.tsx @@ -27,7 +27,6 @@ import AnabioFilter from 'components/Filters/AnabioFilter' import DatesRangeFilter from 'components/Filters/DatesRangeFilter' import ExecutiveUnitsFilter from 'components/Filters/ExecutiveUnitsFilter' import LoincFilter from 'components/Filters/LoincFilter' -import NdaFilter from 'components/Filters/NdaFilter' import { Save, SavedSearch } from '@mui/icons-material' import { ResourceType } from 'types/requestCriterias' import { useSavedFilters } from 'hooks/filters/useSavedFilters' @@ -38,11 +37,11 @@ import { fetchAnabioCodes as fetchAnabioCodesApi } from 'services/aphp/serviceBiology' import services from 'services/aphp' -import EncounterStatusFilter from 'components/Filters/EncounterStatusFilter' import { SourceType } from 'types/scope' import { Hierarchy } from 'types/hierarchy' import { useSearchParams } from 'react-router-dom' import { checkIfPageAvailable, cleanSearchParams, handlePageError } from 'utils/paginationUtils' +import SelectInput from 'components/Filters/SelectInput' const PatientBiology = () => { const { classes } = useStyles() @@ -267,7 +266,9 @@ const PatientBiology = () => { onClose={() => setToggleFilterByModal(false)} onSubmit={(newFilters) => addFilters({ ...filters, ...newFilters })} > - {!searchResults.deidentified && } + {!searchResults.deidentified && ( + + )} @@ -276,10 +277,11 @@ const PatientBiology = () => { value={executiveUnits} name={FilterKeys.EXECUTIVE_UNITS} /> - { /> - @@ -406,11 +410,12 @@ const PatientBiology = () => { /> - diff --git a/src/components/Patient/PatientBiology/styles.js b/src/components/Patient/PatientBiology/styles.ts similarity index 100% rename from src/components/Patient/PatientBiology/styles.js rename to src/components/Patient/PatientBiology/styles.ts diff --git a/src/components/Patient/PatientDocs/PatientDocs.tsx b/src/components/Patient/PatientDocs/PatientDocs.tsx index 93b59f682..e1e9eb706 100644 --- a/src/components/Patient/PatientDocs/PatientDocs.tsx +++ b/src/components/Patient/PatientDocs/PatientDocs.tsx @@ -38,19 +38,18 @@ import Chip from 'components/ui/Chip' import DatesRangeFilter from 'components/Filters/DatesRangeFilter' import DocTypesFilter from 'components/Filters/DocTypesFilter' import ExecutiveUnitsFilter from 'components/Filters/ExecutiveUnitsFilter' -import NdaFilter from 'components/Filters/NdaFilter' import { ResourceType } from 'types/requestCriterias' import { useSavedFilters } from 'hooks/filters/useSavedFilters' import { Save, SavedSearch } from '@mui/icons-material' import TextInput from 'components/Filters/TextInput' import List from 'components/ui/List' import DocStatusFilter from '../../Filters/DocStatusFilter' -import EncounterStatusFilter from 'components/Filters/EncounterStatusFilter' import services from 'services/aphp' import { SourceType } from 'types/scope' import { Hierarchy } from 'types/hierarchy' import { useSearchParams } from 'react-router-dom' import { checkIfPageAvailable, cleanSearchParams, handlePageError } from 'utils/paginationUtils' +import SelectInput from 'components/Filters/SelectInput' const PatientDocs = () => { const dispatch = useAppDispatch() @@ -334,7 +333,9 @@ const PatientDocs = () => { addFilters({ ...filters, ...newFilters }) }} > - {!searchResults.deidentified && } + {!searchResults.deidentified && ( + + )} @@ -343,10 +344,11 @@ const PatientDocs = () => { value={executiveUnits} name={FilterKeys.EXECUTIVE_UNITS} /> - { {!searchResults.deidentified && ( - )} @@ -487,11 +491,12 @@ const PatientDocs = () => { value={selectedSavedFilter?.filterParams.filters.executiveUnits || []} name={FilterKeys.EXECUTIVE_UNITS} /> - diff --git a/src/components/Patient/PatientForms/MaternityForms/index.tsx b/src/components/Patient/PatientForms/MaternityForms/index.tsx index 8b5a9c71d..40fb7f65a 100644 --- a/src/components/Patient/PatientForms/MaternityForms/index.tsx +++ b/src/components/Patient/PatientForms/MaternityForms/index.tsx @@ -20,11 +20,11 @@ import { LoadingStatus } from 'types' import { FilterKeys } from 'types/searchCriterias' import Timeline from './Timeline' import services from 'services/aphp' -import EncounterStatusFilter from 'components/Filters/EncounterStatusFilter' import { SourceType } from 'types/scope' import { Hierarchy } from 'types/hierarchy' import { useSearchParams } from 'react-router-dom' import { getCleanGroupId } from 'utils/paginationUtils' +import SelectInput from 'components/Filters/SelectInput' const MaternityForm = () => { const [toggleModal, setToggleModal] = useState(false) @@ -132,10 +132,11 @@ const MaternityForm = () => { value={executiveUnits} name={FilterKeys.EXECUTIVE_UNITS} /> - )} diff --git a/src/components/Patient/PatientImaging/PatientImaging.tsx b/src/components/Patient/PatientImaging/PatientImaging.tsx index a0895cbc4..1a8931316 100644 --- a/src/components/Patient/PatientImaging/PatientImaging.tsx +++ b/src/components/Patient/PatientImaging/PatientImaging.tsx @@ -15,7 +15,6 @@ import DisplayDigits from 'components/ui/Display/DisplayDigits' import ExecutiveUnitsFilter from 'components/Filters/ExecutiveUnitsFilter' import Modal from 'components/ui/Modal' import ModalityFilter from 'components/Filters/ModalityFilter/ModalityFilter' -import NdaFilter from 'components/Filters/NdaFilter' import SearchInput from 'components/ui/Searchbar/SearchInput' import { cancelPendingRequest } from 'utils/abortController' @@ -30,12 +29,12 @@ import TextInput from 'components/Filters/TextInput' import List from 'components/ui/List' import services from 'services/aphp' import { BlockWrapper } from 'components/ui/Layout' -import EncounterStatusFilter from 'components/Filters/EncounterStatusFilter' import { SourceType } from 'types/scope' import { Hierarchy } from 'types/hierarchy' import { AppConfig } from 'config' import { useSearchParams } from 'react-router-dom' import { checkIfPageAvailable, cleanSearchParams, handlePageError } from 'utils/paginationUtils' +import SelectInput from 'components/Filters/SelectInput' const PatientImaging = () => { const dispatch = useAppDispatch() @@ -254,7 +253,9 @@ const PatientImaging = () => { onClose={() => setToggleFilterByModal(false)} onSubmit={(newFilters) => addFilters({ ...filters, ...newFilters })} > - {!searchResults.deidentified && } + {!searchResults.deidentified && ( + + )} { value={executiveUnits} name={FilterKeys.EXECUTIVE_UNITS} /> - { )} {!searchResults.deidentified && ( - )} { value={selectedSavedFilter?.filterParams.filters.executiveUnits || []} name={FilterKeys.EXECUTIVE_UNITS} /> - diff --git a/src/components/Patient/PatientMedication/PatientMedication.tsx b/src/components/Patient/PatientMedication/PatientMedication.tsx index 06c478ee6..70db6cce5 100644 --- a/src/components/Patient/PatientMedication/PatientMedication.tsx +++ b/src/components/Patient/PatientMedication/PatientMedication.tsx @@ -27,8 +27,7 @@ import Chip from 'components/ui/Chip' import AdministrationTypesFilter from 'components/Filters/AdministrationTypesFilter' import DatesRangeFilter from 'components/Filters/DatesRangeFilter' import ExecutiveUnitsFilter from 'components/Filters/ExecutiveUnitsFilter' -import NdaFilter from 'components/Filters/NdaFilter' -import PrescriptionTypesFilter from 'components/Filters/PrescriptionTypesFilter' +import SelectInput from 'components/Filters/SelectInput' import { Save, SavedSearch } from '@mui/icons-material' import { MedicationLabel, ResourceType } from 'types/requestCriterias' import { useSavedFilters } from 'hooks/filters/useSavedFilters' @@ -37,7 +36,6 @@ import TextInput from 'components/Filters/TextInput' import List from 'components/ui/List' import { mapToAttribute, mapToLabel } from 'mappers/pmsi' import services from 'services/aphp' -import EncounterStatusFilter from 'components/Filters/EncounterStatusFilter' import { SourceType } from 'types/scope' import { Hierarchy } from 'types/hierarchy' import { useSearchParams } from 'react-router-dom' @@ -343,12 +341,15 @@ const PatientMedication = () => { onSubmit={(newFilters) => addFilters({ ...filters, ...newFilters })} onClean={triggerClean} > - {!searchResults.deidentified && } + {!searchResults.deidentified && ( + + )} {selectedTab.id === ResourceType.MEDICATION_REQUEST && prescriptionTypes && ( - )} {selectedTab.id === ResourceType.MEDICATION_ADMINISTRATION && administrationRoutes && ( @@ -364,10 +365,11 @@ const PatientMedication = () => { value={executiveUnits} name={FilterKeys.EXECUTIVE_UNITS} /> - { )} {!searchResults.deidentified && ( - )} {selectedTab.id === ResourceType.MEDICATION_REQUEST && ( - )} @@ -498,11 +503,12 @@ const PatientMedication = () => { value={selectedSavedFilter?.filterParams.filters.executiveUnits || []} name={FilterKeys.EXECUTIVE_UNITS} /> - diff --git a/src/components/Patient/PatientMedication/styles.js b/src/components/Patient/PatientMedication/styles.ts similarity index 100% rename from src/components/Patient/PatientMedication/styles.js rename to src/components/Patient/PatientMedication/styles.ts diff --git a/src/components/Patient/PatientPMSI/PatientPMSI.tsx b/src/components/Patient/PatientPMSI/PatientPMSI.tsx index ac3489b22..df46e6b40 100644 --- a/src/components/Patient/PatientPMSI/PatientPMSI.tsx +++ b/src/components/Patient/PatientPMSI/PatientPMSI.tsx @@ -28,7 +28,6 @@ import CodeFilter from 'components/Filters/CodeFilter' import DatesRangeFilter from 'components/Filters/DatesRangeFilter' import DiagnosticTypesFilter from 'components/Filters/DiagnosticTypesFilter' import ExecutiveUnitsFilter from 'components/Filters/ExecutiveUnitsFilter' -import NdaFilter from 'components/Filters/NdaFilter' import SourceFilter from 'components/Filters/SourceFilter' import { ResourceType } from 'types/requestCriterias' import { useSavedFilters } from 'hooks/filters/useSavedFilters' @@ -37,12 +36,12 @@ import TextInput from 'components/Filters/TextInput' import { mapToAttribute, mapToLabel, mapToSourceType } from 'mappers/pmsi' import List from 'components/ui/List' import { fetchClaimCodes, fetchConditionCodes, fetchProcedureCodes } from 'services/aphp/servicePmsi' -import EncounterStatusFilter from 'components/Filters/EncounterStatusFilter' import { AlertWrapper } from 'components/ui/Alert' import { Hierarchy } from 'types/hierarchy' import { useSearchParams } from 'react-router-dom' import { checkIfPageAvailable, cleanSearchParams, handlePageError } from 'utils/paginationUtils' import { getPMSITab } from 'utils/tabsUtils' +import SelectInput from 'components/Filters/SelectInput' type PmsiSearchResults = { deidentified: boolean @@ -347,7 +346,9 @@ const PatientPMSI = () => { onSubmit={(newFilters) => addFilters({ ...filters, ...newFilters })} onClean={triggerClean} > - {!searchResults.deidentified && } + {!searchResults.deidentified && ( + + )} {selectedTab.id === ResourceType.CONDITION && ( { {selectedTab.id !== ResourceType.CLAIM && } - @@ -450,10 +452,12 @@ const PatientPMSI = () => { {!searchResults.deidentified && ( - )} @@ -503,11 +507,12 @@ const PatientPMSI = () => { /> -