How it's built
Architecture, AI boundaries and the build
Nartis is a healthcare quality platform I designed and prototyped. This page covers the target architecture on AWS,
how data moves through it, where generative AI fits and where it does not, the PHI posture, and what in the
prototype is real today.
The problem
Quality runs on a monthly report. It should run on events.
Health plans are paid and ranked on HEDIS and Star Ratings measures, but most quality programs still find gaps through
batch claims, overnight ETL and dashboards that refresh weekly. By the time a gap is visible, the visit that could have
closed it is over, and a person still has to notice it and act. Nartis evaluates each clinical event against measure
policy as it arrives, ranks the open gaps by what closing them is worth, routes an action to a person, and records the
evidence behind every decision.
Target architecture
On AWS, event-driven, governed end to end
This is the production target, not what the prototype runs on. Every service named here is HIPAA eligible under an AWS BAA.
1 · Sources
Claims837 and 835 feeds
EHRFHIR R4 APIs and ADT events
PharmacyPBM fill files
Lab resultsLOINC-coded results
Enrollment834 eligibility
2 · Ingest
Event streamKinesis Data Streams or MSK for ADT, lab and fill events
Batch normalizeAWS Glue and Lambda for claims and files
Clinical storeAmazon HealthLake (FHIR R4)
Data lakeS3 with Iceberg tables, Lake Formation permissions
3 · State and policy
Member-measure stateDynamoDB: denominator, numerator and evidence per member per measure
Policy-as-code engineVersioned measure rule packs on Lambda or ECS, tested against test decks
Gap eventsEventBridge: gap opened, gap closed
4 · Intelligence
Prioritization modelsSageMaker: closure propensity, channel response
Amazon Bedrock + GuardrailsGap explanations and outreach drafts, PII filters, grounded on the rule and evidence
Spec-to-code assistantDrafts rule-pack changes from measure specs for human review
5 · Action
OrchestrationStep Functions with human approval steps
OutreachAmazon Connect, care management system, provider portal
Work queuesRole-based UI behind API Gateway and Cognito
OutcomesClosures flow back as events
Governance and audit, across every layer
- IAM with purpose-bound access
- Lake Formation column and row controls
- KMS encryption at rest
- VPC endpoints and PrivateLink
- CloudTrail and CloudWatch
- Append-only audit log in S3 Object Lock
- Macie for PHI discovery
Green boxes are where generative AI runs. Everything else is deterministic code or a trained, non-generative model.
Data flow
One event, end to end
- Event arrives. A lab result posts through the EHR's FHIR API, or a pharmacy fill lands in the PBM file.
- Normalize and link. The event is mapped to a code system (LOINC, NDC, CPT) and matched to the member.
- Re-evaluate. The policy engine re-runs only the measures that event can affect, using the current rule pack version.
- Update state. Member-measure state changes; a gap-opened or gap-closed event is emitted with the evidence that decided it.
- Prioritize. Open gaps are scored by weight, distance to the cut point, closure likelihood and value.
- Explain and draft. For the top gaps, a model explains the gap and drafts outreach, using only minimum-necessary fields.
- Act with a person in the loop. A care team member reviews, edits and sends, or routes to a provider.
- Close the loop. The outcome comes back as an event, the rate updates by 1 / denominator, and every step is in the audit log.
Where generative AI fits
Rules decide. Models explain and draft.
Deterministic
- Measure status. Denominator, numerator, exclusions and lookbacks, from versioned rule packs and value sets.
- Rate math. PDC, rates, cut-point distance and the Stars bonus formula.
- Eligibility and dates. Enrollment, age bands and measurement windows.
- Audit. Who did what, for which purpose, with which data, and why.
Generative
- Measure spec to code. Draft rule-pack changes from a new spec year. A person reviews, and test decks must pass before release.
- Gap reasoning. Explain in plain language why a gap is open, citing the rule and the evidence found or missing.
- Outreach drafting. A short, member-friendly note for a person to review and send.
- Later: surfacing chart-note passages that may count as supplemental data, for an abstractor to confirm.
A language model never decides whether a member is in a numerator. It works from what the rules already decided.
HIPAA and PHI posture
Minimum necessary, logged, and under a BAA
Synthetic data only, today
The prototype uses 10,004 generated members. There is no real patient data anywhere in this site or its repository.
No PHI to a model without a BAA
In production, model calls go through Amazon Bedrock under the AWS BAA, inside the VPC. The prototype's direct API call is acceptable only because its data is synthetic.
BAA-eligible services
HealthLake, S3, Lambda, DynamoDB, Kinesis, Step Functions, SageMaker and Bedrock are all HIPAA eligible. Nothing outside that list touches PHI.
Minimum necessary
Each model call gets only the fields the measure needs: age band, product line, the rule and the evidence. No names, member IDs or free-text notes.
De-identification
Analytics and model training use tokenized member IDs and Safe Harbor or expert-determination de-identification. Re-identification keys stay in a separate account.
Audit trail
Every evaluation, action and model call records user, agent, purpose, data class and decision, written append-only. The prototype shows the same shape in memory.
The build story
Built AI-first with an AI coding agent
I designed and built Nartis AI-first with an AI coding agent in about a week in May 2026, and refreshed it in October 2026.
I owned the architecture, the measure logic and the review; the agent generated and refactored most of the code.
The October pass corrected the Stars economics, made each closure move a rate by exactly 1 / denominator, scoped
Medicare-only measures to Medicare Advantage members, and added the live-model feature.
Real today
- 34 simplified measure rules as code, with lookbacks relative to the current measurement year
- Rate math from the synthetic population
- Stars bonus formula and closures calculator
- Ask Nartis: a validated, rate-limited serverless call to a hosted language model
- In-memory audit trail
Simulated
- The member population and all of its data
- Risk scores: fixed constants per rule outcome
- Prioritization: transparent heuristics, not a trained model
- Cut points and measure weights: illustrative
- Actions: nothing is sent
What I would harden next
- Licensed HEDIS value sets and NCQA test decks in CI
- A closure-propensity model trained on outreach outcomes
- Bedrock with Guardrails in place of the direct API, plus an eval set that checks every explanation against the rule output
- Auth, a persistent append-only audit store, and edge rate limiting
- Tracing and cost monitoring for every model call
About
Adam Fiejdasz
Architect and builder.
I designed Nartis and built the prototype to show how I approach generative AI in healthcare: deterministic
rules where correctness matters, models where language helps, and governance and audit designed in from the start.