Latest Obs For Concept List Dashboard Widget to be configurable for n latest observations for each concept

Tags: #<Tag:0x00007f302b8f6968>

Continuing discussion from Speeding up Clinician Facing Dashboard - Dashboard Widgets .

I’m working with an implementation that requires for a number of latest observations to be view-able for the same concept on a dashboard. This is because it is possible with this implementation to record multiple observations with a particular check list.

We’d like to extend the “Latest Obs For Concept List Dashboard Widget” to make this possible. What is currently possible is displaying the “one most recent observation” for a concept which in our case displays the very lastly checked observation on a check list for example.

I created RA-1665 that would allow for backwards compatibility of the widget and at the same time allow configuration of “n latest observations” for a concept. I would like to receive thoughts on this. Thanks.

cc: @ssmusoke, @dkayiwa, @mksd, @mogoodrich

@ruhanga Wouldn’t the encounters widget be the right one for this, since it shows the values of the obs across multiple encounters?

What am I missing?

Thanks @ssmusoke, I think this could work if we were interested in observations across encounters. What we’d like to achieve is a way of displaying multiple observations for a concept from the same encounter. And BTW, the encounters widget also displays the latest observation for a concept of an encounter. We would maybe also have to adjust the “encounters widget” to achieve similar outcomes.

For example displaying as many obs as checked below, multiple_obs_for_concept

@ssmusoke in effect what we want is a “latest obs group” widget. Or rather the latest obs widget to handle groups.

1 Like

@mksd Thank you for that clarification - yes handling obsgroups was on the cards, but never found the need

So the question is what are the comma delimited values of conceptId? Is this the obsgroup or the concepts within the obsgroup?

If one of those concept IDs happens to point to an obs group, then we need to find a way to display that obs group.

I guess we should limit ourselves to a single layer of grouping. Because of course obs groups can be indefinitely nested… A single line does not offer many display options so we should probably do something like:

If the concept ID points to an obs group then produce a display string of the first layer of nested obs.

@mksd additional things to think about:

  1. When displaying the contents of an obs group, is all the available data shown, what happens when there are 10 items in the group, are they all shown
  2. An obs group is considered a single concept
  3. Not sure about the display, but I am thinking that the obsgroup concept name will be displayed, and the other concepts displayed under it but indented. If not do share a mockup (can be built in HTML - thats what I did for the other widget mockups)
  4. What is the purpose of the nLatestObs variable - it is not clear to me in light of Item 1 above

Ideally, all the contents of the obs group would be displayed as this is the desired outcome.

This was a quick work around to achieve no.1. It makes more sense though to use obs groups than nLatestObs.

Yes.

That’s exactly the use case that we need to cover.

The obs concept name is always on the LHS anyway. It will be the same for obs groups concept names.

I don’t know, if one wants to report on a specific obs in a group, they would target it through its defining concept directly, there is no reason to access its latest data through the containing group.

@ssmusoke “concept note” is a bit overkill to describe this document, but here is what we would need: https://docs.google.com/document/d/1NHWpvfRVcVi3YejiUFoQbQ5ETH6gMMuZQsJl2lzxmSY

@ruhanga to expand on how the extra JSON attributes would look like.

@ruhanga thanks for updating the note, the key part would be this new configuration:

"obsGroupLabels": "none || FSN || shortName"

This would drive whether the level-1 obs of an obs group should be labelled, the three options being

  1. No.
  2. Yes, with the FSN.
  3. Yes with the short name.

@ssmusoke, thoughts?

1 Like