Skip to content

Commit 040e4c3

Browse files
pl-buiquangaetchego
authored andcommitted
refactor: filter components - Ref gestion-de-projet#2490
1 parent 2048fb0 commit 040e4c3

File tree

213 files changed

+6029
-9442
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

213 files changed

+6029
-9442
lines changed

.github/workflows/main.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
test:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1515
with:
1616
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
1717

@@ -25,11 +25,18 @@ jobs:
2525
run: npm run lint && npx tsc --noEmit
2626
- name: Test
2727
run: npm run coverage
28+
- name: Retrieve version
29+
run: |
30+
VERSION=$(cat package.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/"version"://g' | sed 's/[",]//g' | tr -d '[[:space:]]')
31+
echo "VERSION=$VERSION" >> $GITHUB_ENV
2832
- name: SonarCloud Scan
2933
uses: SonarSource/sonarcloud-github-action@master
3034
env:
3135
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
3236
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
37+
with:
38+
args: >
39+
-Dsonar.projectVersion=${{ env.VERSION }}
3340
3441
publish:
3542
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ yarn-error.log*
3030
.env*
3131
!.env.example
3232
.mp4
33-
public/config.dev.json
33+
public/config.dev.json
34+
public/config.local.json

package-lock.json

Lines changed: 21 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"antlr4": "^4.13.1-patch-1",
1818
"axios": "^1.6.0",
1919
"buffer": "^6.0.3",
20+
"canvas": "^2.11.2",
2021
"client-oauth2": "^4.2.4",
2122
"d3": "^7.8.2",
2223
"d3-cloud": "^1.2.5",
@@ -41,6 +42,7 @@
4142
"react-router": "^6.9.0",
4243
"react-router-dom": "^6.9.0",
4344
"react-use-websocket": "4.8.1",
45+
"react-window": "^1.8.10",
4446
"redux": "^4.2.1",
4547
"redux-devtools-extension": "^2.13.9",
4648
"redux-logger": "^3.0.6",
@@ -60,7 +62,7 @@
6062
"build": "vite build",
6163
"serve": "vite preview",
6264
"lint": "eslint --ext .jsx,.js,.ts,.tsx src/",
63-
"test": "vitest",
65+
"test": "vitest",
6466
"coverage": "vitest run --coverage",
6567
"ui": "vitest --ui"
6668
},
@@ -98,6 +100,7 @@
98100
"@types/react-redux": "^7.1.25",
99101
"@types/react-router": "^5.1.20",
100102
"@types/react-router-dom": "^5.3.3",
103+
"@types/react-window": "^1.8.8",
101104
"@types/redux-logger": "^3.0.9",
102105
"@types/uuid": "^8.3.4",
103106
"@typescript-eslint/eslint-plugin": "^5.57.0",

src/__tests__/cohortCreation/cohortCreation.test.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@ import {
4848
buildClaimFilter,
4949
buildMedicationFilter,
5050
buildObservationFilter,
51-
buildImagingFilter,
52-
buildPregnancyFilter,
53-
buildHospitFilter
51+
buildImagingFilter
5452
} from 'utils/cohortCreation'
5553
import { completeDocumentCriteria, defaultDocumentCriteria } from '__tests__/data/cohortCreation/documentCriteria'
5654
import { completeConditionCriteria, defaultConditionCriteria } from '__tests__/data/cohortCreation/conditionCriteria'
@@ -301,7 +299,7 @@ describe('test of buildConditionFilter', () => {
301299
const selectedCriteria: Cim10DataType = completeConditionCriteria
302300
const result = [
303301
'subject.active=true',
304-
'code=I841,I842',
302+
'code=https://smt.esante.gouv.fr/terminologie-cim-10/|I841,https://smt.esante.gouv.fr/terminologie-cim-10/|I842',
305303
'orbis-status=fp,f',
306304
'_source=AREM',
307305
'encounter.encounter-care-site=8312016825',
@@ -325,7 +323,7 @@ describe('test of buildProcedureFilter', () => {
325323
const selectedCriteria: CcamDataType = completeProcedureCriteria
326324
const result = [
327325
'subject.active=true',
328-
'code=000126,000127',
326+
'code=https://www.atih.sante.fr/plateformes-de-transmiss…ls/logiciels-espace-de-telechargement/id_lot/3550|000126,https://www.atih.sante.fr/plateformes-de-transmiss…ls/logiciels-espace-de-telechargement/id_lot/3550|000127',
329327
'encounter.encounter-care-site=8312016825',
330328
'encounter.status=entered-in-error',
331329
'date=ge2024-09-06T00:00:00Z',
@@ -348,7 +346,7 @@ describe('test of buildClaimFilter', () => {
348346
const selectedCriteria: GhmDataType = completeClaimCriteria
349347
const result = [
350348
'patient.active=true',
351-
'diagnosis=05C021,05C022,05C023,05C024',
349+
'diagnosis=https://terminology.eds.aphp.fr/aphp-orbis-ghm|05C021,https://terminology.eds.aphp.fr/aphp-orbis-ghm|05C022,https://terminology.eds.aphp.fr/aphp-orbis-ghm|05C023,https://terminology.eds.aphp.fr/aphp-orbis-ghm|05C024',
352350
'encounter.encounter-care-site=8312016825',
353351
'encounter.status=cancelled',
354352
'created=ge2024-09-03T00:00:00Z',
@@ -414,7 +412,7 @@ describe('test of buildObservationFilter', () => {
414412
const selectedCriteria: ObservationDataType = completeObservationCriteria
415413
const result = [
416414
'subject.active=true&status=Val',
417-
'code=I3356',
415+
'code=https://terminology.eds.aphp.fr/aphp-itm-anabio|I3356',
418416
'encounter.encounter-care-site=8312016825',
419417
'encounter.status=cancelled',
420418
'date=ge2024-09-03T00:00:00Z',

src/__tests__/data/cohortCreation/claimCriteria.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,33 @@ export const completeClaimCriteria: GhmDataType = {
3333
{
3434
id: '05C021',
3535
label: '05C021 - Chirurgie De Remplacement Valvulaire Avec…thétérisme Cardiaque Ou Coronarographie, Niveau 1',
36-
system: 'https://terminology.eds.aphp.fr/aphp-orbis-ghm'
36+
system: 'https://terminology.eds.aphp.fr/aphp-orbis-ghm',
37+
above_levels_ids: '*',
38+
inferior_levels_ids: ''
3739
},
3840

3941
{
4042
id: '05C022',
4143
label: '05C022 - Chirurgie De Remplacement Valvulaire Avec…thétérisme Cardiaque Ou Coronarographie, Niveau 2',
42-
system: 'https://terminology.eds.aphp.fr/aphp-orbis-ghm'
44+
system: 'https://terminology.eds.aphp.fr/aphp-orbis-ghm',
45+
above_levels_ids: '*',
46+
inferior_levels_ids: ''
4347
},
4448

4549
{
4650
id: '05C023',
4751
label: '05C023 - Chirurgie De Remplacement Valvulaire Avec…thétérisme Cardiaque Ou Coronarographie, Niveau 3',
48-
system: 'https://terminology.eds.aphp.fr/aphp-orbis-ghm'
52+
system: 'https://terminology.eds.aphp.fr/aphp-orbis-ghm',
53+
above_levels_ids: '*',
54+
inferior_levels_ids: ''
4955
},
5056

5157
{
5258
id: '05C024',
5359
label: '05C024 - Chirurgie De Remplacement Valvulaire Avec…thétérisme Cardiaque Ou Coronarographie, Niveau 4',
54-
system: 'https://terminology.eds.aphp.fr/aphp-orbis-ghm'
60+
system: 'https://terminology.eds.aphp.fr/aphp-orbis-ghm',
61+
above_levels_ids: '*',
62+
inferior_levels_ids: ''
5563
}
5664
],
5765
encounterService: [
@@ -62,12 +70,14 @@ export const completeClaimCriteria: GhmDataType = {
6270
full_path: 'APHP-ASSISTANCE PUBLIQUE AP-HP/H01-GH RCP',
6371
id: '8312016825',
6472
inferior_levels_ids: '8312016826',
73+
label: 'GH RCP',
6574
name: 'GH RCP',
6675
parent_id: '8312002244',
6776
source_value: 'H01',
6877
status: undefined,
6978
subItems: undefined,
70-
type: 'Groupe hospitalier (GH)'
79+
type: 'Groupe hospitalier (GH)',
80+
system: 'nan'
7181
}
7282
]
7383
}

src/__tests__/data/cohortCreation/cohortCreation.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ const defaultProcedureCriteria: SelectedCriteriaType = {
1616
encounterEndDate: [null, null],
1717
includeEncounterEndDateNull: true,
1818
encounterStatus: [],
19-
hierarchy: undefined,
2019
code: [],
2120
source: null,
2221
label: undefined
@@ -86,12 +85,16 @@ export const procedurePeudonimizedCriteria: SelectedCriteriaType[] = [
8685
{
8786
id: '000212',
8887
label: "000212 - Actes Diagnostiques Sur L'oreille",
88+
above_levels_ids: '*',
89+
inferior_levels_ids: '',
8990
system:
9091
'https://www.atih.sante.fr/plateformes-de-transmission-et-logiciels/logiciels-espace-de-telechargement/id_lot/3550'
9192
},
9293
{
9394
id: '000489',
9495
label: '000489 - Actes Thérapeutiques Sur Les Vaisseaux Intracrâniens',
96+
above_levels_ids: '*',
97+
inferior_levels_ids: '',
9598
system:
9699
'https://www.atih.sante.fr/plateformes-de-transmission-et-logiciels/logiciels-espace-de-telechargement/id_lot/3550'
97100
}

src/__tests__/data/cohortCreation/conditionCriteria.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Cim10DataType, Comparators, CriteriaType } from 'types/requestCriterias'
2+
import { System } from 'types/scope'
23

34
export const defaultConditionCriteria: Cim10DataType = {
45
id: 1,
@@ -34,12 +35,16 @@ export const completeConditionCriteria: Cim10DataType = {
3435
{
3536
id: 'I841',
3637
label: 'I841 - *** Su14 *** Hémorroïdes Internes Avec Autres Complications',
37-
system: 'https://smt.esante.gouv.fr/terminologie-cim-10/'
38+
system: 'https://smt.esante.gouv.fr/terminologie-cim-10/',
39+
above_levels_ids: '*',
40+
inferior_levels_ids: ''
3841
},
3942
{
4043
id: 'I842',
4144
label: 'I842 - *** Su15 *** Hémorroïdes Internes Sans Autres Complications',
42-
system: 'https://smt.esante.gouv.fr/terminologie-cim-10/'
45+
system: 'https://smt.esante.gouv.fr/terminologie-cim-10/',
46+
above_levels_ids: '*',
47+
inferior_levels_ids: ''
4348
}
4449
],
4550
source: 'AREM',
@@ -57,6 +62,7 @@ export const completeConditionCriteria: Cim10DataType = {
5762
],
5863
encounterService: [
5964
{
65+
label: 'GH RCP',
6066
above_levels_ids: '8312002244',
6167
cohort_id: '6935',
6268
cohort_size: '23',
@@ -68,7 +74,8 @@ export const completeConditionCriteria: Cim10DataType = {
6874
source_value: 'H01',
6975
status: undefined,
7076
subItems: undefined,
71-
type: 'Groupe hospitalier (GH)'
77+
type: 'Groupe hospitalier (GH)',
78+
system: System.ScopeTree
7279
}
7380
]
7481
}

src/__tests__/data/cohortCreation/documentCriteria.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Comparators, CriteriaType, DocumentDataType } from 'types/requestCriterias'
2+
import { System } from 'types/scope'
23
import { SearchByTypes } from 'types/searchCriterias'
34

45
export const defaultDocumentCriteria: DocumentDataType = {
@@ -42,6 +43,7 @@ export const completeDocumentCriteria: DocumentDataType = {
4243
searchBy: SearchByTypes.TEXT,
4344
encounterService: [
4445
{
46+
label: 'GH RCP',
4547
above_levels_ids: '8312002244',
4648
cohort_id: '6935',
4749
cohort_size: '23',
@@ -53,7 +55,8 @@ export const completeDocumentCriteria: DocumentDataType = {
5355
source_value: 'H01',
5456
status: undefined,
5557
subItems: undefined,
56-
type: 'Groupe hospitalier (GH)'
58+
type: 'Groupe hospitalier (GH)',
59+
system: System.ScopeTree
5760
}
5861
]
5962
}

src/__tests__/data/cohortCreation/encounterCriteria.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Comparators, CriteriaType, EncounterDataType } from 'types/requestCriterias'
2+
import { System } from 'types/scope'
23

34
export const defaultEncounterCriteira: EncounterDataType = {
45
id: 1,
@@ -142,6 +143,7 @@ export const completeEncounterCriteria: EncounterDataType = {
142143
],
143144
encounterService: [
144145
{
146+
label: 'ASSISTANCE PUBLIQUE AP-HP',
145147
above_levels_ids: '',
146148
cohort_id: '118',
147149
cohort_size: '19215',
@@ -154,7 +156,8 @@ export const completeEncounterCriteria: EncounterDataType = {
154156
source_value: 'APHP',
155157
status: undefined,
156158
subItems: undefined,
157-
type: 'AP-HP'
159+
type: 'AP-HP',
160+
system: System.ScopeTree
158161
}
159162
]
160163
}

0 commit comments

Comments
 (0)