nadavWeisler / nadavWeisler/MedCodeTranslator

[Search] Implement alias expansion layer from data/aliases/common.json

Open
#80 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
0
Forks
0
Avg merge
7m
Merged PRs (30d)
7

Description

Problem summary

Alias expansion is documented in README and MatchMethod includes 'alias', but packages/search/src/layered.ts does not load or apply data/aliases/common.json. Queries like DM, HTN, and T2DM do not expand to canonical terms.

Affected area

  • data/aliases/common.json
  • packages/search/src/layered.ts
  • app/components/CodeCard.tsx (alias badge label exists but is never shown)

Expected behavior

Common clinical abbreviations expand before layered search runs. Expanded hits surface with matchMethod: 'alias'.

Actual behavior

Only exact → prefix → substring → fuzzy layers run. Alias file is unused.

Reproduction

  1. Open ATC-5 or ICD-10.
  2. Search DM or HTN.
  3. Compare with searching diabetes mellitus or hypertension.

Acceptance criteria

  • Alias table is loaded at search index build time.
  • Layered search applies alias expansion before or alongside other layers.
  • Results from alias expansion use matchMethod: 'alias'.
  • Unit tests cover at least 5 common abbreviations from common.json.
  • README architecture diagram matches implementation.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with data/aliases/common.json and packages/search/src/layered.ts to trace how the search index is built and how layers assign matchMethod values. Check app/components/CodeCard.tsx and the README architecture diagram for the alias result presentation. Add coverage for at least five abbreviations, verify alias-expanded results use matchMethod 'alias', and confirm the documented architecture matches the implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
search
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.