Skip to content
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

Merged
merged 2 commits into from
Jun 4, 2024

Conversation

gitcliff
Copy link
Contributor

@gitcliff gitcliff commented May 29, 2024

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.
  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • My work includes tests or is validated by existing tests.

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

Copy link
Contributor

@CynthiaKamau CynthiaKamau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @gitcliff , looks like this work is related to this

@gitcliff
Copy link
Contributor Author

gitcliff commented May 29, 2024

Thanks @gitcliff , looks like this work is related to this

oh i see ,,, thanks @CynthiaKamau
was just following up on the issue here

Copy link
Contributor

@arodidev arodidev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @gitcliff

@arodidev arodidev requested a review from samuelmale June 4, 2024 14:16
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);
Copy link
Member

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();
Copy link
Member

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.

@samuelmale samuelmale changed the title (feat)03-3321:Move encounter-roles to the encounter-form component (refactor)03-3321: Move encounter role(s) logic to the encounter-form component Jun 4, 2024
@samuelmale samuelmale merged commit 3d30786 into openmrs:main Jun 4, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants