简体   繁体   中英

FHIR server: using own profiled resource in response or a base resource?

We are developing a FHIR server. We have profiled Condition resource. Now we have been trying to figure out in HAPI library documentation that do we actually return in GET search request a HL7 base resource for Condition or can we return our own profiled resource?

We only find this example in HAPI documentation that return a base resource for Patient. https://hapifhir.io/hapi-fhir/docs/server_plain/resource_providers.html#resource-providers

If we return our own profiled resource, do we need to validate it or is the only difference that we insert meta.profile field in return resource? Is there any example how to return own profiled resource?

In response to a Get, the default is that servers return the data they have. In some cases, they may need to filter to exclude data the requesting system/user does not have permission to share. You can use a profile to document that set of expectations (ie what data the server is capable of exposing/exposing to a given recipient).

When you return an instance, if you happen to be aware that the instance complies with one or more profiles, you're free to list those in Resource.meta. However, there's no general expectation that you do so. Occasionally IGs will set expectations for profile declaration, though this is generally discouraged as it can impose an unnecessary interoperability barrier.

A system is non-conformant if it declares a profile that it turns out the instance is not valid against. Most of the time, this is handled by validating inbound data rather than validating when creating a response, as that's more efficient. However, if you want to validate a response before returning it, you certainly can. (Presumably dropping the profile declaration if it turns out the instance isn't valid against it.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM