Xhuma is a stateless middleware service that facilitates the conversion of GP Connect structured records into CCDA (Consolidated Clinical Document Architecture) format. The service implements IHE ITI profiles for interoperability and uses Redis for efficient caching of responses.
- Stateless architecture for scalability and reliability
- Production-ready Redis caching with:
- Memory management and persistence
- Connection pooling and automatic retry
- Comprehensive monitoring
- IHE ITI profile implementation (ITI-47, ITI-38, ITI-39)
- FHIR to CCDA conversion
- JWT-based authentication for NHS Digital services
- SOAP message handling for healthcare interoperability
The service is built on FastAPI and follows a modular design pattern. For detailed technical documentation, see:
sequenceDiagram
participant EHR
box Xhuma
participant Fast API
participant Redis
end
box NHS API's
participant PDS
participant SDS
participant GP Connect
end
EHR->>Fast API: ITI 47 Request
Fast API->>PDS: FHIR PDS lookup
PDS->>Fast API: PDS response
Fast API->>EHR: ITI 47 Response
Fast API->>Redis: Check for cached SDS lookup
opt if no cached SDS lookup
Fast API--)SDS: ASID Lookup
Fast API--)SDS: FHIR Endpoint Trace
SDS--)Fast API: SDS Responses
Fast API->>Redis: Cache SDS Responses
end
Redis->>Fast API: Return ADIS and FHIR root
EHR->>Fast API: ITI 38 Request
Fast API->>Redis: Check for cached response
opt if no cached GP connect lookup
Fast API--)GP Connect: GPconnect Structured SCR request
GP Connect--)Fast API: Return Structured SCR
Fast API->>Fast API: convert SCR to CCDA
Fast API->>Redis: Cache CCDA
end
Fast API->>EHR: ITI 38 Response
EHR->>Fast API: ITI 39 Request
Fast API->>EHR: ITI 39 Response
- Docker
- Docker Compose
- NHS Digital API access credentials
- Clone the repository:
git clone https://github.com/UCLH-Digital-Innovation-Hub/Xhuma.git
cd Xhuma- Set up environment variables:
cp .env.example .env- Configure the following in your .env file:
# Required configurations
REDIS_PASSWORD=your_secure_redis_password
API_KEY=your_api_key
JWTKEY=your_jwt_key
REGISTRY_ID=your_registry_id
# Optional configurations (defaults provided)
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_DB=0
- Deploy with Docker Compose:
docker-compose up -dThe service will be available at http://localhost:8000
The service uses a production-ready Redis setup with:
- Memory management (256MB limit with volatile-lru policy)
- Data persistence (RDB snapshots and AOF)
- Connection pooling
- Automatic retry mechanism
- Comprehensive monitoring
- Security hardening
Redis metrics are available through Prometheus and can be visualized in Grafana.
Access the interactive API documentation at:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
main: Production releasesdev: Development branchfeature/*: Feature branchesintegration: Integration testing
- Create a feature branch from
dev - Implement changes
- Add tests
- Create a pull request to
dev
Tests are automatically run in the CI pipeline. To run tests locally using Docker:
docker-compose -f docker-compose.test.yml up --buildThis project is licensed under the terms of the license included in the LICENSE file.