-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
If we need to map one value to another, I think we need an explicit structure, like:
display:
"{% switch %myCoding.code %}":
code1: Another Display 1
code2: Another Display 2
code3: Another Display 3
code4: Another Display 4
"{% default %}": OtherCurrently, there are three workarounds to do it.
- Using fhirpath iif --- too difficult to read (wrong formatting to make it readable!)
iif(%myCoding.code = 'code1', 'Another Display 1',
iif(%myCoding.code = 'code2', 'Another Display 2',
iif(%myCoding.code = 'code3', 'Another Display 3',
iif(%myCoding.code = 'code4', 'Another Display 4', 'Other')
)
)
)
- Using FPML if/else --- looks not good and similar to option 1. The keys order might lost when formatted.
display:
"{% if %myCoding.code = ''code1'' %}": Another Display 1
"{% else %}":
"{% if %myCoding.code = ''code2'' %}": Another Display 2
"{% else %}":
"{% if %myCoding.code = ''code3'' %}": Another Display 3
"{% else %}":
"{% if %myCoding.code = ''code4'' %}": Another Display 4- Using if and first value --- the most readable option, but looks like a hack
"{% assign %}":
displayValue:
- "{% if %myCoding.code = 'code1' %}": "Another Display 1"
- "{% if %myCoding.code = 'code2' %}": "Another Display 2"
- "{% if %myCoding.code = 'code3' %}": "Another Display 3"
- "{% if %myCoding.code = 'code4' %}": "Another Display 4"
- Other
display: "{{ %displayValue }}"Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels