Skip to content

Commit

Permalink
feat: add docref config (#1071)
Browse files Browse the repository at this point in the history
  • Loading branch information
pl-buiquang authored Dec 5, 2024
1 parent ec03691 commit d502ad0
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 20 deletions.
4 changes: 3 additions & 1 deletion src/components/CreationCohort/DataList_Criteria.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const criteriaList: () => CriteriaItemType[] = () => {
const ODD_BIOLOGY = getConfig().features.observation.enabled
const ODD_IMAGING = getConfig().features.imaging.enabled
const ODD_MEDICATION = getConfig().features.medication.enabled
const ODD_DOCUMENT_REFERENCE = getConfig().features.documentReference.enabled
return [
{
id: CriteriaType.REQUEST,
Expand Down Expand Up @@ -71,7 +72,8 @@ const criteriaList: () => CriteriaItemType[] = () => {
{
id: CriteriaType.DOCUMENTS,
title: CriteriaTypeLabels.DOCUMENTS,
color: '#0063AF',
color: ODD_DOCUMENT_REFERENCE ? '#0063AF' : '#808080',
disabled: !ODD_DOCUMENT_REFERENCE,
fontWeight: 'bold',
components: DocumentsForm,
fetch: {
Expand Down
6 changes: 6 additions & 0 deletions src/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ type AppConfig = {
procedureHierarchy: ValueSetConfig
}
}
documentReference: {
enabled: boolean
}
claim: {
enabled: boolean
valueSets: {
Expand Down Expand Up @@ -231,6 +234,9 @@ let config: AppConfig = {
procedureHierarchy: { url: '' }
}
},
documentReference: {
enabled: true
},
claim: {
enabled: true,
valueSets: {
Expand Down
55 changes: 36 additions & 19 deletions src/views/Dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const Dashboard: React.FC<{
const appConfig = useContext(AppConfig)
const ODD_IMAGING = appConfig.features.imaging.enabled
const ODD_QUESTIONNAIRES = appConfig.features.questionnaires.enabled
const ODD_DOCUMENT_REFERENCE = appConfig.features.documentReference.enabled

const [searchParams] = useSearchParams()
const groupIds = getCleanGroupId(searchParams.get('groupId'))
Expand All @@ -55,15 +56,19 @@ const Dashboard: React.FC<{
case 'patients':
setTabs([
// { label: 'Création cohorte', value: 'creation', to: `/cohort/new`, disabled: true },
{ label: 'Aperçu', value: 'preview', to: '/my-patients/preview' },
{ label: 'Patients', value: 'patients', to: '/my-patients/patients' },
{ label: 'Documents', value: 'documents', to: '/my-patients/documents' },
{ label: 'PMSI', value: 'pmsi', to: '/my-patients/pmsi' },
{ label: 'Médicaments', value: 'medication', to: '/my-patients/medication' },
{ label: 'Biologie', value: 'biology', to: '/my-patients/biology' },
...(ODD_IMAGING ? [{ label: 'Imagerie', value: 'imaging', to: '/my-patients/imaging' }] : []),
{ label: 'Aperçu', value: 'preview', to: '/my-patients/preview', disabled: false },
{ label: 'Patients', value: 'patients', to: '/my-patients/patients', disabled: false },
...(ODD_DOCUMENT_REFERENCE
? [{ label: 'Documents', value: 'documents', to: '/my-patients/documents', disabled: false }]
: []),
{ label: 'PMSI', value: 'pmsi', to: '/my-patients/pmsi', disabled: false },
{ label: 'Médicaments', value: 'medication', to: '/my-patients/medication', disabled: false },
{ label: 'Biologie', value: 'biology', to: '/my-patients/biology', disabled: false },
...(ODD_IMAGING
? [{ label: 'Imagerie', value: 'imaging', to: '/my-patients/imaging', disabled: false }]
: []),
...(ODD_QUESTIONNAIRES && !dashboard.deidentifiedBoolean
? [{ label: 'Formulaires', value: 'forms', to: `/my-patients/forms` }]
? [{ label: 'Formulaires', value: 'forms', to: `/my-patients/forms`, disabled: false }]
: [])
])
break
Expand All @@ -76,11 +81,16 @@ const Dashboard: React.FC<{
},
{ label: 'Aperçu cohorte', value: 'preview', to: `/cohort/preview?groupId=${groupIds}` },
{ label: 'Données patient', value: 'patients', to: `/cohort/patients${location.search}` },
{
label: 'Documents cliniques',
value: 'documents',
to: `/cohort/documents${location.search}`
},
...(ODD_DOCUMENT_REFERENCE
? [
{
label: 'Documents cliniques',
value: 'documents',
to: `/cohort/documents${location.search}`,
disabled: false
}
]
: []),
{ label: 'PMSI', value: 'pmsi', to: `/cohort/pmsi${location.search}` },
{ label: 'Médicaments', value: 'medication', to: `/cohort/medication${location.search}` },
{ label: 'Biologie', value: 'biology', to: `/cohort/biology${location.search}` },
Expand All @@ -95,7 +105,9 @@ const Dashboard: React.FC<{
// { label: 'Création cohorte', value: 'creation', to: `/cohort/new`, disabled: true },
{ label: 'Aperçu cohorte', value: 'preview', to: `/cohort/new/preview`, disabled: true },
{ label: 'Données patient', value: 'patients', to: `/cohort/new/patients`, disabled: true },
{ label: 'Documents cliniques', value: 'documents', to: `/cohort/new/documents`, disabled: true },
...(ODD_DOCUMENT_REFERENCE
? [{ label: 'Documents cliniques', value: 'documents', to: `/cohort/new/documents`, disabled: true }]
: []),
{ label: 'PMSI', value: 'pmsi', to: `/cohort/new/pmsi` },
{ label: 'Médicaments', value: 'medication', to: `/cohort/new/medication` },
{ label: 'Biologie', value: 'biology', to: `/cohort/new/biology` },
Expand All @@ -114,11 +126,16 @@ const Dashboard: React.FC<{
value: 'patients',
to: `/perimeters/patients${location.search}`
},
{
label: 'Documents cliniques',
value: 'documents',
to: `/perimeters/documents${location.search}`
},
...(ODD_DOCUMENT_REFERENCE
? [
{
label: 'Documents cliniques',
value: 'documents',
to: `/perimeters/documents${location.search}`,
disabled: false
}
]
: []),
{ label: 'PMSI', value: 'pmsi', to: `/perimeters/pmsi${location.search}` },
{
label: 'Médicaments',
Expand Down

0 comments on commit d502ad0

Please sign in to comment.