android-fhir
android-fhir copied to clipboard
Ability to Capture Questionnaire Launch and Submit Timestamps
Is your feature request related to a problem? Please describe. We would like to track how long it takes agents in the field to fill out questionnaires. This is for process auditing purposes and to be able to optimise data collection activities and processes.
Describe the solution you'd like
- Capture the timestamp of when a questionnaire is launched.
- Capture the timestamp of when a questionnaire is submitted.
- The timestamps can then be loaded to the questionnaire response for processing post-submit.
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Additional context Add any other context or screenshots about the feature request here.
Would you like to work on the issue? Please state if this issue should be assigned to you or who you think could help to solve this issue.
@jingtang10 do you mind looking into this?
@f-odhiambo cc: @jingtang10
I am picking up this ticket. As discussed I'll be adding two items to QuestionnaireResponse
, questionnaire-launch-time
and questionnaire-submission-time
@f-odhiambo cc: @jingtang10 @qiarie
After some discussion and scoping, the following enhancements will be implemented:
- Both
QuestionnaireResponseItemComponent
andQuestionnaireItemComponent
will be included at both the launch and submission stages. A sampleQuestionnaireResponseItemComponent
is illustrated below:
QuestionnaireResponseItemComponent().apply {
linkId = "submission-timestamp"
answer = arrayListOf<QuestionnaireResponseItemAnswerComponent?>().apply {
add(QuestionnaireResponseItemAnswerComponent().apply {
value = StringType("<timestamp>")
})
}
}
- The introduced functionality will be configurable.
A sample QR will look like
{
"resourceType": "QuestionnaireResponse",
"item": [
{
"linkId": "1",
"text": "Choose one from the options below",
"answer": [
{
"valueCoding": {
"code": "option-1",
"display": "Option 1"
},
"item": [
{
"linkId": "1-select-one",
"text": "Select one"
}
]
}
]
},
{
"linkId": "launch-timestamp",
"answer": [
{
"valueString": "2024-01-04T11:39:30.040+05:00"
}
]
},
{
"linkId": "submission-timestamp",
"answer": [
{
"valueString": "2024-01-04T11:41:01.095+05:00"
}
]
}
]
}
As per the PR comments, there will be a change in the implementation. I will implement the following changes.
- The
authored
field will be used as a submission timestamp. - The launch-timestamp will be added as an extension to the
QuestionnaireResponse
.
A new sample implementation
{
"resourceType": "QuestionnaireResponse",
"extension": [
{
"urI": "launch-timestamp",
"valueDateTime'": "2024-02-22T15:25:29+05:00"
}
],
"authored": "2024-02-22715:25:32+05:00",
"item": []
}
thanks for creating this discussion @hamza-vd: https://chat.fhir.org/#narrow/stream/179255-questionnaire/topic/Ability.20to.20Capture.20Questionnaire.20Launch.20and.20Submit.20Timestamp