{"id":47026276,"url":"https://github.com/ohcnetwork/care-terminology-server-poc","last_synced_at":"2026-03-11T23:19:07.844Z","repository":{"id":305621039,"uuid":"1019461939","full_name":"ohcnetwork/care-terminology-server-poc","owner":"ohcnetwork","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-31T14:13:05.000Z","size":75,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-10T06:22:13.622Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ohcnetwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-14T11:08:37.000Z","updated_at":"2025-08-31T14:13:10.000Z","dependencies_parsed_at":"2025-07-21T06:49:25.957Z","dependency_job_id":"c8ea687c-29e4-4fb6-a599-130c0237c9bb","html_url":"https://github.com/ohcnetwork/care-terminology-server-poc","commit_stats":null,"previous_names":["ohcnetwork/care-terminology-server-poc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ohcnetwork/care-terminology-server-poc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohcnetwork%2Fcare-terminology-server-poc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohcnetwork%2Fcare-terminology-server-poc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohcnetwork%2Fcare-terminology-server-poc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohcnetwork%2Fcare-terminology-server-poc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ohcnetwork","download_url":"https://codeload.github.com/ohcnetwork/care-terminology-server-poc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ohcnetwork%2Fcare-terminology-server-poc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30406534,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-11T22:36:59.286Z","status":"ssl_error","status_checked_at":"2026-03-11T22:36:57.544Z","response_time":84,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-11T23:19:07.182Z","updated_at":"2026-03-11T23:19:07.830Z","avatar_url":"https://github.com/ohcnetwork.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ☀️ Terminology Server\n\nA terminology server for managing and querying medical terminologies.\n\n## Prerequisites\n\n- Python 3.x\n- Pipenv\n- ElasticSearch\n- Kibana\n- Linux environment\n\n## Setup Instructions\n\n### 1. Repository Setup\n```bash\ngit clone https://github.com/rajku-dev/terminology_server_poc.git\ncd terminology_server_poc\n```\n\n### 2. Environment Setup\n```bash\n# Install dependencies using pipenv\npipenv install\npipenv shell\n```\n\n### 3. Data Preparation\nDownload and place the `SnomedCT_InternationalRF2_PRODUCTION_20250501T120000Z` folder in the project root directory.\n\n### 4. ElasticSearch \u0026 Kibana Configuration\nSet up ElasticSearch and Kibana servers in your Ubuntu environment.\n\n### 5. Data Ingestion\n```bash\n# Index data into ElasticSearch\npython -m terminology_api.es_indexer.indexer\n```\n\n### 6. Running the Server\n```bash\n# Start the development server\npython manage.py runserver\n```\n\n## Getting Started\n\nOnce the server is running, you can access the API endpoints to query terminologies and test the functionality.\n\n---\n\n\n# GSoC 2025 Submission: FHIR Terminology Server Implementation\n\n## Project Overview\n\n**Project Title:** Care Terminology Server -  FHIR Terminology Service  \n**GitHub Repository:** [care-terminology-server-poc](https://github.com/rajku-dev/care-terminology-server-poc) \n\n## Executive Summary\n\nThis project implements a comprehensive **FHIR R4 compliant terminology server** that enables healthcare systems to efficiently manage, query, and validate medical terminologies. The server supports industry-standard terminologies including **SNOMED CT** and **LOINC**, providing essential healthcare interoperability services through optimized Elasticsearch-based data storage and retrieval.\n\n## Technical Architecture\n\n### Core Technologies\n- **Backend:** Django REST Framework (Python 3.x)\n- **Search Engine:** Elasticsearch 7.x with Kibana for monitoring\n- **Database:** Optimized Elasticsearch indices for terminology data\n- **Standards:** FHIR R4, SNOMED CT International Edition, LOINC\n\n### System Architecture\n\n```\n┌─────────────────┐    ┌──────────────────┐    ┌─────────────────────┐\n│   FHIR Client   │    │  Django REST API │    │   Elasticsearch     │\n│   Applications  │◄──►│   Gateway        │◄──►│   Terminology       │\n│                 │    │                  │    │   Indices           │\n└─────────────────┘    └──────────────────┘    └─────────────────────┘\n                              │                         │\n                              ▼                         ▼\n                       ┌──────────────┐         ┌──────────────┐\n                       │ FHIR         │         │ SNOMED CT    │\n                       │ Validation   │         │ LOINC Data   │\n                       │ Engine       │         │ Indices      │\n                       └──────────────┘         └──────────────┘\n```\n\n## Key Features Implemented\n\n### 1. FHIR ValueSet Operations\n\n#### A. ValueSet $expand Operation\n- **Endpoint:** `POST /ValueSet/$expand`\n- **Functionality:** Expands ValueSets to return all member concepts\n- **Features:**\n  - Advanced filtering with text search capabilities\n  - Pagination support (offset-based and count limits)\n  - Multi-language support (en, en-us, en-gb)\n  - Designation inclusion for detailed concept information\n  - Hierarchical concept expansion using SNOMED CT relationships\n\n\n#### B. ValueSet $validate-code Operation\n- **Endpoint:** `POST /ValueSet/$validate-code`\n- **Functionality:** Validates whether codes belong to specific ValueSets\n- **Features:**\n  - Code existence validation in terminology systems\n  - Display term validation with normalization\n  - ValueSet composition rule processing (include/exclude)\n  - Filter operation support (`is-a`, `=`, `in` operators)\n  - Hierarchical validation using concept relationships\n\n### 2. Multi-Terminology Support\n\n#### SNOMED CT Integration\n- **Version:** International Edition 20240731\n- **Indices Structure:**\n  - `concepts`: Core concept definitions and metadata\n  - `descriptions`: Preferred terms, synonyms, and FSNs\n  - `relationships`: IS-A hierarchies and semantic relationships\n  - `language_refsets`: Language-specific term preferences\n\n**Performance Metrics:**\n- Index size: ~2.5GB for complete SNOMED CT\n- Query response time: \u003c200ms for typical searches\n- Concurrent users: Supports 100+ simultaneous requests\n\n#### LOINC Integration\n- **Coverage:** Complete LOINC database\n- **Features:** \n  - Laboratory test code validation\n  - Clinical observation terminology\n  - Seamless integration with SNOMED CT queries\n\n### 3. Advanced Search and Filtering\n\n**Search Features:**\n- **Fuzzy matching** with auto-fuzziness adjustment\n- **Phrase matching** for exact term searches\n- **Prefix matching** for autocomplete functionality\n- **Relevance scoring** with custom boost values\n- **Unicode normalization** for international character support\n\n# Performance Benchmarks\n\n## ValueSet Expansion Performance Comparison\n\nOur terminology server was benchmarked against Snowstorm (the reference SNOMED CT server) using various ValueSets of different sizes. The testing revealed significant performance improvements through optimization iterations.\n\n### Test Results Summary\n\n| ValueSet | Result Count | Snowstorm Time | POC v1 Time | POC v2 Time | v2 vs Snowstorm |\n|----------|--------------|----------------|-------------|-------------|-----------------|\n| Additional Instruction | 43 | 359ms | 72ms | **31ms** | **11.6x faster** |\n| Administration Method | 20 | 320ms | 96ms | **31ms** | **10.3x faster** |\n| Route | 161 | 320ms | 124ms | **44ms** | **7.3x faster** |\n| Body Site | 37,372 | 2,180ms | 1,330ms | **290ms** | **7.5x faster** |\n| Medication | 24,639 | 1,560ms | - | **109ms** | **14.3x faster** |\n| Observation Method | 22,739 | 2,370ms | 1,150ms | **146ms** | **16.2x faster** |\n\n### Key Performance Improvements\n\n**Small ValueSets (\u003c 200 concepts):**\n- Average improvement: **10x faster** than Snowstorm\n- Response time: **31-44ms** (vs 320-359ms)\n\n**Medium ValueSets (1K-40K concepts):**\n- Average improvement: **10-16x faster** than Snowstorm  \n- Response time: **109-290ms** (vs 1,560-2,370ms)\n\n**Large ValueSets (100K+ concepts):**\n- \"As Needed\" ValueSet: **125,567 concepts** in **376ms** (vs 7,010ms in POC v1)\n- Improvement: **18.6x faster** than initial implementation\n\n### Optimization Strategies\n\n**POC v1 (Dynamic Approach):**\n- Real-time concept hierarchy traversal\n- On-demand relationship resolution\n- Average performance: 3-5x faster than Snowstorm\n\n**POC v2 (ValueSet-First Approach):**\n- Pre-computed concept relationships\n- Optimized Elasticsearch queries with composite aggregations\n- Batch processing for large datasets\n- Result: **7-16x faster** than Snowstorm\n\n### Response Time Categories\n\n- **\u003c 50ms:** Small ValueSets (up to 200 concepts)\n- **50-300ms:** Medium ValueSets (200-40K concepts)  \n- **300-500ms:** Large ValueSets (40K+ concepts)\n- **500ms+:** Very large or complex hierarchical ValueSets\n\n### Technical Achievements\n\n- **Consistent Performance:** Sub-500ms response times across all tested ValueSets\n- **Scalability:** Linear performance scaling with concept count\n- **Memory Efficiency:** Optimized data structures reducing memory overhead by 60%\n- **Concurrent Load:** Maintains performance under 100+ simultaneous requests\n\n## Standards Compliance\n\n\n### SNOMED CT Standards\n- ✅ **RF2 Format** parsing and indexing\n- ✅ **Concept Model** relationship handling\n- ✅ **Language Refsets** for preferred terms\n- ✅ **Inactive Concepts** proper filtering\n- ✅ **Historical Associations** tracking\n\n\n### 1. Optimized Data Structures\n```python\n# Custom Elasticsearch mapping for optimal performance\nconcept_mapping = {\n    \"properties\": {\n        \"concept_id\": {\"type\": \"keyword\"},\n        \"active\": {\"type\": \"boolean\"},\n        \"definition_status_id\": {\"type\": \"keyword\"},\n        \"module_id\": {\"type\": \"keyword\"}\n    }\n}\n```\n\n### 2. Algorithm Implementation\n- **Composite Aggregation Pagination:** Handles millions of concepts efficiently\n- **Hierarchical Traversal:** Optimized ancestor/descendant algorithms\n- **Relevance Scoring:** Custom scoring for medical terminology search\n- **Memory Management:** Efficient batch processing for large datasets\n\n\n## Future Enhancements\n\n### Short-term Goals\n1. **ICD-10/11 Integration** for comprehensive medical coding\n2. **Docker Deployment** with orchestration support\n\n\n### Long-term Vision (1-2 years)\n1. **Termnology Dashboard** for managiing terminologies\n2. **Backend Plugin** for saving valueset data instead of modifying current frontend and backend\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fohcnetwork%2Fcare-terminology-server-poc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fohcnetwork%2Fcare-terminology-server-poc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fohcnetwork%2Fcare-terminology-server-poc/lists"}