Skip to content

Commit

Permalink
Fix some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyestein committed Jan 11, 2024
1 parent dcb5118 commit 0c23188
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions pixl_core/src/core/omop.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ def export_radiology(self, anon_data: list[tuple[Any, ...]]) -> pathlib.Path:
self._mkdir(self.radiology_output)
parquet_file = self.radiology_output / "radiology.parquet"

# will need to convert header names
parquet_header_names = ["image_identifier", "procedure_occurrence_id", "image_report"]
if anon_data and len(parquet_header_names) != len(anon_data[0]):
err_str = (
Expand All @@ -108,7 +107,7 @@ def export_radiology(self, anon_data: list[tuple[Any, ...]]) -> pathlib.Path:
export_df = pd.DataFrame(anon_data, columns=parquet_header_names)
export_df.to_parquet(parquet_file)

# Make the latest export dir if it doesn't exist
# Make the "latest" export dir if it doesn't exist
self._mkdir(self.latest_parent_dir)
# Symlink this report to the latest directory
latest_parquet_file = self.latest_parent_dir / "radiology.parquet"
Expand Down
6 changes: 3 additions & 3 deletions pixl_ehr/src/pixl_ehr/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ async def startup_event() -> None:

@app.post(
"/export-radiology-as-parquet",
summary="Copy all radiology reports in the PIXL DB to a parquet file",
summary="Copy all matching radiology reports in the PIXL DB to a parquet file",
)
def export_radiology_as_parquet(project_name: str, extract_datetime: datetime) -> None:
"""Batch export of all radiology reports in PIXL DB to a parquet file."""
"""Batch export of all matching radiology reports in PIXL DB to a parquet file."""
# NOTE: we can't check that all reports in the queue have been processed.
# So we are relying on the user passing correct parameters here.
# So we are relying on the user waiting until processing has finished before running this.
anon_data = PIXLDatabase().get_radiology_reports(project_name, extract_datetime)
pe = ParquetExport(project_name, extract_datetime)
pe.export_radiology(anon_data)
Expand Down
2 changes: 1 addition & 1 deletion pixl_ehr/tests/test_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ async def test_radiology_export(example_messages) -> None:
@pytest.mark.asyncio()
async def test_radiology_export_multiple_projects(example_messages) -> None:
"""
GIVEN 4 messages each from a different project+extract processed by the EHR API
GIVEN 4 messages, each from a different project+extract processed by the EHR API
WHEN export_radiology_as_parquet is called for 1 given project+extract
THEN only the radiology reports for that project are exported
"""
Expand Down

0 comments on commit 0c23188

Please sign in to comment.