Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
teslajoy committed Feb 11, 2025
1 parent 0d35147 commit 4802374
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 5 additions & 2 deletions fhir_query/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ def summarize(db_path: str) -> None:
help="Open the graph in a browser using the dtale package for interactive data exploration.",
)
@click.argument(
"data_type", required=True, type=click.Choice(["Specimen", "DocumentReference", "ResearchSubject", "Patient"]), default="Specimen"
"data_type",
required=True,
type=click.Choice(["Specimen", "DocumentReference", "ResearchSubject", "Patient"]),
default="Specimen",
)
def dataframe(db_path: str, output_path: str, launch_dtale: bool, data_type: str) -> None:
"""Create dataframes from the local db."""
Expand All @@ -190,7 +193,7 @@ def dataframe(db_path: str, output_path: str, launch_dtale: bool, data_type: str

patient_df = None
specimen_df = None
file_name = None
file_name = None
if data_type == "Specimen":
specimen_df = pd.DataFrame(db.flattened_specimens())
if data_type == "Patient":
Expand Down
5 changes: 0 additions & 5 deletions fhir_query/dataframer.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,6 @@ def flattened_specimen(

return flat_specimen


@lru_cache(maxsize=None)
def flattened_patients(self) -> Generator[dict, None, None]:
"""
Expand All @@ -578,7 +577,6 @@ def flattened_patients(self) -> Generator[dict, None, None]:
patient = json.loads(resource)
yield self.flattened_patient(patient, observations_by_focus)


@staticmethod
def flattened_patient(patient: dict, observations_by_subject: dict) -> dict:
"""Return the flattened Patient record with related Observations"""
Expand All @@ -592,6 +590,3 @@ def flattened_patient(patient: dict, observations_by_subject: dict) -> dict:
flat_patient.update(flat_observation)

return flat_patient



0 comments on commit 4802374

Please sign in to comment.