Stream: IG creation
Topic: Resolving URL in IGs
Arvid Thunholm (May 24 2021 at 14:57):
Hi,
I´m a beginner in IG creation. I have created an IG using Sushi ang IG builder and a resulting profile can be seen here: http://hl7.se/fhir/ig/base/StructureDefinition-SEBasePatient.html
My question is wheater the "Defining url" and the Official ULR should be resolvable? The web strucure generated by Sushi/IG builder creates a profile page as StructureDefinition-SEBasePatient.html and the defining url as ...StructureDefinition/SEBasePatient
Regards
Arvid
Lloyd McKenzie (May 24 2021 at 15:33):
It's nice if they resolve - and even nicer if they have content negotiation that pays attention to the accept header and provides XML, JSON or TTL if asked for. However, there's no requirement that they resolve. One special case is extensions, where there's a requirement that if you expose an extension in an instance, the receiver must be able to find the definition of that extension. The easiest way to make that happen is for the extension URL resolve. However, putting the extension in a common public registry, or pre-negotiation in a closed community can also achieve the objective.
Jose Costa Teixeira (May 24 2021 at 17:00):
I'd say it's not nice if they don't resolve, depending on your goals. For example if you start deriving profiles from profiles
Arvid Thunholm (May 24 2021 at 17:09):
Ok, but there isn't any build in mechanism in IG builder to create a web folder structure resulting in paths matching the defining Url:s?
I would have to create that myself with routes or redirects?
Jose Costa Teixeira (May 24 2021 at 17:24):
the publisher handles that (i haven't tested this in production but it is the same procedure used in the HL7 IGs)
Jose Costa Teixeira (May 24 2021 at 17:27):
Of course you have to match the base path with something that exists (i.e. if your urls are http://somewhere.se/fhir/medication/StructureDefinition/SePatient, then you should have the rights to manage files in http://somewhere.se/fhir/medication)
Lloyd McKenzie (May 24 2021 at 17:40):
Resolution has nothing to do with derivation. If you're doing derivation, your IG should have a package reference to the other IG - so you could care less about canonicals resolving.
Arvid Thunholm (May 24 2021 at 19:21):
Jose Costa Teixeira said:
Of course you have to match the base path with something that exists (i.e. if your urls are http://somewhere.se/fhir/medication/StructureDefinition/SePatient, then you should have the rights to manage files in http://somewhere.se/fhir/medication)
Yes, but do you have to do that manually? I have simple FTP access to hl7.se/fhir path and can put any folder structure I want under that. I was expecting the IG publisher to create that folder structure for me, but it outputs a flat structure with files like StructureDefinition-SEBasePatient.html
So do I have to manually create the StrucuteDefinition folder, the SEBasePatient folder and then put the content of StructureDefinition-SEBasePatient.html in an index.html file in that folder (alternatively work with routes/redirects)?
Jose Costa Teixeira (May 24 2021 at 21:00):
sorry, I may have misled you
Jose Costa Teixeira (May 24 2021 at 21:02):
I would presume the publisher does everything for you. I'm not sure if the URL should StructureDefinition/whatever.json or StructureDefinition-whatever.json. I should be trying it next time we publish something
Jose Costa Teixeira (May 24 2021 at 21:03):
if you have access and want to give it a go, the process for "final" publication that adds the redirects is documented here:
Jose Costa Teixeira (May 24 2021 at 21:03):
https://confluence.hl7.org/pages/viewpage.action?pageId=104580055
Lloyd McKenzie (May 24 2021 at 22:21):
If you want to follow convention, then your canonical URLs would look like a standard FHIR RESTful endpoint, which means the files would be sitting beneath a folder named StructureDefinition. No need to have an index.html in the folder, though it's not a bad thing if you have one.
Grahame Grieve (May 24 2021 at 23:27):
there isn't any build in mechanism in IG builder to create a web folder structure resulting in paths matching the defining Url:s?
There is, but it's (a) server software dependent, At present IIS, Apache and Nginx are supported. and (b) it's not documented. Documenting it is on my todo list
Arvid Thunholm (May 25 2021 at 06:42):
Grahame Grieve said:
there isn't any build in mechanism in IG builder to create a web folder structure resulting in paths matching the defining Url:s?
There is, but it's (a) server software dependent, At present IIS, Apache and Nginx are supported. and (b) it's not documented. Documenting it is on my todo list
Ok, so my current approach is to create a folder structure according to the canonical url's: ./StructureDefinition/Resource and in that folder place a htaccess file that does a 302 redirect to the correct file: webroot/StructureDefintion-Resource.html
Arvid Thunholm (May 25 2021 at 06:43):
Lloyd McKenzie said:
If you want to follow convention, then your canonical URLs would look like a standard FHIR RESTful endpoint, which means the files would be sitting beneath a folder named StructureDefinition. No need to have an index.html in the folder, though it's not a bad thing if you have one.
Ok, but why doesn't the IG builder create that structure? Now everything ends up in a flat file structure. If I start moving the files around the links in the IG will stop working
Jose Costa Teixeira (May 25 2021 at 06:47):
@Grahame Grieve is such a folder structure needed?
Grahame Grieve (May 25 2021 at 08:50):
the Ig publisher doesn't create that structure for several reasons:
- The IG will not be posted to the web site directly without other changes
- exactly what goes in those directories is server software specific
- most runs of the IG publisher, that content is just dead weight
Instead, there's a post-processing mode that creates the folders when you decide to post the IG to the web folder, and does other things like update package and rss feed infomration
Arvid Thunholm (May 25 2021 at 09:43):
Are we talking about this?
https://confluence.hl7.org/pages/viewpage.action?pageId=104580055
Grahame Grieve (May 25 2021 at 09:57):
yes @Jose Costa Teixeira was trying to document the process. I wanted to document the underlying assumptions and then review that doco. The process we use at HL7 is https://confluence.hl7.org/display/FHIR/Process+for+Publishing+a+FHIR+IG
Grahame Grieve (May 25 2021 at 09:58):
but that is purely process documentation; it doesn't document why or how it works, or what the set up process is
Jose Costa Teixeira (May 25 2021 at 10:31):
Did we just add stuff to @Grahame Grieve 's backlog? That costs Karma points, right?... :sweat_smile:
David Pyke (May 25 2021 at 13:51):
Now there's a good idea. Adding anything to Grahame's backlog costs points. We all start with 100 and Grahame decides how much a backlog item costs. When you hit zero points, you have to do something nice for him to get reloaded.
Grahame Grieve (May 25 2021 at 14:03):
man most of you are already at 0
David Pyke (May 25 2021 at 14:03):
Well, that's another bottle of wine on me...
Jose Costa Teixeira (May 25 2021 at 14:05):
right. I guess my score by now should look like
Jose Costa Teixeira (May 25 2021 at 14:07):
(the imaginary part is positive but the real part should be quite negative :innocent: )
Arvid Thunholm (May 26 2021 at 06:55):
@Jose Costa Teixeira - I´m trying out your guide mentioned above and on the setup phase I´m running into a jekyll error when running the publication.jar. Is this something that looks familiar?
Generating Summary Outputs (02:46.0795)
Sending Usage Stats to Server (03:03.0885)
Memory (MB): Use = 567, Free = 465, Total = 1033, Max =1796
Reclaiming memory...
Memory (MB): Use = 333, Free = 741, Total = 1075, Max =1796
Jekyll: Source: C:/Users/svratu/Documents/workspace/basprofiler-publication/patient-ig/temp/pages (03:28.0450)
Jekyll: Generating... (03:28.0451)
Jekyll: [33m Liquid Warning: Liquid syntax error (line 21): [:open_square, "["] is not a valid expression in "{{[fmt]}}" in CodeSystem-SecurityLabel.{{[fmt]}}.html←[0m (03:36.0420)
Jekyll: [33m Liquid Warning: Liquid syntax error (line 21): [:open_square, "["] is not a valid expression in "{{[fmt]}}" in CodeSystem-SecurityLabel.{{[fmt]}}.html←[0m (03:36.0422)
Jekyll: [33m Liquid Warning: Liquid syntax error (line 21): [:open_square, "["] is not a valid expression in "{{[fmt]}}" in CodeSystem-SecurityLabel.{{[fmt]}}.html←[0m (03:36.0424)
Jekyll: [33m Liquid Warning: Liquid syntax error (line 21): [:open_square, "["] is not a valid expression in "{{[fmt]}}" in Patient-PatientExample1.{{[fmt]}}.html←[0m (03:36.0540)
Jekyll: [33m Liquid Warning: Liquid syntax error (line 21): [:open_square, "["] is not a valid expression in "{{[fmt]}}" in Patient-PatientExample1.{{[fmt]}}.html←[0m (03:36.0541)
Jekyll: [33m Liquid Warning: Liquid syntax error (line 21): [:open_square, "["] is not a valid expression in "{{[fmt]}}" in Patient-PatientExample1.{{[fmt]}}.html←[0m (03:36.0543)
the command prompt freezes after this
Grahame Grieve (May 26 2021 at 06:56):
that's a template error unrelated to the second phase of publishing
Arvid Thunholm (May 26 2021 at 06:59):
so there is something wrong with my template?
Jose Costa Teixeira (May 26 2021 at 07:13):
i doubt it (unless you messed with it)
Jose Costa Teixeira (May 26 2021 at 07:13):
Is this in a repository somewhere?
Arvid Thunholm (May 26 2021 at 07:33):
yes: https://github.com/HL7Sweden/basprofiler-r4/tree/ballot-patient
I did use a swedish template but I've also tried using fhir.base.template in the build and the same error appears
Michaela Ziegler (May 26 2021 at 08:16):
@Arvid Thunholm do you use the latest IG publisher? (I had this problem with an older version)
Arvid Thunholm (May 26 2021 at 08:51):
@Michaela Ziegler thank you - that solved the issue! My publisher was a month old.
Arvid Thunholm (May 26 2021 at 08:55):
@Grahame Grieve Is this the documentation you were talking about being on your todo-list:
Done. This IG has been built using the 'normal' process for local use. If building to host on an an external website, use the process documented [yet to be documented]])
Grahame Grieve (May 26 2021 at 08:55):
yes
Jose Costa Teixeira (May 26 2021 at 09:06):
(late to the party - I just tried and it builds fine on my machine :) )
Arvid Thunholm (May 26 2021 at 11:04):
I got the publisher to work according to the guide and the canonical are now resolvable. Thanks everyone!
Lloyd McKenzie (May 26 2021 at 12:38):
If you're using the publisher, encourage you to monitor the #committers/announce stream - breaking releases like this one get announced there.
Last updated: Apr 12 2022 at 19:14 UTC