Skip to content

$translate R4 endpoint uses R5 output field name (relationship vs equivalence) #64

@jmandel

Description

@jmandel

Summary

The R4 $translate endpoint returns relationship (an R5 field name) instead of equivalence (the R4 field name) in its match output.

Root cause

In tx/workers/translate.js line ~283, the code outputs:

matchParts.push({ name: 'relationship', valueCode: map.relationship });

But on the R4 endpoint, this should be:

matchParts.push({ name: 'equivalence', valueCode: ... });

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-test","status":"active","group":[{"source":"http://example.org/cs1","target":"http://example.org/cs2","element":[{"code":"active","target":[{"code":"A","equivalence":"equivalent"}]}]}]}}]}'

Prod match part: {"name": "equivalence", "valueCode": "Equivalent"}
Dev match part: {"name": "relationship", "valueCode": "equivalent"}

Notes

This also affects the value — prod capitalizes (Equivalent, Wider) while dev uses lowercase (equivalent). The R4 spec uses lowercase values.

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