Skip to content

Conversation

@Dtphelan1
Copy link
Contributor

Summary

We don't mention scope creep... So this PR looks like it does a lot more than it actually does. Originally, the goal of this PR covered a few items:

  • When one doesn't get data back from the Module, the extractor should communicate that information and return an empty bundle.
  • We shouldn't be using the MRN as our patientId now that we have Context – let's use the ID off of the existing patient resource.

This second change very gently suggested two other reasonable (if not sprawling) changes:

  • If the subjectId isn't an MRN, we probably shouldn't be passing that information into templates using the MRN field.
  • If the patient's ID is parsed off context, we shouldn't enforce a requirement on the MRN property in joinAndReformat. The MRN requirement should be a result of the CSVmodule.get, not a result of the reformatData function.

Overall, these are very small changes that stretch wide distances. Additionally, since changes take place at such a foundational level (e.g. in some cases the interfaces for generatingMcodeResources has changed) there is a sibling PR in the E-MEF.

Testing:

  • Ensure that all tests work locally
  • As best as you can, review the following on CSVExtractors:
    • Look and feel of the get routine
    • Any leftover uses of the mrn beyond the original CSVModule call
    • The validity of data passed into the Templates.
  • Ensure that the cli works and produces data that looks right.
  • Anything else you and think of!

Copy link
Contributor

@jafeltra jafeltra left a comment

Choose a reason for hiding this comment

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

This looks great to me! I ran it with all the extractors in my config and all the resulting bundles are equivalent to what is on develop, and those few errors about destructuring are resolved. I had one incredibly minor comment in line and just one questions about tests:

Do you think a test that each extractor returns an empty bundle if there are no entries returned from the CSV module would be worthwhile? I'm not sure if it's overkill to test that, but it's the only new functionality that I could think of that isn't already tested.

Copy link
Contributor

@jafeltra jafeltra left a comment

Choose a reason for hiding this comment

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

I made a Jira task for the empty bundle tests. This looks great!

Copy link
Contributor

@mgramigna mgramigna left a comment

Choose a reason for hiding this comment

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

Can you update the example csv config JSON file to have the patient extractor first so our example would be kosher with context in a hypothetical extraction situation?

Copy link
Contributor

@mgramigna mgramigna left a comment

Choose a reason for hiding this comment

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

Looks good!

@jafeltra jafeltra force-pushed the csv-extractor-helpful-error-messages branch from 559b3ad to 98c5b37 Compare April 21, 2021 13:56
@jafeltra jafeltra merged commit a81f4f8 into develop Apr 21, 2021
@jafeltra jafeltra deleted the csv-extractor-helpful-error-messages branch April 21, 2021 14:05
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.

4 participants