Open stueynz opened 1 year ago
Discussion on whether or not this is a GoodThing (tm) should probably take place in the matching #508 Issue.
@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?
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 other alert category values the correct FHIR resource isFlag
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