|
|
import os |
|
|
import json |
|
|
|
|
|
''' |
|
|
shared environment variables |
|
|
''' |
|
|
|
|
|
aws_access_key_id = os.getenv('AMRA_AWS_ACCESS_KEY_ID') |
|
|
aws_secret_access_key = os.getenv('AMRA_AWS_SECRET_ACCESS_KEY') |
|
|
openai_api_key = os.getenv('AMRA_OPENAI_API_KEY') |
|
|
|
|
|
default_region = "Spine" |
|
|
|
|
|
device_options={ |
|
|
"secondary extraction":False, |
|
|
"secondary extraction count":0 |
|
|
} |
|
|
|
|
|
default_s3_bucket = "amra-studies" |
|
|
|
|
|
''' |
|
|
ui equivalent environment variables |
|
|
''' |
|
|
ec_options={ |
|
|
"Equivalent Comparator":False, |
|
|
"Equivalent Comparator require SD":False, |
|
|
"Equivalent Comparator count":0 |
|
|
} |
|
|
|
|
|
anatomic_domains=[ |
|
|
|
|
|
"Extremity", |
|
|
"Spine" |
|
|
] |
|
|
|
|
|
''' |
|
|
dynamodb tables structure |
|
|
''' |
|
|
|
|
|
logic_keywords = { |
|
|
"groups":["group"], |
|
|
"preoperatives":["preoperative","preop","pre-op"] |
|
|
} |
|
|
|
|
|
source_format = "<column 1 field>\n<value 1>\n<value 2>...<value n>\n<column 2 field>\n<value 1>\n<value 2>...<value n>\n...<column n field>\n<value 1>\n<value 2>...<value n>\n" |
|
|
|
|
|
anatomic_list = ["Spinal","Extremities"] |
|
|
|
|
|
tables_inst=[ |
|
|
f"extract tables from the system text. the tables are mostly in the following format: {source_format}", |
|
|
f"reformat the returned tables into a markdown table syntax.", |
|
|
f"if applicable, remove the standard deviation after the mean and round all the numbers to one decimal places.", |
|
|
f"include all table titles." |
|
|
] |
|
|
|
|
|
article_prompts = { |
|
|
"Authors": '''extract all of the authors of the article from the above text.\n |
|
|
Return the results on the same line separated by commas as Authors: Author A, Author B... |
|
|
''', |
|
|
"Acceptance Year": '''extract the acceptance year of the article from the above text.\n |
|
|
Return the results on a single line as Accepted Year: <year>. |
|
|
''', |
|
|
|
|
|
"Acceptance Month":'''extract the acceptance month of the article from the above text.\n |
|
|
Return the results on a single line as Accepted Month: <month>. |
|
|
''' |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
''' |
|
|
application default data |
|
|
''' |
|
|
app_data = { |
|
|
"current article":{}, |
|
|
"articles":{}, |
|
|
"prompts":{}, |
|
|
"terms":[], |
|
|
"summary":{}, |
|
|
"user":{ |
|
|
"summary":{"articles":[]}, |
|
|
"performance outcome #1":{"assessment_step":"Clinical"}, |
|
|
"performance outcome #2":{"assessment_step":"Clinical"}, |
|
|
"safety outcome #1":{}, |
|
|
"safety outcome #2":{}, |
|
|
} |
|
|
} |
|
|
|
|
|
with open(".data/defaults.json","r") as f: |
|
|
defaults = json.load(f) |