diff --git a/fhir_query/cli.py b/fhir_query/cli.py index df17960..f37dd2d 100644 --- a/fhir_query/cli.py +++ b/fhir_query/cli.py @@ -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.""" @@ -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": diff --git a/fhir_query/dataframer.py b/fhir_query/dataframer.py index 8df676f..6ba1716 100644 --- a/fhir_query/dataframer.py +++ b/fhir_query/dataframer.py @@ -560,7 +560,6 @@ def flattened_specimen( return flat_specimen - @lru_cache(maxsize=None) def flattened_patients(self) -> Generator[dict, None, None]: """ @@ -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""" @@ -592,6 +590,3 @@ def flattened_patient(patient: dict, observations_by_subject: dict) -> dict: flat_patient.update(flat_observation) return flat_patient - - -