Full Stack Engineer: Building HIPAA-Compliant Telehealth, HL7 FHIR R4 & Medplum Clinical Systems

Healthcare interoperability requires strict adherence to HL7 FHIR R4 resource schemas, SMART on FHIR OAuth 2.0 scopes, and tamper-evident AuditEvent logging. Storing clinical observations, medication requests, and diagnostic reports in ad-hoc relational tables creates costly integration bottlenecks when connecting to Epic, Cerner, or external laboratories. As a Full Stack Engineer and Backend Engineer, I architect HIPAA-compliant telehealth platforms and clinical AI workflows built on FHIR R4, Medplum, and Google Cloud Healthcare API.

1. Idempotent FHIR R4 Transaction Bundles with Conditional Upserts

When synchronizing patient encounters and vital-sign observations from remote monitoring devices or EHR webhooks, partial failures can leave clinical charts inconsistent. By constructing an atomic FHIR R4 Bundle of type transaction using conditional ifNoneExist headers and URN UUID internal references, the FHIR server commits the entire clinical encounter—Patient, Encounter, and Observation resources—in a single ACID transaction:

import uuid
import httpx

def build_vitals_transaction_bundle(
    mrn_system: str,
    patient_mrn: str,
    external_encounter_id: str,
    systolic_mmhg: int,
    diastolic_mmhg: int,
) -> dict:
    patient_urn = f"urn:uuid:{uuid.uuid4()}"
    encounter_urn = f"urn:uuid:{uuid.uuid4()}"
    return {
        "resourceType": "Bundle",
        "type": "transaction",
        "entry": [
            {
                "fullUrl": patient_urn,
                "resource": {
                    "resourceType": "Patient",
                    "identifier": [{"system": mrn_system, "value": patient_mrn}],
                },
                "request": {
                    "method": "POST",
                    "url": "Patient",
                    "ifNoneExist": f"identifier={mrn_system}|{patient_mrn}",
                },
            },
            {
                "fullUrl": encounter_urn,
                "resource": {
                    "resourceType": "Encounter",
                    "status": "finished",
                    "class": {"system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", "code": "VR"},
                    "subject": {"reference": patient_urn},
                    "identifier": [{"system": "https://telehealth.internal/encounters", "value": external_encounter_id}],
                },
                "request": {
                    "method": "POST",
                    "url": "Encounter",
                    "ifNoneExist": f"identifier=https://telehealth.internal/encounters|{external_encounter_id}",
                },
            },
            {
                "resource": {
                    "resourceType": "Observation",
                    "status": "final",
                    "code": {
                        "coding": [{"system": "http://loinc.org", "code": "85354-9", "display": "Blood pressure panel"}]
                    },
                    "subject": {"reference": patient_urn},
                    "encounter": {"reference": encounter_urn},
                    "component": [
                        {
                            "code": {"coding": [{"system": "http://loinc.org", "code": "8480-6"}]},
                            "valueQuantity": {"value": systolic_mmhg, "unit": "mmHg", "system": "http://unitsofmeasure.org", "code": "mm[Hg]"},
                        },
                        {
                            "code": {"coding": [{"system": "http://loinc.org", "code": "8462-4"}]},
                            "valueQuantity": {"value": diastolic_mmhg, "unit": "mmHg", "system": "http://unitsofmeasure.org", "code": "mm[Hg]"},
                        },
                    ],
                },
                "request": {"method": "POST", "url": "Observation"},
            },
        ],
    }

2. SMART on FHIR Scopes, Ambient Clinical Scribes & HIPAA Audit Controls

We combine fine-grained SMART on FHIR scopes (patient/Observation.read, user/QuestionnaireResponse.write) with our HIPAA & SOC 2 cryptographic compliance controls and Vertex AI clinical documentation agents so physicians always review and sign structured SOAP notes before FHIR persistence.

Need a Full Stack Engineer experienced in HL7 FHIR R4, Medplum, and HIPAA telehealth systems? Book a 1-Day Engineering Sprint.


About the Author — Hire Aldian Fazrihady (Cloud Engineer, GCP Professional Cloud Architect, GCP Professional Data Engineer, Backend, AI & Full Stack Engineer)

Aldian Fazrihady is a Top-Rated Senior Cloud Engineer, GCP Professional Cloud Architect (Google Cloud Certified), GCP Professional Data Engineer (Google Cloud Certified), Backend Engineer (Python, Django, FastAPI, Go, PostgreSQL), AI Application Engineer (LLMs, RAG, MCP, Google ADK, LangGraph), and Full Stack Engineer (React, Next.js, TypeScript) with 15+ years of production software engineering experience.

Hire Aldian Fazrihady on Upwork | Book 1-Day Programming Service ($100 USD / Rp 1.000.000) | View Live AI Portfolio | Send a Direct Message

Related Engineering Articles

Engineering Role Pillar Guides & Category Hubs