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

Filter content referenced on the Composition or IG using the _lastUpdated during download #3580

Open
3 tasks
dubdabasoduba opened this issue Oct 28, 2024 · 7 comments
Assignees
Labels
App Configuration Enhancement New feature or request Remote Sync All issues related to syncing data from or to the FHIR server Size - S 2-3 days

Comments

@dubdabasoduba
Copy link
Member

Describe the feature request.

  • Currently, the configurations are re-downloaded every time a user logs in with their username and password. While this ensures we fetch updated configurations, it also results in re-downloading content that hasn’t changed, impacting sync time during subsequent syncs.
  • This ticket aims to introduce a lastConfigSync timestamp, which will work alongside the _lastUpdated property on FHIR resources.
    • The lastConfigSync timestamp will have the following characteristics:
    • It will be updated each time the content download is completed successfully.
    • When available, it will be included in subsequent content requests after login.
    • It will be stored in the application’s shared preferences.

Acceptance criteria

  • Always save the lastConfigSync timestamp everytime the configs are complete sync successfully
  • Always attach the lastConfigSync to requests for content referenced on the Composition or IG
  • Correctly store the lastConfigSync on the application share preferences

Implementation plan (For Engineers)
The plan for implementing the solution e.g. via a description or a check list for the various ordered tasks that will need to be completed.
i.e. Describe how you intend to solve the problem

@dubdabasoduba dubdabasoduba added Enhancement New feature or request Remote Sync All issues related to syncing data from or to the FHIR server Discussion This is an open discussion that may or may not lead to actionable points App Configuration labels Oct 28, 2024
@dubdabasoduba
Copy link
Member Author

@ellykits @pld please review this

@pld
Copy link
Member

pld commented Nov 15, 2024

One issue is how to set lastConfigSync, pretty sure we'd need to set this with a time that is provided by the remote server, since I believe that is also where the _lastUpdated is set.

Is there a way that the current server time is already being set back? It might be somewhat cludgy to add that as a returned value from the remote server.

An alternative approach would be to take the largest timestamp in _lastUpdated from the synced resources and use that as the lastConfigSync timestamp. Then we'd make sure we are using the same timezone/etc the server is. If we use this approach we'd have to make sure we use a strict > comparison, as opposed to a >= comparison.

@ndegwamartin
Copy link
Contributor

One issue is how to set lastConfigSync, pretty sure we'd need to set this with a time that is provided by the remote server, since I believe that is also where the _lastUpdated is set.

Is there a way that the current server time is already being set back? It might be somewhat cludgy to add that as a returned value from the remote server.

An alternative approach would be to take the largest timestamp in _lastUpdated from the synced resources and use that as the lastConfigSync timestamp. Then we'd make sure we are using the same timezone/etc the server is. If we use this approach we'd have to make sure we use a strict > comparison, as opposed to a >= comparison.

I believe this is how the FHIR SDK does it for the data FHIR resources - https://github.com/google/android-fhir/blob/master/engine/src/main/java/com/google/android/fhir/sync/download/ResourceParamsBasedDownloadWorkManager.kt#L115-L127

@pld
Copy link
Member

pld commented Dec 2, 2024

cool sweet, great find, yea let's follow the exact same logic, that's the alternative approach I noted

@pld pld removed the Discussion This is an open discussion that may or may not lead to actionable points label Dec 9, 2024
@pld pld added the Size - S 2-3 days label Dec 9, 2024
@dubdabasoduba
Copy link
Member Author

@Aleem92 I just tested the HAPI API on the current version we use.

_lastUpdated doesn't seem to work when performing GET {{base_url}}/Composition/<uuid> however it works on {{base_url}}/Composition?_lastUpdated=<date>

e.g https://{{base_url}}/fhir/Composition?_lastUpdated=gt2025-04-18

@dubdabasoduba
Copy link
Member Author

@pld @ndegwamartin We might have to pause this until we test it on the latest version of HAPI. If still doesn't work then we close the ticket

@Aleem92
Copy link
Contributor

Aleem92 commented Dec 20, 2024

@Aleem92 I just tested the HAPI API on the current version we use.

_lastUpdated doesn't seem to work when performing GET {{base_url}}/Composition/<uuid> however it works on {{base_url}}/Composition?_lastUpdated=<date>

e.g https://{{base_url}}/fhir/Composition?_lastUpdated=gt2025-04-18

Thanks for confirming this, @dubdabasoduba. I had raised this issue regarding {{base_url}}/Binary/<uuid>?_lastUpdated=<date> not working as expected. I appreciate you taking the time to test and confirm the behavior on the ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
App Configuration Enhancement New feature or request Remote Sync All issues related to syncing data from or to the FHIR server Size - S 2-3 days
Projects
None yet
Development

No branches or pull requests

4 participants