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

Add helpers for batch/transaction requests #24

Open
ruscoder opened this issue Apr 16, 2019 · 2 comments
Open

Add helpers for batch/transaction requests #24

ruscoder opened this issue Apr 16, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@ruscoder
Copy link
Member

Use Bundle resource from #7

@ruscoder ruscoder added the enhancement New feature or request label Apr 16, 2019
@ruscoder
Copy link
Member Author

ruscoder commented Nov 27, 2019

We discussed in the team this issue and decided that Bundle isn't an ordinary resource as a Patient and etc. It is an abstract resource that can't be instantiated. So, it means we can use .delete(), is_valid() and the resource can't have an id.

Let's add a new class BundleResource (and appropriate AsyncBundleResource/SyncBundleResource and aidbox versions) and return it in client.resources('Bundle').

This class should provide an interface:

  • .save() - only if type = transaction/batch - should update the inner resource without changing bundle.type
  • .get_resources()/resources TBD
  • .set_resources()/resources TBD
  • .add_resources() TBD
  • get_resources_by_resource_type(resource_type)
  • get_resource_by_reference(reference)

Also, let's return the instance of this class in fetch_raw - it'll solve #17 partially

@BSVogler
Copy link
Contributor

BSVogler commented Jun 24, 2021

I think it would be good when the bundle would behave identically to the client so that the code like this would work

bundle = client.resources('Bundle')
for patient in patientlist:
    bundle.resources("Patient").reference('Patient', user)
bundle.fetch_all()

as this is a special behavior it might also be good to have a special constructor like bundle = client.bundle() instead

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

No branches or pull requests

2 participants