diff --git a/src/components/CreationCohort/DataList_Criteria.tsx b/src/components/CreationCohort/DataList_Criteria.tsx index 01f048427..0236d4b94 100644 --- a/src/components/CreationCohort/DataList_Criteria.tsx +++ b/src/components/CreationCohort/DataList_Criteria.tsx @@ -16,7 +16,7 @@ import HospitForm from './DiagramView/components/LogicalOperator/components/Crit import services from 'services/aphp' -import { ODD_BIOLOGY, ODD_IMAGING, ODD_MEDICATION, ODD_QUESTIONNAIRE } from '../../constants' +import { ODD_BIOLOGY, ODD_IMAGING, ODD_MEDICATION, ODD_QUESTIONNAIRE, USE_FHIR_CLAIM } from '../../constants' import { CriteriaType, CriteriaTypeLabels } from 'types/requestCriterias' const criteriaList: CriteriaItemType[] = [ @@ -105,17 +105,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 - } - } + ...(USE_FHIR_CLAIM + ? [ + { + id: CriteriaType.CLAIM, + title: CriteriaTypeLabels.CLAIM, + color: '#0063AF', + fontWeight: 'normal', + components: GhmForm, + fetch: { + ghmData: services.cohortCreation.fetchGhmData, + encounterStatus: services.cohortCreation.fetchEncounterStatus + }, + disabled: !USE_FHIR_CLAIM + } + ] + : []) ] }, { diff --git a/src/components/CreationCohort/DiagramView/components/LogicalOperator/components/CriteriaRightPanel/Cim10Form/components/Form/Cim10Form.tsx b/src/components/CreationCohort/DiagramView/components/LogicalOperator/components/CriteriaRightPanel/Cim10Form/components/Form/Cim10Form.tsx index 9f384db27..7322b6683 100644 --- a/src/components/CreationCohort/DiagramView/components/LogicalOperator/components/CriteriaRightPanel/Cim10Form/components/Form/Cim10Form.tsx +++ b/src/components/CreationCohort/DiagramView/components/LogicalOperator/components/CriteriaRightPanel/Cim10Form/components/Form/Cim10Form.tsx @@ -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 { USE_FHIR_EXTRA_SEARCH_PARAM } from 'constants.js' type Cim10FormProps = { isOpen: boolean @@ -205,17 +206,19 @@ const Cim10Form: React.FC = (props) => { onChangeValue('code', value) }} /> - option.label} - isOptionEqualToValue={(option, value) => option.id === value.id} - value={defaultValuesType} - onChange={(e, value) => onChangeValue('diagnosticType', value)} - renderInput={(params) => } - /> + {USE_FHIR_EXTRA_SEARCH_PARAM && ( + option.label} + isOptionEqualToValue={(option, value) => option.id === value.id} + value={defaultValuesType} + onChange={(e, value) => onChangeValue('diagnosticType', value)} + renderInput={(params) => } + /> + )} { )} - - status.label === VitalStatusLabel.DECEASED) - ? VitalStatusOptionsLabel.deceasedAge - : VitalStatusOptionsLabel.age - } - /> - setAge(value)} - onError={(isError) => setError(isError ? Error.INCOHERENT_AGE_ERROR : Error.NO_ERROR)} - deidentified={deidentified} - /> - + {USE_FHIR_EXTRA_SEARCH_PARAM && ( + + status.label === VitalStatusLabel.DECEASED) + ? VitalStatusOptionsLabel.deceasedAge + : VitalStatusOptionsLabel.age + } + /> + setAge(value)} + onError={(isError) => setError(isError ? Error.INCOHERENT_AGE_ERROR : Error.NO_ERROR)} + deidentified={deidentified} + /> + + )} {!deidentified && vitalStatus && (vitalStatus.length === 0 || diff --git a/src/components/CreationCohort/DiagramView/components/LogicalOperator/components/CriteriaRightPanel/DocumentsForm/DocumentsForm.tsx b/src/components/CreationCohort/DiagramView/components/LogicalOperator/components/CriteriaRightPanel/DocumentsForm/DocumentsForm.tsx index c43918b47..1f4d8601c 100644 --- a/src/components/CreationCohort/DiagramView/components/LogicalOperator/components/CriteriaRightPanel/DocumentsForm/DocumentsForm.tsx +++ b/src/components/CreationCohort/DiagramView/components/LogicalOperator/components/CriteriaRightPanel/DocumentsForm/DocumentsForm.tsx @@ -38,6 +38,7 @@ import SearchInput from 'components/ui/Searchbar/SearchInput' import { BlockWrapper } from 'components/ui/Layout' import OccurenceInput from 'components/ui/Inputs/Occurences' import { SourceType } from 'types/scope' +import { USE_FHIR_EXTRA_SEARCH_PARAM } from 'constants.js' const defaultComposition: Omit = { type: CriteriaType.DOCUMENTS, @@ -272,16 +273,18 @@ const DocumentsForm: React.FC = (props) => { }} /> - - _onChangeValue('docStatuses', value)} - options={docStatuses} - value={defaultValues.docStatuses || undefined} - renderInput={(params) => } - /> - + {USE_FHIR_EXTRA_SEARCH_PARAM && ( + + _onChangeValue('docStatuses', value)} + options={docStatuses} + value={defaultValues.docStatuses || undefined} + renderInput={(params) => } + /> + + )} - - - setDuration(value)} - onError={(isError) => setError(isError ? Error.INCOHERENT_AGE_ERROR : Error.NO_ERROR)} - placeholderType="encounter" - /> - + {USE_FHIR_EXTRA_SEARCH_PARAM && ( + + + setDuration(value)} + onError={(isError) => setError(isError ? Error.INCOHERENT_AGE_ERROR : Error.NO_ERROR)} + placeholderType="encounter" + /> + + )} - - - - Début de prise en charge - - setEncounterStartDate(newStartDate)} - onError={(isError) => setError(isError ? Error.INCOHERENT_AGE_ERROR : Error.NO_ERROR)} - includeNullValues={includeEncounterStartDateNull} - onChangeIncludeNullValues={(includeNullValues) => setIncludeEncounterStartDateNull(includeNullValues)} - /> - - Fin de prise en charge - - - - - setEncounterEndDate(newEndDate)} - onError={(isError) => setError(isError ? Error.INCOHERENT_AGE_ERROR : Error.NO_ERROR)} - includeNullValues={includeEncounterEndDateNull} - onChangeIncludeNullValues={(includeNullValues) => setIncludeEncounterEndDateNull(includeNullValues)} - /> - + {USE_FHIR_EXTRA_SEARCH_PARAM && ( + + + + Début de prise en charge + + setEncounterStartDate(newStartDate)} + onError={(isError) => setError(isError ? Error.INCOHERENT_AGE_ERROR : Error.NO_ERROR)} + includeNullValues={includeEncounterStartDateNull} + onChangeIncludeNullValues={(includeNullValues) => setIncludeEncounterStartDateNull(includeNullValues)} + /> + + Fin de prise en charge + + + + + setEncounterEndDate(newEndDate)} + onError={(isError) => setError(isError ? Error.INCOHERENT_AGE_ERROR : Error.NO_ERROR)} + includeNullValues={includeEncounterEndDateNull} + onChangeIncludeNullValues={(includeNullValues) => setIncludeEncounterEndDateNull(includeNullValues)} + /> + + )} @@ -307,18 +313,20 @@ const EncounterForm = ({ renderInput={(params) => } /> - - option.label} - isOptionEqualToValue={(option, value) => option.id === value.id} - value={typeDeSejour} - onChange={(e, value) => setTypeDeSejour(value)} - renderInput={(params) => } - /> - + {USE_FHIR_EXTRA_SEARCH_PARAM && ( + + option.label} + isOptionEqualToValue={(option, value) => option.id === value.id} + value={typeDeSejour} + onChange={(e, value) => setTypeDeSejour(value)} + renderInput={(params) => } + /> + + )} setAdmissionMode(value)} renderInput={(params) => } /> - - option.label} - isOptionEqualToValue={(option, value) => option.id === value.id} - value={admission} - onChange={(e, value) => setAdmission(value)} - renderInput={(params) => } - /> + {USE_FHIR_EXTRA_SEARCH_PARAM && ( + option.label} + isOptionEqualToValue={(option, value) => option.id === value.id} + value={admission} + onChange={(e, value) => setAdmission(value)} + renderInput={(params) => } + /> + )} - - - option.label} - isOptionEqualToValue={(option, value) => option.id === value.id} - value={entryMode} - onChange={(e, value) => setEntryMode(value)} - renderInput={(params) => } - /> + {USE_FHIR_EXTRA_SEARCH_PARAM && ( + + + option.label} + isOptionEqualToValue={(option, value) => option.id === value.id} + value={entryMode} + onChange={(e, value) => setEntryMode(value)} + renderInput={(params) => } + /> - option.label} - isOptionEqualToValue={(option, value) => option.id === value.id} - value={exitMode} - onChange={(e, value) => setExitMode(value)} - renderInput={(params) => } - /> + option.label} + isOptionEqualToValue={(option, value) => option.id === value.id} + value={exitMode} + onChange={(e, value) => setExitMode(value)} + renderInput={(params) => } + /> - option.label} - isOptionEqualToValue={(option, value) => option.id === value.id} - value={reason} - onChange={(e, value) => setReason(value)} - renderInput={(params) => } - /> - - - - - option.label} - isOptionEqualToValue={(option, value) => option.id === value.id} - value={destination} - onChange={(e, value) => setDestination(value)} - renderInput={(params) => } - /> + option.label} + isOptionEqualToValue={(option, value) => option.id === value.id} + value={reason} + onChange={(e, value) => setReason(value)} + renderInput={(params) => } + /> + + + )} + {USE_FHIR_EXTRA_SEARCH_PARAM && ( + + + option.label} + isOptionEqualToValue={(option, value) => option.id === value.id} + value={destination} + onChange={(e, value) => setDestination(value)} + renderInput={(params) => } + /> - option.label} - isOptionEqualToValue={(option, value) => option.id === value.id} - value={provenance} - onChange={(e, value) => setProvenance(value)} - renderInput={(params) => } - /> - - + option.label} + isOptionEqualToValue={(option, value) => option.id === value.id} + value={provenance} + onChange={(e, value) => setProvenance(value)} + renderInput={(params) => } + /> + + + )} {!isEdition && (