Skip to content

feat(hts): synthesise parent/child/inactive properties + definition i…#97

Merged
smunini merged 1 commit into
feat/hts-terminology-servicefrom
feat/hts-lookup-synthesis
May 5, 2026
Merged

feat(hts): synthesise parent/child/inactive properties + definition i…#97
smunini merged 1 commit into
feat/hts-terminology-servicefrom
feat/hts-lookup-synthesis

Conversation

@smunini
Copy link
Copy Markdown
Contributor

@smunini smunini commented May 5, 2026

…n $lookup

The HL7 tx-ecosystem simple-cases/simple-lookup-1 and simple-lookup-2 fixtures send property=* and expect $lookup to surface several "well-known" concept properties that aren't stored directly in concept_properties:

  • parent — derived from concept_hierarchy.parent_code WHERE child_code = req.code
  • child — derived from concept_hierarchy.child_code WHERE parent_code = req.code
  • inactive — boolean derived from a status property in the FHIR inactive set (retired/deprecated/withdrawn/inactive); skipped when the concept already has an explicit inactive row to avoid duplicates
  • definition — top-level Parameters entry sourced from concepts.definition

Each synthesised parent/child entry carries the related concept's display in description, matching the IG fixtures' optional description parts.

The wildcard handling and explicit-property filter both honour synthesised entries: property=* includes them all alongside stored properties; property=parent returns only the synthesised parent.

Both SQLite and PostgreSQL backends are updated. LookupResponse gains a definition: Option<String> field, surfaced by process_lookup as a top-level definition parameter.

Adds 8 unit tests (parent/child/inactive synthesis, no-status fallback, explicit-inactive non-duplication, definition echo, filtered selection, wildcard inclusion) and 1 HTTP-level integration test asserting the IG response shape end-to-end. All 499 helios-hts lib tests pass.

…n $lookup

The HL7 tx-ecosystem `simple-cases/simple-lookup-1` and `simple-lookup-2`
fixtures send `property=*` and expect $lookup to surface several
"well-known" concept properties that aren't stored directly in
`concept_properties`:

* `parent` — derived from `concept_hierarchy.parent_code WHERE child_code = req.code`
* `child`  — derived from `concept_hierarchy.child_code  WHERE parent_code = req.code`
* `inactive` — boolean derived from a `status` property in the FHIR
  inactive set (retired/deprecated/withdrawn/inactive); skipped when
  the concept already has an explicit `inactive` row to avoid duplicates
* `definition` — top-level Parameters entry sourced from
  `concepts.definition`

Each synthesised parent/child entry carries the related concept's
display in `description`, matching the IG fixtures' optional
`description` parts.

The wildcard handling and explicit-property filter both honour
synthesised entries: `property=*` includes them all alongside stored
properties; `property=parent` returns only the synthesised parent.

Both SQLite and PostgreSQL backends are updated. `LookupResponse`
gains a `definition: Option<String>` field, surfaced by
`process_lookup` as a top-level `definition` parameter.

Adds 8 unit tests (parent/child/inactive synthesis, no-status
fallback, explicit-inactive non-duplication, definition echo,
filtered selection, wildcard inclusion) and 1 HTTP-level integration
test asserting the IG response shape end-to-end. All 499
helios-hts lib tests pass.
@smunini smunini merged commit 0070f75 into feat/hts-terminology-service May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant