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

fix: make i2b2 transforms faster by skipping fhirclient #158

Merged
merged 1 commit into from
Jan 26, 2023

Conversation

mikix
Copy link
Contributor

@mikix mikix commented Jan 26, 2023

Description

Much like the recent change to drop fhirclient objects from our core ETL loop, this drops them from the i2b2 conversion code.

Speeds are improved by 50-70%.

The only remaining use of fhirclient is for its oauth bits in our bulk export code.

There are also two tiny i2b2 changes, while I was there:

  • For Condition, mark ICD10PROC/ICD9PROC as icd-10-pcs/icd-9-pcs systems, rather than our custom i2b2 system.
  • For Observation, if the tval_char isn't one of the known covid test results (Positive/Negative/Absent), stop converting it to Absent, and just leave them as-is, marked with our custom i2b2 system url.

Checklist

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

Much like the recent change to drop fhirclient objects from our core
ETL loop, this drops them from the i2b2 conversion code.

Speeds are improved by 50-70%.

The only remaining use of fhirclient is for its oauth bits in our
bulk export code.

There are also two tiny i2b2 changes, while I was there:
- For Condition, mark ICD10PROC/ICD9PROC as icd-10-pcs/icd-9-pcs
  systems, rather than our custom i2b2 system.
- For Observation, if the tval_char isn't one of the known covid
  test results (Positive/Negative/Absent), stop converting it to
  Absent, and just leave them as-is, marked with our custom i2b2
  system url.
Comment on lines -176 to +146
lab_result = "Absent"
observation.valueCodeableConcept = make_concept(
external_mappings.SNOMED_LAB_RESULT[lab_result], "http://snomed.info/sct", display=lab_result
)
lab_result = obsfact.tval_char
lab_result_system = "http://cumulus.smarthealthit.org/i2b2"
observation["valueCodeableConcept"] = make_concept(lab_result, lab_result_system, display=obsfact.tval_char)
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 is one of the two actual i2b2 changes: don't massage unknown things to Absent

Comment on lines +180 to +185
elif i2b2_sys in ["ICD10PROC"]:
i2b2_sys = "http://hl7.org/fhir/sid/icd-10-pcs"
elif i2b2_sys in ["ICD9", "ICD-9"]:
i2b2_sys = "http://hl7.org/fhir/sid/icd-9-cm"
elif i2b2_sys in ["ICD9PROC"]:
i2b2_sys = "http://hl7.org/fhir/sid/icd-9-pcs"
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 is the other change: a couple new recognized systems.

@mikix mikix merged commit a8d5fad into main Jan 26, 2023
@mikix mikix deleted the mikix/faster-i2b2 branch January 26, 2023 18:14
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