[HTML Form Entry] Use <obsFromFragment> datetimepicker value as encounter datetime

Tags: #<Tag:0x00007f3029147b88> #<Tag:0x00007f3029147ac0> #<Tag:0x00007f30291479f8>

Hello,

We are using <obsFromFragment> with commons-ui-datetimepicker in our HTML forms at multiple places. At certain places, we want to use the selected datetime value as encounterDatetime. Is it possible to use some store some <obs> value as encounter_datetime and not store as obs?

Below is how it is defined:

<obsFromFragment
        fragment="field/datetimepicker"
        provider="uicommons"
        conceptId="12345"
        initFragmentParamName="defaultDate"
       fragmentParams="formFieldName=assessmentDate/>

We want to avoid the the <encounterDatetime> tag for selection since it looks a totally different control on the UI.

CC: @mksd @ssmusoke @dkayiwa @rrameshbtech @vasanth2019

@mogoodrich would it be conceivable to upgrade the datetime picker widget behind <encounterDatetime/>?

@mddubey, the thing is <obs*/> tags record obs, and I think it should stay that way.

1 Like

Yes @mksd. Sure, it should be like that. Just checking if there was a way to say use this obs value as datetime.

@mksd @mogoodrich,

While using the datetimepicker with endDate param, it is leading to strange behaviour in a locale other than en.

This is how it looks like in when the locale is fr.

image

The start date is December 1989. If we remove the parameter endDate=$formGeneratedDatetime it all works fine.

While debugging the htmlFormEntry module, I found out we are setting the value as below in FormEntrySession.java:

velocityContext.put("formGeneratedDatetime", new Date());

Should this be somehow locale-sensitive/format-sensitive date? We have not been able to get it working.

CC: @dkayiwa @ssmusoke

@mddubey our distro might be doing some funny things with date formats, confusing the date picker. Can you validate that this also happens on QA Ref App?