Conversation
- fetch patient by identifier instead of patient_id
🐛 fix(couchdb): fetch patient by identifier instead of patient_id
- add dispensed quantity, doses wasted, and location id - include adjustments from pharmacy_obs table - calculate dispensed quantity based on delivered, current, and adjustments
- add usage examples for sync tasks - explain how to sync all records or run a specific job
- correct filtering of visits by closedDateTime - ensure that only open visits can be closed - add null string handling from frontend
Offline fix
…batch number retrieval
Implement feature X to enhance user experience and optimize performance
Offline fix
…to ICD-11 import process
dominickasanga
approved these changes
Dec 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR introduces a robust ICD-11 importer aligned with the OpenMRS 1.9+ data model.
It enables bulk ingestion of the official WHO ICD-11 MMS linearization into the OpenMRS concept dictionary, including:
The importer is designed to be idempotent, re-runnable, and safe for existing data.
Key Features & Implementation Details
1. ICD-11 Concept Import
Parses the WHO ICD-11 MMS Linearization Excel file.
Creates OpenMRS concepts using:
ConceptClass = DiagnosisConceptDatatype = N/AAssigns:
is_setwhere appropriate to support hierarchyAutomatically updates existing concepts if they already exist.
Duplicate handling
2. Concept Naming (OpenMRS-compliant)
Creates
ConceptNameentries using:locale = 'en'concept_name_type = FULLY_SPECIFIEDlocale_preferred = truePrevents duplicate concept names on re-runs.
3. ICD-11 Code Mapping
Registers:
ConceptSource: ICD-11ConceptMapType: ICD-11 CodeEach concept is mapped to its ICD-11 code using the
concept_maptable.Mappings are uniquely constrained by
(concept_id, concept_source_id, concept_code).4. Proper ICD-11 Hierarchy Using
concept_set_memberImplements ICD-11 structure using OpenMRS 1.9+ semantics:
Uses the
concept_set_membertable instead of the deprecatedconcept_set.Maintains correct ordering via
sort_weight.This ensures ICD-11 behaves as a navigable hierarchy in OpenMRS.
5. Automatic Schema Alignment (OpenMRS 1.7 → 1.9+)
The importer includes logic to detect and upgrade legacy schemas without data loss.
It will:
Create missing tables if absent:
concept_sourceconcept_map_typeconcept_mapconcept_set_memberconcept_name_tagand related tablesUpgrade existing tables:
source → concept_source_id,source_code → concept_code)Preserve all existing records
This allows the importer to run safely on older OpenMRS databases.
6. Idempotent & Safe by Design
Uses
find_or_initialize_by/find_or_create_bypatterns throughout.Prevents:
Can be re-run multiple times without corrupting data.
Why This Matters
How to Run
Notes