Skip to content

Commit

Permalink
fix: fixed pseudonymization of age criteria - Ref gestion-de-projet#2563
Browse files Browse the repository at this point in the history
fix: fixed pseudonymization of age criteria - Ref gestion-de-projet#2563
  • Loading branch information
ManelleG authored May 29, 2024
1 parent 6bd2a0c commit 1353f54
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 52 deletions.
46 changes: 0 additions & 46 deletions src/data/encounterStatus.ts

This file was deleted.

6 changes: 3 additions & 3 deletions src/services/aphp/serviceCohortCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand Down Expand Up @@ -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
6 changes: 3 additions & 3 deletions src/utils/cohortCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1353f54

Please sign in to comment.