beda-software / fhir-py

FHIR Client for python
MIT License
168 stars 31 forks source link

Issue with client.execute() Method Removing Parameters from Path #108

Closed zakharych closed 1 year ago

zakharych commented 1 year ago

I encountered an issue while using the client.execute() method for performing conditional updates in my code. When I provide parameters in the path directly, the operation creates a new resource after each call instead of performing the expected conditional update. However, when I pass the parameters as arguments using the params parameter, the condition update works as expected.

Exsample:

# Issue - Creates a new resource instead of conditionally updating
await client.execute(
  path="/fhir/Encounter?identifier=external-ehr|test-encounter-1",
  method="PUT",
  data=data 
) 

# Working Solution - Performs conditional update as expected
await client.execute(
  path="/fhir/Encounter",
  params={"identifier": "external-ehr|test-encounter-1"},
  method="PUT",
  data=data
)
ruscoder commented 1 year ago

I don't think that it's a bug. path in the URL does not contain query if we talk about terms. So, since we have a working example, I'm closing it