Uploaded image for project: 'FHIR Specification Feedback'
  1. FHIR Specification Feedback
  2. FHIR-36032

Remove server requirement for update non-Reference fields during transaction bundle processing

    XMLWordPrintableJSON

Details

    • Icon: Change Request Change Request
    • Resolution: Not Persuasive with Modification
    • Icon: Medium Medium
    • FHIR Core (FHIR)
    • R4
    • FHIR Infrastructure
    • REST (http)
    • 3.1.0.11.2
    • Hide

      The use-case for things like <a or <img is where narrative (or markdown or Composition.section.text) needs to include reference to a picture or PDF or other static file and the file is sent as part of a transaction.  E.g. Patient.text where the narrative includes the patient image. 

      There are other places where uri or url are used to point to a PDF (which might be posted as a binary in the same transaction).  References of type oid or uuid only exist in extensions - and extensions is a wild west, so we need to presume references could be relevant there.

       

      That said, updating references only in narrative is no longer sufficient.  XHTML tags might also appear in Composition.section.text and both references and images can also appear in any markdown element, including extensions with a type of markdown.  These would also need to be updated.

      We believe the intention is that replacement only occurs when there is an exact match or, for url or uri, where there's an exact match followed by a '#'.

      We are unsure whether we can reasonably make updating of narrative and other mixed text content a 'SHALL', as doing so requires parsing the content. 

      Therefore, we will do the following:

      We will move the sentence "Servers SHALL replace all matching links in the bundle, whether they are found in the resource ids, resource references, elements of type uriurloiduuid, and <a href="" & <img src="" in the narrative. Elements of type canonical are not replaced." to be a new paragraph and replace it as follows:

      "Servers SHALL replace all matching links in the bundle, found in the resource ids, resource references, elements of type uriurloiduuid, and <a href="..." & <img src="..." in the Narrative elements in DomainResource.text or Composition.section.text. Elements of type canonical are not replaced.  Servers SHOULD also replace references found in elements of type [markdown], including extensions.  Replacement within URLs is based on either an exact match or a match of the portion of the URL preceding a '#'. 

      E.g. If posting a resource with a reference of "http://somewhere.org/StructureDefinition/myprofile#some.element.path" and "http://somewhere.org/StructureDefinition/myprofile" is the fullUrl of another entry in the transaction, the server would replace the 'myprofile' id portion of the reference with whatever id it assigns and, if the target server base differs from "http://somewhere.org", would also replace the base portion of the URL.

      Similarly if the narrative includes <img src="urn:uuid:someguid"/> and there is an entry within the transaction creating a Binary with a full url of "urn:uuid:someguid", that entire URL would be replaced with the new absolute URL of the created Binary resource.

       

       

      There's also at least one IG extension where XHTML is sent as a string, and trying to parse arbitrary strings is definitely unreasonable.

      Richard E. will start a Zulip discussion about possibly changing the "<a" and "<img" portion of the SHALL statement into a SHOULD, extending it to cover the other places that tags and links can also show up.

      Show
      The use-case for things like <a or <img is where narrative (or markdown or Composition.section.text) needs to include reference to a picture or PDF or other static file and the file is sent as part of a transaction.  E.g. Patient.text where the narrative includes the patient image.  There are other places where uri or url are used to point to a PDF (which might be posted as a binary in the same transaction).  References of type oid or uuid only exist in extensions - and extensions is a wild west, so we need to presume references could be relevant there.   That said, updating references only in narrative is no longer sufficient.  XHTML tags might also appear in Composition.section.text and both references and images can also appear in any markdown element, including extensions with a type of markdown.  These would also need to be updated. We believe the intention is that replacement only occurs when there is an exact match or, for url or uri, where there's an exact match followed by a '#'. We are unsure whether we can reasonably make updating of narrative and other mixed text content a 'SHALL', as doing so requires parsing the content.  Therefore, we will do the following: We will move the sentence "Servers SHALL replace all matching links in the bundle, whether they are found in the resource ids,  resource references , elements of type  uri ,  url ,  oid ,  uuid , and  <a href=""  &  <img src=""  in the narrative. Elements of type  canonical  are not replaced." to be a new paragraph and replace it as follows: "Servers SHALL replace all matching links in the bundle, found in the resource ids,  resource references , elements of type  uri ,  url ,  oid ,  uuid , and  <a href="..."  &  <img src="..."  in the Narrative elements in DomainResource.text or Composition.section.text. Elements of type  canonical  are not replaced.  Servers SHOULD also replace references found in elements of type [markdown] , including extensions.  Replacement within URLs is based on either an exact match or a match of the portion of the URL preceding a '#'.  E.g. If posting a resource with a reference of "http://somewhere.org/StructureDefinition/myprofile#some.element.path" and "http://somewhere.org/StructureDefinition/myprofile" is the fullUrl of another entry in the transaction, the server would replace the 'myprofile' id portion of the reference with whatever id it assigns and, if the target server base differs from "http://somewhere.org", would also replace the base portion of the URL. Similarly if the narrative includes <img src="urn:uuid:someguid"/> and there is an entry within the transaction creating a Binary with a full url of "urn:uuid:someguid", that entire URL would be replaced with the new absolute URL of the created Binary resource.     There's also at least one IG extension where XHTML is sent as a string, and trying to parse arbitrary strings is definitely unreasonable. Richard E. will start a Zulip discussion about possibly changing the "<a" and "<img" portion of the SHALL statement into a SHOULD, extending it to cover the other places that tags and links can also show up.
    • Josh Mandel/Richard Ettema: 18-0-1
    • Clarification
    • Compatible, substantive
    • R5

    Description

      Currently the spec requires servers to be able to update a number of different places in the resources when a transaction bundle is posted:

      > Servers SHALL replace all matching links in the bundle, whether they are found in the resource ids, resource references, elements of type uriurloiduuid, and <a href="" & <img src="" in the narrative.

       

      I definitely understand the value of replacing literal reference values so that the posted resources can reference one another.

      But do we have actual use cases for replacing the values in the other cases?

      Do servers actually implement this requirement?

       

      By "SHALL replace all matching links" does it mean exact matches only (e.g. the entire href value matches the entire resource fullUrl value) or also partial matches?

      My assumption is the former (because the latter just sounds dangerous to me), but it does seem to limit the utility of this technique.

      At the very least, it seems like a stretch for {{<img src="" }}values to reference a resource URL, so maybe just remove that part?

       

      Originally brought up at https://chat.fhir.org/#narrow/stream/179166-implementers/topic/Updating.20non-reference.20values.20in.20bundle.20processing 

       

       

      Attachments

        Activity

          People

            richard.ettema Richard Ettema
            lmsurprenant Lee Surprenant
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: