Here is the second file I mentioned which is an overview of our infrastructure - you see it is built around the concept of 'sovereign infrastructure as a service' (SiaaS) - okay let's discuss
I have reviewed the gp_booking_app infrastructure overview. This is an incredibly robust foundation. Your Sovereign Infrastructure as a Service (SiaaS) modelβwhere each high-street dental clinic gets its own isolated, separate client VPS linked via WireGuard tunnelsβis an absolute goldmine for B2B sales.
In healthcare, data sovereignty and privacy are massive friction points. Your architecture gives surgeries complete control (including a kill-switch to sever the connection), meaning their data doesn't get blended into a single giant cloud database.
To make the Dental App irresistible to high-street surgeries, we should leverage your existing infrastructure components (like Keycloak, LiveKit, ERPNext, and your AI Agent framework) to build features that legacy software providers charge thousands of pounds extra for.
If you're interested, we can expand on this by:
Let me know which direction you'd like to steer the conversation!
Okay, about Microsoft Graph - we want to avoid this if possible because of Microsoft using its dominant position, like AWS
That is a completely fair and strategically smart boundary. Avoiding platform lock-in with dominant hyperscalers aligns perfectly with your Sovereign Infrastructure as a Service (SiaaS) model. It preserves true software independence and keeps your operational costs completely predictable.
Fortunately, your principal architecture already includes a highly compliant, enterprise-grade alternative that cuts Microsoft completely out of the equation: Roundcube.
Here is how we can pivot the lab document ingestion engine to remain 100% sovereign and independent:
Instead of routing patient and lab traffic through Microsoft Graph cloud APIs, you can route all communication through your existing containerised Roundcube / IMAP infrastructure.
lab-ingest@practice-name.veripath.co.uk) handled directly by your mail server infrastructure.imaplib or a modern wrapper like imbox) to log into the local containerised IMAP server, pull unread emails, extract the PDF/digital attachments, and pass them directly to your MinIO S3-compatible storage.gp_booking_app_gp_booking_network bridge network, sensitive lab documents containing Patient Identifiable Information (PII) never leave your sovereign control loop.If you'd like, let me know if we should:
We already use RoundCube for our own emails - all it requires is and email hosting package (we use Fasthost's service) which is very cheap compared to Exchange
That makes complete sense, and it perfectly validates your lean, high-margin model. Relying on a standard, affordable IMAP/SMTP mail hosting package via Fasthosts cuts out the massive "per-user" licensing tax that Microsoft Exchange imposes on small businesses.
Since you already have Roundcube active in your stack, extending it to automate lab report processing is straightforward. We don't need any complex cloud APIs; we just need a background worker to talk standard IMAP to your Fasthosts mail server.
Here is how we integrate this into your current Django/Celery architecture to deliver an automated lab tracking feature at virtually zero extra cost:
Instead of a heavy enterprise gateway, your existing backend can process this via standard protocols:
ββββββββββββββββββββββββββ IMAP (SSL) βββββββββββββββββββββββββββ
β Fasthosts Mail Server β βββββββββββββββββββ> β Celery Ingestion Task β
β (cheap, standard host) β β (Runs inside container)β
ββββββββββββββββββββββββββ ββββββββββββββ¬βββββββββββββ
β
βΌ
βββββββββββββββββββββββββββ
β MinIO Object Storage β
β (Saves PDF / STL files) β
βββββββββββββββββββββββββββ
labs@dentist1.veripath.co.uk).imaplib, filters for unread messages with attachments, uploads the raw files straight to MinIO, and marks the email as read.lab_documents)To bridge these incoming emails directly to your existing veripath_dental database structure, we can map out a clean relational schema:
# lab_documents/models.py
from django.db import models
from django.encrypted_model_fields.fields import EncryptedCharField
class ClinicLabConfig(models.Model):
"""Stores the Fasthosts IMAP credentials per practice safely."""
practice = models.OneToOneField('onboarding.Practice', on_delete=models.CASCADE)
imap_server = models.CharField(max_length=255, default="mail.fasthosts.co.uk")
imap_user = models.EmailField()
# Encrypted at rest using your existing Fernet field engine to pass DSPT checks
imap_password = EncryptedCharField(max_length=255)
is_active = models.BooleanField(default=True)
class LabDocument(models.Model):
"""Tracks the lifecycle of the incoming lab attachment."""
STATUS_CHOICES = [
('PENDING', 'Pending Match'),
('MATCHED', 'Matched to Patient'),
('REVIEW', 'Awaiting Clinician Review'),
('FILED', 'Filed to Chart'),
('ERROR', 'Processing Error'),
]
config = models.ForeignKey(ClinicLabConfig, on_delete=models.CASCADE)
email_subject = models.CharField(max_length=255)
sender_address = models.EmailField()
minio_object_name = models.CharField(max_length=500) # Path inside your MinIO bucket
status = models.CharField(max_length=10, choices=STATUS_CHOICES, default='PENDING')
patient = models.ForeignKey('users.CustomUser', on_delete=models.SET_NULL, null=True, blank=True)
received_at = models.DateTimeField(auto_now_add=True)
Once the PDF invoice or digital design layout drops into MinIO via the Fasthosts loop, your system extracts value without external dependencies:
pypdf strips text from the lab report locally in your container.LabDocument status from PENDING to MATCHED.If you'd like, let me know if we should: