Skip to main content
Glama
nbrain-egypt-uhis-fhir

nbrain-egypt-uhis-fhir

nbrain-egypt-uhis-fhir — Egypt Universal Health Insurance (UHIA / GAHAR) HL7 FHIR R4 & 14-Digit National ID SDK

Zero-dependency Python 3.10+ library, native Rust x64 binary, and Model Context Protocol (MCP) server engineered by NBrain (nbra.in) & Eng. Nadeem Mohamed Badr El-Din (nadeembadr.com) — creators of Nabd Masr (94.99% Clinical Chest X-Ray AI spotlighted by the Egyptian Cabinet).

Core Capabilities

  1. 14-Digit Egyptian National ID (الرقم القومي المصري) Decoder & Verifier:

    • Normalizes Arabic-Indic (٠-٩) and ASCII digits automatically.

    • Extracts & validates Century (2=1900s, 3=2000s), Exact Gregorian Birthdate (including leap years), 27 Official Ministry of Interior Governorate Codes + 88 Born Abroad (bilingual Arabic/English), Gender (digit 13 parity), and Weighted Modulo-11 Checksum ([2,7,6,5,4,3,2,7,6,5,4,3,2]) with configurable strict_checksum mode.

  2. Egypt UHIA / EHA / GAHAR HL7 FHIR R4 Bundle Validator:

    • Validates Patient (http://uhia.gov.eg/identifier/national-id & UHIA family enrollment),

    • Validates DiagnosticReport (LOINC 36643-5 Chest X-Ray & GAHAR National Safety Goal critical-finding notification timestamps),

    • Validates Claim with exact Decimal EGP piastres (ROUND_HALF_UP) line totals, UHIA copayment rules, and Egyptian Drug Authority (EDA) GS1 GTIN-14 modulo-10 checksums (float inputs raise TypeError).

Related MCP server: io.github.CSOAI-ORG/hl7-fhir-bridge-mcp

Supply-Chain Safe Installation (Direct Verified Git Tag or GHCR)

To prevent package-registry name-squatting attacks, install directly from the canonical signed GitHub tag or container:

pip install "git+https://github.com/NBrain-Studio/nbrain-egypt-uhis-fhir.git@v1.0.0"
# Or run via Docker GHCR:
docker run -i --rm ghcr.io/nbrain-studio/nbrain-egypt-uhis-fhir:1.0.0

License

MIT © 2026 Eng. Nadeem Mohamed Badr El-Din & NBrain (https://nbra.in).

Available Tools

4 tools
decode_egypt_14digit_national_idAInspect

Decode and validate a 14-digit Egyptian National ID (century, leap-year birthdate, 27 MOI governorates, gender, and weighted Modulo-11 check digit).

Inputs: national_id (required), strict_checksum.

generate_sample_egypt_uhis_bundleBInspect

Generate a compliant Egypt UHIA & Nabd Masr Chest X-Ray HL7 FHIR R4 Bundle.

Inputs: no named parameters.

validate_egypt_eda_gtin14CInspect

Validate an Egyptian Drug Authority (EDA) GS1 GTIN-14 medication barcode and check digit.

Inputs: gtin (required).

validate_egypt_uhis_gahar_fhir_bundleBInspect

Validate an Egypt Universal Health Insurance (UHIA/EHA) & GAHAR HL7 FHIR R4 Bundle (Patient National ID, critical radiology readback, EDA GTIN-14, and Decimal EGP Claim totals).

Inputs: bundle_json (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 4 tools

    Disambiguation4/5

    Each tool targets a clearly distinct artifact: a national ID, a FHIR bundle, a GTIN-14 barcode, or sample generation. The only mild overlap is that validate_egypt_uhis_gahar_fhir_bundle internally re-checks National ID and GTIN-14 data, so an agent might occasionally ponder whether to validate a barcode standalone or via the bundle validator. Verbs (decode/validate/generate) plus distinct object nouns keep them separable.

    Naming Consistency5/5

    All four tools use snake_case with a consistent verb_noun structure (decode_..., validate_..., validate_..., generate_...). Domain prefixes (egypt_uhis, egypt_eda_gtin14, egypt_14digit_national_id) are applied consistently, making names predictable and scannable.

    Tool Count4/5

    Four tools is a tight, focused surface appropriate for a narrow validation/utility domain, well within the 3-15 sweet spot. It sits at the low end, so a little more coverage (e.g., encoding or standalone resource validation) would round it out.

    Completeness3/5

    The core validation lifecycle is present: decode IDs, validate barcodes, validate bundles, and generate a sample bundle. However, there are notable gaps: no National ID or GTIN-14 generator/encoder, only one sample bundle type (Chest X-Ray), and no validation of individual FHIR resources outside a full bundle, which could cause dead ends for some agent workflows.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables progressive discovery and management of FHIR healthcare resources through intent-based grouping, with support for creating/validating resources, converting between formats, and transforming medical PDFs to FHIR DocumentReference resources.
      -
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI clients to canonicalize Egyptian Tax Authority B2B e-invoices and B2C e-receipts, compute SHA-256 UUIDs, verify previousUUID chains and tax registration numbers, and calculate EGP VAT and withholding tax.
      4
      MIT