You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Demo app get crashed when it parse invalid date of the patient in the PatientListViewModel.
Process: com.google.android.fhir.demo, PID: 27356
java.time.format.DateTimeParseException: Text '1966' could not be parsed at index 4
at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:2050)
at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1952)
at java.time.LocalDate.parse(LocalDate.java:425)
at com.google.android.fhir.demo.PatientListViewModelKt.toPatientItem(PatientListViewModel.kt:186)
at com.google.android.fhir.demo.PatientListViewModel.getSearchResults(PatientListViewModel.kt:104)
at com.google.android.fhir.demo.PatientListViewModel.access$getSearchResults(PatientListViewModel.kt:40)
at com.google.android.fhir.demo.PatientListViewModel$getSearchResults$1.invokeSuspend(Unknown Source:15)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:240)
at android.os.Looper.loop(Looper.java:351)
at android.app.ActivityThread.main(ActivityThread.java:8423)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@6e6ca8a, Dispatchers.Main.immediate]
val dob =
if (hasBirthDateElement()) {
LocalDate.parse(birthDateElement.valueAsString, DateTimeFormatter.ISO_DATE)
} else {
null
}
Component
reference app
To Reproduce
Steps to reproduce the behavior:
Open demo app.
Sync patients resources from HAPI FHIR Test server by clicking one time sync or periodic sync, patients get downloaded.
Open search patients screen.
Start typing 't', app exists.
Expected behavior
App should not exit.
Just catch the exception, and set the null or default value.
Screenshots
If applicable, add screenshots to help explain your problem.
Smartphone (please complete the following information):
Device: Pixel4a emulator
Android version: Android 12
Build number:
Version
The text was updated successfully, but these errors were encountered:
santosh-pingle
changed the title
Demo app crashes when typing 't' in the search box.
Demo app crashes when searching patient which has invalid date.
Nov 14, 2024
Describe the bug
Demo app get crashed when it parse invalid date of the patient in the PatientListViewModel.
Component
reference app
To Reproduce
Steps to reproduce the behavior:
Expected behavior
App should not exit.
Just catch the exception, and set the null or default value.
Screenshots
If applicable, add screenshots to help explain your problem.
Smartphone (please complete the following information):
The text was updated successfully, but these errors were encountered: