FHIR Chat · Avoid long div tag unter StructureDefinition.text · IG creation

Stream: IG creation

Topic: Avoid long div tag unter StructureDefinition.text


view this post on Zulip Moritz Kähler (Feb 18 2022 at 14:02):

IG Publisher creates StructureDefinition resourcen where text field contains a div tag that contains a lot of html formatting information. Is there a way to "tell" IG Publisher to not create this div tag?

view this post on Zulip Lloyd McKenzie (Feb 18 2022 at 15:08):

Yes, there's an IG parameter you can use to indicate specific resources you don't want narrative for. However, in most cases, every resource should have narrative. Why do you want the narrative removed?

view this post on Zulip Moritz Kähler (Feb 22 2022 at 09:36):

I don't want to remove the narrative, I want to remove all the HTML formatting.
Can you provide an example how to pass this parameter?

view this post on Zulip Chris Moesel (Feb 22 2022 at 13:23):

In FSH you can use the typical caret syntax that allows you to access any field in the underlying StructureDefinition. In this case, you would want something like:

* ^text.div = "<div>My own narrative</div>"

or in this case, since the value must be xhtml, you might want to use the """ delimiters:

* ^text.div =
  """
  <div>
    <p>
      My own narrative paragraph 1.
    </p>
    <p>
      My own narrative paragraph 2.
    </p>
  </div>
  """

No matter what, though, writing XHTML in FSH isn't super great -- even though it does have its uses.

view this post on Zulip Lloyd McKenzie (Feb 22 2022 at 14:47):

Narrative is, by definition, HTML. That can't be changed. You must, at minimum, wrap your text in a <div> and the text must render appropriately as XHTML.


Last updated: Apr 12 2022 at 19:14 UTC