Made changes as recommended by Grahame and Elliot

This commit is contained in:
Lloyd McKenzie
2024-09-10 08:07:43 -06:00
parent 16e91ba23b
commit c5b2d3cc42
6 changed files with 251 additions and 32 deletions

View File

@@ -1,6 +1,6 @@
<div xmlns="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hl7.org/fhir ../../input-cache/schemas/R5/fhir-single.xsd">
<p>
This page describes how to embed 'fragments' of a resource within a page, possibly ellipsing out portions
This page describes how to embed 'fragments' of a resource within a page, possibly elliding out portions
of the instance to only show the portions that are relevant to what the surrounding text needs to talk about.
</p>
<p>
@@ -30,18 +30,18 @@
<a name="ellipsing"> </a>
<h3>Ellipsing</h3>
<p>
Sometimes you want to perform more filtering than only selecting an element within your instance. You want to only show a portion of that element, hiding (ellipsing) the content you don't care about. There are two ways to do this: you can either define the specific elements you want to ellipse; or you can define the elements you <i>don't</i> want to ellipse.
Sometimes you want to perform more filtering than only selecting an element within your instance. You want to only show a portion of that element, hiding (ellipsing) the content you don't care about. There are two ways to do this: you can either define the specific elements you want to ellide (replace with '...'); or you can define the elements you <i>don't</i> want to ellide.
</p>
<p>The 'ELLIPSE:' filter can only be specified once, but with FHIRPath '|', you can express as many elements as you like. For example, <code>{% raw %}&#x7b;%&#xA0;fragment Patient/example XML BASE:name.where(use='official').first() ELLIPSE:use|given[1]|period %}{% endraw %}</code> will look like this:</p>
{% fragment Patient/example XML BASE:name.where(use='official').first() ELLIPSE:use|given[1]|period %}
<p>The 'ELLIDE:' filter can only be specified once, but with FHIRPath '|', you can express as many elements as you like. For example, <code>{% raw %}&#x7b;%&#xA0;fragment Patient/example XML BASE:name.where(use='official').first() ELLIDE:use|given[1]|period %}{% endraw %}</code> will look like this:</p>
{% fragment Patient/example XML BASE:name.where(use='official').first() ELLIDE:use|given[1]|period %}
<p>
'EXCEPT:' works slightly differently. With Except you identify the elements to retain (be unellipsed) but you can also specify a descendant 'BASE:' element those expressions are evaluated within. For example, the following expression will return the patient showing only id an names, and within name, will ellipse everything except the family name: <code>{% raw %}&#x7b;%&#xA0;fragment Patient/example XML EXCEPT:id|name EXCEPT:family BASE:name %}{% endraw %}</code>
'EXCEPT:' works slightly differently. With Except you identify the elements to retain (be unellided) but you can also specify a descendant 'BASE:' element those expressions are evaluated within. For example, the following expression will return the patient showing only id an names, and within name, will ellide everything except the family name: <code>{% raw %}&#x7b;%&#xA0;fragment Patient/example XML EXCEPT:id|name EXCEPT:family BASE:name %}{% endraw %}</code>
</p>
{% fragment Patient/example XML EXCEPT:id|name EXCEPT:family BASE:name %}
<p>
The overall syntax for fragments is as follows:
<code>{% raw %}&#x7b;%&#xA0;fragment [resource]/[id] [XML|JSON] (BASE:[base FHIRPath])? (ELLIPSE:[ellipse elements path])? (EXCEPT:[except elements FHIRPath] (BASE:[except base FHIRPath])?)* %}{% endraw %}</code>
<code>{% raw %}&#x7b;%&#xA0;fragment [resource]/[id] [XML|JSON] (BASE:[base FHIRPath])? (ELLIDE:[ellide elements path])? (EXCEPT:[except elements FHIRPath] (BASE:[except base FHIRPath])?)* %}{% endraw %}</code>
</p>
</div>