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

CDA/FHIR connector components #83

Merged
merged 19 commits into from
Oct 24, 2024
Merged

Conversation

jenniferjiangkells
Copy link
Member

@jenniferjiangkells jenniferjiangkells commented Oct 10, 2024

Description

Refactors CDA/FHIR parsing components as part of the pipeline instead of in the sandbox use case.

Related Issue

#63 #71

Changes Made

  • Added Connectors modules to pipelines and removed parsing code from cds and clindoc sandbox functions. This gives more visibility and explicitness to the step that converts request/response data to a pipeline container like Document
  • Added methods .add_input() and .add_output() to BasePipeline and modified __call__ method to handle additional connector logic
  • 💥 Breaking change: renamed .add() method to .add_node() to make it more explicit and follow the convention of the connector add methods
  • 💥 Breaking change: renamed modules that contain Base classes to base.py within the pipeline and component modules for uniformity and brevity when importing. i.e. from healthchain.pipeline.base import BasePipeline
  • Add __init__ to fhir_resources module as need to import Bundle elsewhere
  • Added validate_and_convert_resources() model validator to Bundle, which allows Bundle to be initialised directly on a dictionary - allows dynamic import of resource type and recursively converts nested dictionaries to the appropriate Pydantic models e.g. Patient
  • Added helper methods to CdsFhirData such as .create(), which initialises the model on a copy of the dictionary to avoiding modifying the original (this is due to the Bundle validation method potentially modifying the input dict)
  • Added empty LLM and SummarizationPipeline and connectors to MedicalCodingPipeline, which are works in progress
  • Updated documentation

Testing

  • Added tests for all new components and functionalities, with the exception of the Bundle validator - @adamkells wanted to get your opinion that this is ok first.

@jenniferjiangkells jenniferjiangkells linked an issue Oct 10, 2024 that may be closed by this pull request
@jenniferjiangkells jenniferjiangkells changed the title Feature/cda connector CDA/FHIR connector components Oct 11, 2024
@jenniferjiangkells jenniferjiangkells linked an issue Oct 14, 2024 that may be closed by this pull request
@jenniferjiangkells jenniferjiangkells marked this pull request as ready for review October 17, 2024 11:24
Copy link
Contributor

@adamkells adamkells left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -0,0 +1,20 @@
from healthchain.pipeline.components.base import Component
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this class still be relevant with the Spacy, HuggingFace etc. transformers?

Copy link
Member Author

Choose a reason for hiding this comment

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

should they inherit from Component?

@jenniferjiangkells jenniferjiangkells merged commit 378e6b2 into main Oct 24, 2024
5 checks passed
@jenniferjiangkells jenniferjiangkells deleted the feature/cda-connector branch December 5, 2024 15:22
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.

Add FHIR utilities Move CDA parser from sandbox to pipeline
2 participants