Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds four new default FHIR resources to the mix #283

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

mikix
Copy link
Contributor

@mikix mikix commented Oct 19, 2023

New & default tasks:

  • allergyintollerance
  • device
  • diagnosticreport
  • immunization

I've also modified some of the existing unit testing to be more specific about which tests to run, in the cases where it doesn't make sense to update tests when you add a new task.

Checklist

  • Consider if documentation (like in docs/) needs to be updated
  • Consider if tests should be added

@@ -47,7 +47,6 @@
{"path": "nodesByType('ContactDetail')", "method": "redact"},
{"path": "nodesByType('ContactPoint')", "method": "redact"},
{"path": "nodesByType('HumanName')", "method": "redact"},
{"path": "nodesByType('Identifier')", "method": "redact"},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was previously a blanket injunction against using Identifier elements, because I'd only seen them in Resource.identifier contexts, where the EHR stores PHI identifiers like MRNs or other such business-case oriented identifiers (I think in Patients, the SSN goes there? Or maybe that's an extension, I don't remember.)

Anyway. Device has a version.component field that for some reason uses the Identifier element, so I can't blanket-ban it now. But it is also never allow-listed anywhere else. This line was just a second line of defense against mistakes. But now that we have a real use case, we can drop this.

{"path": "Immunization.reasonReference", "method": "keep"},
{"path": "Immunization.isSubpotent", "method": "keep"},
{"path": "Immunization.subpotentReason", "method": "keep"},
{"path": "Immunization.education.publicationDate", "method": "keep", "comment": "we aren't keeping documentType or uri for fear of any PHI slipping in, so maybe these two dates aren't very useful, but better more data than less"},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm still not 100% on whether it's safe to include documentType/uri -- they seem kinda harmless, but I also don't think they would be very valuable... 🤷

"code" : { "text": "kept" },
"subject" : { "reference": "Patient/x" },
"encounter" : { "reference": "Encounter/x" },
"effectiveDateTime" : "2023",
Copy link
Contributor

Choose a reason for hiding this comment

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

also effectivePeriod?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For "variant" fields, I don't usually unit-test each possible variation. Only the "interesting" variations (like if we drop the string variant, but keep the others, I'll have a unit test for an arbitrary one that we keep and also a unit test for the dropped variant).

We can't put multiple variants in one test file because the MS tool would complain about invalid FHIR.

Comment on lines +3 to +9
"meta": {
"security": [{
"code": "REDACTED",
"display": "redacted",
"system": "http://terminology.hl7.org/CodeSystem/v3-ObservationValue"
}]
},
Copy link
Contributor

Choose a reason for hiding this comment

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

mostly for my own edification: how does this work on the MS side?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah OK for context: this file is the expected output of the MS tool. It's input counterpart is in the input/ folder.

To your actual question: this bit here is inserted by the MS tool automatically (can't turn it off). I find this annoying, and pointless for Cumulus' purposes, so the ETL drops this field again when processing files.

But this unit test doesn't do the full ETL processing, it's just testing our ms-config.json file, so the field is still present.

"manifestation" : [{ "text": "kept" }],
"onset" : "2023",
"severity" : "mild",
"exposureRoute" : { "text": "kept" }
Copy link
Contributor

Choose a reason for hiding this comment

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

also note?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

note is dropped per the ms-config.json config. So it doesn't show up in this "expected output" file. Whether we should drop it or not, is open for discussion. But we tend to drop freeform text fields like that because of high risk of PHI in them, and it's not machine-readable, unless we wanted to NLP it.

Copy link
Contributor

Choose a reason for hiding this comment

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

two comment/questions about nodes down in the test data that also apply here.

Copy link
Contributor Author

@mikix mikix Oct 19, 2023

Choose a reason for hiding this comment

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

Yeah this is the juicier file for sure 😄 Where all the redaction decisions live.

You mentioned note and effectivePeriod:

  • AllergyIntolerance.note is missing from this file (not allow-listed) intentionally - but that's open to discussion.
  • DiagnosticReport.effectivePeriod is picked up by keeping DiagnosticReport.effective which keeps all the variants of that field.

Happy to talk more about each line in here - honestly, for safety's sake, maybe it's worth you and I going over this file's changes line by line sometime next week.

@mikix mikix force-pushed the mikix/4-new-resources branch 2 times, most recently from 6bf54bc to 12aa139 Compare October 24, 2023 14:24
New & default tasks:
- allergyintollerance
- device
- diagnosticreport
- immunization

I've also modified some of the existing unit testing to be more
specific about which tests to run, in the cases where it doesn't make
sense to update tests when you add a new task.
@mikix mikix force-pushed the mikix/4-new-resources branch from 12aa139 to 14ae0f7 Compare October 24, 2023 14:36
@mikix mikix merged commit a12aa01 into main Oct 24, 2023
2 checks passed
@mikix mikix deleted the mikix/4-new-resources branch October 24, 2023 15:15
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