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

feat(request): new code system field input - Ref gestion-de-projet#2371 #1064

Merged
merged 1 commit into from
Jan 9, 2025
Merged
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
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
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
}
]
}
49 changes: 41 additions & 8 deletions src/__tests__/data/cohortCreation/medicationCriteria.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { MedicationDataType, Comparators, CriteriaType } from 'types/requestCriterias'
import { System } from 'types/scope'

export const defaultMedicationCriteria: MedicationDataType = {
id: 1,
Expand Down Expand Up @@ -30,12 +31,26 @@ export const completeMedicationAdministrationCriteria: MedicationDataType = {
includeEncounterEndDateNull: false,
encounterStatus: [{ id: 'cancelled', label: 'Cancelled', system: 'http://hl7.org/fhir/CodeSystem/encounter-status' }],
code: [
{ id: 'D01AA01', label: 'D01AA01 - Nystatin; Topical', system: 'https://terminology.eds.aphp.fr/atc' },
{ id: 'D01AA02', label: 'D01AA02 - Natamycin; Topical', system: 'https://terminology.eds.aphp.fr/atc' },
{
id: 'D01AA01',
label: 'D01AA01 - Nystatin; Topical',
system: 'https://terminology.eds.aphp.fr/atc',
above_levels_ids: '*',
inferior_levels_ids: ''
},
{
id: 'D01AA02',
label: 'D01AA02 - Natamycin; Topical',
system: 'https://terminology.eds.aphp.fr/atc',
above_levels_ids: '*',
inferior_levels_ids: ''
},
{
id: '3400890000055',
label: '3400890000055 - Sawis 2mg Cpr',
system: 'https://terminology.eds.aphp.fr/smt-medicament-ucd'
system: 'https://terminology.eds.aphp.fr/smt-medicament-ucd',
above_levels_ids: '*',
inferior_levels_ids: ''
}
],
administration: [
Expand All @@ -47,6 +62,7 @@ export const completeMedicationAdministrationCriteria: MedicationDataType = {
],
encounterService: [
{
label: 'GH RCP',
above_levels_ids: '8312002244',
cohort_id: '6935',
cohort_size: '23',
Expand All @@ -58,7 +74,8 @@ export const completeMedicationAdministrationCriteria: MedicationDataType = {
source_value: 'H01',
status: undefined,
subItems: undefined,
type: 'Groupe hospitalier (GH)'
type: 'Groupe hospitalier (GH)',
system: System.ScopeTree
}
]
}
Expand All @@ -75,12 +92,26 @@ export const completeMedicationPrescriptionCriteria: MedicationDataType = {
includeEncounterEndDateNull: false,
encounterStatus: [{ id: 'cancelled', label: 'Cancelled', system: 'http://hl7.org/fhir/CodeSystem/encounter-status' }],
code: [
{ id: 'D01AA01', label: 'D01AA01 - Nystatin; Topical', system: 'https://terminology.eds.aphp.fr/atc' },
{ id: 'D01AA02', label: 'D01AA02 - Natamycin; Topical', system: 'https://terminology.eds.aphp.fr/atc' },
{
id: 'D01AA01',
label: 'D01AA01 - Nystatin; Topical',
system: 'https://terminology.eds.aphp.fr/atc',
above_levels_ids: '*',
inferior_levels_ids: ''
},
{
id: 'D01AA02',
label: 'D01AA02 - Natamycin; Topical',
system: 'https://terminology.eds.aphp.fr/atc',
above_levels_ids: '*',
inferior_levels_ids: ''
},
{
id: '3400890000055',
label: '3400890000055 - Sawis 2mg Cpr',
system: 'https://terminology.eds.aphp.fr/smt-medicament-ucd'
system: 'https://terminology.eds.aphp.fr/smt-medicament-ucd',
above_levels_ids: '*',
inferior_levels_ids: ''
}
],
prescriptionType: [
Expand All @@ -92,6 +123,7 @@ export const completeMedicationPrescriptionCriteria: MedicationDataType = {
],
encounterService: [
{
label: 'GH RCP',
above_levels_ids: '8312002244',
cohort_id: '6935',
cohort_size: '23',
Expand All @@ -103,7 +135,8 @@ export const completeMedicationPrescriptionCriteria: MedicationDataType = {
source_value: 'H01',
status: undefined,
subItems: undefined,
type: 'Groupe hospitalier (GH)'
type: 'Groupe hospitalier (GH)',
system: System.ScopeTree
}
]
}
Loading
Loading