FHIR Chat · Core templates · IG creation

Stream: IG creation

Topic: Core templates


view this post on Zulip Nick George (Jun 14 2021 at 18:31):

Hello, I'm curious if the templates used by core fhir spec are available somewhere as reference. Unless I'm missing something it seems the CSS/templates for the core fhir spec are a lot nicer than the stock ones you get from fhir.base.template
(e.g., Profile tables defaulting to "Text Summary" rather than differential view, and artifact lists showing up as a giant table with borders on table cells)
also sorry if this is a dumb question but I'm a bit confused on where the base artifacts.xml lives... I don't see it in the generated [ig]/templates dir...

view this post on Zulip Jose Costa Teixeira (Jun 14 2021 at 18:35):

Hi @Nick George thanks.
The Text Summary thing is already being considered.
For such requests, we're about to setup some regular calls for updates to the IG templates, your input will be welcome.
In the meantime, do you want to submit issues here?
https://github.com/HL7/ig-template-base/issues

view this post on Zulip Jose Costa Teixeira (Jun 14 2021 at 18:37):

In that repo we have the template files. Note that some things are created in the publisher itself, not in the templates

view this post on Zulip Nick George (Jun 14 2021 at 18:42):

sure, I guess I'm more just trying to figure out how things like e.g., us core seem to have their own tables.

view this post on Zulip Nick George (Jun 14 2021 at 18:43):

presumably they override the profiles template with a custom one, but they include a subtemplate for the table... I guess a step one for me would eb to just copy paste USCore or even the the FHIR core spec one

view this post on Zulip Nick George (Jun 14 2021 at 18:44):

e.g., the template used to generate like http://hl7.org/fhir/patient.html

view this post on Zulip Nick George (Jun 14 2021 at 18:44):

so if I could just steal the templates used by http://hl7.org/fhir/, that'd be a great first step

view this post on Zulip Nick George (Jun 14 2021 at 18:46):

like if I could find out how https://www.hl7.org/fhir/us/core/StructureDefinition-us-core-patient.html gets the table to start on differential view

view this post on Zulip Jose Costa Teixeira (Jun 14 2021 at 19:03):

FHIR core spec does not have an IG template. I'm sure some of the CSS is common

view this post on Zulip Jose Costa Teixeira (Jun 14 2021 at 19:03):

starting on the differential view is not hard, I think i made such a change

view this post on Zulip Jose Costa Teixeira (Jun 14 2021 at 19:03):

let me see if I can point to a commit

view this post on Zulip Nick George (Jun 14 2021 at 19:04):

Awesome, thanks @Jose Costa Teixeira !

view this post on Zulip Nick George (Jun 14 2021 at 19:05):

and then for the artifacts page, I'd love to be able to override the list template, because I don't super love the table, although some of that could eb handled by a custom CSS file - is there a way to pass e.g., custom CSS for the artifacts page?

view this post on Zulip Jose Costa Teixeira (Jun 14 2021 at 19:06):

yes

view this post on Zulip Jose Costa Teixeira (Jun 14 2021 at 19:06):

you can add your own css

view this post on Zulip Nick George (Jun 14 2021 at 19:08):

how do you do that? I read https://confluence.hl7.org/pages/viewpage.action?pageId=35718627#IGPublisherDocumentation-Styles but it only says that it can be done

view this post on Zulip Jose Costa Teixeira (Jun 14 2021 at 19:08):

(not to the artifacts page alone, you pass CSS for everything)

view this post on Zulip Jose Costa Teixeira (Jun 14 2021 at 19:08):

http://build.fhir.org/ig/FHIR/ig-guidance/template.html

view this post on Zulip Nick George (Jun 14 2021 at 19:20):

(random other artifacts question - is it possible to alphabetize the list? right now order seems pretty arbitrary)

view this post on Zulip Eric Haas (Jun 14 2021 at 19:35):

US Core predates the templates and for 3.1.1 we did not use the standard templates. We have migrated to the templates for 3.2 + and some of the user experience has been compromised to conform. We override the artifacts pages with multiple additional pages that simpy list the artifacts by type. Hopefully we can make future changes in the templates to improve the look and feel.

view this post on Zulip Eric Haas (Jun 14 2021 at 19:37):

can look at the the latest version of US Core source to see what we did and yes you can sort alphabetically

view this post on Zulip Nick George (Jun 14 2021 at 19:37):

ah, thanks for the context Eric

view this post on Zulip Nick George (Jun 14 2021 at 19:40):

Is this the right place to looks? https://github.com/HL7/US-Core ? I not seeing an artifacts.xml or artifacts.html there. (Again, sorry if I'm missing something obvious!)

view this post on Zulip Jose Costa Teixeira (Jun 14 2021 at 19:48):

I couldn't find the way to do the default tab, sorry. I expect that solution will emerge soon

view this post on Zulip Jose Costa Teixeira (Jun 14 2021 at 19:48):

why do you want a "artifacts.html"? are you looking at changing the artifacts page?

view this post on Zulip Nick George (Jun 14 2021 at 19:49):

yeah so, basically, right now I have
Screen-Shot-2021-06-14-at-12.02.48-PM.png

view this post on Zulip Eric Haas (Jun 14 2021 at 19:50):

here are the added pages...
image.png

view this post on Zulip Nick George (Jun 14 2021 at 19:50):

but would prefer a list view like the one in https://www.hl7.org/fhir/us/core/profiles.html

view this post on Zulip Eric Haas (Jun 14 2021 at 19:50):

fhir artifacts page is autogenerated by the build
it is still present and will show up in the breadcrumb

view this post on Zulip Nick George (Jun 14 2021 at 19:51):

ahh ok

view this post on Zulip Eric Haas (Jun 14 2021 at 19:51):

the pages are added to the menu

view this post on Zulip Nick George (Jun 14 2021 at 19:51):

and not autogenerated?

view this post on Zulip Eric Haas (Jun 14 2021 at 19:52):

added manually to the menu

image.png

view this post on Zulip Nick George (Jun 14 2021 at 19:52):

ok gotcha. So if you add a new resource (which I'm sure is fairly rare) you just manually add a new entry for it

view this post on Zulip Nick George (Jun 14 2021 at 19:53):

I really like how the artifacts page is autogenerated for all resources/extensions/terminologies, I just am looking for a way to control how it is displayed

view this post on Zulip Nick George (Jun 14 2021 at 19:54):

e.g., if I could write a custom template to iterate over everything, the way I'm assuming some kind of artifacts.xml does

view this post on Zulip Eric Haas (Jun 14 2021 at 19:54):

the content for each page is either manual or automatic depending on several factors..

view this post on Zulip Eric Haas (Jun 14 2021 at 19:57):

There is a generated list that can be included, for example

Operations

{% include list-simple-operationdefinitions.xhtml %}

but for display reasons we wanted to highlight new content and created manual lists based off these generated lists.

view this post on Zulip Eric Haas (Jun 14 2021 at 20:00):

these xhtml lists files are all in the temp files and are handy to use out of the box or for transforming to markdown and customizing, etc

view this post on Zulip Jose Costa Teixeira (Jun 14 2021 at 20:04):

so, the artifacts page is generated by some xslt in the template

view this post on Zulip Jose Costa Teixeira (Jun 14 2021 at 20:05):

https://github.com/HL7/ig-template-base/blob/master/scripts/createArtifactSummary.xslt

view this post on Zulip Jose Costa Teixeira (Jun 14 2021 at 20:05):

(appropriately named)

view this post on Zulip Jose Costa Teixeira (Jun 14 2021 at 20:06):

important to know is that you cannot change the xslts in your local template

view this post on Zulip Jose Costa Teixeira (Jun 14 2021 at 20:06):

you can, it will build locally, but not on the FHIR IG CI build

view this post on Zulip Jose Costa Teixeira (Jun 14 2021 at 20:07):

possibly interesting to know is that we had some discussions about revamping that whole thing

view this post on Zulip Nick George (Jun 14 2021 at 20:08):

gotcha

view this post on Zulip Nick George (Jun 14 2021 at 20:08):

thanks

view this post on Zulip Nick George (Jun 14 2021 at 20:09):

yeah some ability to define custom templates for things like that would be great - like my big goal would be to be able to say "Mostly use the default templates, but this particular template bugs me so let me override it"

view this post on Zulip Jose Costa Teixeira (Jun 14 2021 at 20:09):

there was a nice page but I can'f find it - where the artifacts page actually looked like this

view this post on Zulip Nick George (Jun 14 2021 at 20:09):

e.g., turn that table into a formatted list

view this post on Zulip Jose Costa Teixeira (Jun 14 2021 at 20:09):

http://build.fhir.org/resourcelist.html

view this post on Zulip Nick George (Jun 14 2021 at 20:10):

yeah I'd love to be able to generate one of those

view this post on Zulip Eric Haas (Jun 14 2021 at 20:12):

note that can use ant to interject script after the temp files created,

view this post on Zulip Nick George (Jun 14 2021 at 20:15):

@Jose Costa Teixeira is the default artifacts page ordered in any scrutable way? Is it possible to alphabetize?

view this post on Zulip Jose Costa Teixeira (Jun 14 2021 at 21:05):

Besides the groupings that you can override, I think indeed there is an order

view this post on Zulip Jose Costa Teixeira (Jun 14 2021 at 21:06):

Lloyd is away but he can answer that when he's back, or I can see if I can find it

view this post on Zulip Nick George (Jun 14 2021 at 23:26):

thanks @Jose Costa Teixeira!

view this post on Zulip Eric Haas (Jun 15 2021 at 00:48):

the default artifacts page is ordered based on the order in the ImplementationGuide Resource definitions.resource element. The IG resource is created by hand or programmatically by Sushi for example . The resources are grouped by the grouping listed in the groupings.txt file in the templates/scripts folder in the following order:

  • Capability Statements
  • Operation Definitions
  • Message Definitions
  • Search Parameters
  • Graph Definitions
  • Logical Models
  • Questionnaires
  • Abstract Profiles
  • Resource Profiles
  • Data Type Profiles
  • Extension Definitions
  • Value Sets
  • Code Systems
  • Naming Systems
  • Structure Maps
  • Concept Maps
  • Activity Definitions
  • Plan Definitions
  • Libraries
  • Measure
  • Example Scenarios
  • Example Instances

view this post on Zulip Lloyd McKenzie (Jun 25 2021 at 04:29):

And within those, the ordering should be alphabetic - unless you've manually listed your artifacts in the IG, in which case it'll be whatever order you listed them in (in principle giving you absolute control over order of presentation). We recognize that the artifacts list is not exactly ideal once you start getting to bigger lists. There's a plan to move to something more sophisticated, possibly spanning multiple pages and driven by Composition, but we haven't got to the detailed design stage yet. You can certainly write your own template extension that overrides the existing transform to spit out something better in the interim - and/or propose suggestions for how you'd like the current process improved.


Last updated: Apr 12 2022 at 19:14 UTC