Skip to content

Commit

Permalink
corrections sonar cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
aetchego committed Dec 5, 2024
1 parent 19ff32a commit accca18
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,24 @@ const MedicationForm = (props: CriteriaDrawerComponentProps) => {
}
}, [currentCriteria.type])

const medicationReferences = useMemo(() => {
return getValueSetsFromSystems([
getConfig().features.medication.valueSets.medicationAtc.url,
getConfig().features.medication.valueSets.medicationUcd.url
])
}, [])

useEffect(() => {
const foundCodes = currentCriteria.code
.map((code) =>
criteriaData.data.medicationData.find(
(cacheCode: any) => cacheCode.id === code.id && cacheCode.system === code.system
)
)
.filter((e) => e)
setCurrentCriteria({ ...currentCriteria, code: foundCodes })
}, [])

if (criteriaData?.data?.prescriptionTypes === 'loading' || criteriaData?.data?.administrations === 'loading') {
return <></>
}
Expand Down Expand Up @@ -91,24 +109,6 @@ const MedicationForm = (props: CriteriaDrawerComponentProps) => {
})
: []

const medicationReferences = useMemo(() => {
return getValueSetsFromSystems([
getConfig().features.medication.valueSets.medicationAtc.url,
getConfig().features.medication.valueSets.medicationUcd.url
])
}, [])

useEffect(() => {
const foundCodes = currentCriteria.code
.map((code) =>
criteriaData.data.medicationData.find(
(cacheCode: any) => cacheCode.id === code.id && cacheCode.system === code.system
)
)
.filter((e) => e)
setCurrentCriteria({ ...currentCriteria, code: foundCodes })
}, [])

return (
<Grid className={classes.root}>
<Grid className={classes.actionContainer}>
Expand Down
2 changes: 1 addition & 1 deletion src/utils/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const buildLabelObjectFilter = (criterion: LabelObject[] | undefined | nu
let filter = ''
filter = `${criterion
.map((item) => (system && item.system ? `${item.system}|${item.id}` : item.id))
.reduce(searchReducer)}`
.reduce(searchReducer, '')}`
return filter
}
return ''
Expand Down

0 comments on commit accca18

Please sign in to comment.