beda-software / fhir-py

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

Getting _elements when using reference not supported #101

Closed BSVogler closed 1 year ago

BSVogler commented 1 year ago

I want to send this query.

/Patient/83ed7f8c-8a80-47d6-bd70-3923baa5c076?_elements=address

I tried this

client.reference('Patient', id=user_id).elements("address").to_resource()

but this throws an AttributeError that elements is not found.

This works instead but is building internally a different query

client.resources('Patient').search(_id=user_id).elements("address").get()
ruscoder commented 1 year ago

I don't remember that FHIR spec describes _elements for the particular resource, it's more list operation.

BSVogler commented 1 year ago

True. It is supported on HAPI FHIR though.