Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref: 2490-refacto filters - Ref gestion-de-projet#2371 #1083

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

Expand All @@ -25,11 +25,18 @@ jobs:
run: npm run lint && npx tsc --noEmit
- name: Test
run: npm run coverage
- name: Retrieve version
run: |
VERSION=$(cat package.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/"version"://g' | sed 's/[",]//g' | tr -d '[[:space:]]')
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.projectVersion=${{ env.VERSION }}

publish:
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ yarn-error.log*
.env*
!.env.example
.mp4
public/config.dev.json
public/config.dev.json
public/config.local.json
41 changes: 21 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"antlr4": "^4.13.1-patch-1",
"axios": "^1.6.0",
"buffer": "^6.0.3",
"canvas": "^2.11.2",
"client-oauth2": "^4.2.4",
"d3": "^7.8.2",
"d3-cloud": "^1.2.5",
Expand All @@ -41,6 +42,7 @@
"react-router": "^6.9.0",
"react-router-dom": "^6.9.0",
"react-use-websocket": "4.8.1",
"react-window": "^1.8.10",
"redux": "^4.2.1",
"redux-devtools-extension": "^2.13.9",
"redux-logger": "^3.0.6",
Expand All @@ -60,7 +62,7 @@
"build": "vite build",
"serve": "vite preview",
"lint": "eslint --ext .jsx,.js,.ts,.tsx src/",
"test": "vitest",
"test": "vitest",
"coverage": "vitest run --coverage",
"ui": "vitest --ui"
},
Expand Down Expand Up @@ -98,6 +100,7 @@
"@types/react-redux": "^7.1.25",
"@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3",
"@types/react-window": "^1.8.8",
"@types/redux-logger": "^3.0.9",
"@types/uuid": "^8.3.4",
"@typescript-eslint/eslint-plugin": "^5.57.0",
Expand Down
12 changes: 5 additions & 7 deletions src/__tests__/cohortCreation/cohortCreation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ import {
buildClaimFilter,
buildMedicationFilter,
buildObservationFilter,
buildImagingFilter,
buildPregnancyFilter,
buildHospitFilter
buildImagingFilter
} from 'utils/cohortCreation'
import { completeDocumentCriteria, defaultDocumentCriteria } from '__tests__/data/cohortCreation/documentCriteria'
import { completeConditionCriteria, defaultConditionCriteria } from '__tests__/data/cohortCreation/conditionCriteria'
Expand Down Expand Up @@ -301,7 +299,7 @@ describe('test of buildConditionFilter', () => {
const selectedCriteria: Cim10DataType = completeConditionCriteria
const result = [
'subject.active=true',
'code=I841,I842',
'code=https://smt.esante.gouv.fr/terminologie-cim-10/|I841,https://smt.esante.gouv.fr/terminologie-cim-10/|I842',
'orbis-status=fp,f',
'_source=AREM',
'encounter.encounter-care-site=8312016825',
Expand All @@ -325,7 +323,7 @@ describe('test of buildProcedureFilter', () => {
const selectedCriteria: CcamDataType = completeProcedureCriteria
const result = [
'subject.active=true',
'code=000126,000127',
'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',
'encounter.encounter-care-site=8312016825',
'encounter.status=entered-in-error',
'date=ge2024-09-06T00:00:00Z',
Expand All @@ -348,7 +346,7 @@ describe('test of buildClaimFilter', () => {
const selectedCriteria: GhmDataType = completeClaimCriteria
const result = [
'patient.active=true',
'diagnosis=05C021,05C022,05C023,05C024',
'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',
'encounter.encounter-care-site=8312016825',
'encounter.status=cancelled',
'created=ge2024-09-03T00:00:00Z',
Expand Down Expand Up @@ -414,7 +412,7 @@ describe('test of buildObservationFilter', () => {
const selectedCriteria: ObservationDataType = completeObservationCriteria
const result = [
'subject.active=true&status=Val',
'code=I3356',
'code=https://terminology.eds.aphp.fr/aphp-itm-anabio|I3356',
'encounter.encounter-care-site=8312016825',
'encounter.status=cancelled',
'date=ge2024-09-03T00:00:00Z',
Expand Down
20 changes: 15 additions & 5 deletions src/__tests__/data/cohortCreation/claimCriteria.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,33 @@ export const completeClaimCriteria: GhmDataType = {
{
id: '05C021',
label: '05C021 - Chirurgie De Remplacement Valvulaire Avec…thétérisme Cardiaque Ou Coronarographie, Niveau 1',
system: 'https://terminology.eds.aphp.fr/aphp-orbis-ghm'
system: 'https://terminology.eds.aphp.fr/aphp-orbis-ghm',
above_levels_ids: '*',
inferior_levels_ids: ''
},

{
id: '05C022',
label: '05C022 - Chirurgie De Remplacement Valvulaire Avec…thétérisme Cardiaque Ou Coronarographie, Niveau 2',
system: 'https://terminology.eds.aphp.fr/aphp-orbis-ghm'
system: 'https://terminology.eds.aphp.fr/aphp-orbis-ghm',
above_levels_ids: '*',
inferior_levels_ids: ''
},

{
id: '05C023',
label: '05C023 - Chirurgie De Remplacement Valvulaire Avec…thétérisme Cardiaque Ou Coronarographie, Niveau 3',
system: 'https://terminology.eds.aphp.fr/aphp-orbis-ghm'
system: 'https://terminology.eds.aphp.fr/aphp-orbis-ghm',
above_levels_ids: '*',
inferior_levels_ids: ''
},

{
id: '05C024',
label: '05C024 - Chirurgie De Remplacement Valvulaire Avec…thétérisme Cardiaque Ou Coronarographie, Niveau 4',
system: 'https://terminology.eds.aphp.fr/aphp-orbis-ghm'
system: 'https://terminology.eds.aphp.fr/aphp-orbis-ghm',
above_levels_ids: '*',
inferior_levels_ids: ''
}
],
encounterService: [
Expand All @@ -62,12 +70,14 @@ export const completeClaimCriteria: GhmDataType = {
full_path: 'APHP-ASSISTANCE PUBLIQUE AP-HP/H01-GH RCP',
id: '8312016825',
inferior_levels_ids: '8312016826',
label: 'GH RCP',
name: 'GH RCP',
parent_id: '8312002244',
source_value: 'H01',
status: undefined,
subItems: undefined,
type: 'Groupe hospitalier (GH)'
type: 'Groupe hospitalier (GH)',
system: 'nan'
}
]
}
5 changes: 4 additions & 1 deletion src/__tests__/data/cohortCreation/cohortCreation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const defaultProcedureCriteria: SelectedCriteriaType = {
encounterEndDate: [null, null],
includeEncounterEndDateNull: true,
encounterStatus: [],
hierarchy: undefined,
code: [],
source: null,
label: undefined
Expand Down Expand Up @@ -86,12 +85,16 @@ export const procedurePeudonimizedCriteria: SelectedCriteriaType[] = [
{
id: '000212',
label: "000212 - Actes Diagnostiques Sur L'oreille",
above_levels_ids: '*',
inferior_levels_ids: '',
system:
'https://www.atih.sante.fr/plateformes-de-transmission-et-logiciels/logiciels-espace-de-telechargement/id_lot/3550'
},
{
id: '000489',
label: '000489 - Actes Thérapeutiques Sur Les Vaisseaux Intracrâniens',
above_levels_ids: '*',
inferior_levels_ids: '',
system:
'https://www.atih.sante.fr/plateformes-de-transmission-et-logiciels/logiciels-espace-de-telechargement/id_lot/3550'
}
Expand Down
13 changes: 10 additions & 3 deletions src/__tests__/data/cohortCreation/conditionCriteria.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Cim10DataType, Comparators, CriteriaType } from 'types/requestCriterias'
import { System } from 'types/scope'

export const defaultConditionCriteria: Cim10DataType = {
id: 1,
Expand Down Expand Up @@ -34,12 +35,16 @@ export const completeConditionCriteria: Cim10DataType = {
{
id: 'I841',
label: 'I841 - *** Su14 *** Hémorroïdes Internes Avec Autres Complications',
system: 'https://smt.esante.gouv.fr/terminologie-cim-10/'
system: 'https://smt.esante.gouv.fr/terminologie-cim-10/',
above_levels_ids: '*',
inferior_levels_ids: ''
},
{
id: 'I842',
label: 'I842 - *** Su15 *** Hémorroïdes Internes Sans Autres Complications',
system: 'https://smt.esante.gouv.fr/terminologie-cim-10/'
system: 'https://smt.esante.gouv.fr/terminologie-cim-10/',
above_levels_ids: '*',
inferior_levels_ids: ''
}
],
source: 'AREM',
Expand All @@ -57,6 +62,7 @@ export const completeConditionCriteria: Cim10DataType = {
],
encounterService: [
{
label: 'GH RCP',
above_levels_ids: '8312002244',
cohort_id: '6935',
cohort_size: '23',
Expand All @@ -68,7 +74,8 @@ export const completeConditionCriteria: Cim10DataType = {
source_value: 'H01',
status: undefined,
subItems: undefined,
type: 'Groupe hospitalier (GH)'
type: 'Groupe hospitalier (GH)',
system: System.ScopeTree
}
]
}
5 changes: 4 additions & 1 deletion src/__tests__/data/cohortCreation/documentCriteria.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Comparators, CriteriaType, DocumentDataType } from 'types/requestCriterias'
import { System } from 'types/scope'
import { SearchByTypes } from 'types/searchCriterias'

export const defaultDocumentCriteria: DocumentDataType = {
Expand Down Expand Up @@ -42,6 +43,7 @@ export const completeDocumentCriteria: DocumentDataType = {
searchBy: SearchByTypes.TEXT,
encounterService: [
{
label: 'GH RCP',
above_levels_ids: '8312002244',
cohort_id: '6935',
cohort_size: '23',
Expand All @@ -53,7 +55,8 @@ export const completeDocumentCriteria: DocumentDataType = {
source_value: 'H01',
status: undefined,
subItems: undefined,
type: 'Groupe hospitalier (GH)'
type: 'Groupe hospitalier (GH)',
system: System.ScopeTree
}
]
}
5 changes: 4 additions & 1 deletion src/__tests__/data/cohortCreation/encounterCriteria.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Comparators, CriteriaType, EncounterDataType } from 'types/requestCriterias'
import { System } from 'types/scope'

export const defaultEncounterCriteira: EncounterDataType = {
id: 1,
Expand Down Expand Up @@ -142,6 +143,7 @@ export const completeEncounterCriteria: EncounterDataType = {
],
encounterService: [
{
label: 'ASSISTANCE PUBLIQUE AP-HP',
above_levels_ids: '',
cohort_id: '118',
cohort_size: '19215',
Expand All @@ -154,7 +156,8 @@ export const completeEncounterCriteria: EncounterDataType = {
source_value: 'APHP',
status: undefined,
subItems: undefined,
type: 'AP-HP'
type: 'AP-HP',
system: System.ScopeTree
}
]
}
Loading
Loading