Skip to content

Commit

Permalink
update for SHALL and SHOULD granular scopes scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
healthedata1 committed Feb 20, 2024
1 parent 6dbf6cb commit 0fa7af9
Show file tree
Hide file tree
Showing 9 changed files with 334 additions and 259 deletions.
128 changes: 64 additions & 64 deletions input/data/scopes.csv

Large diffs are not rendered by default.

204 changes: 107 additions & 97 deletions input/examples/Observation-average-blood-pressure.json
Original file line number Diff line number Diff line change
@@ -1,103 +1,113 @@
{
"resourceType": "Observation",
"id": "average-blood-pressure",
"meta": {
"profile": [
"http://hl7.org/fhir/us/core/StructureDefinition/us-core-average-blood-pressure"
]
},
"status": "final",
"category": [
{
"text": "Vital Signs",
"coding": [
"resourceType": "Observation",
"id": "average-blood-pressure",
"meta": {
"profile": [
"http://hl7.org/fhir/us/core/StructureDefinition/us-core-average-blood-pressure"
],
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/instance-name",
"valueString": "Average Blood Pressure Example"
},
{
"url": "http://hl7.org/fhir/StructureDefinition/instance-description",
"valueMarkdown": "This is an average blood pressure example for the *Vitalsigns Profile*. It is based on the [Vital Signs with Qualifying Elements](http://hl7.org/fhir/us/vitals/STU1/) [Average Blood Pressure Profile](http://hl7.org/fhir/us/vitals/StructureDefinition/average-blood-pressure)."
}
]
},
"status": "final",
"category": [
{
"code": "vital-signs",
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"display": "Vital Signs"
"text": "Vital Signs",
"coding": [
{
"code": "vital-signs",
"system": "http://terminology.hl7.org/CodeSystem/observation-category",
"display": "Vital Signs"
}
]
}
]
}
],
"code": {
"text": "Avg Blood pressure systolic and diastolic",
"coding": [
{
"system": "http://loinc.org",
"code": "96607-7",
"display": "Blood pressure panel mean systolic and mean diastolic"
},
{
"system": "http://loinc.org",
"code": "85354-9",
"display": "Blood pressure panel with all children optional"
}
]
},
"subject": {
"display": "Amy Shaw",
"reference": "Patient/example"
},
"effectivePeriod": {
"start": "2023-08-03T01:06:52.480Z",
"end": "2023-08-03T13:07:01.166Z"
},
"performer": [
{
"reference": "Practitioner/practitioner-1"
}
],
"component": [
{
"code": {
"text": "Average systolic blood pressure",
],
"code": {
"text": "Avg Blood pressure systolic and diastolic",
"coding": [
{
"system": "http://loinc.org",
"code": "96608-5",
"display": "Systolic blood pressure mean"
},
{
"system": "http://loinc.org",
"code": "8480-6",
"display": "Systolic blood pressure"
}
{
"system": "http://loinc.org",
"code": "96607-7",
"display": "Blood pressure panel mean systolic and mean diastolic"
},
{
"system": "http://loinc.org",
"code": "85354-9",
"display": "Blood pressure panel with all children optional"
}
]
},
"valueQuantity": {
"value": 109,
"unit": "mm[Hg]",
"system": "http://unitsofmeasure.org",
"code": "mm[Hg]"
}
},
{
"code": {
"text": "Average diastolic blood pressure",
"coding": [
{
"system": "http://loinc.org",
"code": "96609-3",
"display": "Diastolic blood pressure mean"
},
{
"system": "http://loinc.org",
"code": "8462-4",
"display": "Diastolic blood pressure"
}
]
},
"valueQuantity": {
"value": 44,
"unit": "mm[Hg]",
"system": "http://unitsofmeasure.org",
"code": "mm[Hg]"
}
}
],
"note": [
{
"text": "Average blood pressure is calculated from 12 measurements taken over 12 hours."
}
]
}
"subject": {
"display": "Amy Shaw",
"reference": "Patient/example"
},
"effectivePeriod": {
"start": "2023-08-03T01:06:52.480Z",
"end": "2023-08-03T13:07:01.166Z"
},
"performer": [
{
"reference": "Practitioner/practitioner-1"
}
],
"component": [
{
"code": {
"text": "Average systolic blood pressure",
"coding": [
{
"system": "http://loinc.org",
"code": "96608-5",
"display": "Systolic blood pressure mean"
},
{
"system": "http://loinc.org",
"code": "8480-6",
"display": "Systolic blood pressure"
}
]
},
"valueQuantity": {
"value": 109,
"unit": "mm[Hg]",
"system": "http://unitsofmeasure.org",
"code": "mm[Hg]"
}
},
{
"code": {
"text": "Average diastolic blood pressure",
"coding": [
{
"system": "http://loinc.org",
"code": "96609-3",
"display": "Diastolic blood pressure mean"
},
{
"system": "http://loinc.org",
"code": "8462-4",
"display": "Diastolic blood pressure"
}
]
},
"valueQuantity": {
"value": 44,
"unit": "mm[Hg]",
"system": "http://unitsofmeasure.org",
"code": "mm[Hg]"
}
}
],
"note": [
{
"text": "Average blood pressure is calculated from 12 measurements taken over 12 hours."
}
]
}
39 changes: 39 additions & 0 deletions input/includes/granular-scopes-table.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!-- This liquid script creates a US Core scope requirements table using input data from input/data/scopes.csv
include parameters: conformance='SHALL'|'SHOULD' see below for how used, and crud='cruds' not currently used -->

{% assign rows = site.data.scopes -%}
{%- assign scopes = '' -%}
{%- for item in rows -%}
{%- unless forloop.first -%}
{%- unless item.add_scope == "FALSE" -%}
{% for i in (1..6) %}
{%- assign category = 'category_' | append: i -%}
{%- assign category_conformance = 'category_' | append: i |append: '_conformance' -%}
{%- if item[category] and item[category_conformance] == include.conformance -%}
{%- assign resource_type = item.resource_type | strip | replace: ',' | append: '?category=' -%}
{%- assign category = item[category] | strip | append: ',' -%}
{%- assign scope = resource_type | append: category -%}
{%- assign scopes = scopes | append: scope -%}
{%- endif -%}
{%- endfor -%}
{%- endunless -%}
{%- endunless -%}
{%- endfor -%}
{%- assign scopes = scopes | split: "," | uniq | sort %}

<table class="grid">
<thead>
<tr>
<th>Resource Type</th>
<th>Granular Scope</th>
</tr>
</thead>
<tbody>
{% for scope in scopes -%}
<tr>
<td>{{scope | split: "?" | first }}</td>
<td><code>{{ scope }}</code></td>
</tr>
{% endfor %}
</tbody>
</table>
25 changes: 22 additions & 3 deletions input/includes/quickstart-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,24 @@
{% for scope in site.data.scopes %}
{% if scope.page_path == page.path %}
{%capture smart_scope %}
Servers providing access to {{ scope.data }} data **SHALL** use [US Core SMART Scopes] for:
- [resource level scopes]\: `patient/{{ scope.resource_type }}.rs`{% if scope.category_1 %}
- [granular scopes]\: `patient.{{scope.resource_type }}.rs?category={{ scope.category_1 }}`{% if scope.category_2 %} and `patient.{{scope.resource_type }}.rs?category={{ scope.category_2 }}`{% endif %}{% if scope.category_3 %} and `patient.{{scope.resource_type }}.rs?category={{ scope.category_3 }}`{% endif %}{% endif %}.
Servers providing access to {{ scope.data_element }} data **SHALL** support these [US Core SMART Scopes]:
- [resource level scopes]\: `patient/{{ scope.resource_type }}.rs`
{% for i in (1..6) %}{% assign category = 'category_' | append: i %}{% assign category_conformance = 'category_' | append: i |append: '_conformance' -%}
{%- if scope[category] and scope[category_conformance] == "SHALL" %}
- [granular scope]\: `patient.{{ scope.resource_type }}.rs?category={{ scope[category] }}`
{% endif -%}
{%- endfor -%}
{%- for i in (1..6) %}{% assign category_conformance = 'category_' | append: i |append: '_conformance' -%}
{%- if scope[category_conformance] == "SHOULD" %}
Servers providing access to {{ scope.data_element }} data **SHOULD** support these [US Core SMART Scope]:
{% for i in (1..6) %}{% assign category = 'category_' | append: i %}{% assign category_conformance = 'category_' | append: i |append: '_conformance' -%}
{%- if scope[category] and scope[category_conformance] == "SHOULD" %}
- [granular scopes]\: `patient.{{ scope.resource_type }}.rs?category={{ scope[category] }}`
{% endif -%}
{%- endfor -%}
{% break -%}
{%- endif -%}
{%- endfor -%}
{% endcapture %}
{% break %}
{% endif %}
Expand All @@ -26,9 +41,13 @@ Below is an overview of the required Server RESTful FHIR interactions for this p



<div class="bg-success" markdown="1">

{% if smart_scope -%}
#### US Core Scopes
{{smart_scope}}
{% endif %}

</div><!-- new-content -->


31 changes: 31 additions & 0 deletions input/includes/resource-scopes-table.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!-- This liquid script creates a US Core scope requirements table using input data from input/data/scopes.csv
include parameters: conformance='SHALL'|'SHOULD' and crud='cruds' not currently used -->

{% assign rows = site.data.scopes -%}
{%- assign scopes = '' -%}
{%- for item in rows -%}
{%- unless forloop.first -%}
{%- unless item.add_scope == "FALSE" -%}
{%- assign scope = item.resource_type | strip | append: ',' -%}
{%- assign scopes = scopes | append: scope -%}
{%- endunless -%}
{%- endunless -%}
{%- endfor -%}
{%- assign scopes = scopes | split: "," | uniq | sort %}

<table class="grid">
<thead>
<tr>
<th>Resource Type</th>
<th>Resource Level Scope</th>
</tr>
</thead>
<tbody>
{% for scope in scopes -%}
<tr>
<td>{{scope}}</td>
<td><code>{{ scope | prepend: 'patient/' | append: '.rs' }}</code></td>
</tr>
{% endfor %}
</tbody>
</table>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% include quickstart-intro.md %}

{% include link-list.md %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% include quickstart-intro.md %}

{% include link-list.md %}
Loading

0 comments on commit 0fa7af9

Please sign in to comment.