ATC and ICD-10 codes describe different sides of a patient record. ATC classifies medicines by their anatomical, therapeutic and chemical properties; ICD-10 classifies diseases, symptoms and health conditions. Extracting both from clinical documents is useful for claims review, pharmacovigilance, cohort construction, utilisation studies and healthcare analytics—but only when the workflow preserves clinical context.
The goal is not simply to find code-shaped strings. A reliable system must identify medicines and diagnoses, resolve synonyms and abbreviations, distinguish active treatment from history, and retain evidence for every assigned code.
What ATC and ICD-10 codes represent
The WHO ATC system organises medicines across five hierarchical levels, moving from broad anatomical groups to specific chemical substances. A product can have more than one relevant classification depending on its active ingredient, route or indication. Brand names, salt forms and combination products therefore need careful normalisation before an ATC code is assigned.
ICD-10 codes represent diagnoses, symptoms, abnormal findings, external causes and other health-related conditions. The exact code set and reporting rules vary by jurisdiction and use case. A clinical NLP pipeline should never assume that an international ICD-10 label, a national modification, and a payer-specific billing code are interchangeable.
This distinction matters: an ATC code is not a treatment code for a diagnosis, and an ICD-10 code is not proof that a particular medicine was prescribed for that condition. Any relationship between the two should be treated as an analytical association supported by documentation, not as an automatic clinical conclusion.
Where extraction is used
Common use cases include:
- Medication utilisation: count prescribing patterns by therapeutic class, ingredient, route or facility.
- Cohort identification: find records containing a condition and one or more relevant medicines.
- Claims and audit support: compare documented diagnoses, prescriptions and billed services.
- Safety surveillance: detect potential adverse-event signals and medication-related patterns.
- Research datasets: create structured features from discharge summaries, prescriptions and laboratory narratives.
- Programme monitoring: analyse disease and medicine access across Indian districts, hospitals or schemes.
For teams building clinical AI, the same principles apply to ICD-10 codes for LLM training: build representative, de-identified datasets and preserve the original text alongside every label.
A robust extraction workflow
1. Define the target schema
Before selecting a model, specify what the output must contain. A useful record may include:
- Patient or encounter identifier, subject to privacy controls
- Source document, section and character span
- Mentioned medicine or condition
- Normalised term and code system
- ATC or ICD-10 code and version
- Assertion status: present, absent, possible, historical or family history
- Temporality: current, past or planned
- Negation and experiencer
- Confidence score and reviewer status
The schema should also distinguish documented code, model-suggested code, and human-approved code. Combining these fields creates false certainty and makes audits difficult.
2. Ingest and protect the source data
Clinical information may arrive as HL7/FHIR resources, CSV exports, pharmacy systems, scanned prescriptions, PDFs or free-text notes. Apply access controls, encryption, de-identification and retention rules before processing. In India, teams should align their design with applicable health-data, consent and security obligations rather than treating de-identification as a one-time export step.
When documents are unstructured, an approach to structured data extraction from unstructured documents can help establish OCR, layout parsing and provenance before clinical coding begins.
3. Normalise medicines and diagnoses
Create terminology dictionaries covering Indian brand names, generic names, spelling variations, abbreviations, transliterations and common OCR errors. Medicine normalisation should resolve the active ingredient, strength, dosage form and route where available. Diagnosis normalisation should account for synonyms, acronyms, local language expressions and clinically meaningful modifiers.
Do not discard the original mention. Store a mapping such as “Metformin 500 mg tablet” → ingredient → ATC candidate, while retaining the exact text and document location. For ICD-10, retain the phrase that justified the candidate code and flag cases requiring a more specific clinical distinction.
4. Extract entities and context
A production pipeline commonly combines OCR, dictionaries, rules, named-entity recognition and an LLM or other language model. Rules are valuable for dosage, units, code formats and negation; statistical models help with variation; human review handles ambiguity.
For every mention, detect whether the text says that the patient has a condition, denies it, is being evaluated for it, or has a family history. Similarly, distinguish an active prescription from a discontinued medicine, an allergy, a medication list entry and a discussion of a possible treatment.
5. Map to the correct release
Code systems change. Record the terminology release, national modification, mapping source and mapping date. Never silently replace a retired code with a current code: preserve the historical value and create an explicit crosswalk when appropriate.
ATC and ICD-10 mapping is often one-to-many. A medicine may be used for several conditions, while a diagnosis may be treated with several medicines. Use curated indication tables only to generate candidates; require documentation or expert review before asserting a clinical relationship.
6. Validate and review
Validation should combine automated checks and qualified review. Useful controls include:
- Code-format and hierarchy validation
- Ingredient, strength and route consistency checks
- Duplicate and contradiction detection
- Negation, temporality and section-aware tests
- Sampling by hospital, specialty, language and document type
- Precision, recall and F1 by entity and context category
- Separate measurement of exact-code accuracy and broad-category accuracy
A confidence score should route uncertain cases to coders or clinicians; it should not be used as a substitute for validation. Track error categories, such as brand ambiguity, OCR corruption, missing specificity and incorrect negation, because aggregate accuracy can conceal serious failure modes.
India-specific implementation considerations
Indian healthcare data is operationally diverse. A single programme may combine English discharge summaries, handwritten prescriptions, scanned bills, regional-language notes and multiple hospital information systems. Design for multilingual OCR, inconsistent date formats, variable medicine naming and uneven metadata quality from the outset.
Prefer standards-based interfaces where available, and keep terminology services separate from application code so releases can be updated without rebuilding the entire pipeline. For public-health or research use, publish aggregate outputs only when re-identification risk has been assessed. AI knowledge extraction from private documents offers useful design principles for access boundaries, audit trails and controlled retrieval.
When to use automation—and when not to
Automation is well suited to triage, pre-annotation, high-volume retrieval and consistency checks. It is less suitable for autonomous billing, treatment decisions or assigning highly specific diagnoses when the source note is incomplete.
A practical deployment pattern is:
1. Extract candidate mentions automatically.
2. Show the source span and suggested code to a reviewer.
3. Capture corrections as labelled feedback.
4. Monitor performance after each terminology or model update.
5. Keep an immutable audit trail of source, model, code release and reviewer action.
Teams can also evaluate how to automate data extraction using AI agents, but agentic systems should be constrained by approved vocabularies, deterministic validation and clear escalation rules.
A pre-launch checklist
Before production, confirm that you have:
- A defined use case, target population and coding jurisdiction
- Versioned ATC and ICD-10 terminology sources
- De-identification, access and retention controls
- A schema that preserves evidence, context and provenance
- Gold-standard annotations from qualified reviewers
- Tests for negation, history, uncertainty and multilingual input
- Human review for low-confidence or high-impact cases
- Monitoring for drift, code updates and site-specific errors
- A rollback plan for model or terminology releases
Conclusion
ATC ICD10 codes extraction is best treated as a terminology and clinical-context problem, not a simple keyword-search task. Reliable results come from versioned code sets, careful medicine and diagnosis normalisation, context detection, transparent mapping and human oversight. For Indian healthcare builders, multilingual data, fragmented systems and changing terminology make provenance and validation essential. Build the workflow around evidence first; automate only what you can measure and safely review.
FAQ
Can ATC and ICD-10 codes be extracted from the same document?
Yes. A discharge summary, prescription or claim may contain both, but each mention must be extracted and validated independently. Any medicine–diagnosis link should be labelled as documented, inferred or reviewed.
Is an ATC code enough to identify a medicine precisely?
Not always. ATC may represent an ingredient or therapeutic grouping rather than a complete product description. Store strength, formulation, route, brand and ingredient separately when those details matter.
Can an LLM assign final billing codes?
An LLM can propose candidates and highlight evidence, but final coding should follow the applicable coding rules and review requirements. Measure performance on representative local data before deployment.
How should code updates be handled?
Version every terminology release, retain historical codes, document crosswalks and rerun regression tests. Never overwrite prior outputs without recording the reason and the mapping used.
Apply for AI Grants India
Building an AI system for clinical coding, health-data interoperability or medical document processing? Explore funding and support opportunities through AI Grants India and design your application around a measurable healthcare problem, responsible data governance and a credible validation plan.