Skip to content

$translate output missing product dependencies due to wrong field name (products vs product) #63

@jmandel

Description

@jmandel

Summary

$translate never includes product dependencies in its output because the code reads map.products (plural) but the R4 ConceptMap target element field is product (singular).

Root cause

In tx/workers/translate.js line ~293, the code iterates:

for (const product of map.products || []) { ... }

But the ConceptMap target element field is product (singular) per the R4 spec.

Repro

curl -s -H 'Content-Type: application/fhir+json' -H 'Accept: application/fhir+json' \
  -X POST 'https://tx-dev.fhir.org/r4/ConceptMap/$translate' \
  -d '{"resourceType":"Parameters","parameter":[{"name":"sourceCode","valueCode":"active"},{"name":"sourceSystem","valueUri":"http://example.org/cs1"},{"name":"targetSystem","valueUri":"http://example.org/cs2"},{"name":"tx-resource","resource":{"resourceType":"ConceptMap","url":"http://example.org/cm-product","status":"active","group":[{"source":"http://example.org/cs1","target":"http://example.org/cs2","element":[{"code":"active","target":[{"code":"A","equivalence":"equivalent","product":[{"property":"http://example.org/related","system":"http://example.org/cs3","code":"R1"}]}]}]}]}}]}'

Prod: Match includes product part
Dev: Match omits product entirely

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions