| 
17 | 17 | #from dotenv import load_dotenv  | 
18 | 18 | 
 
  | 
19 | 19 | #load_dotenv()  | 
 | 20 | +os.environ['API_KEY']='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'  | 
20 | 21 | API_KEY = os.environ['API_KEY'] # API_KEY in streamlit secret  | 
21 | 22 | 
 
  | 
22 | 23 | client = OpenAI(api_key=API_KEY)  | 
 | 
40 | 41 | """  | 
41 | 42 | 
 
  | 
42 | 43 | with tab1:  | 
43 |  | -    st.title('LAB LOKUN')  | 
44 |  | -    st.subheader('Answer the questions, take a picture of your lab test results, and get your personal report immediately!')  | 
 | 44 | +    col1, mid, col2 = st.columns([1,1,10])  | 
 | 45 | +    with col1:  | 
 | 46 | +        st.image("https://i.ibb.co/869GgfZ/stethoscope-logo-text.jpg", width=100)  | 
 | 47 | +    with col2:  | 
 | 48 | +        st.subheader('Answer the questions, take a picture of your lab test results, and get your personal report immediately')  | 
 | 49 | +    #st.subheader('Answer the questions, take a picture of your lab test results, and get your personal report immediately')  | 
45 | 50 | 
 
  | 
46 | 51 |     # User inputs  | 
47 | 52 |     age = st.number_input("Enter your age", min_value=0, max_value=140, step=1,value="min")  | 
 | 
96 | 101 |             print (test_attributes)  | 
97 | 102 |             #test_results test_attributes  | 
98 | 103 |             full_output = ""  | 
99 |  | -            dm = False  | 
100 |  | -            BMI = False   | 
101 | 104 |             for key, value in test_results.items():  | 
 | 105 | +                dm = False  | 
 | 106 | +                anaemia = False   | 
 | 107 | +                LDLBP = False   | 
 | 108 | +                BMI = False   | 
102 | 109 |                 print (f"looking at {key} and {value}")  | 
103 | 110 |                 if value["test_found"]:  | 
104 | 111 |                     if key == "hb":  | 
105 | 112 |                         fbc_output = anaemia_analysis (test_results)  | 
106 |  | -                        print (f"FBC {fbc_output}")  | 
107 | 113 |                         full_output += f"**FBC**  \n{fbc_output}  \n\n" # streamlit needs 2 whitespace before newline char  | 
108 | 114 |                     elif key == "ldl_cholesterol":  | 
109 | 115 |                         chol_output = getLDLBPtarget (test_attributes, test_results)  | 
110 |  | -                        print (f"LDL/BP {chol_output}")  | 
111 | 116 |                         full_output += f"**LDL/BP**  \n{chol_output}  \n\n"  | 
112 | 117 |                     elif key == "glucose" or key == "hba1c":  | 
113 |  | -                        print (f"in DM and checking if entered before {dm}")  | 
114 | 118 |                         if not dm:  | 
115 | 119 |                             glucose_output = get_dm_advice(test_attributes, test_results)  | 
116 | 120 |                             full_output += f"**Glucose**  \n{glucose_output}  \n\n"  | 
 | 
120 | 124 |                             bp_output = "We need your cholesterol levels to interpret the blood pressure targets better. In general, aim for a blood pressure <140/90.  \n\n"  | 
121 | 125 |                             full_output += f"**BP**  \n{bp_output}\n"  | 
122 | 126 |                     elif key == "weight" or key == "height":  | 
123 |  | -                        print (f"in BMI and checking if entered before {BMI}")  | 
124 | 127 |                         if not BMI:  | 
125 | 128 |                             bmi_output = bmi_advice(test_results)  | 
126 | 129 |                             BMI = True   | 
127 |  | -                            full_output += f"**BMI**  \n{bmi_output}  \n\n"  | 
 | 130 | +                        full_output += f"**BMI**  \n{bmi_output}  \n\n"  | 
128 | 131 |             print(full_output)  | 
129 | 132 |             if full_output == "": # if no supported lab results found  | 
130 | 133 |                 full_output = "No supported medical lab results detected in your image.  \nCheck if your image contains lab results listed in our About page."  | 
 | 
134 | 137 | 
 
  | 
135 | 138 | 
 
  | 
136 | 139 | with tab2:  | 
137 |  | -    st.markdown("**Lab Lokun** is an AI-assisted app that interprets and explains blood and lab test reports to provide personalised health advice and recommendations using Singapore ACG guidelines. **Lab Lokun** is co-created by doctors and non-doctors who have interpreted indecipherable lab results to their friends and family too many times.")  | 
138 |  | -    st.header('Lab measurements included for analysis')  | 
 | 140 | +    col1, mid, col2 = st.columns([1,1,10])  | 
 | 141 | +    with col1:  | 
 | 142 | +        st.image("https://i.ibb.co/869GgfZ/stethoscope-logo-text.jpg", width=100)  | 
 | 143 | +    with col2:  | 
 | 144 | +        st.markdown("**Lab Lokun** is an AI-assisted app that interprets and explains blood and lab test reports to provide personalised health advice and recommendations using Singapore ACG guidelines. **Lab Lokun** is co-created by doctors and non-doctors who have interpreted indecipherable lab results to their friends and family too many times.")  | 
 | 145 | +    st.subheader('Lab measurements included for analysis')  | 
139 | 146 |     st.markdown(measurements_list)  | 
140 |  | -    st.write('Other lab tests will be added soon...stay tuned!')  | 
 | 147 | +    st.write('Other lab tests will be added soon...stay tuned!')      | 
141 | 148 | 
 
  | 
142 | 149 | st.caption('Disclaimer: Information provided through our app is for informational and educational purposes only and is not intended as a substitute for professional medical advice, diagnosis, or treatment. Always seek the advice of your physician or other qualified health provider with any questions you may have regarding a medical condition.')  | 
0 commit comments