diff --git a/home/fhirvalidation.py b/home/fhirvalidation.py index 1916e7c..a78ecd0 100644 --- a/home/fhirvalidation.py +++ b/home/fhirvalidation.py @@ -4,6 +4,7 @@ import pandas as pd import re import os import logging +from tqdm.auto import tqdm class Validator(): @@ -117,6 +118,13 @@ class Validator(): total = 0 logging.info(f"Found {total} resources") + if limit < total: + progressbar_total = limit + else: + progressbar_total = total + + progress_bar = tqdm(total=progressbar_total, desc="Validating") + count_entries = 0 entries = bundle_dict.get('entry') if entries: @@ -127,6 +135,8 @@ class Validator(): df_add = self.validate(resource_type, entry) df = pd.concat([df, df_add], ignore_index=True) count += 1 + progress_bar.update(1) + if (limit > 0 and count >= limit): is_limit_reached = True logging.info(