forked from microsoft/FHIR-Converter
-
Notifications
You must be signed in to change notification settings - Fork 0
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: social history conversion #7
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
9f1db8b
fix: wip
mcmcgrath13 4be3dd2
refactor: add some abstraction around wheter to include an entry
mcmcgrath13 c5d2d6e
fix: remove debugging
mcmcgrath13 b03c8f2
fix: better escaping
mcmcgrath13 20d9146
Merge branch 'main' of https://github.com/skylight-hq/FHIR-Converter …
mcmcgrath13 2a52dae
fix: handle null case in cleaning string
mcmcgrath13 3d3355c
fix: handle pregnancy observations
mcmcgrath13 4c9b186
fix: sexual orientation case
mcmcgrath13 54868f4
fix: array-ize before first
mcmcgrath13 a044aa8
fix: another filter on gender identity
mcmcgrath13 047b1d0
fix: elsif
mcmcgrath13 3fbe338
refactor: dry out value handling
mcmcgrath13 ca6f82a
fix: renamed var
mcmcgrath13 80d34d3
Merge branch 'main' of https://github.com/skylight-hq/FHIR-Converter …
mcmcgrath13 5d21998
fix: typo in filter name
mcmcgrath13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,30 @@ | ||
{% if entry.observation -%} | ||
{% assign observationId = entry.observation | to_json_string | generate_uuid -%} | ||
{% if entry.observation.code.nullFlavor or entry.observation.value.nullFlavor -%} | ||
{% else -%} | ||
{% if entry.observation.templateId and entry.observation.templateId.root and entry.observation.templateId.root == '2.16.840.1.113883.10.20.34.3.45' -%} | ||
{% elsif entry.observation.templateId and entry.observation.templateId.root and entry.observation.templateId.root == '2.16.840.1.113883.10.20.22.4.200' -%} | ||
{% assign birthSObs = entry.observation %} | ||
{% elsif entry.observation.templateId and entry.observation.templateId.root and entry.observation.templateId.root == '2.16.840.1.113883.10.20.15.2.3.48' -%} | ||
{% else -%} | ||
{% if entry.observation.templateId and entry.observation.templateId.root and entry.observation.templateId.root == '2.16.840.1.113883.10.20.22.4.109' -%} | ||
{% include 'Resource/ObservationHomeEnv' observationCategory: 'social-history', observationEntry: entry.observation, ID: observationId -%} | ||
{% include 'Reference/Observation/Subject' ID: observationId, REF: fullPatientId -%} | ||
{% elsif entry.observation.templateId and entry.observation.templateId.root and entry.observation.templateId.root == '2.16.840.1.113883.10.20.15.2.3.47' -%} | ||
{% include 'Resource/ObservationDisabilityStatus' observationCategory: 'social-history', observationEntry: entry.observation, ID: observationId -%} | ||
{% include 'Reference/Observation/Subject' ID: observationId, REF: fullPatientId -%} | ||
{% elsif entry.observation.templateId and entry.observation.templateId.root and entry.observation.templateId.root == '2.16.840.1.113883.10.20.22.4.217' -%} | ||
{% include 'Resource/ObservationPastPresentOccupation' observationCategory: 'social-history', observationEntry: entry.observation, ID: observationId -%} | ||
{% include 'Reference/Observation/Subject' ID: observationId, REF: fullPatientId -%} | ||
{% elsif entry.observation.templateId and entry.observation.templateId.root and entry.observation.templateId.root == '2.16.840.1.113883.10.20.22.4.221' -%} | ||
{% include 'Resource/ObservationUsualWork' observationCategory: 'social-history', observationEntry: entry.observation, ID: observationId -%} | ||
{% include 'Reference/Observation/Subject' ID: observationId, REF: fullPatientId -%} | ||
{% else -%} | ||
{% include 'Resource/Observation' observationCategory: 'social-history', observationEntry: entry.observation, ID: observationId -%} | ||
{% include 'Reference/Observation/Subject' ID: observationId, REF: fullPatientId -%} | ||
{% endif -%} | ||
{% capture shouldRender -%} | ||
{%- include 'Utils/IsSocialHistoryObservation' observation: entry.observation -%} | ||
{%- endcapture -%} | ||
{% if shouldRender contains "true" -%} | ||
{% assign observationId = entry.observation | to_json_string | generate_uuid -%} | ||
{% assign firstTemplate = entry.observation.templateId | to_array | first -%} | ||
{% if firstTemplate.root == '2.16.840.1.113883.10.20.22.4.109' -%} | ||
{% include 'Resource/ObservationHomeEnv' observationCategory: 'social-history', observationEntry: entry.observation, ID: observationId -%} | ||
{% elsif firstTemplate.root == '2.16.840.1.113883.10.20.15.2.3.47' -%} | ||
{% include 'Resource/ObservationDisabilityStatus' observationCategory: 'social-history', observationEntry: entry.observation, ID: observationId -%} | ||
{% elsif firstTemplate.root == '2.16.840.1.113883.10.20.22.4.217' -%} | ||
{% include 'Resource/ObservationPastPresentOccupation' observationCategory: 'social-history', observationEntry: entry.observation, ID: observationId -%} | ||
{% elsif firstTemplate.root == '2.16.840.1.113883.10.20.22.4.221' -%} | ||
{% include 'Resource/ObservationUsualWork' observationCategory: 'social-history', observationEntry: entry.observation, ID: observationId -%} | ||
{% elsif firstTemplate.root == '2.16.840.1.113883.10.20.15.3.8' -%} | ||
{% include 'Resource/ObservationPregnancyStatus' observationCategory: 'social-history', observationEntry: entry.observation, ID: observationId -%} | ||
{% elsif entry.observation.code.code == '76690-7' -%} | ||
{% include 'Resource/ObservationSexualOrientation' observationCategory: 'social-history', observationEntry: entry.observation, ID: observationId -%} | ||
{% else -%} | ||
{% include 'Resource/Observation' observationCategory: 'social-history', observationEntry: entry.observation, ID: observationId -%} | ||
{% endif -%} | ||
{% endif -%} | ||
{% include 'Reference/Observation/Subject' ID: observationId, REF: fullPatientId -%} | ||
{% endif %} | ||
{% elsif entry.act %} | ||
{% assign observationId = entry.act | to_json_string | generate_uuid -%} | ||
{% if entry.act.templateId and entry.act.templateId.root and entry.act.templateId.root == "2.16.840.1.113883.10.20.15.2.3.1" %} | ||
{% include 'Resource/ObservationTravelHistory' observationCategory: 'social-history', observationEntry: entry.act, ID: observationId -%} | ||
{% endif %} | ||
{% endif -%} | ||
|
||
{% for socialObservation in SOCIALOBS -%} | ||
{% assign observationId = socialObservation.observation | to_json_string | generate_uuid -%} | ||
{% if socialObservation.observation.templateId and socialObservation.observation.templateId[0] and socialObservation.observation.templateId[0].root and socialObservation.observation.templateId[0].root == '2.16.840.1.113883.10.20.22.4.38' and socialObservation.observation.code and socialObservation.observation.code.code == '76690-7' -%} | ||
{% include 'Resource/ObservationSexualOrientation' observationCategory: 'social-history', observationEntry: socialObservation.observation, ID: observationId -%}, | ||
{% include 'Reference/Observation/Subject' ID: observationId, REF: fullPatientId -%} | ||
{% endif -%} | ||
{% endfor -%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
socialHistoryText
isn't defined yet right? So is the point of passing the blanksocialHistoryText
toSection/SocialHistory
to give it a value that can be used inResource/Patient
?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.
yeah, it's a weird hack that takes advantage of leaky variable scopes 😬