ADR-011: Sovereign Veterinary Healthcare Vertical (GERCIA Vet)
Status
Section titled “Status”ACCEPTED 2026-10-11
Context
Section titled “Context”During the expansion of the GERCIA Platform to accommodate veterinary clinics, pet hospitals, equine centers, and veterinary compounding pharmacies, the engineering team evaluated whether to house veterinary models directly inside the existing human healthcare domain (dotnet/src/Health/ and clinical schema) or to establish an independent sovereign vertical (dotnet/src/Veterinary/ and veterinary schema).
A detailed architectural analysis revealed four insurmountable domain and regulatory divergence factors:
-
Biological & Taxonomic Divergence vs. Single-Species Human Medicine:
- Human healthcare (
clinicalschema) models a single biological species (Homo sapiens) where identity pivots around civil tax numbers (CPF), National Health Cards (CNS), and standardized international classifications (WHO ICD-10/ICD-11). - Veterinary medicine manages hundreds of biological species (Canis lupus familiaris, Felis catus, Equus caballus, Bos taurus, exotic birds, reptiles), each requiring species-specific breed taxonomies, coat patterns (pelagem), microchip transponders (ISO 11784/11785), reproductive states (castrated, intact, cryptorchid), and species-dependent physiological calculation curves (e.g., surface area formulas for chemotherapy and body condition scoring).
- Human healthcare (
-
The Legal Triangulation Invariant (Animal $\leftrightarrow$ Tutor $\leftrightarrow$ Clinician):
- In human healthcare, the patient is either the sovereign civil subject or has a legal guardian with parental custody.
- In veterinary medicine, the animal is the clinical patient and recipient of care, but cannot be a legal party to a contract, civil debtor, or consent signatory. The legal owner/guardian (Tutor / Proprietário) is the counterparty responsible for financial liabilities, euthanasia authorization, and receipt of controlled drug prescriptions. Coupling animal and tutor attributes into human patient tables creates severe schema pollution and nullable foreign key antipatterns.
-
Incompatible Regulatory & Sanction Regimes (MAPA vs. ANVISA / CFM):
- Human healthcare in Brazil is governed by the Ministério da Saúde, ANVISA (RDC 67/2007 for compounding, Portaria SVS/MS 344/1998 for controlled substances), and the Conselho Federal de Medicina (CFM).
- Veterinary medicine is strictly governed by the Ministério da Agricultura e Pecuária (MAPA) (Decree 5.053/2004, Normative Instruction 35/2017, and the SIPEAGRO regulatory reporting system for veterinary compounding) and the Conselho Federal de Medicina Veterinária (CFMV) (Resolution 1.071/2014, CRMV professional licenses).
- Merging these regulatory regimes into a single database schema or domain project introduces catastrophic compliance risk, where human prescription business rules could inadvertently bleed into veterinary agricultural compliance audits.
-
Sovereign Commercial Presence & Portal Segregation:
- Veterinary clinics and compounding pharmacies operate in a distinct B2B market with specialized procurement workflows, equine mobile field visits, and distinct pricing sensibilities. Forcing veterinary clients into a human healthcare portal (
app.gercia.com.br) damages brand positioning and UI relevance.
- Veterinary clinics and compounding pharmacies operate in a distinct B2B market with specialized procurement workflows, equine mobile field visits, and distinct pricing sensibilities. Forcing veterinary clients into a human healthcare portal (
Decision
Section titled “Decision”The GERCIA Platform officially establishes GERCIA Vet as a Sovereign Bounded Vertical:
-
Dedicated Domain Assembly (
dotnet/src/Veterinary/Gercia.Veterinary):- Placed outside
dotnet/src/Health/in a dedicated root vertical folderdotnet/src/Veterinary/. - Projects reference universal platform foundations (
Gercia.BuildingBlocks,Gercia.Core) but maintain zero compile-time dependencies on human healthcare modules (Gercia.Clinical,Gercia.Dental, orGercia.Pharmacy). - Test suite mirrored at
dotnet/tst/Veterinary/Gercia.Veterinary.Tests/.
- Placed outside
-
Dedicated PostgreSQL Database Schema (
veterinary):- Physical persistence is isolated within the
veterinaryschema inside the consolidatedgerciadatabase catalog. - Enforces independent Row-Level Security (RLS) policies scoped by
tenant_id. - Manages domain tables:
species,breeds,patients(animals),tutors(human owners),consultations,prescriptions, andveterinary_compounding_orders.
- Physical persistence is isolated within the
-
Sovereign Web Portals & Host-Based Routing:
- Institutional Marketing Portal (
gercia.vet.br): Sovereign public website dedicated to veterinary software and practice management. - Enterprise B2B SaaS Application (
app.gercia.vet.br/vet.gercia.dev): Served by the enterprise Angular SPA (@gercia/app), which inspects the HTTPHostheader to dynamically activate veterinary layouts, CRMV council validation, tutor-patient navigation, and MAPA compliance modules.
- Institutional Marketing Portal (
flowchart TD
subgraph WEB_TIER ["Web Presentation Tier (Cloudflare Pages)"]
PUB_VET["gercia.vet.br<br>(Astro Marketing Portal)"]
SPA_VET["app.gercia.vet.br (vet.gercia.dev)<br>(Angular Enterprise SPA @gercia/app)"]
end
subgraph API_TIER ["Central API Gateway (api.gercia.com.br - Google Cloud Run)"]
STS["OpenIddict Token Service<br>(Tenant & Vertical Claims)"]
MOD_VET["<b>Gercia.Veterinary Module</b><br>Species Taxonomy • Tutors • CFMV • MAPA/SIPEAGRO"]
end
subgraph DB_TIER ["Google Cloud SQL for PostgreSQL (gercia catalog)"]
SCHEMA_CORE[("core schema<br>tenants, branches, users, rls")]
SCHEMA_VET[("veterinary schema<br>species, breeds, patients, tutors, prescriptions")]
end
SPA_VET -- "Host: app.gercia.vet.br" --> STS
STS --> MOD_VET
MOD_VET -- "Tenant Isolation (RLS)" --> SCHEMA_CORE
MOD_VET -- "Domain Mutations" --> SCHEMA_VET
Consequences
Section titled “Consequences”Positive
Section titled “Positive”- Domain Purity: Zero schema leakage between human medical records (ICD/CID, CRM, CNS) and animal veterinary charts (species, breeds, microchips, CRMV, MAPA).
- Regulatory Compliance: Strict alignment with MAPA (SIPEAGRO) and CFMV standards without compromising ANVISA RDC 67 or CFM human healthcare compliance.
- Autonomous Evolution: Veterinary engineering features (e.g., equine breeding cycles, herd health protocols, farm telemetry) can evolve and deploy without impacting human medical and dental clinics.
- Targeted Commercial Go-to-Market: Sovereign branding (
gercia.vet.br) provides a specialized, professional entry point for veterinary institutions.
Negative / Trade-Offs
Section titled “Negative / Trade-Offs”- Separate Domain Models: Certain shared clinical concepts (e.g., vital signs, appointment scheduling) require specialized implementations tailored to veterinary contexts rather than sharing raw C# classes with
Gercia.Clinical. - Testing Scope: Requires maintaining a dedicated test suite (
dotnet/tst/Veterinary/Gercia.Veterinary.Tests/) and database migration pipeline.