import { Controller, useFormContext } from 'react-hook-form'; import { RangeControl } from "../ui/range-control"; import { Divider } from '../ui/divider'; import { Heading } from '../ui/heading'; import { Spacer } from '../ui/spacer'; import { useValueSetServiceContext } from '../../services'; import { useEffect } from 'react'; interface FhirRangeProps { label: string; context: string; lowMin?: number; lowMax?: number; highMin?: number; highMax?: number; disabled?: boolean; readonly?: boolean; } const FhirRange = ({ label, context, lowMin = 0, lowMax = 100, highMin = 0, highMax = 100, disabled = false, readonly = false }: FhirRangeProps) => { const { control, setValue } = useFormContext(); const { ucumSystemUrl } = useValueSetServiceContext(); const spacerMargin = '24px'; useEffect(() => { setValue(`${context}.low.system`, ucumSystemUrl); setValue(`${context}.high.system`, ucumSystemUrl); }, [context, ucumSystemUrl]); return ( <> {label} ( )}/> ( )}/> ); }; export default FhirRange;