Closed f-odhiambo closed 4 months ago
What would the questionnaire response look like? It should be a response item to a single questionnaire item?
@jingtang10 There is an R5 ballot on the use of geolocation https://build.fhir.org/extension-geolocation.html. Added a zullip chat on this https://chat.fhir.org/#narrow/stream/179166-implementers/topic/Location.20mapping.20widget Will keep reviewing and try and draft a suitable QuestionnaireResponse
There is an R4 extension for GeoLocation http://hl7.org/fhir/extension-geolocation.html. Which could be used to append the location details directly to the Patient Resource or just used separately as in a Questionnaire to get location details. I think the QR can take the following form
{
"resourceType": "QuestionnaireResponse",
"status": "completed",
"subject": {
"reference": "Patient/969",
"display": "Test Patient"
},
"authored": "2013-06-18T00:00:00+01:00",
"author": {
"reference": "Practitioner/970"
},
"source": {
"reference": "Practitioner/970"
},
"item": [
{
"linkId": "1",
"text": "General questions",
"item": [
{
"linkId": "1.1",
"text": "What is your Country of birth?",
"answer": [
{
"valueString": "The Netherlands"
}
]
},
{
"linkId": "1.2",
"text": "What is your City or State of birth?",
"answer": [
{
"valueString": "Amsterdam"
}
]
},
{
"linkId": "1.3",
"text": "What is your Village of birth?",
"answer": [
{
"valueString": "Kraule"
}
]
}
]
},
{
"linkId": "2",
"text": "Location Details",
"item": [
{
"linkId": "2.1",
"text": "Latitude",
"answer": [
{
"valueString": "52.3676"
}
]
},
{
"linkId": "2.2",
"text": "Longitude",
"answer": [
{
"valueString": "4.9041"
}
]
}
]
}
]
}
Hi @f-odhiambo, I would like to work on this issue Could you please assign it to me
Hi @f-odhiambo, I would like to work on this issue Could you please assign it to me
Kindly tag me to the PR or leave a comment once a PR has been raised for this
@f-odhiambo @jingtang10 could you please help me with the questionnaire of the Location widget.
@f-odhiambo @jingtang10 could you please help me with the questionnaire of the Location widget.
Here you go http://turn-fhir.smartregister.org/fhir/Questionnaire/1922. You can add the widget to this questionnaire
Hey, @puranjayK Any progress update on this ? Perhaps we can link up on this sometime this week if available for more details. Let me know
@puranjayK Any progress update on this?
@puranjayK Any progress update on this?
Sorry I couldnt work on this, as the covid situation got worse in my country. I am having issues on how to make this widget and how the questionnaire is to be used
@jingtang10 @Tarun-Bhardwaj As discussed need to hold this issue for more requirement details.
HI @PallaviGanorkar , Are you going to be picking this issue ?
Hello I am new to contribution and would like to contribute to this issue if no one is on it.
Hi @MnCSSJ4x,Thanks for this , how can we connect to have a brief on this issue, can we ? CC @FikriMilano
we can connect via mail : xxxxx or if there is a slack channel please share an invite
@f-odhiambo I assume this widget will retrieve the current device coordinates when the user clicks it?
@f-odhiambo I assume this widget will retrieve the current device coordinates when the user clicks it?
Yes
we can connect via mail : xxxxx or if there is a slack channel please share an invite
I copied and obscured your email . Thanks
@f-odhiambo from this Questionnaire Response, what is 'Location Details' stands for? is it the Location widget? or it's simply a container from a 'group' type Questionnaire Item?
{
"linkId":"2",
"text":"Location Details",
"item":[
{
"linkId":"2.1",
"text":"Latitude",
"answer":[
{
"valueString":"52.3676"
}
]
},
{
"linkId":"2.2",
"text":"Longitude",
"answer":[
{
"valueString":"4.9041"
}
]
}
]
}
It's a container from a 'group' type Questionnaire Item
@f-odhiambo does that mean, there will be 2 location widgets to populate the Latitude and Longitude? (2.1 and 2.2)
@f-odhiambo does that mean, there will be 2 location widgets to populate the Latitude and Longitude? (2.1 and 2.2)
Not really the widget should allow you to invoke the get coordinated from the phone GPS and then use the results to populate the Latitude and Longitude for the specific location So the response will be something like this (0.0236, 37.9062) and then will need to split this comma separated value into Lat, Long as
"position": {
"longitude": 42.256500,
"latitude": -83.694710
}
@MnCSSJ4x Whats the progress on this ?
Not much progress. Packed with exam till 12th. However took some time to review the material shared. However I am still confused whether I submit you a pull request or a design idea now !
@f-odhiambo
I would prefer to have an questionnaire the way you mentioned in the statement. For the location extraction using gps, I would prefer to use the fused Location Provider Client and then convert it to the FHIR is working on (this might involve splitting the data of latitude and longitude . After we get this processing done. We can create the payload in the way stated above (assuming that is the format the entire library follows) . Please let me know if this is what is expected, then I can start on the implementation side of things.
Yes this sounds good for a start @FikriMilano any additions to this ?
@MnCSSJ4x could you send the Questionnaire and QuestionnaireResponse that you expect to look like? Just to make sure we have the same idea on this,
@FikriMilano I was planning to follow the sample format mentioned until and unless there is some limitation
Alright, sounds good for me. Thanks for the feedback @MnCSSJ4x
Hi @MnCSSJ4x , how is the progress here ? CC @FikriMilano
@f-odhiambo I am having my semester exams this week. Will definitely address the coding part of the solution next week @FikriMilano can you provide me how you set up the environment locally to test ?
@MnCSSJ4x you can just simply fork the repo, build the project then try to run the demo apps
@MnCSSJ4x Any progress made on this ticket?
@Tarun-Bhardwaj I think we can close this issue as it had been implemented on FHIR Core https://github.com/opensrp/fhircore/issues/1536
Thanks @f-odhiambo - would it be worth merging this back into the SDK? @jingtang10
Thanks @f-odhiambo - would it be worth merging this back into the SDK? @jingtang10
We can have a discussion on this , happy to elaborate more on the solution we took
@ageryck I think you can re-open this ticket for the GPS picker work.
@jingtang10 this can be re-assigned since the implementation in the attached PR was something different
@f-odhiambo @f-odhiambo I had a suggestion of maybe using a normal Questionnaire item of type string
with a custom extension to render the widget
{
"linkId": "Location widget",
"type": "string",
"text": "Record GPS Location",
"required": true,
"extension": [
{
"url": "https://github.com/google/android-fhir/StructureDefinition/questionnaire-itemControl",
"valueCodeableConcept": {
"coding": [
{
"system": "https://github.com/google/android-fhir/questionnaire-item-control",
"code": "location-widget"
}
]
}
}
]
}
and to render, instead of having it as single "record gps location", maybe have it render similar to the datepicker populating the textview with comma-separated latitude, longitude, altitude
. This way we would probably still be able to use the already implemented utilities for example, adding extensions for help, attachment, translations and also show validation error incase field is required
cc: @ageryck @FikriMilano @dubdabasoduba
After reviewing the above implementation idea, we felt it may have had deficiencies of may be not being able to separate between latitude and longitude in consistent way. And so, with the help of the fhir org team, we had another idea that would be viable, to use a Questionnaire item of type group
. The Questionnaire item would have a custom extension to represent location-widget and also have child items of type string
with custom extensions to specify latitude
, longitude
and altitude
- these would be used in the ui to render and populate the coordinates.
Essentially, it would look like
{
"linkId": "location-widget",
"type": "group",
"extension": [
{
"url": "https://github.com/google/android-fhir/StructureDefinition/questionnaire-itemControl",
"valueCodeableConcept": {
"coding": [
{
"system": "https://github.com/google/android-fhir/questionnaire-item-control",
"code": "location-widget"
}
]
}
}
],
"item": [
{
"linkId": "latitude",
"type": "string",
"required": true,
"readOnly": true,
"extension": [
{
"url": "gps-coordinate",
"value": "latitude"
}
]
},
{
"linkId": "longitude",
"type": "string",
"required": true,
"readOnly": true,
"extension": [
{
"url": "gps-coordinate",
"value": "longitude"
}
]
}
]
}
@jingtang10 would love to hear what you think
cc @f-odhiambo @ageryck
I think defining custom widgets (together with custom extensions) in the SDC library is a great approach. This is fine.
The important thing is documentation and making sure people using your questionnaires are aware of the extensions you define otherwise your questionnaire will not be usable.
Be good to share this with the fhir chat community as well, especially to get grahame and lloyd's opinion.
After reviewing the above implementation idea, we felt it may have had deficiencies of may be not being able to separate between latitude and longitude in consistent way. And so, with the help of the fhir org team, we had another idea that would be viable, to use a Questionnaire item of type
group
. The Questionnaire item would have a custom extension to represent location-widget and also have child items of typestring
with custom extensions to specifylatitude
,longitude
andaltitude
- these would be used in the ui to render and populate the coordinates.Essentially, it would look like
{ "linkId": "location-widget", "type": "group", "extension": [ { "url": "https://github.com/google/android-fhir/StructureDefinition/questionnaire-itemControl", "valueCodeableConcept": { "coding": [ { "system": "https://github.com/google/android-fhir/questionnaire-item-control", "code": "location-widget" } ] } } ], "item": [ { "linkId": "latitude", "type": "string", "required": true, "readOnly": true, "extension": [ { "url": "gps-coordinate", "value": "latitude" } ] }, { "linkId": "longitude", "type": "string", "required": true, "readOnly": true, "extension": [ { "url": "gps-coordinate", "value": "longitude" } ] } ] }
@jingtang10 would love to hear what you think
cc @f-odhiambo @ageryck
@LZRS how does this look on the QR? Do you mind sharing a sample?
After reviewing the above implementation idea, we felt it may have had deficiencies of may be not being able to separate between latitude and longitude in consistent way. And so, with the help of the fhir org team, we had another idea that would be viable, to use a Questionnaire item of type
group
. The Questionnaire item would have a custom extension to represent location-widget and also have child items of typestring
with custom extensions to specifylatitude
,longitude
andaltitude
- these would be used in the ui to render and populate the coordinates. Essentially, it would look like{ "linkId": "location-widget", "type": "group", "extension": [ { "url": "https://github.com/google/android-fhir/StructureDefinition/questionnaire-itemControl", "valueCodeableConcept": { "coding": [ { "system": "https://github.com/google/android-fhir/questionnaire-item-control", "code": "location-widget" } ] } } ], "item": [ { "linkId": "latitude", "type": "string", "required": true, "readOnly": true, "extension": [ { "url": "gps-coordinate", "value": "latitude" } ] }, { "linkId": "longitude", "type": "string", "required": true, "readOnly": true, "extension": [ { "url": "gps-coordinate", "value": "longitude" } ] } ] }
@jingtang10 would love to hear what you think cc @f-odhiambo @ageryck
@LZRS how does this look on the QR? Do you mind sharing a sample?
The QuestionnaireResponse would probably look like this
{
"linkId": "location-widget",
"item": [
{
"linkId": "latitude",
"answer": [
{
"valueString": "41.40338"
}
]
},
{
"linkId": "longitude",
"answer": [
{
"valueString": "2.17403"
}
]
}
]
}
Is your feature request related to a problem? Please describe. Add a location widget that allows you to submit the location with GPS coordinates and location details as FHIR Location resources Describe the solution you'd like
The Widget should be able to trigger the GPS to collect Latitude and Longitude coordinates for a precise location
Sample location payload for an Immunization facility
Describe alternatives you've considered N/A
Additional context Sample location payload for an Immunization facility
Sample location payload for a Household location/home
Sample ANC mock
NB. The accompanying details of the Location (address, display name) can be collected via a questionnaire and appended to the Questionnaire response before extraction and saving/posting/sync as a location resource