Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
pl-buiquang committed Dec 5, 2024
1 parent f66f277 commit a8558b2
Show file tree
Hide file tree
Showing 49 changed files with 1,216 additions and 655 deletions.
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.example.json
163 changes: 163 additions & 0 deletions public/config.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
{
"core": {
"codeSystems": {
"docStatus": "http://hl7.org/fhir/CodeSystem/composition-status"
},
"extensions": {
},
"perimeterSourceTypeHierarchy": [
"hospital","hospital_depart","hospital_serv"
],
"valueSets": {
"demographicGender": {
"url": "https://terminology.eds.aphp.fr/aphp-orbis-patient-genre"
},
"encounterAdmission": {
"url": "https://terminology.eds.aphp.fr/aphp-orbis-visit-type-admission"
},
"encounterAdmissionMode": {
"url": "https://terminology.eds.aphp.fr/aphp-orbis-visit-motif-admission"
},
"encounterDestination": {
"url": "https://terminology.eds.aphp.fr/aphp-orbis-visit-destination"
},
"encounterEntryMode": {
"url": "https://terminology.eds.aphp.fr/aphp-orbis-visit-mode-entree"
},
"encounterExitMode": {
"url": "https://terminology.eds.aphp.fr/aphp-orbis-visit-mode-sortie"
},
"encounterExitType": {
"url": "https://terminology.eds.aphp.fr/aphp-orbis-visit-type-sortie"
},
"encounterFileStatus": {
"url": "https://terminology.eds.aphp.fr/aphp-orbis-visite-status"
},
"encounterProvenance": {
"url": "https://terminology.eds.aphp.fr/aphp-orbis-visit-provenance"
},
"encounterSejourType": {
"url": "https://terminology.eds.aphp.fr/aphp-orbis-type-sejour"
},
"encounterStatus": {
"url": "http://hl7.org/fhir/CodeSystem/encounter-status"
},
"encounterVisitType": {
"url": "https://terminology.eds.aphp.fr/aphp-orbis-visit-type"
}
},
"fhir": {
"valueSetExploration": false,
"facetsExtensions": false,
"filterActive": false,
"totalCount": true,
"selectedCodeOnly": false,
"extraSearchParams": false,
"resourceLists": false,
"textSearch": false,
"valuesetExpansion": false
}
},
"features": {
"claim": {
"enabled": false
},
"cohort": {
"enabled": true,
"shortCohortLimit": 2000
},
"condition": {
"enabled": true,
"valueSets": {
"conditionHierarchy": {
"url": "https://smt.esante.gouv.fr/terminologie-cim-10/"
},
"conditionStatus": {
"url": "https://terminology.eds.aphp.fr/aphp-orbis-condition-status"
}
}
},
"contact": {
"enabled": false
},
"export": {
"enabled": false,
"exportLinesLimit": 300000
},
"feasabilityReport": {
"enabled": false
},
"imaging": {
"enabled": true,
"extensions": {},
"valueSets": {
"imagingModalities": {
"url": "https://dicom.nema.org/medical/dicom/current/output/chtml/part16/sect_CID_33.html"
}
}
},
"locationMap": {
"enabled": false
},
"medication": {
"enabled": true,
"valueSets": {
"medicationAdministrations": {
"url": "https://terminology.eds.aphp.fr/aphp-orbis-medicament-voie-administration"
},
"medicationAtc": {
"url": "https://terminology.eds.aphp.fr/atc"
},
"medicationAtcOrbis": {
"url": "https://terminology.eds.aphp.fr/aphp-orbis-medicament-atc-article"
},
"medicationPrescriptionTypes": {
"url": "https://terminology.eds.aphp.fr/aphp-medicament-type-prescription"
},
"medicationUcd": {
"url": "https://terminology.eds.aphp.fr/smt-medicament-ucd"
}
},
"useMedicationAtcUcdCodes": false
},
"observation": {
"enabled": true,
"valueSets": {
"biologyHierarchyAnabio": {
"url": "https://terminology.eds.aphp.fr/aphp-itm-anabio"
},
"biologyHierarchyLoinc": {
"url": "https://terminology.eds.aphp.fr/aphp-itm-loinc"
}
},
"useObservationValueRestriction": false,
"useObservationDefaultValidated": false
},
"procedure": {
"enabled": true,
"valueSets": {
"procedureHierarchy": {
"url": "https://www.atih.sante.fr/plateformes-de-transmission-et-logiciels/logiciels-espace-de-telechargement/id_lot/3550"
}
}
},
"questionnaires": {
"enabled": false
}
},
"labels": {
"exploration": "Exploration"
},
"system": {
"codeDisplayJWT": "ArrowUp,ArrowUp,ArrowDown,ArrowDown,ArrowLeft,ArrowRight,ArrowLeft,ArrowRight,b,a,Enter",
"oidc": {
"clientId": "cohort360",
"issuer": "http://172.28.0.20:8080/realms/cohort/protocol/openid-connect/auth",
"redirectUri": "http://localhost:8003",
"responseType": "code",
"scope": "openid",
"state": "mlTPASu3bwdFmFUSK4G4ImecrsKW9pQ7SDdf7uB"
},
"wsProtocol": "ws://"
}
}
28 changes: 17 additions & 11 deletions src/components/CreationCohort/DataList_Criteria.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const criteriaList: () => CriteriaItemType[] = () => {
const ODD_IMAGING = getConfig().features.imaging.enabled
const ODD_MEDICATION = getConfig().features.medication.enabled
const ODD_DOCUMENT_REFERENCE = getConfig().features.documentReference.enabled
const ODD_CLAIM = getConfig().features.claim.enabled
return [
{
id: CriteriaType.REQUEST,
Expand Down Expand Up @@ -112,17 +113,22 @@ const criteriaList: () => CriteriaItemType[] = () => {
encounterStatus: services.cohortCreation.fetchEncounterStatus
}
},
{
id: CriteriaType.CLAIM,
title: CriteriaTypeLabels.CLAIM,
color: '#0063AF',
fontWeight: 'normal',
components: GhmForm,
fetch: {
ghmData: services.cohortCreation.fetchGhmData,
encounterStatus: services.cohortCreation.fetchEncounterStatus
}
}
...(ODD_CLAIM
? [
{
id: CriteriaType.CLAIM,
title: CriteriaTypeLabels.CLAIM,
color: '#0063AF',
fontWeight: 'normal',
components: GhmForm,
fetch: {
ghmData: services.cohortCreation.fetchGhmData,
encounterStatus: services.cohortCreation.fetchEncounterStatus
},
disabled: !ODD_CLAIM
}
]
: [])
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ export const defaultBiology: Omit<ObservationDataType, 'id'> = {

const Index = (props: CriteriaDrawerComponentProps) => {
const { criteriaData, selectedCriteria, onChangeSelectedCriteria, goBack } = props
const config = useContext(AppConfig)
const appConfig = useContext(AppConfig)
const { classes } = useStyles()
const [selectedTab, setSelectedTab] = useState<'form' | 'hierarchy' | 'search'>(
selectedCriteria ? 'form' : 'hierarchy'
selectedCriteria || !appConfig.core.fhir.valueSetExploration ? 'form' : 'hierarchy'
)
const [defaultCriteria, setDefaultCriteria] = useState<ObservationDataType>(
(selectedCriteria as ObservationDataType) || defaultBiology
Expand Down Expand Up @@ -83,8 +83,8 @@ const Index = (props: CriteriaDrawerComponentProps) => {
value={selectedTab}
onChange={(e, tab) => setSelectedTab(tab)}
>
<Tab label={config.labels.exploration} value="hierarchy" />
<Tab label="Recherche" value="search" />
{appConfig.core.fhir.valueSetExploration && <Tab label={appConfig.labels.exploration} value="hierarchy" />}
{appConfig.core.fhir.valueSetExploration && <Tab label="Recherche" value="search" />}
<Tab label="Formulaire" value="form" />
</Tabs>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react'
import React, { useContext, useEffect, useState } from 'react'
import { Tab, Tabs } from '@mui/material'

import useStyles from './styles'
Expand All @@ -13,6 +13,7 @@ import { EXPLORATION } from '../../../../../../../..//constants'
import { CriteriaDrawerComponentProps } from 'types'
import { CcamDataType, Comparators, CriteriaType } from 'types/requestCriterias'
import { Hierarchy } from 'types/hierarchy'
import { AppConfig } from 'config'

export const defaultProcedure: Omit<CcamDataType, 'id'> = {
type: CriteriaType.PROCEDURE,
Expand All @@ -32,7 +33,10 @@ export const defaultProcedure: Omit<CcamDataType, 'id'> = {

const Index = (props: CriteriaDrawerComponentProps) => {
const { criteriaData, selectedCriteria, onChangeSelectedCriteria, goBack } = props
const [selectedTab, setSelectedTab] = useState<'form' | 'hierarchy'>(selectedCriteria ? 'form' : 'hierarchy')
const appConfig = useContext(AppConfig)
const [selectedTab, setSelectedTab] = useState<'form' | 'hierarchy'>(
selectedCriteria || !appConfig.core.fhir.valueSetExploration ? 'form' : 'hierarchy'
)
const [defaultCriteria, setDefaultCriteria] = useState<CcamDataType>(
(selectedCriteria as CcamDataType) || defaultProcedure
)
Expand Down Expand Up @@ -81,7 +85,7 @@ const Index = (props: CriteriaDrawerComponentProps) => {
value={selectedTab}
onChange={(e, tab) => setSelectedTab(tab)}
>
<Tab label={EXPLORATION} value="hierarchy" />
{appConfig.core.fhir.valueSetExploration && <Tab label={EXPLORATION} value="hierarchy" />}
<Tab label="Formulaire" value="form" />
</Tabs>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState } from 'react'
import React, { useContext, useState } from 'react'

import {
Alert,
Expand Down Expand Up @@ -31,6 +31,7 @@ import { BlockWrapper } from 'components/ui/Layout'
import OccurenceInput from 'components/ui/Inputs/Occurences'
import { SourceType } from 'types/scope'
import { Hierarchy } from 'types/hierarchy'
import { AppConfig } from 'config'

type Cim10FormProps = {
isOpen: boolean
Expand All @@ -50,7 +51,7 @@ enum Error {

const Cim10Form: React.FC<Cim10FormProps> = (props) => {
const { isOpen, isEdition, criteriaData, selectedCriteria, onChangeValue, onChangeSelectedCriteria, goBack } = props

const appConfig = useContext(AppConfig)
const { classes } = useStyles()
const dispatch = useAppDispatch()
const initialState: HierarchyTree | null = useAppSelector((state) => state.syncHierarchyTable)
Expand Down Expand Up @@ -205,17 +206,19 @@ const Cim10Form: React.FC<Cim10FormProps> = (props) => {
onChangeValue('code', value)
}}
/>
<Autocomplete
multiple
id="criteria-cim10-type-autocomplete"
className={classes.inputItem}
options={criteriaData.data.diagnosticTypes || []}
getOptionLabel={(option) => option.label}
isOptionEqualToValue={(option, value) => option.id === value.id}
value={defaultValuesType}
onChange={(e, value) => onChangeValue('diagnosticType', value)}
renderInput={(params) => <TextField {...params} label="Type de diagnostic" />}
/>
{appConfig.core.fhir.extraSearchParams && (
<Autocomplete
multiple
id="criteria-cim10-type-autocomplete"
className={classes.inputItem}
options={criteriaData.data.diagnosticTypes || []}
getOptionLabel={(option) => option.label}
isOptionEqualToValue={(option, value) => option.id === value.id}
value={defaultValuesType}
onChange={(e, value) => onChangeValue('diagnosticType', value)}
renderInput={(params) => <TextField {...params} label="Type de diagnostic" />}
/>
)}
<Autocomplete
multiple
options={criteriaData.data.encounterStatus || []}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react'
import React, { useContext, useEffect, useState } from 'react'
import { Tab, Tabs } from '@mui/material'

import Cim10Form from './components/Form/Cim10Form'
Expand All @@ -12,6 +12,7 @@ import { EXPLORATION } from '../../../../../../../../constants'
import { CriteriaDrawerComponentProps } from 'types'
import { Cim10DataType, Comparators, CriteriaType } from 'types/requestCriterias'
import { Hierarchy } from 'types/hierarchy'
import { AppConfig } from 'config'

export const defaultCondition: Omit<Cim10DataType, 'id'> = {
type: CriteriaType.CONDITION,
Expand All @@ -31,7 +32,10 @@ export const defaultCondition: Omit<Cim10DataType, 'id'> = {

const Index = (props: CriteriaDrawerComponentProps) => {
const { criteriaData, selectedCriteria, onChangeSelectedCriteria, goBack } = props
const [selectedTab, setSelectedTab] = useState<'form' | 'hierarchy'>(selectedCriteria ? 'form' : 'hierarchy')
const appConfig = useContext(AppConfig)
const [selectedTab, setSelectedTab] = useState<'form' | 'hierarchy'>(
selectedCriteria || !appConfig.core.fhir.valueSetExploration ? 'form' : 'hierarchy'
)
const [defaultCriteria, setDefaultCriteria] = useState<Cim10DataType>(
(selectedCriteria as Cim10DataType) || defaultCondition
)
Expand Down Expand Up @@ -80,7 +84,7 @@ const Index = (props: CriteriaDrawerComponentProps) => {
value={selectedTab}
onChange={(e, tab) => setSelectedTab(tab)}
>
<Tab label={EXPLORATION} value="hierarchy" />
{appConfig.core.fhir.valueSetExploration && <Tab label={EXPLORATION} value="hierarchy" />}
<Tab label="Formulaire" value="form" />
</Tabs>

Expand Down
Loading

0 comments on commit a8558b2

Please sign in to comment.