aehrc / aehrc/smart-forms

Prepopulation of QuestionnaireResponse is including non-conformant extensions from source system

Open
#2,087 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
61
Forks
29
Avg merge
2d 22h
Merged PRs (30d)
19

Description

Describe the bug
When prepopulating answers in a QuestionnaireResponse, if the FHIRpath expression returns an unexpected extension as part of the query, it is being included when populating the answer. For example, if the expression retrieves a coding (e.g. MedicationStatement.code.coding(where.system='http://snomed.info/sct'), that coding may include the Medication Type extension. This is extension is not permitted to be used for QuestionnaireResponse.item.answerCoding.

To Reproduce
Was observed in Inferno. AU Base examples contain this extension and if used for prepop would reproduce.

Expected behavior
Prepopulation service should strip invalid extensions before including the datatype value in the QuestionnaireResponse.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the prepopulation service and reproduce the issue using the AU Base MedicationStatement examples linked in the report, or the Inferno scenario where it was observed. Confirm that a FHIRPath result containing the Medication Type extension is handled before populating QuestionnaireResponse.item.answerCoding, and consider the work done when invalid extensions are absent from the populated value.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.