Stream: shorthand
Topic: Bogus cardinality complaint
Jean Duteau (Jan 22 2021 at 18:03):
I have a set of examples where some of the instances live independently and also live as a contained in another instance. I'm doing this by overriding the references in the contained resources when I add them to the parent:
* contained[USAgentAffiliation] = NationalPharmaIndiaAffiliation
* contained[USAgentAffiliation].organization.reference = "#"
* contained[USAgentAffiliation].participatingOrganization.reference = "#usagent"
* contained[USAgent] = NationalPharmaIndiaUSAgent
* contained[USAgent].id = "usagent"
* contained[BusinessOperation] = NationalPharmaIndiaOperation
* contained[BusinessOperation].providedBy.reference = "#"
That seems to work just fine, except that I'm getting a cardinality error on the instances when they are contained but not the instance itself:
error Element Organization.contained:USAgent.identifier:DUNSNumber has minimum cardinality 1 but occurs 0 time(s).
File: /Users/jeanduteau/Documents/DDIWork/Samvit/SPL/fhir-spl/input/fsh/LabelerCodeRequest.fsh
Line: 85 - 110
error Element Organization.contained:USAgent.telecom:Phone has minimum cardinality 1 but occurs 0 time(s).
File: /Users/jeanduteau/Documents/DDIWork/Samvit/SPL/fhir-spl/input/fsh/LabelerCodeRequest.fsh
Line: 85 - 110
error Element Organization.contained:USAgent.telecom:Email has minimum cardinality 1 but occurs 0 time(s).
File: /Users/jeanduteau/Documents/DDIWork/Samvit/SPL/fhir-spl/input/fsh/LabelerCodeRequest.fsh
Line: 85 - 110
Here is the definition of the Instance that shows those things actually exist:
Instance: NationalPharmaIndiaUSAgent
InstanceOf: USAgentOrganization
Description: "An example of a US Agent Organization."
* identifier[DUNSNumber].value = "888888888"
* name = "National Pharma of India Inc. US Agent"
* telecom[Phone].value = "+1-908-999-1212;ext=444"
* telecom[Email].value = "jdoe_2@npoiinc.net"
And when I look at the generated JSON it looks fine as well. I'm not sure why I'm getting those errors.
Chris Moesel (Jan 22 2021 at 23:03):
Hmm... yeah, I'm not sure. We'll have to take a look at that one...
Jean Duteau (Jan 22 2021 at 23:30):
Here's the repository with the files: https://github.com/HL7/fhir-spl
Jean Duteau (Jan 25 2021 at 17:45):
@Chris Moesel i hate to push but I'm wondering if the team will have a chance to look at this and find out what is wrong (or what I'm doing wrong)? I can workaround it but I'd rather not and I'd like my guide to build so the rest of my team can see what the contained resources look like.
Chris Moesel (Jan 25 2021 at 18:37):
@Jean Duteau -- I'll take a look at it this afternoon.
Jean Duteau (Jan 25 2021 at 18:38):
thanks (and sorry again for bothering you about it)
Chris Moesel (Jan 25 2021 at 18:53):
Should I be looking at a specific branch or something? Because it's compiling nice and clean for me using SUSHI 1.1.0:
image.png
Jean Duteau (Jan 25 2021 at 18:54):
of course it is!
Jean Duteau (Jan 25 2021 at 18:54):
i'm running 1.0.1. i thought I had upgraded. let me upgrade and retry
Jean Duteau (Jan 25 2021 at 18:57):
sigh, whatever was broken got fixed in 1.1.0. i should have looked at that before coming here. sorry
Chris Moesel (Jan 25 2021 at 19:21):
It's OK. We actually relaxed some of our cardinality checks around slices in 1.1.0. Although I thought we only did that for instance paths that used numeric indices rather than slice names (which isn't the case here). Anyway, glad it's all good now.
Last updated: Apr 12 2022 at 19:14 UTC