FHIR Chat · hapi_fhir_cli with custom profile · hapi

Stream: hapi

Topic: hapi_fhir_cli with custom profile


view this post on Zulip Günter Zöchbauer (Oct 18 2016 at 05:52):

Is there a way to make hapi_fhir_cli work with a custom profile, so that the profile is referenced in Conformance response?

view this post on Zulip Günter Zöchbauer (Oct 19 2016 at 12:39):

Is this a stupid question?
Any hint?

view this post on Zulip Günter Zöchbauer (Oct 20 2016 at 05:19):

Looks exactly like what I'm looking for. Have yet to check the details though
https://fhirblog.com/2016/10/19/setting-up-your-own-fhir-server-for-profiling/

view this post on Zulip James Agnew (Oct 21 2016 at 16:02):

Hi Gunter, sorry unfortunately this isn't yet supported.

view this post on Zulip Günter Zöchbauer (Oct 21 2016 at 16:09):

@James Agnew Thanks a lot for the info!
Do you know any server I can use to test if my client properly works with servers that have custom profiles configured?

view this post on Zulip James Agnew (Oct 21 2016 at 16:49):

Depends on what you need to test I suppose. I haven't actually yet come across any client workflows that depend on profiles being exposed via the conformance statement yet (not that they don't exist of course).

If you just need a server to serve up resources which declare and conform to a given profile URL, you can upload to most of the public test servers (certainly HAPI among others) and the server will preserve the profile URL when you fetch the resources..

view this post on Zulip Günter Zöchbauer (Oct 21 2016 at 18:03):

@James Agnew I'm working on a code generator for a FHIR REST client, and I want it to build the classes in a way that they include all the expected extensions.
What do you think is the correct way to get this information from a server?

view this post on Zulip James Agnew (Oct 21 2016 at 18:15):

Whoa, neat. Would love to hear more about the project! :)

That does sound like you'd want a proper conformance statement if the aim is to have the code generated for all profiles supported by a given server.

I suppose another approach might be to have it pull down profiles from a registry instead of from the server (e.g. point the tool at a profile on http://simplifier.net and generate corresponding code for that..) Man that would be neat...

view this post on Zulip Günter Zöchbauer (Oct 21 2016 at 18:24):

I'm working for a customer. He considers to make this part open source (yet to decide).

That does sound like you'd want a proper conformance statement if the aim is to have the code generated for all profiles supported by a given server.

Yes, this is exactly what I try to figure out how to do it right.

I suppose another approach might be to have it pull down profiles from a registry instead of from the server (e.g. point the tool at a profile on http://simplifier.net and generate corresponding code for that..) Man that would be neat...

How do I know which profiles should be pulled down for a specific server?

I got the impression this is common practice in .Net, Java, Swift, Python, JS. But the language I'm using is not among these therefore I'm working on my own implementation. At the beginning I got a few ideas from https://github.com/smart-on-fhir/client-py

view this post on Zulip James Agnew (Oct 21 2016 at 21:29):

I might be misunderstanding.. I don't think there are tools in any of these languages yet to go to a server, download the conformance statement and generate code for the profiles it supports.

FWIW HAPI won't do this completely out of the box, but it does let you put anything you want in your server's conformance profile (by overriding ServerConformanceProvider and then passing your overridden class into RestfulServer). You could certainly mock up anything you want it to do..

view this post on Zulip Günter Zöchbauer (Oct 21 2016 at 21:32):

@James Agnew I guess that explains why I haven't yet found anything about that ;-)

So how are people doing this. I assumed the structuredefinitions are supposed to be used to define the interfaces. Are they usually exchanged in advance? Are they more used like documentation to implement the clients and servers accordingly?

view this post on Zulip James Agnew (Oct 21 2016 at 21:36):

So far, yes. The bulk of the current / short term work in this area is using the profiles to do two things: generate documentation (e.g. implementation guides) and do validation of resources which conform to those profiles. There is lots of good tooling for both of these things.

The thing you're talking about, code-generation from profiles, is an awesome idea but I don't believe it exists yet in any platform.

Claude Nanjo is actually doing some really cool work in this space in Java (we're hoping to bring it into HAPI at some point when it's ready).. I do totally think the concept is sound. It's just not a trivial problem to solve which is why it hasn't happened yet.

view this post on Zulip Grahame Grieve (Oct 21 2016 at 21:49):

there's a team in Europe working on java code generation for profiles

view this post on Zulip Grahame Grieve (Oct 21 2016 at 21:49):

we'll see them in a few weeks time at devDays

view this post on Zulip Günter Zöchbauer (Oct 22 2016 at 11:19):

But the conformance statement or capability statement are, at least in theory, the right place to look up the profile configuration for a specific FHIR REST endpoint?
Until this is fully supported by HAPI or other tools, the way to go is to just share the profiles as XML or JSON files, right?

view this post on Zulip Brian Postlethwaite (Oct 24 2016 at 01:21):

Rather than working from a conformance statement from a specific server, I would think you'd be creating the conformance resource that you plan for the project to generate off. This is then not dependant on any specific server.
And you can publish that to other server vendors to state that this is the base profile that we expect everyone to be able to support.
For our needs we are just using the standard .NET FHIR client, and have wrappers converting from our native (legacy/internal) object models into the FHIR model, with extensions included as required.

view this post on Zulip Günter Zöchbauer (Oct 25 2016 at 05:28):

Thanks a lot everyone for helping me understand this topic better.

@Brian Postlethwaite I guess that could work.

I'm still wondering what the purpose of the profile information in the conformance statement is then exactly.

view this post on Zulip Brian Postlethwaite (Oct 25 2016 at 06:04):

There are 2 reasons that I would expect to find the profile in there (both are related to what you could expect to find in the server)
1. The server is a facade on an existing legacy system that cannot handle anything but the provided profile. (other content will be discarded or rejected as the server doesn't support storing it)
2. The server is planning to only support a subset of information based on a defined profile for a specific use.
(Such as configuring a HAPI server - which can support any fhir content - such that it will only accept that subset of content - disclaimer: not sure if you can configure HAPI like this out of the box yet.)

view this post on Zulip Günter Zöchbauer (Oct 25 2016 at 06:20):

Thanks, I think that helps me understand a bit better how FHIR is supposed to be used.

view this post on Zulip Mustafa Yuksel (Nov 10 2016 at 13:24):

Hi all, I have read the whole conversation with great interest. Within the scope of a multi-national EU project for diabetes, we have profiled several FHIR resources, and as the server side we would like to provide our client partners with easy to use HAPI based java clients. For a few profiled resources only, the simplest way is to manually create custom classes extending native resources. However, we have tens of profiled resources and we would like to have a more sustainable and reusable mechanism. Hence, we are also looking into code generation automatically from structure definitions.
@James Agnew and @Grahame Grieve Regarding the efforts you mentioned (i.e. Claude Nanjo and a team in Europe), is there any further information that you can share or point to? We can actively contribute to such efforts if possible. In the worst case, we are planning to implement it ourselves. Thanks.

view this post on Zulip James Agnew (Nov 13 2016 at 19:58):

Unfortunately there isn't really anything I can point you to. We've had lots of discussions about getting this project off the ground, but I'm not sure if any code has actually been written that is anywhere public yet. I know Claude's plans are to contribute his work back to HAPI, but I don't believe he has any code written yet. The other effort was presented at DevDays last year, but I don't believe they are open-sourcing their work.

If you decide you want to go down the code-generation route, of course I'd be delighted if you wanted to do it in a way that we could integrate it into HAPI. I'm happy to chat about ideas for how it could be done... I've got lots of ideas, just not enough hours in the day to do them all. :)

view this post on Zulip Mustafa Yuksel (Nov 14 2016 at 07:15):

Thanks James. We are happy to collaborate for integration with HAPI. I will come back to you soon with some more details about our plans.


Last updated: Apr 12 2022 at 19:14 UTC