{% if Library.id.exists() %} {% endif %} {% if Library.url.exists() %} {% endif %} {% if Library.version.exists() %} {% endif %} {% for identifier in Library.identifier %} {% endfor %} {% if Library.name.exists() %} {% endif %} {% if Library.title.exists() %} {% endif %} {% if Library.subtitle.exists() %} {% endif %} {% if Library.status.exists() %} {% endif %} {% if Library.experimental.exists() %} {% endif %} {% if Library.type.exists() %} {% endif %} {% if Library.subject.exists() %} {%if Library.subject is CodeableConcept %} {% endif %} {% if Library.subject is Reference %} {% endif %} {% endif %} {% if Library.date.exists() %} {% endif %} {% if Library.publisher.exists() %} {% endif %} {% if Library.description.exists() %} {% endif %} {% if Library.useContext.exists() %} {% endif %} {% if Library.jurisdiction.exists() %} {% endif %} {% if Library.purpose.exists() %} {% endif %} {% if Library.usage.exists() %} {% endif %} {% if Library.copyright.exists() %} {% endif %} {% if Library.approvalDate.exists() %} {% endif %} {% if Library.lastReviewDate.exists() %} {% endif %} {% if Library.effectivePeriod.exists() %} {% endif %} {% if Library.relatedArtifact.exists() %} {% endif %} {% if Library.parameter.exists() %} {% endif %} {% if Library.dataRequirement.exists() %} {% endif %} {% for c in Library.content %} {% if c.contentType = 'text/cql' %}
Id: {{Library.id}}
Url: {{Library.url}}
Version: {{Library.version}}
Identifier: {% if identifier.type.exists() %}

type: {{identifier.type.value}}

{% endif %} {% if identifier.value.exists() %}

value: {{identifier.value}}

{% endif %}
Name: {{Library.name}}
Title: {{Library.title}}
Subtitle: {{Library.subtitle}}
Status: {{Library.status.value}}
Experimental: {{Library.experimental.value}}
Type: {% if Library.type.coding.exists() %} {% for coding in Library.type.coding %} {% if coding.system.exists() %}

system: {{coding.system}}

{% endif %} {% if coding.code.exists() %}

code: {{coding.code}}

{% endif %} {% if coding.display.exists() %}

display: {{coding.display}}

{% endif %} {% endfor %} {% endif %} {% if Library.type.coding.exists().not and Library.type.text.exists() %} {{Library.type.text}} {% endif %}
Subject: {% if Library.subject.coding.exists() %} {% for coding in Library.subject.coding %} {% if coding.system.exists() %}

system: {{coding.system}}

{% endif %} {% if coding.code.exists() %}

code: {{coding.code}}

{% endif %} {% if coding.display.exists() %}

display: {{coding.display}}

{% endif %} {% endfor %} {% endif %} {% if Library.subject.coding.exists().not and Library.subject.text.exists() %} {{Library.subject.text}} {% endif %}
{% if Library.subject.reference.exists() %}

reference: {{Library.subject.reference}}

{% endif %} {% if Library.subject.type.exists() %}

type: {{Library.subject.type}}

{% endif %} {% if Library.subject.display.exists() %}

code: {{Library.subject.display}}

{% endif %}
Date: {{Library.date}}
Publisher: {{Library.publisher}}
Description: {{Library.description}}
Use Context: {% for useContext in Library.useContext %} {% endfor %}
codevalue
{{useContext.code.code}} {{(useContext.value as CodeableConcept).coding.first().code}}
Jurisdiction: {{Library.jurisdiction.first().coding.first().code}}
Purpose: {{Library.purpose}}
Usage: {{Library.usage}}
Copyright: {{Library.copyright}}
Approval Date: {{Library.approvalDate}}
Last Review Date: {{Library.lastReviewDate}}
Effective Period: {{Library.effectivePeriod.start}}..{{Library.effectivePeriod.end}}
Related Artifacts: {% for artifact in Library.relatedArtifact %} {% endfor %}
TypeResource
{{artifact.type.value}}{{artifact.resource}}
Parameters: {% for param in Library.parameter %} {% endfor %}
NameTypeMinMaxIn/Out
{{param.name}}{{param.type}}{{param.min}}{{param.max}}{{param.use}}
Data Requirements: {% for requirement in Library.dataRequirement %} {% endfor %}
TypeProfileMSCode Filter
{{requirement.type.value}} {% for profile in requirement.profile %}{{profile.value}}{% endfor %} {% for support in requirement.mustSupport %}{{mustSupport}};{% endfor %} {% for cfilter in requirement.codeFilter %}

code filter: {% if cfilter.path.exists() or cfilter.valueSet.exists() or cfilter.code.exists() %}
{% endif %} {% if cfilter.path.exists() %} path: {{cfilter.path}} {% if cfilter.valueSet.exists() or cfilter.code.exists() %}
{% endif %} {% endif %} {% if cfilter.valueSet.exists() %} value set: {{cfilter.valueSet.value}} {% endif %} {% for coding in cfilter.code %} {% if coding.system.exists() %}

system: {{coding.system}}

{% endif %} {% if coding.code.exists() %}

code: {{coding.code}}

{% endif %} {% if coding.display.exists() %}

display: {{coding.display}}

{% endif %} {% endfor %}

{% endfor %}
Content: {{c.contentType}}
{{c.data.decode('base64').escape('html')}}
{% endif %} {% if c.contentType != 'text/cql' %}
Content: {{c.contentType}}
{{'Encoded data (' + c.data.length().toString() + ' characters)'}}
{% endif %} {% endfor %}