Data Generators
CdsDataGenerator
A class to generate CDS (Clinical Decision Support) data based on specified workflows and constraints.
ATTRIBUTE | DESCRIPTION |
---|---|
registry |
A registry of data generators.
TYPE:
|
mappings |
A mapping of workflows to their respective data generators.
TYPE:
|
data |
The generated CDS FHIR data.
TYPE:
|
Source code in healthchain/data_generators/cdsdatagenerator.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
|
fetch_generator(generator_name)
Fetches a data generator function by its name from the registry.
PARAMETER | DESCRIPTION |
---|---|
generator_name
|
The name of the data generator to fetch.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Callable
|
The data generator function.
TYPE:
|
Source code in healthchain/data_generators/cdsdatagenerator.py
free_text_parser(path_to_csv, column_name)
Parses free text data from a CSV file and converts it into a list of DocumentReference models.
PARAMETER | DESCRIPTION |
---|---|
path_to_csv
|
The path to the CSV file containing free text data.
TYPE:
|
column_name
|
The column name in the CSV file to use for free text data.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict
|
A dictionary of parsed free text data converted into DocumentReference models.
TYPE:
|
Source code in healthchain/data_generators/cdsdatagenerator.py
generate(constraints=None, free_text_path=None, column_name=None, random_seed=None)
Generates CDS data based on the current workflow, constraints, and optional free text data.
PARAMETER | DESCRIPTION |
---|---|
constraints
|
A list of constraints to apply to the data generation.
TYPE:
|
free_text_path
|
The path to a CSV file containing free text data.
TYPE:
|
column_name
|
The column name in the CSV file to use for free text data.
TYPE:
|
random_seed
|
The random seed to use for reproducible data generation.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
BaseModel
|
The generated CDS FHIR data.
TYPE:
|
Source code in healthchain/data_generators/cdsdatagenerator.py
set_workflow(workflow)
Sets the current workflow to be used for data generation.
PARAMETER | DESCRIPTION |
---|---|
workflow
|
The name of the workflow to set.
TYPE:
|
ClassGenerator
Bases: BaseGenerator
A generator class for creating FHIR Class resources.
METHOD | DESCRIPTION |
---|---|
generate |
Generates a FHIR Class resource. |
Source code in healthchain/data_generators/encountergenerators.py
EncounterGenerator
Bases: BaseGenerator
A generator class for creating FHIR Encounter resources.
METHOD | DESCRIPTION |
---|---|
generate |
Optional[list] = None, random_seed: Optional[int] = None) -> Encounter: Generates a FHIR Encounter resource with optional constraints and random_seed. |
Source code in healthchain/data_generators/encountergenerators.py
EncounterLocationGenerator
Bases: BaseGenerator
A generator class for creating FHIR EncounterLocation resources.
METHOD | DESCRIPTION |
---|---|
generate |
Generates a FHIR EncounterLocation resource. |
Source code in healthchain/data_generators/encountergenerators.py
EncounterPriorityGenerator
Bases: BaseGenerator
A generator class for creating FHIR EncounterPriority resources.
METHOD | DESCRIPTION |
---|---|
generate |
Generates a FHIR EncounterPriority resource. |
Source code in healthchain/data_generators/encountergenerators.py
EncounterTypeGenerator
Bases: BaseGenerator
A generator class for creating FHIR EncounterType resources.
METHOD | DESCRIPTION |
---|---|
generate |
Generates a FHIR EncounterType resource. |
Source code in healthchain/data_generators/encountergenerators.py
PeriodGenerator
Bases: BaseGenerator
A generator class for creating FHIR Period resources.
METHOD | DESCRIPTION |
---|---|
generate |
Generates a FHIR Period resource with random start and end times. |