Skip to content

NDP Microservices Documentation ​

Service Status Overview ​

βœ… Completed - Healthcare Enhanced (P0) ​

ServiceStatusLinesKey Features
Prescription Serviceβœ… COMPLETE9704-layer validation, FHIR, clinical safety
FHIR Serverβœ… COMPLETE549HAPI FHIR R4, CDS Hooks, SMART on FHIR
CDSSβœ… COMPLETE843Drug interactions, allergies, dosing
Insurance Serviceβœ… COMPLETE645UHIS integration, PA, claims

πŸ”„ Needs Update (P1) ​

ServiceCurrentNeeds
Patient RegistryBasicClinical data, consent, FHIR
Medicine DirectoryBasicFHIR Medication, extended data
Dispense ServiceBasicInventory, insurance adjudication
HPR RegistryBasicEnhanced authorization, specialties
Audit ServiceBasicHealthcare compliance, immutable

πŸ“ To Create (P1) ​

ServicePriorityPurpose
Notification ServiceHIGHSMS, email, push, alerts
Analytics ServiceHIGHPublic health, reporting
Master Data ManagementMEDIUMICD-10, LOINC, SNOMED

Architecture Overview ​

Click diagrams to zoom

All diagrams are interactive - click to expand to full screen

Critical Dependencies ​

πŸ”„ Prescription Creation Flow ​

πŸ’Š Dispensing Flow ​

Safety-Critical Services ​

🚨 Tier 1 - CRITICAL (Cannot Function Without) ​

  1. CDSS - Patient safety validations

    • Drug-drug interactions
    • Allergy checking
    • Dosing validation
    • Downtime Impact: Cannot prescribe safely
    • SLA: 99.99% uptime
  2. FHIR Server - Central data repository

    • Single source of truth
    • Patient clinical data
    • Downtime Impact: System-wide outage
    • SLA: 99.95% uptime
  3. Patient Registry - Identity & clinical data

    • Patient verification
    • Allergies, conditions
    • Downtime Impact: Cannot verify patients
    • SLA: 99.9% uptime

⚠️ Tier 2 - HIGH PRIORITY ​

  1. Insurance Service - Cannot dispense without
  2. Prescription Service - Core functionality
  3. HPR Registry - Prescriber validation
  4. Dispense Service - Pharmacy operations

πŸ“Š Tier 3 - SUPPORTING ​

  1. Medicine Directory - Reference data (can cache)
  2. Audit Service - Logging (can queue)
  3. Notification Service - User experience (can delay)
  4. Analytics Service - Reporting (batch processing)

Performance Targets ​

ServiceThroughputP95 LatencyUptime
FHIR Server10,000 req/s100ms99.95%
CDSS5,000 req/s200ms99.99%
Prescription5,000 req/s300ms99.9%
Insurance3,000 req/s500ms99.9%
Dispense3,000 req/s300ms99.9%
Patient Registry10,000 req/s100ms99.9%

Data Flow ​

FHIR Resource Mappings ​

yaml
NDP Service β†’ FHIR Resource: Patient Registry β†’ Patient
  Patient Registry β†’ AllergyIntolerance
  Patient Registry β†’ Condition
  Patient Registry β†’ Observation (labs)

  HPR Registry β†’ Practitioner
  HPR Registry β†’ PractitionerRole
  HPR Registry β†’ Organization

  Pharmacy Registry β†’ Location
  Pharmacy Registry β†’ Organization

  Medicine Directory β†’ Medication

  Prescription Service β†’ MedicationRequest

  Dispense Service β†’ MedicationDispense

  Insurance Service β†’ Coverage
  Insurance Service β†’ Claim

  Audit Service β†’ AuditEvent
  Audit Service β†’ Provenance

Security Model ​

Authentication & Authorization ​

yaml
External Clients:
  - Prescriber Apps: OAuth 2.0 / SMART on FHIR
  - Pharmacy Systems: mTLS + API keys
  - Patient Apps: OAuth 2.0 / OIDC

Service-to-Service:
  - mTLS (mutual TLS)
  - JWT tokens
  - Service mesh (Istio)

Data Protection:
  - PHI: Encrypted at rest (AES-256)
  - PHI in transit: TLS 1.3
  - PII: Field-level encryption
  - Audit: All access logged

Deployment Strategy ​

Stack Organization ​

yaml
1. Infrastructure Stack (stack-infra):
  - Traefik (gateway)
  - Portainer (management)

2. Data Stack (stack-data):
  - PostgreSQL (relational data)
  - MongoDB (document data)
  - Redis (caching)

3. Monitoring Stack (stack-monitor):
  - Prometheus (metrics)
  - Grafana (visualization)
  - Loki (logs)

4. Discovery Stack (stack-discovery):
  - Consul (service discovery)
  - Vault (secrets)

5. Application Stack (stack-apps):
  - FHIR Server
  - Prescription Service
  - CDSS
  - Insurance Service
  - Dispense Service
  - Patient Registry
  - HPR Registry
  - Medicine Directory
  - Audit Service
  - Notification Service
  - Analytics Service

Next Steps ​

Phase 1: Complete P0 Services βœ… ​

  • [x] Prescription Service with clinical safety
  • [x] FHIR Server (HAPI FHIR)
  • [x] CDSS (drug interactions, allergies)
  • [x] Insurance Service (UHIS integration)

Phase 2: Update Existing Services (In Progress) ​

  • [ ] Patient Registry (clinical data, consent)
  • [ ] Medicine Directory (FHIR compliance)
  • [ ] Dispense Service (inventory, insurance)
  • [ ] HPR Registry (enhanced authorization)
  • [ ] Audit Service (healthcare compliance)

Phase 3: Create Supporting Services ​

  • [ ] Notification Service
  • [ ] Analytics & Public Health Service
  • [ ] Master Data Management Service

Phase 4: Integration & Testing ​

  • [ ] End-to-end testing
  • [ ] Load testing
  • [ ] Security audit
  • [ ] FHIR compliance validation

Getting Started ​

  1. Read the Architecture Review:

  2. Understand the Critical Services:

For Healthcare Professionals ​

  1. Clinical Decision Support:

  2. Prescription Workflow:

  3. Insurance & Coverage:

Support ​

License ​

Proprietary - Egyptian Ministry of Health and Population