Skip to content

Move metadata extractor upgrades to Core#794

Closed
ljtucker wants to merge 2 commits into
mainfrom
id-144-move-extractor-updates
Closed

Move metadata extractor upgrades to Core#794
ljtucker wants to merge 2 commits into
mainfrom
id-144-move-extractor-updates

Conversation

@ljtucker

Copy link
Copy Markdown
Contributor

Several metadata extractor enhancements were made to a custom extension to the service in the Davinci PAS test kit. These enhancements were found to be useful for all kits, so they have been moved to Inferno Core for direct use through the base class.

To Test:

  • Check out this branch locally and run bundle
  • Check out the support-v2.2.0 branch of the PAS test kit
  • In the PAS kit, add gem 'inferno_core', path: 'relative/path/to/local/repo' to the gemfile and run bundle
    • You might also need to delete the existing inferno_core reference in the gemspec file for this local reference to work
  • Run the pas suites (server and client) against each other. Ensure everything passes

@ljtucker ljtucker requested a review from karlnaden June 22, 2026 21:11
@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.79%. Comparing base (d9cfb03) to head (d39a5b0).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #794   +/-   ##
=======================================
  Coverage   89.79%   89.79%           
=======================================
  Files         291      291           
  Lines        8365     8371    +6     
  Branches     2002     2005    +3     
=======================================
+ Hits         7511     7517    +6     
  Misses        799      799           
  Partials       55       55           
Flag Coverage Δ
backend 92.51% <100.00%> (+<0.01%) ⬆️
frontend 83.71% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

@karlnaden karlnaden left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. See comment for a discussion of whether we want this in core or not - looking at it more closely, I'm not so sure.
  2. The testing instructions aren't quite right. This core metadata extractor isn't invoked at runtime, but instead at generation time. So the real verification is to
  3. check out this branch of core
  4. check out the PAS PR that removes the PAS code and relies solely on the core must support metadata extraction.
  5. force loading of the inferno_core gem from the local directory as explained
  6. run bundle exec rake pas:generate and confirm that no file changes are made (extraction logic hasn't changed.

Comment on lines +221 to +231
def save_pattern_identifier_slice(pattern_identifier, runtime_path)
identifier_type_coding = pattern_identifier.type&.coding&.first
if identifier_type_coding
type_path = runtime_path.present? ? "#{runtime_path}.type" : 'type'
{
type: 'patternCodeableConcept',
path: type_path,
code: identifier_type_coding.code,
system: identifier_type_coding.system
}
else

@karlnaden karlnaden Jun 24, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment to the top of this method explaining the special case and maybe pointing to an example profile and element. I think the gist is that this is a case where Inferno's handling of patterns diverges from FHIR's: In the FHIR representation, the pattern is an identifier with just the type present and it matches any identifier with the indicated type at a given path. from the PAS insurer profile:

    {
      "id" : "Organization.identifier:PI",
      "path" : "Organization.identifier",
      "sliceName" : "PI",
      ...
      "type" : [{
        "code" : "Identifier"
      }],
      "patternIdentifier" : {
        "type" : {
          "coding" : [{
            "system" : "http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBIdentifierType",
            "code" : "payerid"
          }]
        }
      },
      ...
    },

In Inferno, the case we have so far for identifiers is a match on the system, and so a match on the type wasn't working. However, this update (already implemented and used in PAS) represents an identifier pattern with type specified as a CodeableConcept pattern and adding type to the path. That works, and it is a divergence from the FHIR approach, which is a bit worrying. That may mean it is better to leave it as an override in PAS after all for now. At some point later, we could consider following the FHIR representation.

@ljtucker

Copy link
Copy Markdown
Contributor Author

Closing as we have decided on review it is best to leave these changes in PAS

@ljtucker ljtucker closed this Jun 24, 2026
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.

2 participants