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

Add RR extraction logic, phdi dependency to FHIR converter #814

Merged
merged 45 commits into from
Sep 13, 2023

Conversation

emmastephenson
Copy link
Collaborator

@emmastephenson emmastephenson commented Sep 6, 2023

PULL REQUEST

Summary

Adds RR extraction logic to the FHIR converter.

This also adds a dependency on phdi, which in turn required some substantial changes to the Dockerfile to ensure we're installing Python 3.10 (the old way installed 3.7, which wasn't compatible with some of the phdi dependencies.)

Related Issue

Fixes #737

Additional Information

One more planned PR in this effort - adding RR extraction to the validation service.

There's also a bunch of integration test work that I split into a separate PR - #826.

@codecov
Copy link

codecov bot commented Sep 6, 2023

Codecov Report

Merging #814 (8c9cf6b) into main (ee559e5) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #814   +/-   ##
=======================================
  Coverage   96.42%   96.42%           
=======================================
  Files          45       45           
  Lines        2626     2626           
=======================================
  Hits         2532     2532           
  Misses         94       94           
Flag Coverage Δ
unit-tests 96.42% <ø> (ø)

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

@@ -98,14 +98,16 @@ def convert_to_fhir(
# Process the response from FHIR Converter.
if converter_response.returncode == 0:
result = json.load(open(output_data_file_path))
old_id = None
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Required for the Python 3.10 update 🤷

Copy link
Collaborator

@DanPaseltiner DanPaseltiner left a comment

Choose a reason for hiding this comment

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

Thanks @emmastephenson this looks good to me. Left one minor suggestion and a question below, but reason for either to be blocking.

Comment on lines 120 to 124
rr_data: str = Field(
description="If an eICR message, the accompanying Reportability Response data.",
example=["sample"],
default=None,
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should let this be optional, so that the docs don't show it as *required?

Copy link
Contributor

Choose a reason for hiding this comment

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

agreed and good catch.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch, thank you! Updated.

Comment on lines +61 to +67
if input.rr_data is not None:
if input.root_template != "EICR" or input.input_type != "ecr":
response.status_code = status.HTTP_422_UNPROCESSABLE_ENTITY
result = {
"message": "Reportability Response (RR) data is only accepted "
"for eCR conversion requests."
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice

Comment on lines +23 to +32
# Install python via pyenv
RUN apt-get update && apt-get install -y curl git build-essential libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
RUN curl https://pyenv.run | bash
RUN export PYENV_ROOT="$HOME/.pyenv"
RUN export PATH="$PYENV_ROOT/bin:$PATH"
RUN eval "$(pyenv init -)"
RUN /root/.pyenv/bin/pyenv install 3.10.13
RUN /root/.pyenv/bin/pyenv global 3.10.13

RUN /root/.pyenv/shims/pip install --no-cache --upgrade pip setuptools
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need to use pyenv here? It's fine, I'm just curious.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

More or less because there weren't other options that allowed us to install a specific Python version on top of the dotnet image. We originally tried building Python 3.7 from source but that didn't work, so pyenv ended up being the most straightforward way to install everything.

Copy link
Contributor

@BradySkylight BradySkylight left a comment

Choose a reason for hiding this comment

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

This is great! Thank you for doing this work.

@emmastephenson emmastephenson merged commit fdac67e into main Sep 13, 2023
24 checks passed
@emmastephenson emmastephenson deleted the emma/737-part-2 branch September 13, 2023 21:46
@nickclyde nickclyde mentioned this pull request Sep 26, 2023
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.

Move RR to EICR extraction process into FHIR Converter Container
3 participants