How avinashcreates/wirachain-healthcare-consent works
WiraChain is a consent-aware healthcare exchange prototype spanning a React client, ASP.NET Core API, and blockchain log service. The principal workflow is a user working through the client to manage patient, clinic, and doctor records and patient-to-clinic permissions; the backend exposes domain APIs, with FHIR interoperability and Ethereum-backed permission provenance as documented platform capabilities. Controller-to-service links are supported by excerpts; broader integration links are documented in the README, while unsampled implementation details are not asserted.
Main entry points: CustomBaseQuery.tsx API query layer · main.tsx React client · Program.cs ASP.NET API · PatientsController.cs Patient workflows
Components 18
Client application
- React client
wirachain-frontend-main/wirachain-frontend-main/src/main.tsx - Auth state
wirachain-frontend-main/wirachain-frontend-main/src/redux/slices/AuthSlice.tsx - Token manager
wirachain-frontend-main/wirachain-frontend-main/src/features/auth/utils/TokenManager.tsx - API query layer
wirachain-frontend-main/wirachain-frontend-main/src/redux/api/CustomBaseQuery.tsx
Healthcare API
- ASP.NET API
wirachain-backend-main/wirachain-backend-main/Program.cs - Patient workflows
wirachain-backend-main/wirachain-backend-main/Patients/Controllers/Rest/PatientsController.cs - Patient services
wirachain-backend-main/wirachain-backend-main/Patients/Services/PatientService.cs - Clinic workflows
wirachain-backend-main/wirachain-backend-main/Clinics/Controllers/Rest/ClinicsController.cs - Doctor workflows
wirachain-backend-main/wirachain-backend-main/Doctors/Controllers/Rest/DoctorsController.cs - Consultations and tests
wirachain-backend-main/wirachain-backend-main/MedicalConsultations/Api/Rest/Controllers/MedicalConsultationsController.cs - MySQL persistence
wirachain-backend-main/wirachain-backend-main/Shared/Persistence/Context/AppDbContext.cs
Consent and interoperability
- Patient clinic consent
wirachain-backend-main/wirachain-backend-main/Permissions/Api/Rest/Controllers/PatientClinicPermissionsController.cs - FHIR interoperability
wirachain-backend-main/wirachain-backend-main/Shared/Integration/Fhir/Service/FhirPatientService.cs
Blockchain audit
- Ethereum event integration
wirachain-backend-main/wirachain-backend-main/Shared/Integration/Ethereum/Services/EthereumService.cs - Contract API
wirachain-smart-contract-deployment-main/wirachain-smart-contract-deployment-main/src/server.ts - Permission event logs
wirachain-smart-contract-deployment-main/wirachain-smart-contract-deployment-main/src/api/logs/logs.controller.ts
Other components
- Healthcare user
- Ethereum network
Connections 19
- Healthcare user → React client: uses
- React client → Auth state: manages session
wirachain-frontend-main/wirachain-frontend-main/src/main.tsx - API query layer → Token manager: reads tokens
wirachain-frontend-main/wirachain-frontend-main/src/redux/api/CustomBaseQuery.tsx - API query layer → Auth state: refreshes session
wirachain-frontend-main/wirachain-frontend-main/src/redux/api/CustomBaseQuery.tsx - React client → API query layer: requests API
- API query layer → ASP.NET API: calls API
- ASP.NET API → Patient workflows: routes requests
- ASP.NET API → Clinic workflows: routes requests
- Patient workflows → Patient services: calls
wirachain-backend-main/wirachain-backend-main/Patients/Controllers/Rest/PatientsController.cs - Clinic workflows → MySQL persistence: persists records
- Doctor workflows → MySQL persistence: persists records
- Consultations and tests → MySQL persistence: persists records
- Patient workflows → Patient clinic consent: grants or revokes
wirachain-backend-main/wirachain-backend-main/Patients/Controllers/Rest/PatientsController.cs - Doctor workflows → Patient clinic consent: requests access
wirachain-backend-main/wirachain-backend-main/Doctors/Controllers/Rest/DoctorsController.cs - Patient services → FHIR interoperability: exchanges FHIR
- Patient clinic consent → Ethereum event integration: records consent events
- Ethereum event integration → Ethereum network: emits events
- Contract API → Permission event logs: routes log requests
wirachain-smart-contract-deployment-main/wirachain-smart-contract-deployment-main/src/server.ts - Permission event logs → Ethereum network: queries permission events
wirachain-smart-contract-deployment-main/wirachain-smart-contract-deployment-main/src/api/logs/logs.controller.ts