$set-accounts in a batch?
# support
a
Hello all! I was looking at putting a bundle of $set-accounts calls together but ran into the bundle returning 404 errors. I see that the bundle is routing through a different router than the direct requests and doesn’t support the $set-accounts end point explaining the 404. I’m guessing this is an intentional design decision? And the best practice to call $set-accounts a large set of resources is to issue individual requests?
a
Hi @argmonster! You are correct, our implementation does not support Batch FHIR operation calls, and this is intentional. The best practice is to: 1. Call POST /fhir/R4///$set-accounts per resource 2. If you're working with Patient resources, use
propagate: true
in the parameters body. This will make Medplum automatically cascade the account assignment to all related resources in the patient compartment. This significantly reduces the number of calls needed for patient-centric data. Note that if you're doing this, you'll want to use the
Prefer: respond-async
header to avoid timeouts. This returns an AsyncJob you can poll for completion. Hope this helps. Happy coding!
a
thank you for clarifying!
47 Views