ObsAcrossEncounter Widgets - control datetime format and display encounter provider name

Hi everyone,

I was wondering if you could give your thoughts about improving ObsAcrossEncounter widgets in order to be possible to control the datetime format for date column (widget default) and also have the possibility to display the ecnounter provider name.

Maybe the widget app configuration could have something like:

"config" : {
    ...
    "datetimeFormat" : "dd-mm-yyyy HH:mm",
    "showEncounterProviderName" : "TRUE",
},

What are your thoughts on this?

Thank you!

cc: @mksd @bistenes @mogoodrich

1 Like

Seems reasonable to me @ifernandes !

1 Like

@ifernandes Looks good! Is it possible to have this across all the widgets too - I know you may not be focusing on it but IMO

  1. Have a default config for dateTimeFormat across all the widgets
  2. Enable this to be overridden by a new one from the config
1 Like

Thanks @ifernandes.

While I like to have the ability to specify the datetime format, I also think that there should be a way to say that we want either date only or date + time while inheriting UIFR’s global format for datetimes (here or here).

1 Like

Hi @ssmusoke ,

Thanks for your insights. Just a few questions so that I can open an improvement that covers your topics:

1. Have a default config for dateTimeFormat across all the widgets

There are some widgets that have already this option (dateFormat) : Programs List, Program Status, Programs History. So here there is no need to change anything. About other widgets we can add dateFormat or dateTimeFormat.

I think we should add dateFormat to next widgets:

  • ObsGraph
  • RecentVisitByEncounterType

And dateTimeFormat for:

  • Obs Across Encounters
  • Bahmni Appointments Widget

Next widgets don’t seem to have dates or use different time measure (eg. Today 11:15), so no actions are needed:

  • Latest Obs For Concept List
  • Data Integrity Violations
  • Relationships
  • Dispensed Medication.

Please let me know if it makes sense.

Thank you!

@ifernandes

  1. The Latest Obs for Concept List will have a date format to display the value of the Obs which has a date value, it is similar to the Obs Across Encounter widget

  2. I am not sure about the Dispensed Medication widget maybe @mogoodrich may be of help there.

What is the determination between dateFormat and dateTimeFormat?

@ssmusoke are you sure about latest obs for concept list? Because I only see next format for each concept date:

image

Unless you are talking about date format of date concepts: image

dateFormat should be used when we want the config to have ‘DD-MM-YYYY’ or ‘DD.MMM.YYYY’ and dateTimeFormat when the config should have ‘DD-MM-YYYY HH:mm:ss’ or ‘DD.MMM.YYYY HH:mm’.

If we use dateTimeFormat conotation on obsgraph widget config, for instance, it may lead the user into error. In other words, the user can use ‘DD-MM-YYYY HH:mm:ss’ in the configuration and we will have a datetime format in the graphics, which doesn’t seem to make much sense to me.

Check config differences below:

"config" : {
     ... "dateTimeFormat" : "DD-MM-YYYY HH:mm:ss"
}, 
"config" : {
     ... "dateFormat" : "DD-MM-YYYY"
}, 

Please let me know you thoughts on this. Thanks!

@ifernandes I was thinking of the concept date, and seems like everything is probably for dateFormat - we can start with that and see how else others use the widgets

1 Like