-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(refactor)03-3321: Move encounter role(s) logic to the encounter-form component #300
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh i see ,,, thanks @CynthiaKamau |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @gitcliff
const [fields, setFields] = useState<Array<FormField>>([]); | ||
const [encounterLocation, setEncounterLocation] = useState(null); | ||
const [encounterDate, setEncounterDate] = useState(formSessionDate); | ||
const [encounterProvider, setEncounterProvider] = useState(provider); | ||
const [encounterRole, setEncounterRole] = useState(role); | ||
const [encounterRole, setEncounterRole] = useState(newEncounterRole?.uuid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't correctly initialise the encounterRole
state, it will introduce a regression for forms without a field capturing an encounter role.
@@ -86,11 +85,12 @@ const EncounterForm: React.FC<EncounterFormProps> = ({ | |||
isSubmitting, | |||
}) => { | |||
const { t } = useTranslation(); | |||
const { newEncounterRole, isLoading: isLoadingEncounterRole } = useEncounterRole(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would treat this more like a "default" role.
Requirements
Summary
PR is enabling the loading of encounter roles from the encounter-form component
Screenshots
Related Issue
https://openmrs.atlassian.net/browse/O3-3321
Other