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

Entry format extension has no effect on a date item #1623

Closed
KhumboLihonga opened this issue Sep 22, 2022 · 13 comments
Closed

Entry format extension has no effect on a date item #1623

KhumboLihonga opened this issue Sep 22, 2022 · 13 comments
Assignees
Labels
effort:medium Medium effort - 3 to 5 days P1 High priority issue type:bug Something isn't working

Comments

@KhumboLihonga
Copy link

Describe the bug
Setting the entry format on a date item has no effect.

Component
SDC library

To Reproduce
Steps to reproduce the behavior:

  1. Open the catalog app
  2. Select date picker
  3. The format on the UI is shown as 'dd/MM/y'
  4. But the item in the questionnaire has an entry format of 'yyyy-mm-dd'

Expected behavior
I expect when I select a date using the date picker, it should appear in the format set in the entry format extension.

Screenshots
Below is what the date item looks like with the entry format set to 'yyyy-mm-dd':
Screenshot_20220922-163113_Structured Data Capture Catalog

Smartphone (please complete the following information):

  • Device: Samsung A12
  • Android version: 11
  • Build number: RP1A.200720.012.A127FXXU4AUK1
  • Version: 30

Additional context
N/A

@KhumboLihonga KhumboLihonga added the type:bug Something isn't working label Sep 22, 2022
@KhumboLihonga KhumboLihonga changed the title Entry format extension seemingly has no effect on a date item Entry format extension has no effect on a date item Sep 22, 2022
@Gental-Giant
Copy link

@f-odhiambo Kindly take a look.

@shelaghm
Copy link

Is this because the device date format overrides the extension? what do you think @jingtang10?

@jingtang10
Copy link
Collaborator

@PallaviGanorkar can you please take a look at this?

@Tarun-Bhardwaj Tarun-Bhardwaj added the effort:small Small effort - 2 days label Oct 18, 2022
@PallaviGanorkar
Copy link
Contributor

Sure @jingtang10

@PallaviGanorkar
Copy link
Contributor

PallaviGanorkar commented Oct 19, 2022

@jingtang10 As per discussion in issue #1418 and current implementation, Date entry format hint is displayed from locale date format, entry format defined in Questionnaire is not considered. Please confirm, what is expected behavior?

@jingtang10 jingtang10 added effort:medium Medium effort - 3 to 5 days and removed effort:small Small effort - 2 days labels Oct 19, 2022
@jingtang10
Copy link
Collaborator

Thanks @KhumboLihonga for creating this issue. @PallaviGanorkar yes that's right - we do not consider the entry format extension right now.

The issue with the entry format extension, however, is that it's not really "computable". In the spec (https://build.fhir.org/ig/HL7/sdc/rendering.html#entryFormat) it says this:

This provides a string that helps to guide entry of formatted text and often appears directly "behind" the control to be filled. For example, "nnn-nnn-nnnn" for a North American phone number, "YYYY-MM-DD" for a date, "nnnn nnnn nnnn nnnn" for certain types of credit card numbers, etc.

The keyword here is "guide". the entry format extension is guiding the user to input. But not necessarily used as validation. The FHIR questionnaire is a standard for all platforms. My question is how can we interpret this string in Android and be consistent with other langauges / APIs people might use to interpret entry format? Is this guaranteed to be universally consistent? Someone might use the same questionnaire in a .NET environment, or in Python, or in other langauges with other date libraries. Do we know that the entry format string is going to be generating the same validation result?

If we have confidence here, we can probably use entry format extension. But otherwise I'm not so sure.

@jingtang10 jingtang10 moved this from New to In Progress in Android FHIR SDK Oct 19, 2022
@KhumboLihonga
Copy link
Author

@jingtang10 Thanks for clarifying this. I assumed it was being used because it is included in the catalog app date picker questionnaire. I think it would be good to remove the extension from there to avoid further confusion.

Well, the reason I shared this issue is that when using the catalog app, the date format is automatically set to dd/MM/y as shown in the screenshot above (and is the preferred format for us). However, when using questionnaires in our app on the same phone, the date format is automatically set to M/d/yy as shown below. So I figured the entry extension may be responsible for this but now I have no idea. Any thoughts?

Screenshot_20221020-110127_Tingathe

@PallaviGanorkar
Copy link
Contributor

@KhumboLihonga Have you changed your device locale by any chance?

@KhumboLihonga
Copy link
Author

@PallaviGanorkar No, I haven't. These two screenshots is me switching from the catalog app to our app. Also, the language of the phone is set to English (United Kingdom) so I expect the catalog app format i.e. dd/MM/y to be used.

@PallaviGanorkar
Copy link
Contributor

PallaviGanorkar commented Oct 21, 2022

@KhumboLihonga Could you please confirm few things

  1. Which SDC lib version you are using?
  2. Open date picker popup and check format after trying to edit date and confirm if it is same with expected format.

@KhumboLihonga
Copy link
Author

  1. In our gradle, we are using org.smartregister:data-capture:0.1.0-beta05-preview-SNAPSHOT in the FHIR Core app
  2. When trying to edit the date, the format is m/d/yy which is incorrect

@f-odhiambo @Gental-Giant could this issue be FHIR Core related?

@PallaviGanorkar
Copy link
Contributor

As Discussed @KhumboLihonga , Both date Picker and Input box hint show same date format i.e. US locale format though device Setting has UK locale which is incorrect. On other hand catalog app shows correct UK local date format.
So, @KhumboLihonga could you please conform, other app is not setting locale at app level?

@KhumboLihonga
Copy link
Author

@PallaviGanorkar Thank you for your assistance. Yes, it's being set at the application level. I'll close this issue.

Repository owner moved this from In Progress to Complete in Android FHIR SDK Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort:medium Medium effort - 3 to 5 days P1 High priority issue type:bug Something isn't working
Projects
Status: Complete
Development

No branches or pull requests

6 participants