Skip to content

Commit

Permalink
Fix $populate operation for fhir server
Browse files Browse the repository at this point in the history
  • Loading branch information
ir4y committed Sep 18, 2024
1 parent 30be07b commit 72fac93
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/fhir_server/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,16 @@ async def populate_questionnaire_handler(request: web.BaseRequest):

@routes.post("/Questionnaire/{id}/$populate")
async def populate_questionnaire_instance(request: web.BaseRequest):
client = request.app["client"]
original_client = request.app["client"]
client = AsyncFHIRClient(
original_client.url,
authorization=request.headers["Authorization"],
extra_headers=original_client.extra_headers,
)
questionnaire = (
await client.resources("Questionnaire").search(_id=request.match_info["id"]).get()
)
env = parameter_to_env(request["resource"])
env = parameter_to_env(await request.json())
converted = to_first_class_extension(questionnaire)
env["Questionnaire"] = converted
populated_resource = await populate(client, converted, env)
Expand Down

0 comments on commit 72fac93

Please sign in to comment.