-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix filters in if tag #385
Conversation
…ft/FHIR-Converter into personal/quwan/Fix_Filters_In_If
Could you help to double confirm these changes of C-CDA templates? @hongyh13 |
{% include 'Resource/Condition' conditionEntry: entryRelationship.observation, ID: observationId -%} | ||
{% assign fullObservationId = observationId | prepend: 'Condition/' -%} | ||
{% include 'Reference/MedicationAdministration/ReasonReference' ID: substanceAdministrationId, REF: fullObservationId-%} | ||
{% endif -%} | ||
|
||
{% if entryRelationship.supply.templateId | to_json_string | contains '"2.16.840.1.113883.10.20.22.4.17"' -%} | ||
{% assign templateIdString = entryRelationship.supply.templateId | to_json_string -%} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need we double-check what happens when reassigning a new value to templateIdString
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked the re-assignment case, the newest assign takes effect, which means the assign behavior align with our expects.
Templates:
{
...
{% assign templateIdString = r.observation.templateId | to_json_string -%}
"templateIdString1": "{{ templateIdString | escape_special_chars }}",
...
{% assign templateIdString = allergyEntry.entryRelationship | to_json_string -%}
"templateIdString2": "{{ templateIdString | escape_special_chars }}",
...
}
Result:
"templateIdString1": "{\"root\":\"2.16.840.1.113883.10.20.22.4.9\"}",
"templateIdString2": "[{\"typeCode\":\"SUBJ\",\"inversionInd\":\"true\",\"observation\":......"
Fix the filters in liquid
if
tag, filters are only supported on a subset of tags (e.g.assign
tag), which don't includeif
,for
orcase
tags. Refer to this issue in Shopify/liquid repo.E.g. The below condition will always true as long as
relationship.observation.templateId
is not null, the followed filter pipes| to_json_string | contains: '"2.16.840.1.113883.10.20.22.4.7"'
takes no effetcs.