Automated summary
Walks through migrating the core-africare-identity service to a hybrid architecture where HAPI FHIR becomes the source of truth for Patient/Practitioner resources and PostgreSQL keeps GDPR metadata.
Strengths
- Breaks the migration into six ordered phases (infrastructure, client, mappers, GDPR models, service orchestration, legacy removal) with explicit Poetry commands and file paths.
- States a clear target architecture splitting responsibilities across HAPI FHIR, PostgreSQL and Keycloak.
- Lists the modules to build (async HTTP client, config, identifiers, typed exceptions) plus the HAPI_FHIR_BASE_URL and timeout environment variables.
- Includes a unit-test step for the mappers before wiring the service layer.
Limitations
- Tightly bound to the core-africare-identity repository: file names, app/ paths and make migrate commands are project-specific.
- Implementation details are delegated to companion files (CLIENT-SETUP.md, MAPPERS.md, GDPR-MODELS.md, SERVICE-LAYER.md) that are not part of the SKILL.md.
- Does not cover backfilling existing records or a rollback plan beyond flagging legacy tables as deprecated.
Use it when actually implementing the hybrid FHIR architecture, writing Patient/Practitioner mappers, or wiring an HTTP client to HAPI FHIR in this Python service.
Skip it for a different FHIR server, a non-Python/Poetry stack, or a generic FHIR resource-modelling question with no migration involved.
Security analysis
SafeThe skill only uses Read, Glob, Grep, Edit, Write, and restricted Bash commands for poetry and git. The instructions contain no destructive, exfiltrating, or obfuscated actions. The referenced bash snippets (poetry add, mkdir, touch, make) are standard development operations and do not pose meaningful security risk within the declared tool restrictions.
No concerns found
How this analysis is madeExamples
Implémente la Phase 2 de la migration : crée app/infrastructure/fhir/config.py, identifiers.py, exceptions.py et client.py avec un client HTTP async vers HAPI FHIR (httpx, timeout configurable via HAPI_FHIR_TIMEOUT).Écris app/infrastructure/fhir/mappers/patient_mapper.py pour convertir un PatientCreate Pydantic en ressource FHIR Patient, et ajoute les tests unitaires dans tests/unit/test_fhir_mappers.py.Modifie app/services/patient_service.py pour orchestrer HAPI FHIR et les tables PatientGdprMetadata, puis génère la migration Alembic des modèles GDPR.name: fhir-migration description: Migration du stockage Patient/Practitioner vers HAPI FHIR. Utiliser quand l'utilisateur demande d'implémenter l'architecture hybride FHIR, créer des mappers FHIR, ou intégrer avec HAPI FHIR. allowed-tools: Read, Glob, Grep, Edit, Write, Bash(poetry:), Bash(git:)
Migration HAPI FHIR - core-africare-identity
Ce skill guide la migration du service core-africare-identity vers une architecture hybride avec HAPI FHIR comme source de vérité pour les données démographiques.
Architecture Cible
Client → API (Pydantic) → Service Layer → HAPI FHIR (Patient/Practitioner)
↓
PostgreSQL (métadonnées GDPR)
- HAPI FHIR: Source de vérité pour données démographiques (Patient, Practitioner)
- PostgreSQL: Métadonnées GDPR locales (soft_deleted_at, correlation_hash, etc.)
- Keycloak: Authentification et gestion des utilisateurs
Composants à Implémenter
1. Infrastructure FHIR
| Fichier | Description |
|---------|-------------|
| app/infrastructure/fhir/__init__.py | Exports du module |
| app/infrastructure/fhir/client.py | Client HTTP async pour HAPI FHIR |
| app/infrastructure/fhir/config.py | Configuration FHIR (URL, timeout) |
| app/infrastructure/fhir/identifiers.py | Systèmes d'identifiants FHIR |
| app/infrastructure/fhir/exceptions.py | Exceptions FHIR typées |
Voir CLIENT-SETUP.md pour les détails d'implémentation.
2. Mappers Pydantic ↔ FHIR
| Fichier | Description |
|---------|-------------|
| app/infrastructure/fhir/mappers/__init__.py | Exports des mappers |
| app/infrastructure/fhir/mappers/patient_mapper.py | PatientCreate ↔ FHIR Patient |
| app/infrastructure/fhir/mappers/professional_mapper.py | ProfessionalCreate ↔ FHIR Practitioner |
Voir MAPPERS.md pour les templates de mappers.
3. Modèles GDPR Locaux
| Fichier | Description |
|---------|-------------|
| app/models/gdpr_metadata.py | PatientGdprMetadata, ProfessionalGdprMetadata |
Voir GDPR-MODELS.md pour les modèles SQLAlchemy.
4. Service Layer Orchestration
Modifier les services existants pour orchestrer HAPI FHIR + PostgreSQL.
Voir SERVICE-LAYER.md pour le pattern d'orchestration.
Workflow de Migration
Phase 1: Infrastructure (Prérequis)
# 1. Ajouter dépendances
poetry add "fhir.resources>=7.0.0" "httpx>=0.27.0"
# 2. Créer structure répertoires
mkdir -p app/infrastructure/fhir/mappers
touch app/infrastructure/fhir/__init__.py
touch app/infrastructure/fhir/mappers/__init__.py
Phase 2: Client FHIR
- Créer
app/infrastructure/fhir/config.py- Configuration - Créer
app/infrastructure/fhir/identifiers.py- Systèmes d'identifiants - Créer
app/infrastructure/fhir/exceptions.py- Exceptions - Créer
app/infrastructure/fhir/client.py- Client HTTP async
Phase 3: Mappers
- Créer
app/infrastructure/fhir/mappers/patient_mapper.py - Créer
app/infrastructure/fhir/mappers/professional_mapper.py - Ajouter tests dans
tests/unit/test_fhir_mappers.py
Phase 4: Modèles GDPR
- Créer
app/models/gdpr_metadata.pyavec PatientGdprMetadata - Créer migration Alembic:
make migrate MESSAGE="Add GDPR metadata tables" - Appliquer migration:
make migrate-up
Phase 5: Orchestration Services
- Modifier
app/services/patient_service.pypour utiliser FHIR + PostgreSQL - Modifier
app/services/professional_service.py - Mettre à jour les endpoints API
Phase 6: Suppression Legacy
- Marquer tables
patients/professionalscomme deprecated - Créer migration de suppression
- Nettoyer les imports
Variables d'Environnement
# HAPI FHIR
HAPI_FHIR_BASE_URL=http://localhost:8090/fhir
HAPI_FHIR_TIMEOUT=30
# Optionnel: Auth FHIR
HAPI_FHIR_AUTH_TOKEN=
Tests
# Tests unitaires mappers
poetry run pytest tests/unit/test_fhir_mappers.py -v
# Tests intégration FHIR (nécessite HAPI FHIR local)
make test-services-up
poetry run pytest tests/integration/test_fhir_client.py -v
make test-services-down
Ressources
- Client Setup - Configuration client FHIR
- Mappers - Templates de mappers Pydantic ↔ FHIR
- GDPR Models - Modèles SQLAlchemy pour métadonnées
- Service Layer - Pattern d'orchestration
- FHIR R4 Spec - Spécification FHIR
Checklist Migration
- [ ] Dépendances installées (fhir.resources, httpx)
- [ ] Client FHIR créé et testé
- [ ] Mappers Patient et Professional créés
- [ ] Modèles GDPR créés avec migration
- [ ] Services refactorisés pour orchestration
- [ ] Tests unitaires et intégration passent
- [ ] Tables legacy supprimées
- [ ] Documentation mise à jour
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/hapi-fhir-migration-hybrid-architecture-mmlj2nxb/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/hapi-fhir-migration-hybrid-architecture-mmlj2nxb' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/hapi-fhir-migration-hybrid-architecture-mmlj2nxb/download' --output '.skill-downloads/hapi-fhir-migration-hybrid-architecture-mmlj2nxb/SKILL.md.part' && mv '.skill-downloads/hapi-fhir-migration-hybrid-architecture-mmlj2nxb/SKILL.md.part' '.skill-downloads/hapi-fhir-migration-hybrid-architecture-mmlj2nxb/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
Tools declared by the author (check availability in your agent): Read, Glob, Grep, Edit, Write, Bash(poetry:*), Bash(git:*)
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/hapi-fhir-migration-hybrid-architecture-mmlj2nxb/SKILL.md' && test -s '.skill-downloads/hapi-fhir-migration-hybrid-architecture-mmlj2nxb/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/fhir-migration' && cp -R '.skill-downloads/hapi-fhir-migration-hybrid-architecture-mmlj2nxb' '.claude/skills/fhir-migration'Cursor
test -f '.skill-downloads/hapi-fhir-migration-hybrid-architecture-mmlj2nxb/SKILL.md' && test -s '.skill-downloads/hapi-fhir-migration-hybrid-architecture-mmlj2nxb/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/fhir-migration' && cp -R '.skill-downloads/hapi-fhir-migration-hybrid-architecture-mmlj2nxb' '.cursor/skills/fhir-migration'Codex
test -f '.skill-downloads/hapi-fhir-migration-hybrid-architecture-mmlj2nxb/SKILL.md' && test -s '.skill-downloads/hapi-fhir-migration-hybrid-architecture-mmlj2nxb/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/fhir-migration' && cp -R '.skill-downloads/hapi-fhir-migration-hybrid-architecture-mmlj2nxb' '.agents/skills/fhir-migration'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/hapi-fhir-migration-hybrid-architecture-mmlj2nxb'openskills read 'hapi-fhir-migration-hybrid-architecture-mmlj2nxb'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/hapi-fhir-migration-hybrid-architecture-mmlj2nxb/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
React Hook Form Best Practices
Development
Master React Hook Form: avoid anti-patterns, manage subscriptions, and handle reset, dirty state, and controlled inputs correctly.
Emotion to Mantine Migration
Development
Migrate Emotion styled-components to Mantine components with style props and CSS modules. Use when converting .styled.tsx files or removing @emotion imports.
Scope Creep Detector
Development
Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad PRs, and oversized changes, then suggests keep, split, or justify actions.