• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

medplum / medplum / 24218154041
92%
main: 92%

Build:
Build:
LAST BUILD BRANCH: fhirpatch
DEFAULT BRANCH: main
Ran 09 Apr 2026 11:27PM UTC
Jobs 1
Files 768
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

09 Apr 2026 11:20PM UTC coverage: 91.859%. Remained the same
24218154041

push

github

web-flow
fix(health-gorilla): strip non-Coding fields from diagnoses to prevent lab order submission failures (#8932)

* fix(health-gorilla): strip non-Coding fields from diagnoses to prevent lab order submission failures

## Problem

When a clinician submitted a lab order with ICD-10 diagnoses, the order
failed silently: the "Error creating lab order" toast appeared, no order
was sent to Health Gorilla, and no AuditEvent was recorded for the
send-to-health-gorilla bot.

Investigation revealed orphaned per-test ServiceRequest resources in
Medplum with basedOn references pointing to a root ServiceRequest that
did not exist. CloudWatch logs surfaced the root cause:

  "Invalid additional property \"designation\"
  (ServiceRequest.reasonCode[1].coding[0].designation)"

## Root Cause

ValueSetAutocomplete returns ValueSetExpansionContains objects from the
terminology server. These include fields that are not valid on the FHIR
Coding type (designation, abstract, inactive, contains). In both
OrderLabsPage and the health-gorilla-demo HomePage, the ValueSetAutocomplete
onChange handler was casting these objects directly as Coding with no
sanitization:

  items.map((item) => ({ coding: [item] }))

When the selected ICD-10 code had a designation array in its terminology
expansion, the root lab order ServiceRequest failed FHIR schema
validation (422) on write. Because the project did not have the
transaction-bundles feature flag enabled, the batch processed entries
independently: per-test ServiceRequests committed as orphans, the root
ServiceRequest was never created, and the bot was never triggered.

## Fixes

1. packages/react/src/CodingInput/CodingInput.tsx
   - Exported valueSetElementToCoding and codingToValueSetElement as
     public utilities from @medplum/react. These functions already
     existed privately in CodingInput; making them public gives all
     callers a correct, shared conversion function to reach for.

2. examples/medplum-provider/src/pages/labs/Or... (continued)

18270 of 20816 branches covered (87.77%)

Branch coverage included in aggregate %.

33118 of 35126 relevant lines covered (94.28%)

13453.9 hits per line

Jobs
ID Job ID Ran Files Coverage
1 24218154041.1 09 Apr 2026 11:27PM UTC 768
91.86
GitHub Action Run
Source Files on build 24218154041
  • Tree
  • List 768
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 211f47cf on github
  • Prev Build on gh-readonly-queue/main/pr-8913-9704b5cbe679a929cdaeb629d2bb558c83c346e2 (#24215151983)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc