Stream: shorthand
Topic: Resource must define resourceType and id
Ward Weistra (Jun 16 2020 at 13:57):
error Resource at C:\Users\Ward\Documents\FHIR workspace\R4\SushiProject\ig-data\input\resources\ACMEUSCorePatientProfile.StructureDefinition.json must define resourceType and id.
Is id
an IG publisher requirement because the files need to be renamed to type-id.json
? Because id
isn't mandatory, right? I generally don't fill it for profiles (I'm not a real user though).
Lloyd McKenzie (Jun 16 2020 at 14:13):
id is mandatory if you want to be able to reference the resource - which obviously in an IG we do
Nick Freiter (Jun 16 2020 at 14:24):
You are exactly right as to why SUSHI requires the id in that situation though. Since the IG Publisher expects files to be in the format type-id.json
, we rename files to be in that format, so we do require that those files have an id
.
If someone was just using SUSHI to turn FSH files into JSON without any of the extra IG Publisher things I could see why you might not want to have to set an id
. But, I'm not so sure why someone using SUSHI for that use case would even be putting resources into ig-data/input/resources
, since generally the reason to put resources there is so that they get copied over to the input/resources
folder that the IG Publisher will use, while also being included in the SUSHI generated IG resource.
Jose Costa Teixeira (Jun 16 2020 at 14:41):
Nick Freiter said:
the IG Publisher expects files to be in the format
type-id.json
, we rename files to be in that format, so we do require that those files have anid
.
probably not relevant but the publisher can handle files that are not named as `type-id.json/xml'. This naming convention keeps things safe, though
Lloyd McKenzie (Jun 16 2020 at 15:14):
I don't think it can handle files that don't have ids though
Chris Moesel (Jun 16 2020 at 15:21):
I'm 98% sure the publisher at least used to complain when file names did not follow the type-id.json
format. It sounds like maybe that's not the case anymore, but as Lloyd noted -- probably still a good idea.
Lloyd McKenzie (Jun 16 2020 at 15:25):
Regardless of the filename, the IG points to the included files by reference - which needs an id.
Ward Weistra (Jun 17 2020 at 16:29):
Thanks for the explanations! @Nick Freiter I'm taking advantage of sushi's config.yaml, even when I only have JSON resources, to get my IG Publisher project configured :slight_smile: But it's clear I'll just have to add an id
to make an IG.
Last updated: Apr 12 2022 at 19:14 UTC