add streamlit mosaiq login to transfer_check
@@ -16,6 +16,7 @@ from pymedphys._imports import streamlit as st
from pymedphys._mosaiq import connect
from pymedphys._streamlit import categories
+from pymedphys._streamlit.utilities.mosaiq import uncached_get_mosaiq_cursor
from pymedphys._experimental.chartchecks.compare import (
colour_results,
@@ -36,8 +37,14 @@ CATEGORY = categories.PRE_ALPHA
TITLE = "Pre-Treatment Data Transfer Check"
+@st.cache(allow_output_mutation=True, suppress_st_warning=True)
+def get_mosaiq_cursor(server):
+ return uncached_get_mosaiq_cursor(server)
+
+
def main():
server = "PRDMOSAIQIWVV01.utmsa.local"
+ cursor = get_mosaiq_cursor(server)
st.sidebar.header("Instructions:")
st.sidebar.markdown(
@@ -86,7 +93,7 @@ def main():
# Using MRN from RP file, find patient in MOSAIQ and perform query
mrn = dicom_table.iloc[0]["mrn"]
- with connect.connect(server) as cursor:
+
mosaiq_table = get_all_treatment_data(cursor, mrn)
if mosaiq_table.iloc[0]["create_id"] is not None:
@@ -207,7 +214,7 @@ def main():
field_approval_id = mosaiq_table[
mosaiq_table["field_name"] == field_selection
]["field_approval"]
- with connect.connect(server) as cursor:
+
field_approval_initials = get_staff_initials(
cursor, str(int(field_approval_id.iloc[0]))
)
