Stream: tooling
Topic: igpublisher and scope of unique resource id
Richard Townley-O'Neill (Jul 27 2020 at 04:12):
I want to create a CodeSystem and ValueSet with the same id and name, though with different file names.
I believe that this is possible and appropriate.
The FHIR IG Publisher Version 1.1.3 gives me an error about there being a duplicate resource.
Duplicate Resource in IG: ValueSet/sra-external-service-type
Exception in thread "main" java.lang.Error: Unable to continue because duplicate input resources were identified
at org.hl7.fhir.igtools.publisher.Publisher.load(Publisher.java:3012)
at org.hl7.fhir.igtools.publisher.Publisher.createIg(Publisher.java:842)
at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:708)
at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:7835)
Is this an IGPublisher bug? Is this expected behaviour?
Richard Townley-O'Neill (Jul 27 2020 at 04:13):
implementationguide-serviceregistrationassistant-2.xml sra-external-service-type.xml sra-external-service-type-codesystem.xml
Richard Townley-O'Neill (Jul 27 2020 at 04:14):
@Grahame Grieve ?
Michael Lawley (Jul 27 2020 at 04:14):
ValueSets and CodeSystems exist in the same conceptual namespace wrt URI uniqueness i.e., they are not allowed to share a URI
Richard Townley-O'Neill (Jul 27 2020 at 04:15):
One URI contains CodeSystem and one ValueSet.
They are not quite the same.
Michael Lawley (Jul 27 2020 at 04:15):
It may also be that the URI for the default "all codes" implicit ValueSet is clashing?
Michael Lawley (Jul 27 2020 at 04:15):
i.e., the value of CodeSystem.valueSet
Richard Townley-O'Neill (Jul 27 2020 at 04:17):
Maybe.
Grahame Grieve (Jul 27 2020 at 04:19):
the check is for duplicates on type/id, not just id. That suggests that there's something more going on that you appreciate
Richard Townley-O'Neill (Jul 27 2020 at 04:22):
(deleted)
Richard Townley-O'Neill (Jul 27 2020 at 04:22):
(deleted)
Richard Townley-O'Neill (Jul 27 2020 at 04:38):
I get the same problem, with a different error message if I change nothing but the names of the files: sra-external-service-type.xml to * sra-external-service-type-valueset.xml* and sra-external-service-type-codesystem.xml to sra-external-service-type.xml
Now the reported duplicate resource is in CodeSystem/... not ValueSet/...
Duplicate Resource in IG: CodeSystem/sra-external-service-type
Exception in thread "main" java.lang.Error: Unable to continue because duplicate input resources were identified
at org.hl7.fhir.igtools.publisher.Publisher.load(Publisher.java:3012)
at org.hl7.fhir.igtools.publisher.Publisher.createIg(Publisher.java:842)
at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:708)
at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:7835)
Which suggests that it is not a clash with the name for an implicit valueset.
Richard Townley-O'Neill (Jul 27 2020 at 04:39):
sra-external-service-type.xml sra-external-service-type-valueset.xml implementationguide-serviceregistrationassistant-2.xml
Richard Townley-O'Neill (Jul 27 2020 at 04:39):
Any idea what might be going on?
Richard Townley-O'Neill (Jul 27 2020 at 04:41):
Is it a bad idea to give a codesystem and a valueset of all of its contents the URIs CodeSystem/a-name and ValueSet/a-name ?
I thought it was preferred.
Grahame Grieve (Jul 27 2020 at 04:42):
it's certainly common. I don't know about preferred. It suggests that you have some registration problem somewhere
Richard Townley-O'Neill (Jul 27 2020 at 04:42):
It is all in a local build using ig.json.
Richard Townley-O'Neill (Jul 27 2020 at 04:45):
There is not much to cause problems as the three posted resources are all that there is in the resources directory.
Richard Townley-O'Neill (Jul 27 2020 at 04:45):
Any suggestions as to where to look?
Grahame Grieve (Jul 27 2020 at 04:47):
looks ok. can you package up the whole thing so I don't have to spend time doing it?
Richard Townley-O'Neill (Jul 27 2020 at 04:48):
How do I package an IG that does not build?
Grahame Grieve (Jul 27 2020 at 05:39):
the problem here is the way that the publisher loads content. It's pretty resilient, but the resilience has a price. You can have more than one resource with the same id, but if you do, you cannot have a source file with just [id] as the name (sra-external-service-type in your case). you need to be explicit about the type for all files: codeystem-sra-external-service-type
Richard Townley-O'Neill (Jul 27 2020 at 06:06):
works a treat.
Thanks.
Richard Townley-O'Neill (Jul 28 2020 at 04:36):
:disappointed: This still has problems.
While it builds fine The ValueSet's links to the CodeSystem are wrong.
For example the text
Include all codes defined in http://sra.digitalhealth.gov.au/fhir/CodeSystem/sra-external-service-category
has a '/' instead of a '-' and links to
file:///C:/work/git/sra-fhir-release-2/output/CodeSystem/sra-external-service-category.html instead of
file:///C:/work/git/sra-fhir-release-2/output/CodeSystem-sra-external-service-category.html
Grahame Grieve (Jul 28 2020 at 04:43):
that's in your set up - not to do with the ids
Richard Townley-O'Neill (Jul 28 2020 at 04:48):
Can you suggest where to start looking?
Grahame Grieve (Jul 28 2020 at 04:49):
what template are you using?
Richard Townley-O'Neill (Jul 28 2020 at 04:49):
I'm using pre-template ig.json
Richard Townley-O'Neill (Jul 28 2020 at 04:52):
I might have it: vs.html in the same directory as the ig.json
Grahame Grieve (Jul 28 2020 at 05:08):
then you need to specify the file output pattern
Last updated: Apr 12 2022 at 19:14 UTC