From 1353f54df48de883d3ce3c5fac8c98f9bfc170e4 Mon Sep 17 00:00:00 2001 From: Manelle G <39384110+ManelleG@users.noreply.github.com> Date: Wed, 29 May 2024 17:04:55 +0200 Subject: [PATCH] fix: fixed pseudonymization of age criteria - Ref gestion-de-projet#2563 fix: fixed pseudonymization of age criteria - Ref gestion-de-projet#2563 --- src/data/encounterStatus.ts | 46 ---------------------- src/services/aphp/serviceCohortCreation.ts | 6 +-- src/utils/cohortCreation.ts | 6 +-- 3 files changed, 6 insertions(+), 52 deletions(-) delete mode 100644 src/data/encounterStatus.ts diff --git a/src/data/encounterStatus.ts b/src/data/encounterStatus.ts deleted file mode 100644 index b2f53d82c..000000000 --- a/src/data/encounterStatus.ts +++ /dev/null @@ -1,46 +0,0 @@ -export const encounterStatusList = [ - { - id: 'in-progress', - label: 'Courant' - }, - { - id: 'onleave', - label: 'On Leave' - }, - { - id: 'arrived', - label: 'Arrived' - }, - { - id: 'entered-in-error', - label: 'Supprimé' - }, - { - id: 'unknown', - label: 'Unknown' - }, - { - id: 'finished', - label: 'Actif' - }, - { - id: 'triaged', - label: 'Migré' - }, - { - id: 'planned', - label: 'Planifié' - }, - { - id: 'INCONNU', - label: 'INCONNU' - }, - { - id: 'NON RENSEIGNE', - label: 'NON RENSEIGNE' - }, - { - id: 'cancelled', - label: 'Cancelled' - } -] diff --git a/src/services/aphp/serviceCohortCreation.ts b/src/services/aphp/serviceCohortCreation.ts index 1b4d6e78e..d1a3c6d81 100644 --- a/src/services/aphp/serviceCohortCreation.ts +++ b/src/services/aphp/serviceCohortCreation.ts @@ -59,13 +59,13 @@ import { EXIT_PLACE_TYPE, FEEDING_TYPE, EXIT_FEEDING_MODE, - EXIT_DIAGNOSTIC + EXIT_DIAGNOSTIC, + ENCOUNTER_STATUS } from '../../constants' import { fetchSingleCodeHierarchy, fetchValueSet } from './callApi' import { DocType } from 'types/requestCriterias' import { VitalStatusLabel } from 'types/searchCriterias' import { birthStatusData, booleanFieldsData, booleanOpenChoiceFieldsData, vmeData } from 'data/questionnaire_data' -import { encounterStatusList } from 'data/encounterStatus' export interface IServiceCohortCreation { /** @@ -536,7 +536,7 @@ const servicesCohortCreation: IServiceCohortCreation = { }, fetchExitFeedingMode: async () => fetchValueSet(EXIT_FEEDING_MODE, { joinDisplayWithCode: false, sortingKey: 'id' }), fetchExitDiagnostic: async () => fetchValueSet(EXIT_DIAGNOSTIC, { joinDisplayWithCode: false, sortingKey: 'id' }), - fetchEncounterStatus: async () => encounterStatusList + fetchEncounterStatus: async () => fetchValueSet(ENCOUNTER_STATUS, { joinDisplayWithCode: false, sortingKey: 'id' }) } export default servicesCohortCreation diff --git a/src/utils/cohortCreation.ts b/src/utils/cohortCreation.ts index 44e777c8f..11057c3e8 100644 --- a/src/utils/cohortCreation.ts +++ b/src/utils/cohortCreation.ts @@ -233,10 +233,10 @@ type RequeteurSearchType = { export const cleanCriterias = (selectedCriteria: SelectedCriteriaType[], dispatch: AppDispatch) => { const cleanDurationRange = (value: DurationRangeType) => { - const regex = /\/[^/]*$/ + const regex = /^[^/]+/ return [ - value[0] ? value[0].replace(regex, '/0') : null, - value[1] ? value[1].replace(regex, '/0') : null + value[0] ? value[0].replace(regex, '0') : null, + value[1] ? value[1].replace(regex, '0') : null ] as DurationRangeType } const cleanedSelectedCriteria = selectedCriteria