Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can you describe why this is needed? Is there a ticket for this change? What problem are you trying to solve?
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 was needed within the sequence of an issue identified on patient-grid. The patient-grid uses module-reporting to retrieve data for populating the grid. An issue arises when the same concept is reused within a single form. patient-grid lacks sufficient data to correlate observations with their respective columns.
On patient-grid, module-reporting DataSetDefinitionServiceImpl is invoked here and, on the 1st arg, column data is passed. Foreach column, reporting-module invokes patient-grid's ObsForLatestEncounterPatientDataEvaluator.evaluate. However, the challenge here is that there is no provided data that allows us to identify the specific column being processed. Currently, fetching observations relies solely on encounter and concept, which can lead to multiple matching observations, differing only in their formNamespaceAndPath.
The inclusion of column data within the ObsForLatestEncounterPatientDataEvaluator.evaluate will allow us to correlate the obs formNamespaceAndPath with the right column.
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 @icrc-psousa . Could you configure things to pass the necessary information as a configuration parameter from your data set definition down to your data definition. Can you show me where these data set and data definitions are constructed and configured?
Just looking at your commit here icrc/openmrs-module-patientgrid@173fde6 it seems that it would help if your data definition could be configured with
formNamespaceAndPath
in addition to concept and encounterType, and then if this is present you could just match on it directly.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.
Data set definition is constructed here. I missed the fact that it's populated on patient-grid side.
We can include the
formNamespaceAndPath
and other required data, if needed, on patient-grid side here on this data definition as you've suggested. Thanks for your input @mseaton!This PR on module-reporting won't be needed.