Closed f-odhiambo closed 2 years ago
Relatedly check on
Mismatched Labels
Report shows 1st Indicator title
Search ANC register not working
@f-odhiambo,
I tried to resolve crash issue, did some refactoring within ReportFilterPage, ReportActivity and ReportViewModel class, for moving functionalities' calls from UI to viewmodel
but while debugging I found that
fhirResourceDataSource.loadData(patientURL)
is not working inside fetchCQLPatientData()
detailed message shared on slacked group.
and for Search ANC register not working search filter for picking patient in reports module, is the pending issue to resolve from my side, and for that I had to connect with @ellykits, but we couldn't sync those days, on 3rd December Elly mentioned he would try resolving that with ANC Test refactoring , I was expecting Elly to guide/hint me resolving that issue.
@Abdul Wahab Thanks for guiding on this.
Problem is we are loading data from server and the issue is that the flow is unable to find Patient with given id ...
see ReportHomeActivity.loadCQLMeasurePatientData where it fetches patientId from lateinit var.
and this is updated from ReportHomeActivity.generateMeasureReport which actually updates it as per filter selected
So there are two edge cases and one bug we need to handle
1- If user has not selected a patientId we should show Toast that a patient MUST be selected and prevent it from getting further
2- (Problem) it loads data from server and would for sure fail or give erroneous results on a patient and data which is not syced yet. We need to handle this and show error after Retrofit call fails
3- The patientId is var and is updated on each time we select filter. This is
val selectedPatient by remember { mutableStateOf(viewModel.selectedPatientItem.value) }
and we need to ensure that it can not work with previous selection by any means. It always updates the selected filter (I selected a patient in other report and then came back to failing report and clicked 'All' and it didnot crash.. so despite working the flow is giving wrong results)
@maimoonak Among the cases you mentioned , point-1 and point-3 has been resolved with issue #898, linked PR #901
cc: @kwasim , @f-odhiambo , @kimigxfoxy
NOT valid anymore as we are moving to the API implementation
Describe the bug
To Reproduce Steps to reproduce the behaviour:
Expected behaviour
Screenshots
Smartphone (please complete the following information):
Additional context See Logcat crush on when you load the app afresh and invoke measureReporting