OpenFn / adaptors

The new home for OpenFn adaptors; re-usable connectors for the most common DPGs and DPI building blocks.
GNU General Public License v3.0
5 stars 8 forks source link

fhir: support the correct verbs #677

Open josephjclark opened 1 month ago

josephjclark commented 1 month ago

This is the FHIR API spec:

image

I think we need to extend the FHIR adaptor with the following functions, which should be familiar to FHIR users:

read(resourceType, id, query) // get a resource by id

search(resourceType, query, options) // list resources with a filter

update(resourceType, resource) // upsert a resource (but resourceType is in the data, so maybe this is just update(resource)

We already have create(resourceType, resource) (which tbh should just be create(resource))

This is in addition to the HTTP verbs get, post, request. I'd be tempted to namespace all these under http., but the verbs are distinct enough that I don't think it's neccessary

When this has been done, getClaims needs to be removed. read and search make it superfluous.

aleksa-krolls commented 1 month ago

Hey @josephjclark I'm onboard with adding these 3 functions (read, update, & search) per the FHIR documentation, and removing getClaims().

@mtuchi I'm going to add this to this week's sprint and drop some of the other lower priority adaptor issues. Does that sound okay?

mtuchi commented 1 month ago

@aleksa-krolls sounds good 👍🏽

mtuchi commented 1 month ago

Just minor discovery on read(). It looks like we will need to support an additional params query. This will look something like this read(resourceType, id, query). This is because the read function will need to support query params for filtering.

Screenshot 2024-07-16 at 2 51 00 PM
mtuchi commented 1 month ago

Another finding, looks like search(resourceType, query) needs more design thinking. There are couple of limitation that i am seeing in their documentation. Read more here

josephjclark commented 1 month ago

Great research @mtuchi , thank you.

Let's put this on ice and just get the basic FHIR adaptor done.

For the record:

josephjclark commented 1 month ago

When we come back to this work, I think we need to refactor createTransactionBundle into batch and transaction (the only difference, I think, is the type key on the payload - so batch and transaction need to be wrappers around some common util)