Roland Ding commited on
Commit
2d719a7
1 Parent(s): d995bae

1.1.3.10 added application into other files to manage collective app variables.

Browse files
Files changed (4) hide show
  1. application.py +29 -0
  2. ui_device.py +4 -9
  3. ui_equivalent.py +1 -6
  4. utility.py +1 -47
application.py CHANGED
@@ -1,3 +1,5 @@
 
 
1
  '''
2
  shared environment variables
3
  '''
@@ -7,6 +9,30 @@ aws_access_key_id = os.environ.get('AMRA_AWS_ACCESS_KEY_ID')
7
  aws_secret_access_key = os.environ.get('AMRA_AWS_SECRET_ACCESS_KEY')
8
  openai_api_key = os.environ.get('AMRA_OPENAI_API_KEY')
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  data_structure = {
11
  "terms":{
12
  "key":{
@@ -39,6 +65,9 @@ data_structure = {
39
  ]
40
  }
41
 
 
 
 
42
  app_data = {
43
  "articles":[],
44
  "terms":[],
 
1
+ import os
2
+
3
  '''
4
  shared environment variables
5
  '''
 
9
  aws_secret_access_key = os.environ.get('AMRA_AWS_SECRET_ACCESS_KEY')
10
  openai_api_key = os.environ.get('AMRA_OPENAI_API_KEY')
11
 
12
+ '''
13
+ ui device environment variables
14
+ '''
15
+ eu_device_classification = ["phone", "laptop", "tablet", "desktop"]
16
+ performance_outcome_list = [ "VAS Score", "Incidence of Fusion", "Incidence of Pseudoarthrosis", "Incidence of Reoperation"]
17
+ safety_outcome_list = ["Incidence of Revision","Incidence of Nonunion"]
18
+
19
+ device_options={
20
+ "secondary extraction":False,
21
+ "secondary extraction count":0
22
+ }
23
+
24
+ '''
25
+ ui equivalent environment variables
26
+ '''
27
+ ec_options={
28
+ "Equivalent Comparator":False,
29
+ "Equivalent Comparator require SD":False,
30
+ "Equivalent Comparator count":0
31
+ }
32
+
33
+ '''
34
+ dynamodb tables structure
35
+ '''
36
  data_structure = {
37
  "terms":{
38
  "key":{
 
65
  ]
66
  }
67
 
68
+ '''
69
+ application default data
70
+ '''
71
  app_data = {
72
  "articles":[],
73
  "terms":[],
ui_device.py CHANGED
@@ -3,20 +3,15 @@ import gradio as gr
3
  from article import *
4
  from utility import *
5
 
6
- performance_outcome_list = [ "VAS Score", "Incidence of Fusion", "Incidence of Pseudoarthrosis", "Incidence of Reoperation"]
7
- safety_outcome_list = ["Incidence of Revision","Incidence of Nonunion"]
8
-
9
- device_options={
10
- "secondary extraction":False,
11
- "secondary extraction count":0
12
- }
13
 
14
  with gr.Blocks() as device_page:
15
  with gr.Row():
16
  with gr.Column():
17
- gr.Markdown("## Device 1 Stratification")
 
18
  device_name = gr.Textbox(lines=1, label="Subject Device Name")
19
- device_type = gr.Dropdown(["phone", "laptop", "tablet", "desktop"], label="EU Device Classification")
20
 
21
  upload_instruction = gr.Files(file_count="multiple")
22
  upload_studies = gr.Files(file_count="multiple")
 
3
  from article import *
4
  from utility import *
5
 
6
+ from application import *
 
 
 
 
 
 
7
 
8
  with gr.Blocks() as device_page:
9
  with gr.Row():
10
  with gr.Column():
11
+ gr.Markdown("## Stratification")
12
+ gr.HTML("<hr>")
13
  device_name = gr.Textbox(lines=1, label="Subject Device Name")
14
+ device_type = gr.Dropdown(eu_device_classification, label="EU Device Classification")
15
 
16
  upload_instruction = gr.Files(file_count="multiple")
17
  upload_studies = gr.Files(file_count="multiple")
ui_equivalent.py CHANGED
@@ -2,12 +2,7 @@ import gradio as gr
2
 
3
  from article import *
4
  from utility import *
5
-
6
- ec_options={
7
- "Equivalent Comparator":False,
8
- "Equivalent Comparator require SD":False,
9
- "Equivalent Comparator count":0
10
- }
11
 
12
  with gr.Blocks() as equivalent_page:
13
  ec_options["Equivalent Comparator"] = gr.Checkbox(label="Will an Equivalent Comparator (EC) be included?")
 
2
 
3
  from article import *
4
  from utility import *
5
+ from application import *
 
 
 
 
 
6
 
7
  with gr.Blocks() as equivalent_page:
8
  ec_options["Equivalent Comparator"] = gr.Checkbox(label="Will an Equivalent Comparator (EC) be included?")
utility.py CHANGED
@@ -2,53 +2,7 @@ import json
2
  import os
3
  import PyPDF2
4
 
5
- '''
6
- shared environment variables
7
- '''
8
- default_domain = "cervical-cage"
9
-
10
- aws_access_key_id = os.environ.get('AMRA_AWS_ACCESS_KEY_ID')
11
- aws_secret_access_key = os.environ.get('AMRA_AWS_SECRET_ACCESS_KEY')
12
- openai_api_key = os.environ.get('AMRA_OPENAI_API_KEY')
13
-
14
- data_structure = {
15
- "terms":{
16
- "key":{
17
-
18
- },
19
- "fields":[
20
- "assessment_step",
21
- "term",
22
- "clinical study",
23
- "summary",
24
- "command"
25
- ]},
26
- "prompts":[
27
- "assessment_step",
28
- "template_name",
29
- "instruction"
30
- ],
31
- "articles":[
32
- "domain",
33
- "name",
34
- "s3_path",
35
- "vector",
36
- "meta",
37
- "content"
38
- ],
39
- "outputs":[
40
- "domain",
41
- "article",
42
- "output"
43
- ]
44
- }
45
-
46
- app_data = {
47
- "articles":[],
48
- "terms":[],
49
- "prompts":[],
50
- "outputs":[]
51
- }
52
 
53
  '''
54
  following functions are for file manipulation
 
2
  import os
3
  import PyPDF2
4
 
5
+ from application import *
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
  '''
8
  following functions are for file manipulation