Skip to content

Commit

Permalink
Symlink radiology export
Browse files Browse the repository at this point in the history
  • Loading branch information
milanmlft committed Jan 8, 2024
1 parent 07fb60f commit c32dd88
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pixl_core/src/core/omop.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,14 @@ def export_radiology(self, anon_data: Iterable[tuple]) -> str:
export_df = pd.DataFrame(anon_data)
export_df.to_parquet(parquet_file)

# do symlinks
# 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"
if latest_parquet_file.exists():
latest_parquet_file.unlink()

latest_parquet_file.symlink_to(parquet_file, target_is_directory=False)

return self.project_slug

Expand Down

0 comments on commit c32dd88

Please sign in to comment.