beda-software / fhir-py

FHIR Client for python
MIT License
177 stars 33 forks source link

Is there an API to handle the ValueSet resource? #102

Open anibal2j opened 1 year ago

anibal2j commented 1 year ago

I need to generate ValueSet in JSON from some data that's stored in Excel. I can read the Excel data no problem (using pandas), but I'd like to have an API to be able to build a ValueSet and then have that resource export it to JSON, so that we can import it into some other system. I've been looking at this library - but can't find any classes nor API to deal with ValueSet.

If the ValueSet resource is not available in the FHIR-PY, is there another module out there that I can use?

ruscoder commented 1 year ago

Hi @anibal2j! This library provides general resource wrappers, so it means that you can use low-level API:

my_vs = client.resource("ValueSet", {
    # Content of ValueSet resource
})
my_vs.save()
ruscoder commented 1 year ago

If you need to execute ValueSet operations, like $expand it can be done using execute(), e.g.:

my_vs.execute('$expand')