Stream: implementers
Topic: Slicing Composition Entries
Shovan Roy (Feb 19 2019 at 23:56):
Hi all,
I'm currently working on drafting a FHIR document which has couple of sections and each section contains multiple named entries. To achieve this, I've done slicing on both the sections and entries. the section slices are done on the 'code' and is working fine. However, the slicing on the entries (Composition.section.entry()) are not working. I' getting the following types of error while validating the sample using the IG publisher. I've tried the following options and getting the errors as provided in the section below:
I'm getting "Profile based discriminators nust have a type with a profile (Reference.reference)" error if I am doing profile reference based discriminators
Here is the snippet from the SD:
"slicing": {
"discriminator": [
{
"type": "profile",
"path": "reference"
}
],
"rules": "closed"
}
I'm getting "This element does not match any known slice for profile ... and slicing is CLOSED" if I'm using the profile resolve() based discriminators
Here is the Snippet from the SD:
"slicing": {
"discriminator": [
{
"type": "profile",
"path": "resolve()"
}
],
"rules": "closed"
Here is the snippet from the Sample:
"section": [
{
"title": "Other health conditions",
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "86674-9"
}
]
},
"text": {
"status": "additional",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">Other health conditions</div>"
},
"entry": [
{
"reference": "Observation/541a72a8-df75-4484-ac89-ac4923f03b81"
}
]
}
]
In the "Observation/541a72a8-df75-4484-ac89-ac4923f03b81" instance, I've provided the resource profile in the "meta' tag (which matches with the targetProfile as provided in the SD).
It will be extremely helpful if the community can provide me suggestion about what I'm missing in the above implementation or any alternative solution.
Lloyd McKenzie (Feb 20 2019 at 00:54):
Slicing by profile isn't generally supported by the validator
Shovan Roy (Feb 20 2019 at 01:40):
Thanks @Lloyd McKenzie .
I was trying the profile based approach as per the guideline provided in https://www.hl7.org/fhir/profiling.html. I was more interested to use it since the guidelines says: "profile - Used to match slices based on the whether the item conforms to the specified profile. This provides the most power, since the full range of profiling capabilities are available, but it is also the hardest to implement, and requires the most processing (>1000-fold compared to the others). Implementers should use this only where absolutely required. Typical example: slice on the type of Composition.section.entry() for the profiles Current-Clinical-Condition, Past-Medical-Event, etc"
Happy to change it. My objective is to ensure that the slicing on the entries works. May I request you to guide me an alternative approach to slice the entries which works with the validator?
Lloyd McKenzie (Feb 20 2019 at 04:08):
I understand the desire, but it turns out to be hard to implement. If you can slice on the type of the target resource or an element (e.g. code) in the target resource
Rob Hausam (Feb 20 2019 at 15:33):
@Lloyd McKenzie So, I believe we should be able to slice on the value of meta.profile in the resource referenced by Composition.section.entry? In the IPS IG we've tried a variety of approaches to do this using resolve(), but we haven't been able to get it to work yet. Any help working through the details and figuring out either what we've been doing wrong or what's not (yet) supported by the validator (or both) would be great.
Lloyd McKenzie (Feb 20 2019 at 16:07):
You can't count on meta.profile being declared - and the validator doesn't assume it'll be there.
Lloyd McKenzie (Feb 20 2019 at 16:07):
But if you want to force its inclusion, then yes you could slice on that value.
Rob Hausam (Feb 20 2019 at 16:23):
We don't want to force it, but it seems that this may be our only choice if we want it to work? But we still haven't been able to make that work.
Rob Hausam (Feb 20 2019 at 16:24):
So any help in making even that work would be a step forward.
Rob Hausam (Feb 20 2019 at 17:15):
Although on our IPS call just now I think we've decided to relax the approach to use only a reference choice and not require slicing on the entry, as it's appearing likely that we aren't going to have the tooling support needed to really make that work.
Shovan Roy (Feb 20 2019 at 21:26):
I've tried multiple options and unfortunately unable to make any of them working. I used, type - resolve(), type - $this, data- id etc. I've even tried meta.profile but no luck.
It seems entry slicing is not working at all. I guess an alternative option could be not to slice the entry but include all the different profiles as entry reference and provide invariant. However that may become unmanageable when the number of profiles to be included in a sections become 20+ like what we have.
It will be extremely helpful if we get a working position on how entry slicing works.
Shovan Roy (Feb 27 2019 at 04:38):
Problem Summary: Multiple Composition section entry profile (of same resource type) reference choice is not working. It seems validator is caching the first profile of a particular resource type and applying it to all instances of that section.
Details:
As mentioned in the above post, I have been working on drafting a FHIR profiles. The Objective is to construct a FHIR document which contains the followings:
1. Two Sections : Vital Sign and Other health conditions
2. Vital Sign Section consists of the following allowed entries:
1. Body Weight (1..1)
2. Body Height (1..1)
3. Head Circum (1..1)
4. BMI (0..1)
3. Other Assessment Details Contains multiple (~25) Observation profiles.
Initially I tried to achieve the above using Composition.section.entry slicing. However that didn't work (please see the post history for more details).
As an alternative approach, I've chosen entry reference and added allowed entries as references in the target profile. For an example, in the Vital Sign Section I have listed down the following profiles as the entry target profile:
http://hl7.org.au/fhir/ch/v1/StructureDefinition/ncdhc-observation-vitalsign-bodyweight
http://hl7.org.au/fhir/ch/v1/StructureDefinition/ncdhc-observation-vitalsign-bodyheight
http://hl7.org.au/fhir/ch/v1/StructureDefinition/ncdhc-observation-vitalsign-headcircum
http://hl7.org.au/fhir/ch/v1/StructureDefinition/ncdhc-observation-vitalsign-bmi
I've added a sample which consists of Body Weight and BMI entries. However it looks like the validator is applying only the first entry profile reference on the referenced entries. In this case the validator is applying the bodyweight profile on the both the Body Weight and BMI entry in the Bundle and coming back with errors on the BMI entry. I tried with multiple other combinations and found the similar behaviour. It seems the validator is caching the first resource type profile reference only (I may be wrong).
This has become a blocker for us now. @Grahame Grieve , @Lloyd McKenzie may I request you to suggest me if I'm doing anything wrong in my profile? Is there any alternative solution/approach to achieve the above objective?
@Brett Esler , @Danielle Tavares , @Richard Townley-O'Neill fyi..
Here is the details of the profile and sample I've used:
Profile: http://build.fhir.org/ig/hl7au/au-fhir-childhealth/StructureDefinition-ncdhc-composition-health-check-assessment.html
Git Hub: https://github.com/hl7au/au-fhir-childhealth/blob/master/resources/structuredefinition-ncdhc-composition-health-check-assessment.json
Sample: http://build.fhir.org/ig/hl7au/au-fhir-childhealth/Bundle-28900024-070c-4141-8109-9d9fa34dd24b.json.html
GitHub: https://github.com/hl7au/au-fhir-childhealth/blob/master/examples/Bundle-document-healthcheck-response-payload.json
Error page: http://build.fhir.org/ig/hl7au/au-fhir-childhealth/qa.html search Bundle-document-healthcheck-response-payload
Rob Hausam (Feb 27 2019 at 13:02):
This seems pretty similar to where we've landed and the issues that we've encountered with slicing Composition.section and attempting to slice Composition.section.entry in IPS. Agree that a fully functional solution for this is needed.
Shovan Roy (Feb 28 2019 at 21:32):
ok..np.. would it be possible for you to have a look at it today. sorry to bother you on this.. it has now become a burning issue for us and trying to find out a workaround.
Lloyd McKenzie (Feb 28 2019 at 23:15):
Is there an IG I can grab of Github that has all of the relevant files?
Shovan Roy (Feb 28 2019 at 23:31):
The Github location is : https://github.com/hl7au/au-fhir-childhealth
Shovan Roy (Feb 28 2019 at 23:34):
all the relevant files are available in the resource directory.. the above mentioned issue is with the http://build.fhir.org/ig/hl7au/au-fhir-childhealth/StructureDefinition-ncdhc-composition-health-check-assessment.html profile .. please let me know if you need any other details
Shovan Roy (Mar 01 2019 at 00:14):
HI Lloyd.. thanks for looking into it.. let me know if you need any further details. The GitHub location of the profile is: https://github.com/hl7au/au-fhir-childhealth/blob/master/resources/structuredefinition-ncdhc-composition-health-check-assessment.json
Lloyd McKenzie (Mar 01 2019 at 03:22):
That's quite the IG. My PC's had its CPU pinned for 15 minutes just checking the hyperlinks... Have you considered splitting it?
Lloyd McKenzie (Mar 01 2019 at 03:33):
In the slice definition, you're setting Composition.section.entry to max=0, but in your slices you're trying to override it to other values. That's not legal.
Also, why are you using a fixed value for code instead of a pattern? Fixed value is going to prevent translations, display names and other stuff which is all bad practice.
Lloyd McKenzie (Mar 01 2019 at 03:34):
The IGPublisher seems to be hung. Can you send me the igpack it produces when generation completes?
Last updated: Apr 12 2022 at 19:14 UTC