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

0.2.5 - Add Location Coordinates on Questionnaire Submission #3042

Merged
merged 17 commits into from
Mar 19, 2024

Conversation

qiarie
Copy link
Contributor

@qiarie qiarie commented Feb 6, 2024

IMPORTANT: Where possible all PRs must be linked to a Github issue

Fixes [link to issue]

Engineer Checklist

  • I have written Unit tests for any new feature(s) and edge cases for bug fixes
  • I have added any strings visible on UI components to the strings.xml file
  • I have updated the CHANGELOG.md file for any notable changes to the codebase
  • I have run ./gradlew spotlessApply and ./gradlew spotlessCheck to check my code follows the project's style guide
  • I have built and run the FHIRCore app to verify my change fixes the issue and/or does not break the app
  • I have checked that this PR does NOT introduce breaking changes that require an update to Content and/or Configs? If it does add a sample here or a link to exactly what changes need to be made to the content.

Code Reviewer Checklist

  • I have verified Unit tests have been written for any new feature(s) and edge cases
  • I have verified any strings visible on UI components are in the strings.xml file
  • I have verifed the CHANGELOG.md file has any notable changes to the codebase
  • I have verified the solution has been implemented in a configurable and generic way for reuseable components
  • I have built and run the FHIRCore app to verify the change fixes the issue and/or does not break the app

@qiarie qiarie marked this pull request as draft February 16, 2024 09:44
@qiarie qiarie marked this pull request as ready for review March 4, 2024 09:34
@@ -41,4 +41,5 @@ data class ApplicationConfiguration(
val showLogo: Boolean = true,
val taskBackgroundWorkerBatchSize: Int = 500,
val eventWorkflows: List<EventWorkflow> = emptyList(),
val logQuestionnaireLocation: Boolean = false,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please match the architecture on the main PR. I think we have different configs there

Comment on lines 28 to 39
var locationResourceCopy = locationResource

if (locationResourceCopy == null) {
locationResourceCopy = org.hl7.fhir.r4.model.Location()
}

locationResourceCopy.id = UUID.randomUUID().toString()
locationResourceCopy.position.latitude = gpsLocation!!.latitude.toBigDecimal()
locationResourceCopy.position.longitude = gpsLocation!!.longitude.toBigDecimal()
locationResourceCopy.position.altitude = gpsLocation!!.altitude.toBigDecimal()

return locationResourceCopy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we creating a new object?

.addOnSuccessListener { location: Location? ->
if (location != null) {
Timber.d(
"Approx location - lat: ${location.latitude}; long: ${location.longitude}; alt: ${location.altitude}",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"Approx location - lat: ${location.latitude}; long: ${location.longitude}; alt: ${location.altitude}",
"Approximate location - lat: ${location.latitude}; long: ${location.longitude}; alt: ${location.altitude}",

@ellykits ellykits added the 0.2.5 label Mar 14, 2024
@ageryck ageryck merged commit 32b4070 into opensrp-0.2.5 Mar 19, 2024
@ageryck ageryck deleted the questionnaire-location-0-2-5 branch March 19, 2024 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants