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

(feat) Add ability to filter observations in the generic patient widget app by encounter type #854

Conversation

icrc-agomes
Copy link
Contributor

@icrc-agomes icrc-agomes commented Nov 3, 2022

Requirements

  • This PR has a title that briefly describes the work done, including the ticket number if there is a ticket.
  • My work conforms to the OpenMRS 3.0 Styleguide.
  • My work includes tests or is validated by existing tests.

Summary

In esm-generic-patient-widgets-app, it was needed to implement the filter of observations endpoint by encounter type. Some changes were also made in the mock data for testing.

Related Issue

This branch is a continuation of this pull request #827

@gracepotma
Copy link
Contributor

gracepotma commented Nov 8, 2022

Requesting review by @vasharma05. FYI Vineet, @ibacher was reviewing #827 and believes this should be good to go, but great if you can review this one. FYI ICRC is blocked by this.
CC for your awareness, @denniskigen

@gracepotma gracepotma requested a review from vasharma05 November 8, 2022 20:10
Copy link
Member

@denniskigen denniskigen left a comment

Choose a reason for hiding this comment

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

Generally looks good. I've left a few comments to address then this should be good to go.

const { data } = useConfig();
const { encounterTypes, data } = useConfig();

const UrlEncounterTypes: string = encounterTypes.length ? `&encounter.type=${encounterTypes.toString()}` : '';
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const UrlEncounterTypes: string = encounterTypes.length ? `&encounter.type=${encounterTypes.toString()}` : '';
const urlEncounterTypes: string = encounterTypes.length ? `&encounter.type=${encounterTypes.toString()}` : '';

Copy link
Member

Choose a reason for hiding this comment

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

Seems better to name this variable encounterTypes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used the suggested change 'urlEncounterTypes'

_description: 'Displayed graph by default',
_default: true,
},
encounterTypes: {
Copy link
Member

Choose a reason for hiding this comment

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

We should have a _description for this property as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Parameter added

@denniskigen denniskigen changed the title Filter by encounter types implemented in observation endpoint on esm-generic-patient-widgets-app (feat) Add ability to filter observations in the generic patient widget app by encounter type Nov 10, 2022
Copy link
Contributor

@hadijahkyampeire hadijahkyampeire left a comment

Choose a reason for hiding this comment

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

Looks Good, thanks @icrc-agomes 👍 , except for the merge conflicts, otherwise, we can merge it.

@icrc-agomes
Copy link
Contributor Author

Looks Good, thanks @icrc-agomes 👍 , except for the merge conflicts, otherwise, we can merge it.

@hadijahkyampeire conflicts fixed :) Thanks.

@hadijahkyampeire hadijahkyampeire merged commit e7c4d8c into openmrs:main Nov 17, 2022
icrc-agomes added a commit to icrc-agomes/openmrs-esm-patient-chart that referenced this pull request Dec 19, 2022
…et app by encounter type (openmrs#854)

* Filter by encounter types implemented in observation endpoint on esm-generic-patient-widgets-app 2#

* esm-generic-patient-widgets-app mock data for testing changed

* Changes made in variables, tests and data structure

Co-authored-by: Andre Gomes <[email protected]>
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