<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Krista Paul</title>
    <description>The latest articles on Forem by Krista Paul (@kristapaul).</description>
    <link>https://forem.com/kristapaul</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3757393%2F8d1188e8-248e-42c1-92b8-0988a9891f71.jpg</url>
      <title>Forem: Krista Paul</title>
      <link>https://forem.com/kristapaul</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/kristapaul"/>
    <language>en</language>
    <item>
      <title>Medical Billing Automation System: Lessons learned through the OB/GYN workflows</title>
      <dc:creator>Krista Paul</dc:creator>
      <pubDate>Fri, 06 Feb 2026 22:49:57 +0000</pubDate>
      <link>https://forem.com/kristapaul/medical-billing-automation-system-lessons-learned-through-the-obgyn-workflows-5a9d</link>
      <guid>https://forem.com/kristapaul/medical-billing-automation-system-lessons-learned-through-the-obgyn-workflows-5a9d</guid>
      <description>&lt;h2&gt;
  
  
  Medical Billing Automation System: Lessons learned through the OB/GYN workflows
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkqjzzswu2ue66bid9tab.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkqjzzswu2ue66bid9tab.jpg" alt=" " width="800" height="561"&gt;&lt;/a&gt;Medical billing is one of such problem spaces that appear to be easy on the surface but turn in to a nightmare as soon as you begin to model it in software. Billing systems are at the border of regulations, data integrity, long-running processes, and human error-prone interfaces to developers in the healthtech industry.&lt;/p&gt;

&lt;p&gt;This paper will discuss the design of a &lt;strong&gt;&lt;a href="https://www.utsa.edu/pace/news/ai-in-medical-billing-and-coding.html" rel="noopener noreferrer"&gt;Medical Billing Automation System&lt;/a&gt;&lt;/strong&gt;, but the workflows of OB/GYN serve as a practical example. It does not focus on selling solutions, but rather on architecture choices, data modeling issues and pitfalls developers face when developing healthcare billing platforms.&lt;/p&gt;

&lt;p&gt;The Hardness of Medical Billing as an Engineering Problem&lt;br&gt;
On a higher plane, medical billing seems to be a pipeline:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;visit → code → claim → payment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As a matter of fact, it acts like a remote system whereby feedback is delayed and inconsistent&lt;br&gt;
The main features that complicate the process of automation of billing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Old processes (claims can be settled months old)&lt;/li&gt;
&lt;li&gt;External Relationships (opaque-rule insurance payers)&lt;/li&gt;
&lt;li&gt;Sensitivity to errors (When one error breaks the entire chain).&lt;/li&gt;
&lt;li&gt;Regulatory limitations (HIPAA, auditability, traceability)&lt;/li&gt;
&lt;li&gt;These obstacles are further increased by the fact that OB/GYN billing is not transactional care, but longitudinal care.
## It is possible to visualize the OB/GYN Billing Lifecycle
This is a simplified &lt;strong&gt;&lt;a href="https://www.ibm.com/think/topics/workflow-diagram" rel="noopener noreferrer"&gt;Workflow Diagram&lt;/a&gt;&lt;/strong&gt; depicting why the billing of OB/GYN cannot be a one-time process.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;flowchart LR
    A[Initial Prenatal Visit] --&amp;gt; B[Ongoing Prenatal Care]
    B --&amp;gt; C[Diagnostic Tests]
    C --&amp;gt; D[Delivery Event]
    D --&amp;gt; E[Postpartum Care]
    E --&amp;gt; F[Final Claim Resolution]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each node may generate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Separate codes&lt;/li&gt;
&lt;li&gt;Shared bundles&lt;/li&gt;
&lt;li&gt;Different payer interpretations
&lt;h2&gt;Evaluating the Domain Problem of OB/GYN Billing&lt;/h2&gt;
&lt;p&gt;In the domain-driven design (DDD) perspective, the OB/GYN billing can be considered a &lt;strong&gt;High-Complexity Bounded Context&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Domain characteristics&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Pregnancy care spans months&lt;/li&gt;
&lt;li&gt;Services can be bundled and not.&lt;/li&gt;
&lt;li&gt;The billing regulations vary according to gestational schedules.&lt;/li&gt;
&lt;li&gt;Payers implement arbitrary meanings.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This would not work in practice in real-life conditions with a basic CRUD application modeled.&lt;/p&gt;

&lt;p&gt;The more precise mental model is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Domain event driven stateful workflows.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;Billings Systems Design Event-Driven&lt;/h2&gt;

&lt;p&gt;Rather than the modeling of claim as a record, model the claim as an event stream.&lt;/p&gt;

&lt;h2&gt;Event-Driven Design for Billing Systems&lt;/h2&gt;

&lt;p&gt;Instead of modeling “claims” as static records, treat them as &lt;strong&gt;event streams&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;Example event sequence (pseudo-code)&lt;/h3&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Event: PrenatalVisitRecorded
Event: UltrasoundPerformed
Event: RiskStatusUpdated
Event: DeliveryCompleted
Event: PostpartumVisitCompleted
Event: ClaimGenerated
Event: ClaimSubmitted
Event: ClaimRejected
Event: ClaimCorrected
Event: ClaimPaid
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each event is immutable, timestamped, and auditable.&lt;/p&gt;

&lt;h2&gt;How Event Sourcing is Suitable to OB/GYN Billing&lt;/h2&gt;

&lt;p&gt;The effectiveness of event sourcing is especially due to the fact that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Billing issues emerge a long time after the events have been experienced.&lt;/li&gt;
&lt;li&gt;Retroactive justification is possible at the request of payers.&lt;/li&gt;
&lt;li&gt;Data should not be corrupted.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Situation: Event Store Architecture.&lt;/strong&gt;&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "aggregate_id": "pregnancy_123",
  "events": [
    { "type": "PrenatalVisitRecorded", "date": "2024-01-12" },
    { "type": "UltrasoundPerformed", "date": "2024-02-05" },
    { "type": "DeliveryCompleted", "date": "2024-06-19" }
  ]
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Reproduction of the follows enables the systems to:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Recalculate billing logic&lt;/li&gt;
&lt;li&gt;Debug denials&lt;/li&gt;
&lt;li&gt;Show compliance when auditing&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Claim Lifecycle as a State Machine&lt;/h2&gt;

&lt;p&gt;Claims should not be treated as rows in a database — they are &lt;strong&gt;State Machines&lt;/strong&gt;.&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;h2&amp;gt;Claim State Diagram&amp;lt;/h2&amp;gt;
stateDiagram-v2
    Created --&amp;gt; Validated
    Validated --&amp;gt; Submitted
    Submitted --&amp;gt; Rejected
    Rejected --&amp;gt; Corrected
    Corrected --&amp;gt; Resubmitted
    Resubmitted --&amp;gt; Paid
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each transition must:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Be logged&lt;/li&gt;
&lt;li&gt;Be time-aware&lt;/li&gt;
&lt;li&gt;Capture failure reasons&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Payer Rules: Why Hardcoding Does Not Work.&lt;/h2&gt;

&lt;p&gt;Paying systems that are hardcoded are brittle.&lt;/p&gt;

&lt;p&gt;Instead, use a &lt;a href="https://connected-corridors.berkeley.edu/developing-system/response-plan-development/rules-and-rules-engine" rel="noopener noreferrer"&gt;&lt;strong&gt;Rules Engine&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pseudo-code Rule definition example&lt;/strong&gt;&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rule GlobalOBBilling {
  when:
    delivery_completed == true
    gestation_weeks &amp;gt;= 37
  then:
    apply_bundle_code("GLOBAL_OB")
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Rules should be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Configurable&lt;/li&gt;
&lt;li&gt;Versioned&lt;/li&gt;
&lt;li&gt;Traceable to claim outcomes&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Where Generic Billing Platforms Fail&lt;/h2&gt;

&lt;p&gt;The generic billing platforms presuppose:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One visit = one claim&lt;/li&gt;
&lt;li&gt;Short feedback cycles&lt;/li&gt;
&lt;li&gt;Little time-dependent dependency.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is the case with the violation of all three assumptions in the OB/GYN workflows.&lt;/p&gt;

&lt;p&gt;This is the reason why systems, that are created to process standard outpatient billing, fail when implemented to the OB/GYN environments, such as the implementations that conform to the &lt;a href="https://billingfreedom.com/ob-gyn-medical-billing-services-in-arkansas/" rel="noopener noreferrer"&gt;&lt;strong&gt;OB/GYN Medical Billing Services in Arkansas&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Engineering wise, the problem is not a question of volume to be billed, it is a question of time to be a &lt;a href="https://professional.mit.edu/course-catalog/solving-complex-problems-structured-thinking-design-principles-and-ai" rel="noopener noreferrer"&gt;&lt;strong&gt;Complex Problem&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Automation that is Nepotistic is Perilous&lt;/h2&gt;

&lt;p&gt;Potent observability should be combined with automation.&lt;/p&gt;

&lt;p&gt;Minimal observability requirements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Structured logs per claim&lt;/li&gt;
&lt;li&gt;Payer and denial reason measures.&lt;/li&gt;
&lt;li&gt;Alerts for rejection spikes&lt;/li&gt;
&lt;li&gt;Event to code to payment Traceability.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Example Logging Pattern&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;json
{
  "claim_id": "CLM-90821",
  "state": "Rejected",
  "payer": "PayerA",
  "reason": "Invalid modifier",
  "timestamp": "2024-08-03T14:22Z"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;Security and Compliance As a Developer Views It&lt;/h2&gt;

&lt;p&gt;Security should not be an option when it comes to healthcare billing systems.&lt;/p&gt;

&lt;p&gt;Key requirements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In-transit and at-rest encryption.&lt;/li&gt;
&lt;li&gt;Role-based access control (RBAC)&lt;/li&gt;
&lt;li&gt;Immutable audit logs&lt;/li&gt;
&lt;li&gt;Stringent PHI management of logs and errors.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is not an area that speed is more important than being right.&lt;/p&gt;

&lt;p&gt;Important lessons to be learned as a &lt;a href="https://forum.freecodecamp.org/t/healthcare-to-healthtech-my-developer-journey/763856" rel="noopener noreferrer"&gt;&lt;strong&gt;HealthTech developer&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;When constructing billing systems in the healthcare sector, the following is true:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Model billing as a &lt;a href="https://digitalcommons.usu.edu/etd/6821/" rel="noopener noreferrer"&gt;&lt;strong&gt;Fundamental Sphere&lt;/strong&gt;&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Design for delayed feedback&lt;/li&gt;
&lt;li&gt;Regard claims as state machines.&lt;/li&gt;
&lt;li&gt;Favor event based architectures.&lt;/li&gt;
&lt;li&gt;Invest in observability during the early stages.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;OB/GYN billing is software design stress tests -and an efficient training ground to engineers&lt;/p&gt;

&lt;h2&gt;Final Thoughts&lt;/h2&gt;

&lt;p&gt;Automation of medical billing is not the one that pushes claims in a hurry. It is concerned with &lt;a href="https://soar.wichita.edu/bitstreams/1d68257a-9803-4164-bf20-5acf96362836/download" rel="noopener noreferrer"&gt;&lt;strong&gt;proper modeling of reality overtime&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The OB/GYN workflows reveal the flaws of simplistic systems and compel developers of software to create software that acknowledges complexity, regulation, and delayed results.&lt;/p&gt;

&lt;p&gt;Healthcare technology software does not streamline healthcare, but &lt;a href="https://knight.as.cornell.edu/reflective-writing-guide-" rel="noopener noreferrer"&gt;&lt;strong&gt;reflects it accurately&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>healthtech</category>
      <category>architecture</category>
      <category>systemdesign</category>
      <category>automation</category>
    </item>
  </channel>
</rss>
