-
Notifications
You must be signed in to change notification settings - Fork 36
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
Feature: Conditional Resource Templates #507
Open
stueynz
wants to merge
15
commits into
LinuxForHealth:master
Choose a base branch
from
stueynz:feat/conditionalResourceTemplate
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature: Conditional Resource Templates #507
stueynz
wants to merge
15
commits into
LinuxForHealth:master
from
stueynz:feat/conditionalResourceTemplate
Conversation
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
…etimes ignore weird empty HL7 Segments Signed-off-by: Stuart McGrigor <stuart.mcgrigor@midcentraldhb.govt.nz>
…y AL1 and ZAL segments; just for testing Signed-off-by: Stuart McGrigor <stuart.mcgrigor@midcentraldhb.govt.nz>
…arked as ignoreEmpty and is actually empty then don't attempt to make a matching Resource Signed-off-by: Stuart McGrigor <stuart.mcgrigor@midcentraldhb.govt.nz>
Signed-off-by: Stuart McGrigor <stuart.mcgrigor@midcentraldhb.govt.nz>
Signed-off-by: Stuart McGrigor <stuart.mcgrigor@midcentraldhb.govt.nz>
Signed-off-by: Stuart McGrigor <stuart.mcgrigor@midcentraldhb.govt.nz>
Signed-off-by: Stuart McGrigor <stuart.mcgrigor@midcentraldhb.govt.nz>
…alue doesn't qualify as empty Signed-off-by: Stuart McGrigor <stuart.mcgrigor@midcentraldhb.govt.nz>
…o sometime not map a particular segment to a particular Resource Signed-off-by: Stuart McGrigor <stuart.mcgrigor@midcentraldhb.govt.nz>
…pply a template to a particular segment Signed-off-by: Stuart McGrigor <stuart.mcgrigor@midcentraldhb.govt.nz>
…a valid segment name; PID.5.1.2 is a valid hl7 specification, and it includes SubComponent Signed-off-by: Stuart McGrigor <stuart.mcgrigor@midcentraldhb.govt.nz>
… condition is true Signed-off-by: Stuart McGrigor <stuart.mcgrigor@midcentraldhb.govt.nz>
…h expressions inside templates Signed-off-by: Stuart McGrigor <stuart.mcgrigor@midcentraldhb.govt.nz>
…NIQUES.md Signed-off-by: Stuart McGrigor <stuart.mcgrigor@midcentraldhb.govt.nz>
Discussion on whether or not this is a GoodThing (tm) should probably take place in the matching #508 Issue. |
stueynz
changed the title
Feat/conditional resource template
Feature: Conditional Resource Templates
Sep 12, 2023
* We need to be able to use FIELDS, COMPONENTS and SUBCOMPONENTS from custom segments in Conditions * Added a note that fields, components & sub-components can now be included in expressions Signed-off-by: Stuart McGrigor <stuart.mcgrigor@midcentraldhb.govt.nz>
@stueynz thank you for your contribution, I have not reviewed but a quick glance it looks quite complete! Can you sign to handle the DCO? |
@stueynz I see no activity here; do you still want to pursue? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Sometimes, when dealing with custom HL7 segments the correct FHIR resource for the segment differs
depending upon some value in the segment. For example, in our ZAL custom Alert segment field
ZAL.2.1
denotes the Alert Category, and when the value is one ofA1
,A3
,H2
orH4
then the correct FHIR resource isAllergyIntolerance
; for all otheralert category values the correct FHIR resource is
Flag
Two resources template entries with suitable
condition
expressions will direct eachZAL
segment to its correct resource template.The grammar for the condition field is as follows:
Notes:
hl7spec uses the same dot notation as expression syntax inside templates and can be of the folowing forms:
ZAL
,ZAL.2
,ZAL.2.1
,ZAL.2.1.2
,PID.14(1).2
&PID.14(1).2.1
are all valid values for hl7spec.The SEGMENT part of hl7spec MUST match the value of the
segment
field.EQUALS and NOT_EQUALS expressions only accept a single value on the right-hand side of the expression.
IN and NOT_IN expressions only accept a list of values, delimited by comma, in square brackets on the right-hand side of the expression.
NULL and NOT_NULL do not accept any value.
The condition expression cannot be much more complex, as there are no context variables available at evaluation time.
Examples:
PID.5.1.2 EQUALS van
ZAL.2.1.3 NOT_NULL
ZAL.2(1).1 NULL
ZAL.3.1 IN [A3, A4, H1, H3, FA, DA]
ZAL.3.1 NOT_IN [A2, F3, DA]
ZAL.2 EQUALS A4
ZAL NOT_EQUALS H2