Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

11.2 Design Principle

Separation of Concerns

AspectCurrent SystemNew Implementation
Hierarchy TypeInventory hierarchyHealthcare hierarchy
Primary GoalStock & MMU managementClinical & service delivery
Impact on Existing Logic❌ No impact
Data ModelM_Facility (store-based)New hierarchy layer
Backward Compatibility✅ Fully preserved

...

11.3 Enhanced M_Facility Entity (Additive Only)

...

storeType and healthcareLevel operate independently

...

11.4

...

A new dedicated table is introduced to model healthcare relationships.

Purpose

  • Represent clinical hierarchy:
    District Hospital → CHC → PHC → Subcenter

  • Enable structured referrals and reporting

  • Keep healthcare logic separate from store logic

Key Characteristics

  • Self-referencing parent–child relationship

  • Healthcare-level validation rules

  • HFR ID mapping for ABDM

  • Audit fields and soft deletion

This table does not replace mapStore or Main/Sub Store logic.

...

Hierarchy Coexistence Model

Both hierarchies exist in parallel, serving different purposes.

Inventory Logic (Existing)Healthcare Logic (New)
Main StoreDistrict Hospital (DH)
Sub StoreCHC / PHC / SC
Van & MMU focusReferral & care delivery
Stock flowPatient/service flow

...

11.

...

5 API Enhancements (Non-Breaking)

Extended / New APIs

  • /createStore – accepts optional healthcare fields

  • /editStore – updates healthcare attributes

  • /getFacilityHierarchy – returns healthcare tree

  • /validateFacilityHierarchy – validates DH→CHC→PHC→SC rules

Important Note

  • Existing API consumers do not need changes

  • Healthcare parameters are optional

  • Current flows remain intact

...