1

What if my FHIR server needs to support multiple profiles, and they have conflicts, e.g. same resource is included in both profiles?

How this conflict meant to be resolved on the protocol level? As far as I understand, the resource url should always be the same (/Patient, not /PatientUSCore + /PatientCarinBB).

Also, how it should look like in the Capability Statement? I can see that each resource can have only one profile, not and array.

Does HAPI FHIR support such a thing?

silent-box
  • 1,649
  • 3
  • 21
  • 40

1 Answers1

2

The CapabilityStatement defines what your internal system capabilities are - i.e. what data elements can you actually receive and store or spit out. Typically, it's possible to comply with multiple profiles simultaneously - you just need to spit out all the data elements, codings, extensions, etc. required by anyone. Where this runs into trouble is where profiles improperly enforce maximums. It's super bad practice to say things like "Patient.name is 1..1". The correct approach is for a profile to say "Of all the Patient.names that exist, there must be exactly one that is marked as a legal name, does not have an end date (and possibly that has an extension declaring it as the 'U.S. legal name)". That approach means that a system can build a single interface that exposes the relevant data to everyone and consuming systems can use the data they care about. Otherwise, you're forced to create, maintain and expose different interfaces to different consumers which creates additional initial and ongoing costs.

It's possible for instances to declare conformance with multiple profiles, but the usual recommendation is to not declare profiles at all (as it's unlikely you'll ever declare all the profiles most consumers will care about). Instead, client applications will determine validity against what profiles they care about if/when they care to.

Lloyd McKenzie
  • 6,345
  • 1
  • 13
  • 10
  • Thank you for the answer! When you say "to not declare profiles at all", do you mean that in the capability statement, I need to specify the hl7.org profile, but add all the extensions/codings/elements from the supported profiles for this resource? – silent-box May 08 '20 at 20:13
  • 1
    I was referring to in instances, though declaring profiles is also optional in the CapabilityStatement. Technically, there are two places for profiles - resource.profile indicates the base capabilities of the system and resource.supportedProfile indicates what profiles are recognized and complied with. – Lloyd McKenzie May 09 '20 at 01:55