Stream: implementers
Topic: Difference between 'Profile' and 'Target profile' in Forge
Jakob Lindblad (Nov 05 2018 at 13:35):
Hi,
What is the difference between 'Profile' and 'Target profile' on type 'Reference' in Forge, and how do i use this correctly?
If i create a new profile based on the resource 'Location' i can see that 'managingOrganization' is of type 'Reference(Organization)' and has a 'Target profile' -> http://hl7.org/fhir/StructureDefinition/Organization. The field 'Profile' is by default empty. I get this since this is just a reference to a basic profile on 'Organization'.
But what is the approach if i want to reference my own profile of 'Organization'?
My guess was that i point 'Target profile' to my Organization profile(like http://absoluteUri/myOrganization) and in the 'Profile' field i reference the basic profile for Organization(http://hl7.org/fhir/StructureDefinition/Organization). However Forge is giving me an Error when i open the profile again sayin "... The target represent a profile on 'Location' which is incompatible with the element type 'Reference' ", so im obviously doing something wrong.
If i hoover over 'Target profile' and 'Profile' the help dialog is exactly the same. So what is the difference and when do i use what?
Michel Rutten (Nov 05 2018 at 13:38):
ElementDefinition.type.targetProfile
only applies when ElementDefinition.type.code
equals 'Reference'. In that case, the targetProfile
property allows you to constrain the target resource of the reference, whereas ElementDefinition.type.profile
would constrain the Reference itself - which FHIR allows, but is usually not what you need/want.
Lloyd McKenzie (Nov 05 2018 at 13:39):
Profile is a profile on the "Reference" data type itself. You could use it to mandate that "display" is present or to prohibit Reference.identifier
Michel Rutten (Nov 05 2018 at 13:39):
Exactly!
Lloyd McKenzie (Nov 05 2018 at 13:39):
Actually @Michel Rutten, targetProfile is also allowed if the type is Resource.
Michel Rutten (Nov 05 2018 at 13:39):
Today I learned...
Michel Rutten (Nov 05 2018 at 13:41):
@Lloyd McKenzie could you explain when this applies and what it means?
Lloyd McKenzie (Nov 05 2018 at 13:50):
It would apply for something like Bundle.entry.resource
Lloyd McKenzie (Nov 05 2018 at 13:50):
At least that's my understanding
Brian Postlethwaite (Nov 05 2018 at 22:19):
Or in the parameters resource.
Grahame Grieve (Nov 09 2018 at 01:04):
Actually @Michel Rutten, targetProfile is also allowed if the type is Resource.
really? why?
Lloyd McKenzie (Nov 09 2018 at 01:14):
Can you just change the type to a specialization when slicing?
Grahame Grieve (Nov 09 2018 at 01:20):
no but you'd use profile, not targetProfile
Lloyd McKenzie (Nov 09 2018 at 01:36):
Ok. Then I stand corrected. And @Michel Rutten will have to unlearn what I mis-taught him...
Michel Rutten (Nov 09 2018 at 10:02):
Clear, thanks!
Last updated: Apr 12 2022 at 19:14 UTC