forked from dotimplement/HealthChain
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integration of data generator and api (dotimplement#13)
Co-authored-by: jenniferajiang <[email protected]>
- Loading branch information
Showing
68 changed files
with
2,401 additions
and
295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
import logging | ||
from .utils.logger import add_handlers | ||
|
||
from healthchain.decorators import ehr, api, sandbox | ||
from healthchain.data_generator.data_generator import DataGenerator | ||
from healthchain.models.requests.cdsrequest import CDSRequest | ||
|
||
logger = logging.getLogger(__name__) | ||
add_handlers(logger) | ||
logger.setLevel(logging.INFO) | ||
|
||
# Export them at the top level | ||
__all__ = ["ehr", "api", "sandbox", "DataGenerator", "CDSRequest"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import argparse | ||
import subprocess | ||
|
||
|
||
def run_file(filename): | ||
try: | ||
result = subprocess.run(["poetry", "run", "python", filename], check=True) | ||
print(result.stdout) | ||
except subprocess.CalledProcessError as e: | ||
print(f"An error occurred while trying to run the file: {e}") | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser(description="HealthChain command-line interface") | ||
subparsers = parser.add_subparsers(dest="command", required=True) | ||
|
||
# Subparser for the 'run' command | ||
run_parser = subparsers.add_parser("run", help="Run a specified file") | ||
run_parser.add_argument("filename", type=str, help="The filename to run") | ||
|
||
args = parser.parse_args() | ||
|
||
if args.command == "run": | ||
run_file(args.filename) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from .encounter_generators import EncounterGenerator | ||
from .condition_generators import ConditionGenerator | ||
from .patient_generators import PatientGenerator | ||
from .practitioner_generators import PractitionerGenerator | ||
from .procedure_generators import ProcedureGenerator | ||
from .medication_administration_generators import MedicationAdministrationGenerator | ||
from .medication_request_generators import MedicationRequestGenerator | ||
from .data_generator import DataGenerator | ||
|
||
__all__ = [ | ||
"EncounterGenerator", | ||
"ConditionGenerator", | ||
"PatientGenerator", | ||
"PractitionerGenerator", | ||
"ProcedureGenerator", | ||
"MedicationAdministrationGenerator", | ||
"MedicationRequestGenerator", | ||
"DataGenerator", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.