Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to use the 'server' attribute? #44

Closed
themantalope opened this issue Dec 8, 2020 · 2 comments
Closed

how to use the 'server' attribute? #44

themantalope opened this issue Dec 8, 2020 · 2 comments

Comments

@themantalope
Copy link

themantalope commented Dec 8, 2020

Hi all,

This is a really amazing library. I'm a physician, and I'm starting to learn about FHIR and how to use it and this library has been a great starting place.

I'm having a hard time finding documentation on the 'server' attribute that is found in many objects. For example if I create a new patient:

data = {'name':{'given':['Bob'], 'family':'Smith'}}
new_p = Patient(**data)

There is now a new_p.server attribute. I would like to know if I set the server attribute am I able to then just call new_p.create() to create an instance on the server? Or if I want to find patients on a server do I just set the search parameters in a Patient object and then call .search().

For context, I've been learning how to post and search for FHIR objects on a locally running HAPI FHIR server with this docker image.

Any help is much appreciated.

EDIT
I now realize that I was using an old version of the library. I would like to know if similar functionality is available in the current version that from the master branch on this repository ('6.0.0b11').

@nazrulworld
Copy link
Owner

Hi @themantalope
This is the library is the pure python representation of https://www.hl7.org/fhir/resourcelist.html. There is no attribute like create, search.
I think you can use this https://pypi.org/project/requests/ library to connect to the server (create and search)

You can use fhir.resources to validate incoming data or validate data before creating a resource for the server.

@themantalope
Copy link
Author

Thanks for letting me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants