root = tkinter.Tk() root.withdraw() # use to hide tkinter window currdir = os.getcwd() dicomFile = tkinter.filedialog.askopenfilename( parent=root, initialdir=currdir, title="Please select a Pinnacle RP file") if len(dicomFile) > 0: print("You chose %s" % dicomFile) dicom_table = get_all_dicom_treatment_info(dicomFile) mrn = dicom_table.iloc[0]["mrn"] # host_name = 'prwinvds006.utmsa.local' with connect.connect("prwinvds006.utmsa.local") as cursor: mosaiq_table = get_all_treatment_data(cursor, mrn) field_version = max(mosaiq_table["field_version"]) mosaiq_table = mosaiq_table[mosaiq_table["field_version"] == field_version] mosaiq_table = mosaiq_table.reset_index(drop=True) index = [] for j in dicom_table.iloc[:]["field_label"]: for i in range(len(mosaiq_table)): if mosaiq_table.iloc[i]["field_label"] == j: index.append(i) remove = [] for i in mosaiq_table.iloc[:].index: if i not in index:
import os import streamlit as st from pymedphys._mosaiq import connect from pymedphys._mosaiq.helpers import get_all_treatment_data currdir = os.getcwd() st.title("Weekly Check") mrn = st.text_input("Patient MRN: ") if len(mrn) is not 0: with connect.connect("PRDMOSAIQIWVV01.utmsa.local") as cursor: mosaiq_table = get_all_treatment_data(cursor, mrn) st.write(mosaiq_table) # display_results = compare_to_mosaiq(mosaiq_table, mosaiq_table) # st.write(display_results)
st.title("Data Transfer Check") dicomFile = st.file_uploader("Please select a RP file.") if dicomFile is not None: # retrieve data from both systems. dicom_table = get_all_dicom_treatment_info(dicomFile) dicom_table["tolerance"] = [ TOLERANCE_TYPES[item] for item in dicom_table["tolerance"] ] dicom_table = dicom_table.sort_values(["field_label"]) mrn = dicom_table.iloc[0]["mrn"] with connect.connect(server) as cursor: mosaiq_table = get_all_treatment_data(cursor, mrn) site_initials = get_staff_initials( cursor, str(mosaiq_table.iloc[0]["create_id"]) ) mosaiq_table = mosaiq_table[mosaiq_table["field_version"] == 0] mosaiq_table = mosaiq_table.reset_index(drop=True) mosaiq_table["tolerance"] = [ TOLERANCE_TYPES[item] for item in mosaiq_table["tolerance"] ] ######################################################################################################################## # verify general patient information between the two systems name = dicom_table.iloc[0]["first_name"] + " " + dicom_table.iloc[0]["last_name"] st.subheader("Patient:")