FHIR Chat · Open API spec · implementers

Stream: implementers

Topic: Open API spec


view this post on Zulip Dinesh Palanivel (Mar 10 2021 at 22:31):

Hello folks.. Is there a good reference point for an Open API spec for Patient resource? Any base sample that you can point me to?
Much appreciated...

view this post on Zulip Lloyd McKenzie (Mar 10 2021 at 22:40):

You might want to search "Open API" on this site - there's a lot of discussion, both about what's available as well as the limitations.

view this post on Zulip Dinesh Palanivel (Mar 10 2021 at 22:44):

Lloyd McKenzie said:

You might want to search "Open API" on this site - there's a lot of discussion, both about what's available as well as the limitations.

Thank you so much.. Will search...

view this post on Zulip Richard Braman (FLY.HEALTH) (Mar 15 2021 at 20:13):

@Dinesh Palanivel , there are open api specs available for download on each IG page. The one for US Core , which has the patient resource is here: https://www.hl7.org/fhir/us/core/us-core-server.openapi.json . There is also a full r4 open api file, but I cant seem to put my finger on it. Anyone else have a pointer?

view this post on Zulip Dinesh Palanivel (Mar 15 2021 at 20:17):

Richard Braman (FHIRFLY.IO) said:

Dinesh Palanivel , there are open api specs available for download on each IG page. The one for US Core , which has the patient resource is here: https://www.hl7.org/fhir/us/core/us-core-server.openapi.json . There is also a full r4 open api file, but I cant seem to put my finger on it. Anyone else have a pointer?

Thank you.. Its very helpful

view this post on Zulip Gino Canessa (Mar 15 2021 at 20:19):

I have an example of an R4 output on SwaggerHub. It's generated by the fhir-codegen on GitHub. I'd recommend searching Zulip for discussion on OpenApi, since it's quite the can of worms in practice =)

view this post on Zulip Dinesh Palanivel (Mar 15 2021 at 20:28):

Gino Canessa said:

I have an example of an R4 output on SwaggerHub. It's generated by the fhir-codegen on GitHub. I'd recommend searching Zulip for discussion on OpenApi, since it's quite the can of worms in practice =)

I like the work and its just awesome.. It's helping us a lot. Appreciate the great work.

view this post on Zulip Richard Braman (FLY.HEALTH) (Mar 16 2021 at 01:19):

Gino Canessa I took a look at your file Gino, and its just a small subset of the full r4. I know there is a full r4 OpenAPI 3 or Swagger 2 file floating around somewhere. I cant remember if I generated it from a tool or if someone else at HL7 did, but either way I can find it.

view this post on Zulip Josh Mandel (Mar 16 2021 at 01:21):

I think the challenge is that "full r4 OpenAPI" isn't a well-defined concept; there are dozens of small decisions you need to make when you decide to represent FHIR in OpenAPI. (Though certainly for something to count as "full r4 OpenAPI" there are certain necessary conditions -- e.g., including definitions for all resource types.)

view this post on Zulip Richard Braman (FLY.HEALTH) (Mar 16 2021 at 01:26):

I agree josh, I was using the full r4 fhir file as a way to create a full test suite in postman which was very convenient and worked quite well. I have also used various openapi 3 fhir files from the IGs to creates typescript libraries and apigee proxies and the results were pretty good. I just cant find the file....

view this post on Zulip Gino Canessa (Mar 16 2021 at 20:14):

Hi @Richard Braman (FHIRFLY.IO) , the one I posted is a subset so the pages work =). Here is a "full" version (the generator only exports paths for what is available on a server - but this is using HAPI R4, so it's pretty complete). That said, the page does not work for me - too large for SwaggerHub :-/.

So, attached is a Zip with the OAS 3 JSON file I used to import that: OpenApi_R4.zip. That's part of why I've moved my focus from static output to tooling - beyond things like files being too large, there are many issues with workflow (e.g., required casing of symbols, etc.).

Beyond the more practical issues above are the questions around usability - most languages would be better served with code that uses their FHIR libraries (e.g., Java code should use HAPI, C# code should use Firely, etc.). None of the OpenAPI code generators can do that today, and I'm not sold on trying to do it there. But, doing "something" in that space is surfacing on my to-do list, so I hope to be able to put something up for discussion soon.

view this post on Zulip Jose Costa Teixeira (Mar 24 2021 at 18:04):

I'm catching up with this. When I take an openAPI file as generated by the IG publisher, if I put it in SwaggerUI or ReDoc gives me an error that it can't get the schemas it needs
ReDoc says "
Error: Error downloading https://hl7.org/fhir/R4/OperationOutcome.xsd
Failed to fetch
"

view this post on Zulip Jose Costa Teixeira (Mar 24 2021 at 18:05):

is there a working solution at this moment? I want to include only my system's capStatment in a ui such as those mentioned above.

view this post on Zulip Jose Costa Teixeira (Mar 24 2021 at 18:06):

do I need to include the ful fhir spec (that huge file that @Gino Canessa mentions)?
Or is this any other type of limitation e.g. CORS (I just tried the online demos of redoc and swaggerui)

view this post on Zulip Gino Canessa (Mar 24 2021 at 19:25):

All the good questions =).

I have not worked much with the output from IG publisher yet, since I have been focused more on the core specs. Is the IG are you working with public, so I can take a look?

That said, I am currently working on adding IG support to the code generator, so once that's complete I can test the OpenAPI output as well.

view this post on Zulip Jose Costa Teixeira (Mar 24 2021 at 19:37):

I just created a simple IG and added a draft capStatement provided by the project, and this is what the Publisher generated:

view this post on Zulip Jose Costa Teixeira (Mar 24 2021 at 19:37):

https://gist.githubusercontent.com/costateixeira/e3eaaaa2b170df02bb9439a47fa828ab/raw/0d3c559927e305c837eaedb285fd3415c92e6c1a/allergyintolerance.openapi.json

view this post on Zulip Jose Costa Teixeira (Mar 24 2021 at 19:38):

https://gist.githubusercontent.com/costateixeira/71e98b0da6f292ec097500d518ef5baf/raw/00d9c96f301ab5c404e9f1efdd2a1ff110a8b11a/test.json

view this post on Zulip Gino Canessa (Mar 24 2021 at 19:45):

Hmm... I'll poke around with it shortly and see what I can do.

view this post on Zulip Jose Costa Teixeira (May 07 2021 at 21:44):

@Gino Canessa have you had any chance to look into openapi?

view this post on Zulip Gino Canessa (May 07 2021 at 21:49):

@Jose Costa Teixeira unfortunately, it's still a bit down on my list. I still have a tab open with ReDoc to remind me though =)

view this post on Zulip Jose Costa Teixeira (May 07 2021 at 21:53):

:)

view this post on Zulip Jose Costa Teixeira (May 07 2021 at 21:54):

do you recommend me to look at something to try and advance the work? Any idea of what I can do that could be useful?

view this post on Zulip Gino Canessa (May 07 2021 at 22:02):

You've already created an example of what you'd like, so there's not much on that front. If you want to play with the generator, it's on GitHub, the only file that you'd really need to look at would be LangOpenApi.cs.

Otherwise, I'll get to it as soon as I can!

view this post on Zulip Richard Braman (FLY.HEALTH) (May 07 2021 at 22:23):

I am a big fan of OpenAPI. I use it to create proxies, test suites, swagger clients, and the like, so its very important to me that an IG ships with an OpenAPI file. OpenAPI is not too different from a Capability Statement, and there are several prior works in the public domain that simply create an OpenAPI spec from the Capability Statement. Many IGs ship with an OAPI3 file, including US Core, Carin BB, Saner, Davinci Plannet, Pdex, etc. However some, such as Bulk Data, do not. I cannot figure out why some do and some do not. Is it a feature of the IG generator (SUSHI vs Publisher)? Or is it a IG otuput configuration that some maintainers use and some do not?

view this post on Zulip Eric Haas (May 08 2021 at 01:10):

the OpenAPI is created from the Capstatements by the ig publisher. But is still a WIP

view this post on Zulip Eric Haas (May 08 2021 at 01:15):

@Jose Costa Teixeira I have toyed with the fhir.resources library which uses pydantic and has great potential for use with fastAPI to create swagger files out of the box, but I haven't gotten very far. See this thread

view this post on Zulip Jose Costa Teixeira (May 09 2021 at 13:08):

Gino Canessa said:

You've already created an example of what you'd like, so there's not much on that front.

The issue is that it doesn't work - it doesn't resolve the schema. I don't know if that is a schema limitation, or it could be due to CORS...


Last updated: Apr 12 2022 at 19:14 UTC