Skip to content

Conversation

@YalingPeiS
Copy link
Collaborator

@YalingPeiS YalingPeiS commented Nov 18, 2025

Problem Statement

Search operation with chained referencing is not working after enabling MDM expansion search.

Description

When MDM expansion search is enabled, search operations with chained reference are failing.
Example: http://localhost:8000/AllergyIntolerance?patient.identifier=https://api.loblaw.ca/fhir/NamingSystem/hw-1222%7Cpaaaid1102101

This worked fine before enabling the MDM expansion search. but doesn't work after enabling it. Below is the error message

{
    "resourceType": "OperationOutcome",
    "issue": [
        {
            "severity": "error",
            "code": "processing",
            "diagnostics": "HAPI-2001: Resource NamingSystem/hw-1222|paaaid1102101 is not known"
        }
    ]
}

Cause

Based on the doc and the current MDM expansion implementation, the expansion only supports reference search that contains the reference ID, such as [base]/Observation?patient:mdm=Patient/123.
Consequently, the chained reference search of ?patient.identifier=https://api.loblaw.ca/fhir/NamingSystem/hw-1222%7Cpaaaid1102101 would lead to incorrect parsing of the resource ID.

Fix

Add a check to only allow MDM expansion for non-chained reference search.

@robogary
Copy link
Contributor

Formatting check succeeded!

@codecov
Copy link

codecov bot commented Nov 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.78%. Comparing base (112cec3) to head (bc35e27).
⚠️ Report is 181 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #7393      +/-   ##
============================================
+ Coverage     83.41%   83.78%   +0.37%     
- Complexity    29193    30180     +987     
============================================
  Files          1843     1833      -10     
  Lines        113422   116599    +3177     
  Branches      14251    14808     +557     
============================================
+ Hits          94608    97694    +3086     
+ Misses        12730    12609     -121     
- Partials       6084     6296     +212     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MDM Expansion Search impacts the Search operation with conditional references

3 participants