def generate_table_layout(table_df, title, tableid, sort_cols, remove_cols): children = html.Div([ ddk.Card(children=[ ddk.CardHeader(children=[ html.Div( title, style={"float": "left"}, ), ]), ddk.Block(ddk.DataTable( columns=[{ "name": i.replace("_", " ").title(), "id": i } for i in table_df.columns if (i not in remove_cols)], filter_action="native", page_action="native", page_size=10, row_selectable="multi", id=tableid, style_cell={ 'fontSize': 12, 'font-family': 'sans-serif' }, style_table={'overflowX': 'auto'}, ), style={"overflow": "scroll"}), ]), ]) return children
def serv_layout(): return html.Div([ dcc.Location(id='url', refresh=False), ddk.App(style={'background-color': 'transparent'}, children=[ ddk.Block(width=100, style={ 'height': '100vh', 'width': '100%', 'text-align': 'center', 'padding': '0' }, children=ddk.Block( width=100, style={ 'margin': '0', 'width': '100%' }, children=html.Div(id='page-content'))), html.Div(id='hidden-div') ]) ])
def get_home(): return ddk.Block([ # ddk.Card(), portfolio_table(), dcc.Markdown(id='output') # ddk.Card([dcc.Tabs( # id='portfolio-tabs', # value='create-report', # children=[ # dcc.Tab(value='historical', label='Historical View'), # dcc.Tab(value='predicted', label='Predicted View'), # # I need to figure out why I get a console error about this not being present in layout even though suppress callback exeptions is on. # dcc.Tab(value='create-report', label='Create Report', children=html.Button(id='portfolio-create-report-button', n_clicks=0, style={'display': 'none'})) # ] # ), # html.Div(id='portfolio-tabs-content') # ]) ])
def news_page(id): all_cardsBD = pd.read_csv(main_path_data + '\\news.csv') # print(" id from NEWS :", id) # id = id.replace("news/", "") df = all_cardsBD[(all_cardsBD['Mid'].isin([int(id)]))] ############## HEAD CARD of MATCH ################################### news_head = ddk.Card( style={ 'width': '-webkit-fill-available', 'min-height': '120px', 'margin': '10px', 'padding': '15px', 'background-color': '#f9f9f91c' }, children=[ ddk.Block(width=100, style={ 'height': 'fit-content', }, children=[ html.H2(df.iloc[0]['name'], style={ 'text-align': 'left', 'font-size': '30px', 'text-color': 'azure', 'margin': '0' }) ]), ddk.Block(width=100, style={ 'max-height': 'fit-content', 'margin-bottom': '20px', }, children=[ html.P('{}'.format(df.iloc[0]['date']), style={ 'text-align': 'left', 'margin': '0' }) ]), ddk.Block(width=100, style={'max-height': 'fit-content'}, children=[ html.P('{}'.format(df.iloc[0]['disc']), style={ 'text-align': 'left', 'margin': '0' }) ]), ]) match_card = ddk.Block( width=100, style={ 'height': '93vh', 'text-align': 'center' }, children=[ ddk.Block( width=70, style={ 'height': '89vh', 'margin': '0', 'padding': '0', 'color': 'azure', 'overflowY': 'scroll', 'overflowX': 'hidden', }, children=[ news_head # ddk.Card(style={'width':'-webkit-fill-available', # 'margin':'10px', 'padding':'0', # 'background-color': '#f9f9f91c',}, # children=news_head), ]), ddk.Block(width=30, style={'height': '90vh'}, children=[ ddk.Card(width=100, style={ 'background-color': 'transparent', 'max-height': '40vh', 'min-height': '40vh', 'padding-bottom': '5px', 'padding': '0', 'overflowY': 'hidden', 'margin': '10px' }, children=[ ddk.CardHeader(title='Live', style={ 'background-color': 'transparent' }), Live_matches.live_list() ]), ddk.Card(width=100, id='match_sample_right', style={ 'background-color': 'transparent', 'max-height': '45vh', 'min-height': '45vh', 'padding-bottom': '5px', 'padding': '0', 'overflowY': 'hidden', 'margin': '10px' }, children=[ ddk.CardHeader(title='Matches', style={ 'background-color': 'transparent' }), Main_page.main_page() ]) ]) ]) return match_card
def film_list(db): all_cardsBD = db all_cardsBD.index += 1 all_cardsBD['start'] = all_cardsBD['start'].apply(pd.to_numeric, errors='coerce') all_cardsBD['volume'] = all_cardsBD['volume'].apply(pd.to_numeric, errors='coerce') all_cardsBD['back'] = all_cardsBD['back'].apply(pd.to_numeric, errors='coerce') all_cardsBD['step'] = all_cardsBD['step'].apply(pd.to_numeric, errors='coerce') rows = [] rows.append(html.Tr([html.Td("№", style={'text-align': 'center'}), html.Td("БИРЖА", style={'text-align': 'center'}), html.Td("НАПРАВЛЕНИЕ", style={'text-align': 'center'}), html.Td("ПРОФИТ", style={'text-align': 'center'}), html.Td("Дейстиве", style={'text-align': 'center'}), html.Td("Результат", style={'text-align': 'center'})])) USD_fil = all_cardsBD[(all_cardsBD['valin_x'] == "USD") | (all_cardsBD['valin_x'] == "USDT")] BTC_fil = all_cardsBD[(all_cardsBD['valin_x'] == "BTC") & (all_cardsBD['valin_y'].isin(["USD", "USDT"]))] BTC_fil_main = all_cardsBD[(all_cardsBD['valin_x'] == "BTC") & (~all_cardsBD['valin_y'].isin(["USD", "USDT"]))] BTC_fil_main2 = all_cardsBD[(all_cardsBD['valin_y'] == "BTC") & (~all_cardsBD['valin_x'].isin(["USD", "USDT"]))] # print('########### USD_fil :', '\n',USD_fil) # print('########### BTC_fil :', '\n',BTC_fil) # print('########### BTC_fil_main :', '\n',BTC_fil_main) # print('########### BTC_fil_main2 :', '\n',BTC_fil_main2) if USD_fil.shape[0]>0: for ind in USD_fil.index: if USD_fil['volume'][ind] > 0: rate1 = (USD_fil['start'][ind] / USD_fil['step'][ind]) rate2 = (USD_fil['back'][ind] / USD_fil['step'][ind]) step = (USD_fil['volume'][ind] * rate1) step2 = (rate2 * USD_fil['volume'][ind]) rows.append(html.Tr([ html.Td(style={'text-align': 'center'}, children=[ddk.Block(USD_fil['TIME'][ind]), ddk.Block(USD_fil['timer'][ind]), ddk.Block(id={'type': "uregim",'index': ind}, children=USD_fil['regim'][ind])]), html.Td([ html.Tr(USD_fil['birga_x'][ind], id={'type': "ubirga_1", 'index': ind}), html.Tr(USD_fil['birga_y'][ind], id={'type': "ubirga_2", 'index': ind}) ]), html.Td(style={'padding': '0'}, children=[ html.Tr(html.Td(style={'padding': '0'}, children= ddk.Block(width=100, style={'width': '600px'}, children=[ ddk.Block(width=30, children=[ddk.Block(step, style={"font-weight": "700"}, id={'type': "uval1_vol", 'index': ind}), ddk.Block(USD_fil['valin_x'][ind], id={'type': "uval1", 'index': ind})]), ddk.Block(width=30, children=[ddk.Block(USD_fil['rates_x'][ind], style={'text-align': 'center'}, id={'type':"urate1", 'index':ind}), ddk.Block("-->>", style={'text-align': 'center'})]), ddk.Block(width=30, children=[ddk.Block(USD_fil['volume'][ind], style={"text-align": "right"}, id={'type': "uval2_vol", 'index': ind}), ddk.Block(USD_fil['valin_y'][ind], style={"text-align": "right"}, id={'type': "uval2", 'index': ind})]), ]))), html.Tr(html.Td(style={'padding': '0'}, children= ddk.Block(width=100, style={'width': '600px'}, children=[ ddk.Block(width=30, children=[ddk.Block(USD_fil['volume'][ind], id={'type': "uval3_vol", 'index': ind}), ddk.Block(USD_fil['valin_y'][ind], id={'type': "uval3", 'index': ind})]), ddk.Block(width=30, children=[ddk.Block(USD_fil['rates_y'][ind], style={'text-align': 'center'}, id={'type':"urate2", 'index':ind} ), ddk.Block("-->>", style={'text-align': 'center'})]), ddk.Block(width=30, children=[ddk.Block(step2, style={"font-weight": "700", "text-align": "right"}, id={'type': "uval4_vol", 'index': ind}), ddk.Block(USD_fil['valout_y'][ind], style={"text-align": "right"}, id={'type': "uval4", 'index': ind})]), ]) ))]), html.Td([ html.Tr(USD_fil['perc'][ind], style={"font-weight": "700"}) ]), html.Td([ html.Tr( style={'text-align': 'center'}, children=[html.Button("Go !", style={'text-align': 'center', 'max-width': '100px', "background-color": "palegreen", "border-radius": "20px", 'font-size': '15px'}, n_clicks=0, id={'type': "uorder_btn", 'index': ind})]) ]), html.Td([html.Tr([], id={'type': "uorder_result", 'index': ind})]) ])) else: pass else: pass if BTC_fil.shape[0] > 0: for ind in BTC_fil.index: if BTC_fil['volume'][ind] > 0: rate1 = (BTC_fil['step'][ind] / BTC_fil['start'][ind]) rate2 = (BTC_fil['step'][ind] / BTC_fil['back'][ind]) step = (BTC_fil['volume'][ind] * rate1) step2 =(step / rate2) rows.append(html.Tr([ html.Td(style={'text-align': 'center'}, children=[ddk.Block(BTC_fil['TIME'][ind]), ddk.Block(BTC_fil['timer'][ind]), ddk.Block(id={'type': "uregim",'index': ind}, children=BTC_fil['regim'][ind])]), html.Td([ html.Tr(BTC_fil['birga_x'][ind], id={'type':"ubirga_1", 'index':ind}), html.Tr(BTC_fil['birga_y'][ind], id={'type':"ubirga_2", 'index':ind}) ]), # Birga html.Td(style={'padding': '0'}, children=[ html.Tr(html.Td(style={'padding': '0'}, children= ddk.Block(width=100, style={'width': '600px'}, children=[ ddk.Block(width=30, children=[ddk.Block(BTC_fil['volume'][ind], style={"font-weight": "700"}, id={'type':"uval1_vol", 'index':ind}), ddk.Block(BTC_fil['valin_x'][ind], id={'type':"uval1", 'index':ind})]), ddk.Block(width=30, children=[ddk.Block(BTC_fil['rates_x'][ind], style={'text-align': 'center'}, id={'type':"urate1", 'index':ind}), ddk.Block("-->>",style={'text-align': 'center'})]), ddk.Block(width=30, children=[ddk.Block(step, style={"text-align":"right"}, id={'type':"uval2_vol", 'index':ind}), ddk.Block(BTC_fil['valin_y'][ind], style={"text-align":"right"}, id={'type':"uval2", 'index':ind})]), ]))), html.Tr(html.Td(style={'padding': '0'}, children= ddk.Block(width=100, style={'width': '600px'}, children=[ ddk.Block(width=30, children=[ddk.Block(step, id={'type':"uval3_vol", 'index':ind}), ddk.Block(BTC_fil['valin_y'][ind], id={'type':"uval3", 'index':ind})]), ddk.Block(width=30, children=[ddk.Block(BTC_fil['rates_y'][ind], style={'text-align': 'center'}, id={'type':"urate2", 'index':ind}), ddk.Block("-->>", style={'text-align': 'center'})]), ddk.Block(width=30, children=[ddk.Block(step2,style={"font-weight": "700", "text-align":"right"}, id={'type':"uval4_vol", 'index':ind}), ddk.Block(BTC_fil['valout_y'][ind], style={"text-align":"right"}, id={'type':"uval4", 'index':ind})]), ]) ))]), # Direction html.Td([ html.Tr(BTC_fil['perc'][ind], style={"font-weight": "700"},) ]), # Profit html.Td([ html.Tr( style={'text-align': 'center'}, children=[html.Button("Go !", style={'text-align': 'center', 'max-width': '100px', "background-color": "palegreen", "border-radius": "20px", 'font-size': '15px'}, n_clicks=0, id={'type':"uorder_btn", 'index':ind})]) ]), # Button html.Td([ html.Tr([], id={'type':"uorder_result", 'index':ind}) ]) # Result ])) else: pass else: pass if BTC_fil_main.shape[0]>0: for ind in BTC_fil_main.index: if BTC_fil_main['volume'][ind] > 0: rate1 = (BTC_fil_main['start'][ind] / BTC_fil_main['step'][ind]) rate2 = (BTC_fil_main['back'][ind] / BTC_fil_main['step'][ind]) step = (BTC_fil_main['volume'][ind] * rate1) step2 = (rate2 * BTC_fil_main['volume'][ind]) rows.append(html.Tr([ html.Td(style={'text-align': 'center'}, children=[ddk.Block(BTC_fil_main['TIME'][ind]),ddk.Block(BTC_fil_main['timer'][ind]), ddk.Block(id={'type': "uregim",'index': ind}, children=BTC_fil_main['regim'][ind])]), html.Td([ html.Tr(BTC_fil_main['birga_x'][ind], id={'type': "ubirga_1", 'index': ind}), html.Tr(BTC_fil_main['birga_y'][ind], id={'type': "ubirga_2", 'index': ind}) ]), html.Td(style={'padding': '0'}, children=[ html.Tr(html.Td(style={'padding': '0'}, children= ddk.Block(width=100, style={'width': '600px'}, children=[ ddk.Block(width=30, children=[ddk.Block(step, style={"font-weight": "700"}, id={'type': "uval1_vol", 'index': ind}), ddk.Block(BTC_fil_main['valin_x'][ind], id={'type': "uval1", 'index': ind})]), ddk.Block(width=30, children=[ddk.Block(BTC_fil_main['rates_x'][ind], style={'text-align': 'center'}, id={'type':"urate1", 'index':ind}), ddk.Block("-->>")]), ddk.Block(width=30, children=[ddk.Block(BTC_fil_main['volume'][ind], style={"text-align": "right"}, id={'type': "uval2_vol", 'index': ind}), ddk.Block(BTC_fil_main['valin_y'][ind], style={"text-align": "right"}, id={'type': "uval2", 'index': ind})]), ]))), html.Tr(html.Td(style={'padding': '0'}, children= ddk.Block(width=100, style={'width': '600px'}, children=[ ddk.Block(width=30, children=[ddk.Block(BTC_fil_main['volume'][ind], id={'type': "uval3_vol", 'index': ind}), ddk.Block(BTC_fil_main['valin_y'][ind], id={'type': "uval3", 'index': ind})]), ddk.Block(width=30, children=[ddk.Block(BTC_fil_main['rates_y'][ind], style={'text-align': 'center'}, id={'type':"urate2", 'index':ind} ), ddk.Block("-->>")]), ddk.Block(width=30, children=[ddk.Block(step2, style={"font-weight": "700", "text-align": "right"}, id={'type': "uval4_vol", 'index': ind}), ddk.Block(BTC_fil_main['valout_y'][ind], style={"text-align": "right"}, id={'type': "uval4", 'index': ind})]), ]) ))]), html.Td([ html.Tr(BTC_fil_main['perc'][ind], style={"font-weight": "700"}) ]), html.Td([ html.Tr( style={'text-align': 'center'}, children=[html.Button("Go !", style={'text-align': 'center', 'max-width': '100px', "background-color": "palegreen", "border-radius": "20px", 'font-size': '15px'}, n_clicks=0, id={'type': "uorder_btn", 'index': ind})]) ]), html.Td([html.Tr([], id={'type': "uorder_result", 'index': ind})]) ])) else: pass else: pass if BTC_fil_main2.shape[0] > 0: for ind in BTC_fil_main2.index: if BTC_fil_main2['volume'][ind] > 0: rate1 = (BTC_fil_main2['step'][ind] / BTC_fil_main2['start'][ind]) rate2 = (BTC_fil_main2['step'][ind] / BTC_fil_main2['back'][ind]) step = (BTC_fil_main2['volume'][ind] * rate1) step2 =(step / rate2) rows.append(html.Tr([ html.Td(style={'text-align': 'center'}, children=[ddk.Block(BTC_fil_main2['TIME'][ind]),ddk.Block(BTC_fil_main2['timer'][ind]), ddk.Block(id={'type': "uregim",'index': ind}, children=BTC_fil_main2['regim'][ind])]), html.Td([ html.Tr(BTC_fil_main2['birga_x'][ind], id={'type':"ubirga_1", 'index':ind}), html.Tr(BTC_fil_main2['birga_y'][ind], id={'type':"ubirga_2", 'index':ind}) ]), # Birga html.Td(style={'padding': '0'}, children=[ html.Tr(html.Td(style={'padding': '0'}, children= ddk.Block(width=100, style={'width': '600px'}, children=[ ddk.Block(width=30, children=[ddk.Block(BTC_fil_main2['volume'][ind], style={"font-weight": "700"}, id={'type':"uval1_vol", 'index':ind}), ddk.Block(BTC_fil_main2['valin_x'][ind], id={'type':"uval1", 'index':ind})]), ddk.Block(width=30, children=[ddk.Block(BTC_fil_main2['rates_x'][ind], style={'text-align': 'center'}, id={'type':"urate1", 'index':ind}), ddk.Block("-->>",style={'text-align': 'center'})]), ddk.Block(width=30, children=[ddk.Block(step, style={"text-align":"right"}, id={'type':"uval2_vol", 'index':ind}), ddk.Block(BTC_fil_main2['valin_y'][ind], style={"text-align":"right"}, id={'type':"uval2", 'index':ind})]), ]))), html.Tr(html.Td(style={'padding': '0'}, children= ddk.Block(width=100, style={'width': '600px'}, children=[ ddk.Block(width=30, children=[ddk.Block(step, id={'type':"uval3_vol", 'index':ind}), ddk.Block(BTC_fil_main2['valin_y'][ind], id={'type':"uval3", 'index':ind})]), ddk.Block(width=30, children=[ddk.Block(BTC_fil_main2['rates_y'][ind], style={'text-align': 'center'}, id={'type':"urate2", 'index':ind}), ddk.Block("-->>", style={'text-align': 'center'})]), ddk.Block(width=30, children=[ddk.Block(step2,style={"font-weight": "700", "text-align":"right"}, id={'type':"uval4_vol", 'index':ind}), ddk.Block(BTC_fil_main2['valout_y'][ind], style={"text-align":"right"}, id={'type':"uval4", 'index':ind})]), ]) ))]), # Direction html.Td([ html.Tr(BTC_fil_main2['perc'][ind], style={"font-weight": "700"},) ]), # Profit html.Td([ html.Tr( style={'text-align': 'center'}, children=[html.Button("Go !", style={'text-align': 'center', 'max-width': '100px', "background-color": "palegreen", "border-radius": "20px", 'font-size': '15px'}, n_clicks=0, id={'type':"uorder_btn", 'index':ind})]) ]), # Button html.Td([ html.Tr([], id={'type':"uorder_result", 'index':ind}) ]) # Result ])) else: pass else: pass table_body = [html.Tbody(rows)] table = dbc.Table(table_body, bordered=True, dark=True, hover=True, responsive=True, striped=True, style={'width':"100%"}) return table
ddk.Block( width=33, style={'text-align': 'left'}, children=[ html.Div(id='placeholder1', style={"display": "none"}, children=layouts.sound(0)), html.Div(id='on-content', style={'display': 'none'}), html.Div(id='off-content', style={'display': 'none'}), html.Button(children="TURN ON", style={ 'text-align': 'center', "background-color": "palegreen", "border-radius": "20px", 'margin': '10px', 'font-size': '15px' }, id='On_Avtomat_btn', n_clicks=0), html.Button( children="ALERT", style={ 'text-align': 'center', # 'max-width': '100px', "background-color": "tomato", "border-radius": "20px", 'margin': '10px', 'font-size': '15px' }, id='Off_Avtomat_btn', n_clicks=0) ]),
def layout(): data = chart_utils.get_loaded_data("SCHEDULEREPORTS_VISITSBYSTATUS","DATASET") remove_cols = ['BRANCH','COLUMN_MAPPING', 'COLUMN_PARAMETERS'] max_date = datetime.now() children = html.Div( [ ddk.Row( [ ddk.ControlCard( [ html.Details( [ html.Summary("About this app"), html.P( """Select attributes to fine tune graphs and tables.""" ), ] ), ddk.ControlItem( dcc.Dropdown( options=[ {"label": status, "value": status,} for status in sorted( [ patient for patient in data["STATUS"].unique() if patient ] ) ], multi=True, placeholder="Select Status", id="status-selector", value=["Not Yet Started", "Saved"], ) ), ddk.ControlItem( dcc.Dropdown( options=[ {"label": clinician, "value": clinician,} for clinician in sorted( [ patient for patient in data[ "ASSIGNED_TO" ].unique() if patient ] ) if clinician ], multi=True, placeholder="Select a Clinician", id="clinician-selector", ) ), ddk.ControlItem( dcc.Dropdown( multi=True, placeholder="Select a Patient", id="patient-selector", ) ), ddk.ControlItem( dcc.DatePickerRange( id="date-picker", min_date_allowed=pd.to_datetime( data["SCHEDULED_DATE"].min() ), max_date_allowed=max_date, initial_visible_month=max_date, start_date=max_date - timedelta(days=30), end_date=max_date, ), ), ddk.ControlItem( html.Button( id="select-all-rows", children="Select all matching records", style={"margin": "auto"}, n_clicks=0, ) ), html.Div( [ ddk.Modal( id="modal-btn-outer", children=[ html.Button( id="expand-modal-2", n_clicks=0, children="Take action", ), ], target_id="modal-content", hide_target=True, style={"float": "right"}, ), ], style={"margin": "auto"}, ), ], width=30, style={"overflow": "scroll"}, ), ddk.Card(id="time-series"), ] ), ddk.Row(id="pie-charts"), ddk.Card( children=[ ddk.CardHeader( title="Table of selected tasks", children=[ html.Div( [ ddk.Modal( id="modal-btn-outer", children=[ html.Button( id="expand-modal", n_clicks=0, children="Take action", ) ], target_id="modal-content", hide_target=True, style={"float": "right"}, ), ddk.Block( id="modal-content", children=html.Div(id="modal-div"), style={ "width": "50%", "margin": "auto", "overflow": "scroll", }, ), ] ), ], ), ddk.Block( ddk.DataTable( columns=[ {"name": i.replace("_", " ").title(), "id": i} for i in data.columns if (i not in remove_cols) ], data = data.sort_values(by="SCHEDULED_DATE").to_dict("records"), filter_action="native", page_action="native", page_size=25, row_selectable="multi", id="data-table", style_cell={'fontSize': 12, 'font-family': 'sans-serif'} ), style={"overflow": "scroll"} ), ] ), ] ) return children
def layout(): # load data for display episodicdata = chart_utils.get_loaded_data("AXXESS_API.RAW.MEDICARE_MCRADV_VISITPLANNING_NOAUTH", "DATASET") pervisitdata = chart_utils.get_loaded_data("AXXESS_API.RAW.MANAGEDCARE_VISITPLANNING_NOAUTH", "DATASET") currentepisodic = chart_utils.get_loaded_data("AXXESS_API.RAW.VW_MEDICARE_MCRADV_VISITPLANNING_CURRENT_EPISODES","DATASET") lupa_riskdata = chart_utils.get_loaded_data("AXXESS_API.RAW.VW_MEDICARE_MCRADV_LUPA_RISK", "DATASET") #reorder the columns ''' new_order = ['INS_CODE', 'INITIAL_TIMELY_FILING', 'MRN', 'PATIENT', 'PATIENT_STATUS', 'DATE_OF_BIRTH', 'EPISODE_START_DATE', 'EPISODE_END_DATE', 'PHYSICIAN_NAME', 'PHYSICIAN_PHONE', 'PHYSICIAN_FACSIMILE', 'ORDERS_DETAILS', 'CONSOLIDATED_COMMENTS', 'COLOR', 'USER_UPDATE_DATE', 'NEW_COMMENTS', 'EPISODE_UNEARNED_AMOUNT', 'EPISODE_EARNED_AMOUNT', 'EPISODE_BILLED_AMOUNT', 'EPISODE_ADJUSTMENTS' ] ''' gl_mrn_arr = chart_utils.get_options(episodicdata, "MRN") gl_ins_code_arr = chart_utils.get_options(episodicdata, "INS_CODE") gl_patient_arr = chart_utils.get_options(episodicdata, "PATIENT") gl_patient_status_arr = chart_utils.get_options(episodicdata, "PATIENT_STATUS") gl_pcc_arr = chart_utils.get_options(currentepisodic, "CASE_MANAGER_NAME") gl_lupa_risk_arr = chart_utils.get_options(currentepisodic, "LUPA_RISK") remove_cols = ['INS_CODE', 'OASIS_STATUS', 'OASIS_DETAILS', 'EPISODE_PRIMARY_INSURANCE_NAME', 'DATE_OF_BIRTH', 'PHONE','PHYSICIAN_FACSIMILE', 'PHYSICIAN_NAME', 'PHYSICIAN_PHONE', 'ZIP', 'ORDERS_STATUS', 'ORDERS_DETAILS', 'EARLY_LUPA_RISK', 'LATE_LUPA_RISK', 'EARLY_ORIGINAL_PROSPECTIVE_PAY', 'LATE_ORIGINAL_PROSPECTIVE_PAY', 'TOTAL_COST', 'TOTAL_PROFIT', 'EARLY_COST', 'EARLY_PROFIT', 'LATE_COST', 'LATE_PROFIT', 'EPISODE_BILLED_AMOUNT', 'EPISODE_ADJUSTMENTS', 'EPISODE_EARNED_AMOUNT', 'EPISODE_UNEARNED_AMOUNT', 'SCHEDULE_ACTIVE', 'COMPLETED_VISITS', 'TOTAL_VISITS' , 'TOTAL_BILLABLE_HHA_VISITS' ] max_date = pd.to_datetime(episodicdata['EPISODE_END_DATE']).max() today = dt.now().date() sixtydaysprior = today sixtydaysprior += datetime.timedelta(days=-60) #min_date = pd.to_datetime(episodicdata['EPISODE_END_DATE']).min() children = html.Div([ # block on the right ddk.Block( width=100, children=[ ddk.Row([ ddk.Block( children=[ ddk.ControlCard( orientation='horizontal', width = 100, children=[ ddk.ControlItem( dcc.Dropdown( options=gl_ins_code_arr, multi=True, placeholder="Select", id="vp-ins-code-selector", # value=["Not Yet Started", "Saved"], style = { 'fontSize': 12, 'font-family': 'sans-serif', } ), width = 10, label='Billing Code', style={ 'fontSize': 12, 'font-family': 'sans-serif', } ), ddk.ControlItem( dcc.Dropdown( options=gl_patient_arr, multi=True, placeholder="Select", id="vp-patient-selector", style = { 'fontSize': 12, 'font-family': 'sans-serif', } ), width=10, label='Patient', label_text_alignment='center', style={ 'fontSize': 12, 'font-family': 'sans-serif', } ), ddk.ControlItem( dcc.Dropdown( options=gl_mrn_arr, multi=True, placeholder="Select", id="vp-mrn-selector", style={ 'fontSize': 12, 'font-family': 'sans-serif', } ), width =10, label='MRN', label_text_alignment='center', style={ 'fontSize': 12, 'font-family': 'sans-serif', } ), ddk.ControlItem( dcc.Dropdown( options=gl_patient_status_arr, id="vp-patient-status-selector", multi=True, placeholder="Select", value=['Active'], style={ 'fontSize': 12, 'font-family': 'sans-serif', } ), width = 10, label = 'Patient Status', label_text_alignment='center', style={ 'fontSize': 12, 'font-family': 'sans-serif', } ), ddk.ControlItem( dcc.Slider( id='vp-margin-slider', min=-50, max=100, step=10, marks={-50: '-50', -40: '-40', -20: '-20', -10: '-10', 0: '0', 10: '10', 20: '20', 40: '40', 60: '60', 80: '80', 100: '100', }, value=20, ), width = 20, label='Margin (%)', label_text_alignment='center', style={ 'fontSize': 12, 'font-family': 'sans-serif', } ), ddk.ControlItem( dcc.Dropdown( options=gl_pcc_arr, multi=True, placeholder="select", id="vp-case-manager-selector", style={ 'fontSize': 12, 'font-family': 'sans-serif', } ), width=10, label='Case Manager', label_text_alignment= 'center', style={ 'fontSize': 12, 'font-family': 'sans-serif', } ), ddk.ControlItem( dcc.DatePickerRange( id="vp-episode-picker", min_date_allowed=pd.to_datetime(episodicdata['EPISODE_START_DATE'].min() ), max_date_allowed=max_date, initial_visible_month=max_date, start_date=sixtydaysprior, end_date=max_date ), width = 20, label='Episode Range', label_text_alignment='center', style={ 'fontSize': 12, 'font-family': 'sans-serif', } ), ddk.ControlItem( dcc.Dropdown( options=gl_lupa_risk_arr, multi=True, placeholder="select", id="vp-lupa-risk-selector", style={ 'fontSize': 12, 'font-family': 'sans-serif', } ), width=10, label='LUPA RISK', label_text_alignment='center', style={ 'fontSize': 12, 'font-family': 'sans-serif', } ), ], ) ] ), ]), ddk.Row([ ddk.Card( children=[ ddk.CardHeader( title="VISIT PLANNING", children=[ html.Div( [ ddk.Modal( id="vp-modal-btn-outer", children=[ html.Button( id="vp-expand-modal", n_clicks=0, children="Take action", ) ], target_id="vp-modal-content", hide_target=True, style={"float": "right"}, ), ddk.Block( id="vp-modal-content", children=html.Div(id="vp-modal-div"), style={ "width": "50%", "margin": "auto", "overflow": "scroll", }, ), ddk.DataCard( id='vp_episodic_selected_count', value=currentepisodic.shape[0], label='Episodic Selected Count', style={ 'fontSize': 12, 'font-family': 'sans-serif', } ), ] ), ], ), ddk.Block( dcc.Tabs(id='tabs-example', value='tab-1', children=[ dcc.Tab(label='EPISODIC', children=[generate_table_layout(episodicdata, "","vp_episodic-table", "MRN", remove_cols)] ), dcc.Tab(label='PERVISIT', children=[generate_table_layout(pervisitdata, "","vp_pervisit-table", "MRN", remove_cols)]), ] ), ) ] ), ]), ] ) ]) return children
def cards_items(): serverBD1 = pd.read_csv(main_path_data + '\\live.csv') serverBD = pd.read_csv(main_path_data + '\\server.csv') cards = [] # print('serverBD1', serverBD1) for ind in serverBD1.index: if serverBD1['T1gold'][ind] == "r" or serverBD1['T1gold'][ind] == 'd': T1gold = dbc.Row(style={'margin':'0','justify-content': 'center', # 'width': 'fit-content', 'padding':'0'}, children=[ dbc.Col(width=80, style={'margin': '0', 'padding': '0', 'width': '80%',}, children=html.H6("", style={'color': '#ff0000', 'font-weight': '900', # 'width': 'fit-content', 'padding': '0px', 'margin': '0', 'max-height': '-webkit-fill-available', 'vertical-align': '-webkit-baseline-middle'})), dbc.Col(width=20, style={'margin': '0', 'padding': '0','width': '20%', 'max-height': '20px', 'height': '20px'}, children=[])]) else: T1gold = dbc.Row(style={'margin':'0','justify-content': 'center', # 'width': 'fit-content', 'padding':'0'}, children=[ dbc.Col(width=80, style={'margin': '0', 'padding': '0','width': '80%',}, children=html.H6(serverBD1['T1gold'][ind], style={'color': '#ff0000', 'font-weight': '900', # 'width': 'fit-content', 'padding': '0px', 'margin': '0', 'max-height': '-webkit-fill-available', 'vertical-align': '-webkit-baseline-middle'})), dbc.Col(width=20, style={'margin': '0', 'padding': '0','width': '20%', 'max-height': '20px', 'height': '20px'}, children=ddk.Logo( src='../assets/png/gold.png', style={'text-align': 'center', 'max-height': '-webkit-fill-available', 'padding': '0px', 'margin': '0', 'vertical-align': '-webkit-baseline-middle'}))]) if serverBD1['T2gold'][ind] == "r" or serverBD1['T2gold'][ind] == 'd': T2gold = dbc.Row(style={'margin':'0','justify-content': 'center', # 'width': 'fit-content', 'padding':'0'}, children=[ dbc.Col(width=20, style={'margin': '0', 'padding': '0', 'max-height': '20px','width': '20%', 'height': '20px'}, children=[]), dbc.Col(width=80, style={'margin': '0', 'padding': '0', 'width': '80%',}, children=html.H6("", style={'color': '#ff0000', 'font-weight': '900', # 'width': 'fit-content', 'padding': '0px', 'margin': '0', 'max-height': '-webkit-fill-available', 'vertical-align': '-webkit-baseline-middle'})), ]) else: T2gold = dbc.Row(style={'margin':'0','justify-content': 'center', 'width': '100%', 'padding':'0'}, children=[ dbc.Col(width=20, style={'margin': '0', 'padding': '0', 'max-height': '20px','width': '20%', 'height': '20px'}, children=ddk.Logo( src='../assets/png/gold.png', style={'text-align': 'center', 'max-height': '-webkit-fill-available', 'padding': '0px', 'margin': '0', 'vertical-align': '-webkit-baseline-middle'})), dbc.Col(width=80, style={'margin': '0', 'padding': '0', 'width': '80%',}, children=html.H6(serverBD1['T2gold'][ind], style={'color': '#ff0000', 'font-weight': '900', # 'width': 'fit-content', 'padding': '0px', 'margin': '0', 'max-height': '-webkit-fill-available', 'vertical-align': '-webkit-baseline-middle'})), ]) T1 = dbc.Col(style={'margin':'0','justify-content': 'center', # 'width': '100%', 'padding':'0'}, children=[ dbc.Row( # width=100, style={'margin':'0','justify-content': 'center', # 'width': '100%', 'padding':'0'}, children=html.H6(serverBD1['T1names_live'][ind], style={'color': 'azure', # 'width': 'fit-content', 'padding': '0px', 'margin': '0', 'max-height': '-webkit-fill-available', 'vertical-align': '-webkit-baseline-middle'})), T1gold # dbc.Row( # # width=100, # style={'margin': '0', 'width': '100%','padding': '0'}, # children=T1gold) ]) T2 = dbc.Col(style={'margin':'0','justify-content': 'center', # 'width': 'fit-content', 'padding':'0'}, children=[ dbc.Row( # width=100, style={'margin': '0', 'width': '100%','justify-content': 'center', 'padding': '0'}, children=html.H6(serverBD1['T2names_live'][ind], style={'color': 'azure', 'padding': '0px', 'margin': '0', 'max-height': '-webkit-fill-available', 'vertical-align': '-webkit-baseline-middle'})), T2gold # dbc.Row( # # width=100, # style={'margin': '0', # 'width': '100%', # 'padding': '0'}, # children=T2gold), ]) cards_items1=dbc.ListGroupItem( id={'type': 'live-cards-item', 'index': str(serverBD1['match_id_live'][ind])}, href='/{}'.format(str(serverBD1['match_id_live'][ind])), style={'line-height': '1', 'margin': '0', 'margin-right': '0', 'height': 'fit-content', 'justify-content': 'center', 'vertical-align': '-webkit-baseline-middle', 'max-height': '60px', 'padding': '0px', 'align-items': 'center'}, color="default", className='live_list', action=True, children=[ dbc.Row(style={'max-height': '60px', "flex-direction": "row", # 'overflow-y': 'hidden', 'height': '100%', 'padding': '0px', # "width": 'fit-content', 'align-items': 'center', # 'justify-content': 'flex-start', 'justify-content': 'center', # 'margin': '0', 'vertical-align': '-webkit-baseline-middle', 'textAlign': 'center', # 'margin-left': '0', # 'margin-right': '0' }, children=[ dbc.Col(width=30, style={'width': '30%', 'padding': '0', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center', 'margin-left': '0', 'margin-right': '0'}, children=dbc.Row( [ dbc.Col(width=40, style={ 'max-height': '40px', 'height': '40px', # 'background-image': 'url(/assets/png/fon2.png)', # 'background-repeat': 'no-repeat', # 'background-position': 'center', # 'background-size': 'auto 90%', 'width': '40%', 'padding': '0px', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center'}, children=ddk.Logo( src=serverBD1['T1logos_live'][ind], style={'text-align': 'center', 'max-height': '-webkit-fill-available', 'padding': '0px', 'margin': '0', 'vertical-align': '-webkit-baseline-middle'})), dbc.Col(width=60, style={ 'width': '60%', 'padding': '0px', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center'}, children=T1)])), dbc.Col(width=20, style={'min-width': 'fit-content', 'width': '20%', 'max-height': 'fit-content', 'padding': '0px', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center', 'margin-left': '10px', 'margin-right': '10px'}, children=[html.H1("{} : {}".format(serverBD1['T1_live_score1'][ind], serverBD1['T2_live_score1'][ind]), style={'height': '100%', 'margin-top': '10px', # 'margin': '0', 'margin-bottom': '0px', 'color': '#3dea04', 'padding':'0', 'max-height': 'fit-content', 'width':'100%', 'vertical-align': '-webkit-baseline-middle'}), html.P("{} - {}".format(serverBD1['T1_live_score2'][ind], serverBD1['T2_live_score2'][ind]), style={'height': '100%', 'color': 'gold', 'padding': '0', 'max-height': 'fit-content', 'margin-bottom': '10px', 'margin-top': '0px', 'width': '100%','font-size': '10px', 'vertical-align': '-webkit-baseline-middle'}) ]), dbc.Col(width=30, style={ 'width': '30%', 'padding': '0', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center', # 'width':'fit-content', 'margin-left': '0', 'margin-right': '0'}, children=dbc.Row( [ dbc.Col(width=60, style={'width': '60%', # 'overflowX': 'hidden', 'padding': '0px', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center'}, children=T2), dbc.Col(width=40, style={ 'max-height': '40px', 'height': '40px', 'width': '40%', 'padding': '0px', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center'}, children=ddk.Logo(src=serverBD1['T2logos_live'][ind], style={'text-align': 'center', # 'background-image': 'url(/assets/png/fon2.png)', # 'background-repeat': 'no-repeat', # 'background-position': 'center', # 'background-size': 'auto 90%', 'max-height': '-webkit-fill-available', 'padding': '0px', 'margin': '0', 'vertical-align': '-webkit-baseline-middle'}))])), # ]) ])]) cards.append(cards_items1) for ind in serverBD.index: cards_items=dbc.ListGroupItem( id={'type': 'dynamic-cards-item', 'index': str(serverBD['match_id'][ind])}, href='/{}'.format(str(serverBD['match_id'][ind])), style={'line-height': '1', 'margin': '0', 'margin-right': '0', 'height': 'fit-content', 'justify-content': 'center', 'vertical-align': '-webkit-baseline-middle', 'max-height': 'fit-content', 'padding': '0px', 'align-items': 'center'}, color="default", action=True, children=[ dbc.Row(style={'max-height': '50px', 'overflow-y':'hidden', 'height': '100%', 'padding': '0px', # "width": '100%', 'align-items': 'center', # 'justify-content': 'flex-start', 'justify-content': 'center', 'margin': '0', 'vertical-align': '-webkit-baseline-middle', 'textAlign': 'center', 'margin-left': '0', 'margin-right': '0'}, children=[ dbc.Col(width=30, style={ 'padding': '0', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center', "width": '30%', 'margin-left': '0', 'margin-right': '0'}, children=dbc.Row([ dbc.Col(width=40, style={ 'max-height': '40px', 'height': '40px', # 'background-image': 'url(/assets/png/fon2.png)', # 'background-repeat': 'no-repeat', # 'background-position': 'center', # 'background-size': 'auto 90%', # 'background-size': 'cover', "width": '40%', 'padding': '0px', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center'}, children=ddk.Logo( src=serverBD['T1logos'][ind], style={'text-align': 'center', 'max-height': '-webkit-fill-available', 'padding': '0px', 'margin': '0', 'vertical-align': '-webkit-baseline-middle'})), dbc.Col(width=60, style={"width": '60%', # 'overflowX': 'hidden', 'padding': '0px', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center'}, children=html.H6(serverBD['T1names'][ind], style={'color':'azure', # 'width': 'fit-content', 'padding': '0px', 'margin': '0', 'max-height': '-webkit-fill-available', 'vertical-align': '-webkit-baseline-middle'}))])), dbc.Col(width=20, style={'min-width': 'fit-content', "width": '20%', 'max-height': 'fit-content', 'padding': '0px', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center', 'margin-left': '10px', 'margin-right': '10px'}, children=[html.H6(serverBD['Mtime'][ind][:-3], style={'height': '100%', 'color': 'azure', 'padding':'0', 'max-height': 'fit-content', 'vertical-align': '-webkit-baseline-middle'})]), dbc.Col(width=30, style={ "width": '30%', 'padding': '0', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center', # 'width':'fit-content', 'margin-left': '0', 'margin-right': '0'}, children=dbc.Row([ dbc.Col(width=60, style={"width": '60%', # 'overflowX': 'hidden', 'padding': '0px', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center'}, children=html.H6(serverBD['T2names'][ind], style={'color':'azure', # 'width': 'fit-content', 'padding': '0px', 'margin': '0', 'max-height': '-webkit-fill-available', 'vertical-align': '-webkit-baseline-middle'})), dbc.Col(width=40, style={"width": '40%', 'max-height': '40px', 'height': '40px', # 'width': 'fit-content', 'padding': '0px', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center'}, children=ddk.Logo(src=serverBD['T2logos'][ind], style={'text-align': 'center', # 'background-image': 'url(/assets/png/fon2.png)', # 'background-repeat': 'no-repeat', # 'background-position': 'center', # 'background-size': 'auto 90%', 'max-height': '-webkit-fill-available', 'padding': '0px', 'margin': '0', 'vertical-align': '-webkit-baseline-middle'}))])), # dbc.Col( # # width=50, # style={'max-width': '200px', # 'max-height': 'fit-content', # 'padding': '0px', 'vertical-align': '-webkit-baseline-middle', # 'align-items': 'center', 'justify-content': 'center', # 'margin': '0', 'textAlign': 'center', # # 'margin-left': '10px', 'margin-right': '10px' # }, # children=html.H6(serverBD['Mtour'][ind], # style={'height': '100%','color':'azure', # 'max-height': 'fit-content', # 'max-width': '200px', # 'overflow-x':'hidden', # 'margin': '0', # 'vertical-align': '-webkit-baseline-middle'})), ])]) cards.append(cards_items) empty_card=dbc.ListGroupItem( style={'line-height': '1', 'margin': '0', 'margin-right': '0', 'height': 'fit-content', 'justify-content': 'center', 'vertical-align': '-webkit-baseline-middle', 'max-height': '50px', 'padding': '0px', 'align-items': 'center'}, color="default", action=True, children=[ ddk.Block(style={'max-height': '50px', 'overflow-y':'hidden', 'height': '50px', 'padding': '0px', "width": '100%', 'align-items': 'center', # 'justify-content': 'flex-start', 'justify-content': 'center', 'margin': '0', 'vertical-align': '-webkit-baseline-middle', 'textAlign': 'center', 'margin-left': '0', 'margin-right': '0'}, children=[ dbc.Col(width=30, style={ 'padding': '0', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center', 'height': '40px', # 'width':'fit-content', 'margin-left': '0', 'margin-right': '0'}, children=[ dbc.Col(width=40, style={ 'max-height': '40px', 'height': '40px', # 'background-image': 'url(/assets/png/fon2.png)', # 'background-repeat': 'no-repeat', # 'background-position': 'center', # 'background-size': 'auto 90%', # 'background-size': 'cover', # 'width': 'fit-content', 'padding': '0px', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center'}, children=ddk.Logo( src='', style={'text-align': 'center', 'max-height': '-webkit-fill-available', 'padding': '0px', 'margin': '0', 'vertical-align': '-webkit-baseline-middle'})), dbc.Col(width=60, style={'height': '40px', # 'overflowX': 'hidden', 'padding': '0px', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center'}, children=html.H6('', style={'color':'azure', # 'width': 'fit-content', 'padding': '0px', 'margin': '0', 'max-height': '-webkit-fill-available', 'vertical-align': '-webkit-baseline-middle'}))]), dbc.Col(width=20, style={'max-width': 'fit-content', 'max-height': '50px', 'height': '50px', 'padding': '0px', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center', 'margin-left': '10px', 'margin-right': '10px'}, children=[html.H6('', style={'height': '100%', 'color': 'azure', 'padding':'0', 'max-height': 'fit-content', 'vertical-align': '-webkit-baseline-middle'})]), dbc.Col(width=30, style={ 'padding': '0', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center', # 'width':'fit-content', 'margin-left': '0', 'margin-right': '0'}, children=[ dbc.Col(width=60, style={ # 'overflowX': 'hidden', 'height': '50px', 'padding': '0px', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center'}, children=html.H6('', style={'color':'azure', # 'width': 'fit-content', 'padding': '0px', 'margin': '0', 'max-height': '-webkit-fill-available', 'vertical-align': '-webkit-baseline-middle'})), dbc.Col(width=40, style={ 'max-height': '50px', 'height': '50px', # 'width': 'fit-content', 'padding': '0px', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center'}, children=ddk.Logo(src='', style={'text-align': 'center', # 'background-image': 'url(/assets/png/fon2.png)', # 'background-repeat': 'no-repeat', # 'background-position': 'center', # 'background-size': 'auto 90%', 'max-height': '-webkit-fill-available', 'padding': '0px', 'margin': '0', 'vertical-align': '-webkit-baseline-middle'}))]), dbc.Col( # width=50, style={'max-width': '200px', 'max-height': '50px', 'padding': '0px', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center', # 'margin-left': '10px', 'margin-right': '10px' }, children=html.H6('', style={'height': '50px','color':'azure', 'max-height': '50px', 'max-width': '200px', 'overflow-x':'hidden', 'margin': '0', 'vertical-align': '-webkit-baseline-middle'})), ])]) cards.append(empty_card) return cards
def layout(): # load data for display authorizations_data = chart_utils.get_loaded_data("VW_AUTHORIZATIONS", "DATASET") patient_status_arr = chart_utils.get_options(authorizations_data, "PATIENTSTATUS") discipline_arr = chart_utils.get_options(authorizations_data, "DISCIPLINE") auth_type_arr = chart_utils.get_options(authorizations_data, "AUTHORIZATION_TYPE") payer_arr = chart_utils.get_options(authorizations_data, "PAYER") patient_arr = chart_utils.get_options(authorizations_data, "PATIENT") remove_cols = ['BRANCH','COLUMN_MAPPING', 'COLUMN_PARAMETERS' ] max_date = datetime.now() #pending_df = authorizations_data.loc[authorizations_data["DATA_SOURCE_ARRAY"].str.contains(r'authsPENDINGMDS', na=True)] #history_df = authorizations_data.loc[authorizations_data["DATA_SOURCE_ARRAY"].str.contains(r'authsHISTORY', na=True)] #tbs_df = authorizations_data.loc[ authorizations_data["DATA_SOURCE_ARRAY"].str.contains(r'authsTOBESENT', na=True)] children = html.Div( [ ddk.Row( [ ddk.DataCard( id='auths_patient_status_count', value=12 ,#tbs_df.shape[0], label = 'Patient Status Count' ), ddk.DataCard( id='auths_auth_type_count', value=13,#pending_df.shape[0] , label='Authorization Type Count' ), ddk.DataCard( id='auths_total_count', value=authorizations_data.shape[0] , label='Total Authorizations' ), ] ), ddk.Row( [ ddk.ControlCard( [ html.Details( [ html.Summary("About this app"), html.P( """Select attributes to fine tune graphs and tables.""" ), ] ), ddk.ControlItem( dcc.Dropdown( options=auth_type_arr, multi=True, placeholder="Select Authorization Type", id="auths-auth-type-selector" # value=["Not Yet Started", "Saved"], ) ), ddk.ControlItem( dcc.Dropdown( options=discipline_arr, multi=True, placeholder="Select Discipline", id="auths-discipline-selector" # value=["Not Yet Started", "Saved"], ) ), ddk.ControlItem( dcc.Dropdown( options=patient_arr, multi=True, placeholder="Select Patient", id="auths-patient-selector" # value=["Not Yet Started", "Saved"], ) ), ddk.ControlItem( dcc.Dropdown( options=patient_status_arr, multi=True, placeholder="Select Discipline", id="auths-patientstatus-selector" # value=["Not Yet Started", "Saved"], ) ), ddk.ControlItem( dcc.Dropdown( options=payer_arr, multi=True, placeholder="Select Payer", id="auths-payer-selector" # value=["Not Yet Started", "Saved"], ) ), ddk.ControlItem( dcc.DatePickerRange( id="auths-date-picker", min_date_allowed=pd.to_datetime( authorizations_data["START_DATE"].min() ), max_date_allowed=max_date, initial_visible_month=max_date, start_date=max_date - timedelta(days=700), end_date=max_date +timedelta(days=700), ), ), ddk.ControlItem( html.Button( id="auths-select-all-rows", children="Select all matching records", style={"margin": "auto"}, n_clicks=0, ) ), ], width=25, style={"overflow": "scroll"}, ), ddk.Card( width=75, children=[ ddk.CardHeader( children=[ html.Div( "Combined auths View", style={"float": "left"}, ), ] ), ddk.Block( ddk.DataTable( columns=[ {"name": i.replace("_", " ").title(), "id": i} for i in authorizations_data.columns if (i not in remove_cols) ], data=authorizations_data.sort_values(by="START_DATE").to_dict("records"), filter_action="native", page_action="native", page_size=50, row_selectable="multi", id="auths-history-data-table", style_cell={'fontSize': 12, 'font-family': 'sans-serif'}, style_table = {'overflowX': 'auto'}, ), style={"overflow": "scroll"} ), ] ), ] ), ] ) return children
'a': [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3], 'b': [4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6], 'x': [2, 3, 4, 5, 2.2, 3.1, 4.1, 5.1, 1.5, 2.5, 3.5, 4.5], 'y': [1, 1.4, 1.6, 1.75, 2, 2.5, 2.7, 2.75, 3, 3.5, 3.7, 3.75], }]] return html.Div([ ddk.Card(width=25, children=[ ddk.CardHeader(title=data[0]['type']), ddk.Graph(id='graph-{}'.format(i), figure={ 'data': data, 'layout': { 'title': 'Hello World', } }) ]) for (i, data) in enumerate(datas) ]) layout = html.Div([Graphs()] + [ html.Div(className='container', children=[ddk.Block(example, width=33) for example in suite()]) for suite in [ Dropdowns, Sliders, DatePickerSingles, DatePickerRanges, TextInputs, Checkboxes, RadioItems, Buttons, Text, Tables ] ])
def layout(): # load data for display orders_history_data = chart_utils.get_loaded_data("VIEW_ORDERSHISTORY", "DATASET") orders_pending_mds_data = chart_utils.get_loaded_data("VIEW_ORDERSMANAGEMENT_ORDERSPENDINGMDS", "DATASET") orders_tobe_sent_data = chart_utils.get_loaded_data("VIEW_ORDERSTOBESENT", "DATASET") max_date = datetime.now() order_number_data = pd.concat( [orders_history_data["ORDER_NUMBER"], orders_pending_mds_data["ORDER_NUMBER"], orders_tobe_sent_data["ORDER_NUMBER"]]) physician_data = pd.concat( [orders_history_data["PHYSICIAN"], orders_pending_mds_data["PHYSICIAN"], orders_tobe_sent_data["PHYSICIAN"]]) ordertype_data = pd.concat( [orders_history_data["TYPE"], orders_pending_mds_data["TYPE"], orders_tobe_sent_data["TYPE"]]) patient_data = pd.concat( [orders_history_data["PATIENT"], orders_pending_mds_data["PATIENT"], orders_tobe_sent_data["PATIENT"]]) children = html.Div( [ ddk.Row( [ ddk.DataCard( id='orders_tobe_sent_count', value=orders_tobe_sent_data.shape[0], label = 'To Be Sent' ), ddk.DataCard( id='orders_pending_mds_count', value=orders_pending_mds_data.shape[0] , label='Pending MD Signature' ), ddk.DataCard( id='orders_history_count', value=orders_history_data.shape[0] , label='Total Orders' ), ] ), ddk.Row( [ ddk.ControlCard( [ html.Details( [ html.Summary("About this app"), html.P( """Select attributes to fine tune graphs and tables.""" ), ] ), ddk.ControlItem( dcc.Dropdown( options=[ {"label": orderstype, "value": orderstype} for orderstype in sorted( [ orderstype for orderstype in ordertype_data.unique() if orderstype ] ) ], multi=True, placeholder="Select Type", id="orders-type-selector" # value=["Not Yet Started", "Saved"], ) ), ddk.ControlItem( dcc.Dropdown( options=[ {"label": physician, "value": physician} for physician in sorted( [ physician for physician in physician_data.unique() if physician ] ) ], multi=True, placeholder="Select Physician", id="orders-physician-selector" # value=["Not Yet Started", "Saved"], ) ), ddk.ControlItem( dcc.Dropdown( options=[ {"label": patient, "value": patient} for patient in sorted( [ patient for patient in patient_data.unique() if patient ] ) ], multi=True, placeholder="Select Patient", id="orders-patient-selector" # value=["Not Yet Started", "Saved"], ) ), ddk.ControlItem( dcc.DatePickerRange( id="order-date-picker", min_date_allowed=pd.to_datetime( orders_history_data["ORDER_DATE"].min() ), max_date_allowed=max_date, initial_visible_month=max_date, start_date=max_date - timedelta(days=30), end_date=max_date, ), ), ddk.ControlItem( html.Button( id="orders_tob_esent-select-all-rows", children="Select all matching records", style={"margin": "auto"}, n_clicks=0, ) ), ], width=30, style={"overflow": "scroll"}, ), ddk.Card( children=[ ddk.CardHeader( children=[ html.Div( "Table of selected tasks", style={"float": "left"}, ), ] ), ddk.Block( ddk.DataTable( columns=[ {"name": i.replace("_", " ").title(), "id": i} for i in orders_history_data.columns if (i != 'BRANCH') ], data=orders_history_data.sort_values(by="PHYSICIAN").to_dict("records"), filter_action="native", page_action="native", page_size=50, row_selectable="multi", id="orders-history-data-table", style_cell={'fontSize': 12, 'font-family': 'sans-serif'} ), style={"overflow": "scroll"} ), ] ), ] ), ] ) return children
def layout(): # load data for display episodesummdata = chart_utils.get_loaded_data( "AXXESS_API.RAW.VW_ALLPAYOR_EPISODE_BILLING_TIMELYFILING", "DATASET") #reorder the columns new_order = [ 'INSURANCE_CODE', 'INITIAL_TIMELY_FILING', 'MRN', 'PATIENT', 'PATIENT_STATUS', 'EPISODE_START_DATE', 'EPISODE_END_DATE', 'INSURANCE', 'AUTH_REQUIRED', 'EPISODE_UNEARNED_AMOUNT', 'EPISODE_EARNED_AMOUNT', 'EPISODE_BILLED_AMOUNT', 'EPISODE_ADJUSTMENTS', 'ORDERS_DETAILS', 'PHYSICIAN_NAME', 'PHYSICIAN_PHONE', 'PHYSICIAN_FACSIMILE', 'Auth #|Auth type|Range|Discipline|Authorized|Used|Unused|Units|' ] episodesummdata = episodesummdata[new_order] claimsdetailsdata = chart_utils.get_loaded_data( "AXXESS_API.RAW.VW_ALLPAYOR_BILLING_CLAIMS_DETAILS", "DATASET") # print(episodesummdata.columns) # print(claimsdetailsdata.columns) gl_mrn_arr = chart_utils.get_options(episodesummdata, "MRN") gl_ins_code_arr = chart_utils.get_options(episodesummdata, "INSURANCE_CODE") gl_auth_reqd_arr = chart_utils.get_options(episodesummdata, "AUTH_REQUIRED") gl_patient_status_arr = chart_utils.get_options(episodesummdata, "PATIENT_STATUS") remove_cols = ['BRANCH', 'COLUMN_MAPPING', 'COLUMN_PARAMETERS'] max_date = pd.to_datetime(episodesummdata['EPISODE_END_DATE']).max() min_date = pd.to_datetime(episodesummdata['EPISODE_END_DATE']).min() children = html.Div([ # block on the right ddk.Block( width=100, children=[ ddk.Row([ ddk.Block(children=[ ddk.ControlCard( orientation='horizontal', width=100, children=[ html.Details([ html.Summary("Filter here"), html. P("""Select attributes to fine tune tables.""" ), ]), ddk.ControlItem( dcc.Dropdown( options=gl_ins_code_arr, multi=True, placeholder="Select Ins code", id="billing-ins-code-selector" # value=["Not Yet Started", "Saved"], )), ddk.ControlItem( dcc.Dropdown( options=gl_auth_reqd_arr, multi=True, placeholder="Select Auth Reqd Status", id="billing-auth-reqd-selector" # value=["Not Yet Started", "Saved"], )), ddk.ControlItem( dcc.Dropdown( options=gl_mrn_arr, multi=True, placeholder="Select MRN", id="billing-mrn-selector" # value=["Not Yet Started", "Saved"], )), ddk.ControlItem( dcc.DatePickerRange( id="billing-episode-picker", min_date_allowed=pd.to_datetime( episodesummdata[ 'EPISODE_START_DATE'].min()), max_date_allowed=max_date, initial_visible_month=max_date, start_date=min_date, end_date=max_date), ), ddk.ControlItem( html.Button( id="billing-select-all-rows", children="Select all matching records", style={"margin": "auto"}, n_clicks=0, )), ], ) ]), ]), ddk.Row([ ddk.Block(children=[ generate_table_layout( episodesummdata, "ALL PAYOR EPISODES", "all_payor_episodes-table", "MRN", remove_cols) ]) ]), ddk.Row([ ddk.Block(children=[ generate_table_layout( claimsdetailsdata, "CLAIMS DETAILS", "claims_details-table", "MRN", remove_cols) ]) ]), ]) ]) return children
app = dash.Dash(__name__) server = app.server app.title = "AKDEL" app.layout = ddk.App(children=[ ddk.Block( ddk.ControlCard( width=100, rounded=True, children=[ ddk.ControlItem(children=[ dcc.Dropdown( id="dropdown", options=iex.companies, value="AAPL"), ddk.ControlItem(width=50, children=[ dcc.DatePickerRange( id="datepicker", start_date="2015-01-01", end_date="2016-01-01", display_format="YYYY-MM-DD") ]) ]) ], )), ddk.Block(children=[ ddk.DataCard(id="dc1", width=25, label="Dividend Yield", value="-"), ddk.DataCard(id="dc2", width=25, label="Peg Ratio", value="-"), ddk.DataCard(id="dc3", width=25, label="Beta", value="%"), ddk.DataCard(id="dc4", width=25, label="Country", value="-"), ]),
def live(): liveBD = pd.read_csv(main_path_data + "\\live.csv") live_items = [] for ind in liveBD.index: ########################## TOP 3 LIVE ################################### top3_live = html.A( href='/{}'.format(str(liveBD['match_id_live'][ind])), children=[ ddk.Card( width=50, rounded=10, card_hover=True, style={ 'max-height': 'fit-content', 'height': '70px', 'padding': '0px', 'display': 'inline-block', # "width": '100%', 'background-color': '#163d47', "opacity": "0.8", 'align-items': 'center', # 'justify-content': 'flex-start', 'justify-content': 'center', 'margin': '5px', 'vertical-align': '-webkit-baseline-middle', 'textAlign': 'center', # 'margin-left': '0', # 'margin-right': '0' }, children=ddk.Block( style={ 'width': '-webkit-fill-available', 'max-width': '-webkit-fill-available', 'vertical-align': '-webkit-baseline-middle', 'margin': '0', 'padding': '0px', }, children=[ ddk.Block( width=40, style={ 'height': '-webkit-fill-available', 'padding': '0', # 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center', # 'width':'100%', 'margin-left': '0', 'margin-right': '0' }, children=[ ddk.Block( width=40, style={ 'max-height': '80px', 'height': '80px', # 'background-image': 'url(/assets/png/fon2.png)', # 'background-repeat': 'no-repeat', # 'background-position': 'center', # 'background-size': 'auto', # 'background-size': 'cover', # 'width': 'fit-content', 'padding': '0px', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center' }, children=ddk.Logo( src=liveBD['T1logos_live'][ind], style={ 'text-align': 'left', # 'width':'100%', 'height': '80px', 'max-height': '80px', 'padding': '0px', 'margin': '0', 'vertical-align': '-webkit-baseline-middle' })), ddk.Block( width=60, style={ # 'overflowX': 'hidden', 'padding': '0px', # 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center' }, children=[ html.H6( liveBD['T1names_live'][ind], style={ 'color': 'azure', # 'width': 'fit-content', 'padding': '0px', 'margin': '0', 'width': '100%', # 'max-height': '-webkit-fill-available', 'vertical-align': '-webkit-baseline-middle' }), html.H1( liveBD['T1_live_score1'][ind], style={ 'color': 'azure', # 'width': 'fit-content', 'padding': '0px', "opacity": "1.2", "margin-top": "10px", 'width': '100%', # 'margin': '0', 'font-weight': "900", # 'max-height': '-webkit-fill-available', 'vertical-align': '-webkit-baseline-middle' }) ]) ]), ddk.Block( width=6, style={ 'max-width': 'fit-content', 'max-height': 'fit-content', 'padding': '0px', # 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center', 'margin-left': '10px', 'margin-right': '10px' }, children=[ html.H2( "VS", style={ 'height': '100%', 'color': 'azure', 'padding': '0', 'max-height': 'fit-content', 'width': 'fit-content', "margin-top": "10px" # 'vertical-align': '-webkit-baseline-middle' }) ]), ddk.Block( width=40, style={ 'height': '-webkit-fill-available', 'padding': '0', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center', # 'width':'fit-content', 'margin-left': '0', 'margin-right': '0' }, children=[ ddk.Block( width=60, style={ # 'overflowX': 'hidden', 'padding': '0px', # 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center' }, children=[ html.H6( liveBD['T2names_live'][ind], style={ 'color': 'azure', # 'width': 'fit-content', 'padding': '0px', 'margin': '0', 'width': '100%', # 'max-height': '-webkit-fill-available', 'vertical-align': '-webkit-baseline-middle' }), html.H1( liveBD['T2_live_score1'][ind], style={ 'color': 'azure', # 'width': 'fit-content', "margin-top": "10px", "opacity": "1.2", 'padding': '0px', 'width': '100%', # 'margin': '0', 'font-weight': "900", # 'max-height': '-webkit-fill-available', 'vertical-align': '-webkit-baseline-middle' }) ]), ddk.Block( width=40, style={ 'max-height': '80px', 'height': '80px', # 'background-image': 'url(/assets/png/fon2.png)', # 'background-repeat': 'no-repeat', # 'background-position': 'center', # 'background-size': 'auto', # 'background-size': 'cover', # 'width': 'fit-content', 'padding': '0px', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center' }, children=ddk.Logo( src=liveBD['T2logos_live'][ind], style={ 'text-align': 'center', # 'background-image': 'url(/assets/png/fon2.png)', # 'background-repeat': 'no-repeat', # 'background-position': 'center', # 'background-size': 'auto 130%', # 'width':'100%', 'height': '80px', 'max-height': '80px', 'padding': '0px', 'margin': '0', 'vertical-align': '-webkit-baseline-middle' })) ]), ])) ]) live_items.append(top3_live) return live_items
def generate_table_layout(table_df, title, tableid, sort_cols, remove_cols): children = html.Div( [ ddk.Card( children=[ ddk.CardHeader( children=[ html.Div( title, style={"float": "left"}, ), ] ), ddk.Block( ddk.DataTable( columns=[ {"name": i.replace("_", " ").title(), "id": i} for i in table_df.columns if (i not in remove_cols) ], data=table_df.sort_values(by=sort_cols).to_dict("records"), filter_action="native", sort_action="native", page_action="native", # page_size=10, row_selectable="multi", id=tableid, style_cell={ 'height': 'auto', # all three widths are needed # 'minWidth': '180px', 'width': '180px', 'maxWidth': '180px', 'fontSize': 12, 'font-family': 'sans-serif', 'whiteSpace': 'pre', #'wordBreak': 'break-all', 'textAlign': 'center' }, style_cell_conditional=[ { 'if': {'column_id': c}, 'textAlign': 'left' } for c in ['ORDERS_DETAILS', 'OASIS_DETAILS', 'AUTH #|AUTH TYPE|RANGE|DISCIPLINE|AUTHORIZED|USED|UNUSED|UNITS'] ] + [ { 'if': {'column_id': c}, 'width': '100px', 'textAlign': 'right' } for c in ['1-30 days Disc: T/S/C/M','31-60 days Disc: T/S/C/M', 'Visits Disc: T/S/C/M'] ] + [{'if': {'column_id': 'CONSOLIDATED_COMMENTS'}, 'width': '100px', 'whiteSpace': 'normal', 'textAlign': 'left' }, {'if': {'column_id': 'MRN'}, 'width': '90px', 'whiteSpace': 'normal', 'textAlign': 'center' }, {'if': {'column_id': 'INS_CODE'}, 'width': '40px', 'whiteSpace': 'normal', 'textAlign': 'center' }, {'if': {'column_id': 'PATIENT_STATUS'}, 'width': '60px', 'whiteSpace': 'normal', 'textAlign': 'center' }, {'if': {'column_id': 'INSURANCE'}, 'width': '60px', 'whiteSpace': 'normal', 'textAlign': 'center' }, {'if': {'column_id': 'PATIENT'}, 'width': '60px', 'whiteSpace': 'normal', 'textAlign': 'center' }, {'if': {'column_id': 'EPISODE_START_DATE'}, 'width': '70px', 'whiteSpace': 'normal', 'textAlign': 'center' }, {'if': {'column_id': 'EPISODE_END_DATE'}, 'width': '70px', 'whiteSpace': 'normal', 'textAlign': 'center' }, {'if': {'column_id': 'AUTH_REQUIRED'}, 'width': '45px', 'whiteSpace': 'normal', 'textAlign': 'center' }, {'if': {'column_id': 'EPISODE_UNEARNED_AMOUNT'}, 'width': '70px', 'whiteSpace': 'normal', 'textAlign': 'center' }, {'if': {'column_id': 'EPISODE_EARNED_AMOUNT'}, 'width': '70px', 'whiteSpace': 'normal', 'textAlign': 'center' }, {'if': {'column_id': 'EPISODE_BILLED_AMOUNT'}, 'width': '70px', 'whiteSpace': 'normal', 'textAlign': 'center' }, {'if': {'column_id': 'EPISODE_ADJUSTMENTS'}, 'width': '70px', 'whiteSpace': 'normal', 'textAlign': 'center' }, ], style_data_conditional=[ { 'if': {'row_index': 'odd'}, 'backgroundColor': 'rgb(248, 248, 248)' } ] + [ {'if': {'column_id': 'TOTAL_MARGIN', 'filter_query': '{TOTAL_MARGIN} < 20'}, 'color': 'red'} ], style_header={ 'backgroundColor': 'rgb(230, 230, 230)', 'fontWeight': 'bold', 'whiteSpace': 'normal', 'textAlign': 'center' }, style_table={'overflowX': 'auto', 'overflowY': 'scroll'}, #style_table={'overflowX': 'auto', 'maxHeight': '400px', 'overflowY': 'scroll'}, ), style={"overflow": "scroll"} ), ] ), ] ) return children
def cards_items(): serverBD = pd.read_csv(main_path_data + '\\live.csv') cards = [] for ind in serverBD.index: cards_items = dbc.ListGroupItem( id={ 'type': 'live-cards-item', 'index': str(serverBD['match_id_live'][ind]) }, href='/{}'.format(str(serverBD['match_id_live'][ind])), style={ 'line-height': '1', 'margin': '0', 'margin-right': '0', 'height': 'fit-content', 'justify-content': 'center', 'vertical-align': '-webkit-baseline-middle', 'max-height': '60px', 'padding': '0px', 'align-items': 'center' }, color="default", action=True, children=[ ddk.Block( style={ 'max-height': '60px', 'overflow-y': 'hidden', 'height': '100%', 'padding': '0px', "width": '100%', 'align-items': 'center', # 'justify-content': 'flex-start', 'justify-content': 'center', 'margin': '0', 'vertical-align': '-webkit-baseline-middle', 'textAlign': 'center', 'margin-left': '0', 'margin-right': '0' }, children=[ ddk.Block( width=30, style={ 'padding': '0', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center', # 'width':'fit-content', 'margin-left': '0', 'margin-right': '0' }, children=[ ddk.Block( width=40, style={ 'max-height': '40px', 'height': '40px', 'background-image': 'url(/assets/png/fon2.png)', 'background-repeat': 'no-repeat', 'background-position': 'center', 'background-size': 'auto 90%', # 'background-size': 'cover', # 'width': 'fit-content', 'padding': '0px', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center' }, children=ddk.Logo( src=serverBD['T1logos_live'][ind], style={ 'text-align': 'center', 'max-height': '-webkit-fill-available', 'padding': '0px', 'margin': '0', 'vertical-align': '-webkit-baseline-middle' })), ddk.Block( width=60, style={ # 'overflowX': 'hidden', 'padding': '0px', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center' }, children=html.H6( serverBD['T1names_live'][ind], style={ 'color': 'azure', # 'width': 'fit-content', 'padding': '0px', 'margin': '0', 'max-height': '-webkit-fill-available', 'vertical-align': '-webkit-baseline-middle' })) ]), ddk.Block(width=20, style={ 'max-width': 'fit-content', 'max-height': 'fit-content', 'padding': '0px', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center', 'margin-left': '10px', 'margin-right': '10px' }, children=[ html.H1("{} : {}".format( serverBD['T1_live_score1'][ind], serverBD['T2_live_score1'][ind]), style={ 'height': '100%', 'color': 'azure', 'padding': '0', 'max-height': 'fit-content', 'vertical-align': '-webkit-baseline-middle' }) ]), ddk.Block( width=30, style={ 'padding': '0', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center', # 'width':'fit-content', 'margin-left': '0', 'margin-right': '0' }, children=[ ddk.Block( width=60, style={ # 'overflowX': 'hidden', 'padding': '0px', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center' }, children=html.H6( serverBD['T2names_live'][ind], style={ 'color': 'azure', # 'width': 'fit-content', 'padding': '0px', 'margin': '0', 'max-height': '-webkit-fill-available', 'vertical-align': '-webkit-baseline-middle' })), ddk.Block( width=40, style={ 'max-height': '40px', 'height': '40px', # 'width': 'fit-content', 'padding': '0px', 'vertical-align': '-webkit-baseline-middle', 'align-items': 'center', 'justify-content': 'center', 'margin': '0', 'textAlign': 'center' }, children=ddk.Logo( src=serverBD['T2logos_live'][ind], style={ 'text-align': 'center', 'background-image': 'url(/assets/png/fon2.png)', 'background-repeat': 'no-repeat', 'background-position': 'center', 'background-size': 'auto 90%', 'max-height': '-webkit-fill-available', 'padding': '0px', 'margin': '0', 'vertical-align': '-webkit-baseline-middle' })) ]), # ddk.Block( # # width=50, # style={'max-width': '200px', # 'max-height': 'fit-content', # 'padding': '0px', 'vertical-align': '-webkit-baseline-middle', # 'align-items': 'center', 'justify-content': 'center', # 'margin': '0', 'textAlign': 'center', # # 'margin-left': '10px', 'margin-right': '10px' # }, # children=html.H6(serverBD['Mtour_live'][ind], # style={'height': '100%','color':'azure', # 'max-height': 'fit-content', # 'max-width': '200px', # 'overflow-x':'hidden', # 'margin': '0', # 'vertical-align': '-webkit-baseline-middle'})), ]) ]) cards.append(cards_items) return cards
ddk.Block( # left-hand column width=20, children=[ dcc.Tabs([ dcc.Tab( label='Map Filters', children=[ ddk.ControlCard( id='map-controls', children=[ ddk.CardHeader(title='Search for Funding'), ddk.ControlItem(dcc.Dropdown( id='province-dropdown', options=[{ 'label': i, 'value': i } for i in province_list], multi=True, clearable=False, value=province_list), label='Province'), ddk.ControlItem(dcc.Dropdown( id='naics-dropdown', options=[{ 'label': i, 'value': i } for i in naics_sect_list], multi=True, value=['Manufacturing'], clearable=False, ), label='NAICS Sector'), ddk.ControlItem(dcc.Dropdown( id='year-dropdown', options=[{ 'label': i, 'value': i } for i in year_list], multi=True, clearable=False, value=['2019_20 Only']), label='Year'), ddk.ControlItem( dcc.Dropdown( id='donor-dropdown', options=[{ 'label': i, 'value': i } for i in donor_list], multi= True, # allow for multiple selections value= donor_list, # default value on app load clearable=False, ), label='Donor Program'), ddk.ControlItem( dcc.Input( id='project-input', maxLength=20, multiple=False, placeholder="enter keyword", type="text", disabled=True # DISABLED... for now! ), label='Project Search') ]), # end of map-controls ControlCard ]), # end of map-controls tab dcc.Tab( label='About', children=[ ddk.Card( id='app-description', children=[ ddk.CardHeader( title= 'How can this data be used and what questions can it answer?' ), dcc.Markdown(''' 1. How many companies have received federal funding (how many are new in 2019_20)? 2. What is the total annual federal budget for IRAP funding? 3. What is the National/Local budget for funding? What are the trends from year to year? 4. How is the funding distributed? (Is it based on populations? Industry type? other factors?) 5. How novel is my grant request compared to already funded projects? 6. Which federal program should I apply to? 7. How much funding should I apply for (compared to other similarly sized companies, research opportunities, jurisdictional budget limits)? '''), ddk.CardFooter("Source Information:"), dcc.Link( 'Data Source', href='https://open.canada.ca/', ), html.Br(), dcc.Link( 'Available under open gov. license', href= 'http://open.canada.ca/en/open-government-licence-canada', ), ] ), # end of app-description Card and it's children ]), # end of About tab and it's children ]), # end of dcc.Tabs() and it's children ] # end of left-hand column - children ), # end of left-hand column
dcc.Link('Team 2', href=app.get_relative_path('/')), ]), dcc.Link('Conditions', href=app.get_relative_path('/')), dcc.Link('Historical', href=app.get_relative_path('/')), dcc.Link('Portal', href=app.get_relative_path('/')), ]) app.layout = ddk.App([ ddk.Header([ ddk.Logo(src=app.get_asset_url('logo.png')), ddk.Title(get_configuration()), menu ]), ddk.Block(width=30, children=[ ddk.ControlCard(controls), ddk.ControlCard(controls), ddk.ControlCard(controls), ]), ddk.Block(width=70, children=[ ddk.Row([ ddk.Card(width=50, children=dcc.Markdown( textwrap.dedent(''' Sed ut perspiciatis unde omnis iste natus voluptatem accusantium doloremque laudantium, totam rem aperiam, **expect similar results next week** ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. '''))), ddk.DataCard(value='1.17',
ddk.SectionTitle('', id='final_date'), html.Button('Refresh', style={'float': 'right'}, id='refresh', n_clicks=0), ]), ddk.Block( children=[ dcc.Tabs(id='selected-tab', value='load', children=[ dcc.Tab(label="Load", value='load', children=[ddk.Card(width=100, children=[ dcc.Loading(id='load_loader', children=[ ddk.Graph(id="load_plot", config=graph_config)]), ] ) ] ) ] ), dcc.Tab(label="Profiles", value='profiles', children=[ddk.Card(width=100, children=[ dcc.Loading(id='profile_loader', children=[ ddk.Graph(id="profile_plot", config=graph_config)]) ] ) ] ) ] ), ddk.Card(children=[ ddk.Block(width=6, children= [
'layout': { 'title': 'Hello World', } } ) ]) for (i, data) in enumerate(datas) ]) layout = html.Div( [Graphs()] + [html.Div( className='container', children=[ ddk.Block(example, width=33) for example in suite() ]) for suite in [ Dropdowns, Sliders, DatePickerSingles, DatePickerRanges, TextInputs, Checkboxes, RadioItems, Buttons, Text, Tables ] ] )
def layout(): patient_roster_data = patient_roster_df() patient_roster_data["DOB"] = patient_roster_data["DOB"].astype(str) redis_instance.hset("app-data", "PATIENT_ROSTER", json.dumps(patient_roster_data.to_dict("records"))) data = full_df() data["SCHEDULED_DATE"] = data["SCHEDULED_DATE"].astype(str) redis_instance.hset("app-data", "CENSUS_VISITS_BY_STATUS", json.dumps(data.to_dict("records"))) max_date = datetime.now() children = html.Div( [ ddk.Row( [ ddk.Card(id="patient-roster-chart"), ] ), ddk.Row( [ ddk.ControlCard( [ html.Details( [ html.Summary("About this app"), html.P( """Select attributes to fine tune graphs and tables.""" ), ] ), ddk.ControlItem( dcc.Dropdown( options=[ {"label": status, "value": status} for status in sorted( [ status for status in data["STATUS"].unique() if status ] ) ], multi=True, placeholder="Select Status", id="census-status-selector" #value=["Not Yet Started", "Saved"], ) ), ddk.ControlItem( dcc.Dropdown( options=[ {"label": task, "value": task} for task in sorted( [ task for task in data["TASK"].unique() if task ] ) ], multi=True, placeholder="Select Task", id="census-task-selector" ) ), ddk.ControlItem( dcc.Dropdown( options=[ {"label": task_category, "value": task_category} for task_category in sorted( [ task_category for task_category in data["TASK_CATEGORY"].unique() if task_category ] ) ], multi=True, placeholder="Select Task Category", id="census-task_category-selector" ) ), ddk.ControlItem( dcc.Dropdown( options=[ {"label": clinician, "value": clinician,} for clinician in sorted( [ patient for patient in data[ "ASSIGNED_TO" ].unique() if patient ] ) if clinician ], multi=True, placeholder="Select a Clinician", id="census-clinician-selector", ) ), ddk.ControlItem( dcc.Dropdown( multi=True, placeholder="Select a Patient", id="census-patient-selector", ) ), ddk.ControlItem( dcc.DatePickerRange( id="census-date-picker", min_date_allowed=pd.to_datetime( data["SCHEDULED_DATE"].min() ), max_date_allowed=max_date, initial_visible_month=max_date, start_date=max_date - timedelta(days=30), end_date=max_date, ), ), ddk.ControlItem( html.Button( id="census-select-all-rows", children="Select all matching records", style={"margin": "auto"}, n_clicks=0, ) ), html.Div( [ ddk.Modal( id="census-modal-btn-outer", children=[ html.Button( id="census-expand-modal-2", n_clicks=0, children="Take action", ), ], target_id="census-modal-content", hide_target=True, style={"float": "right"}, ), ], style={"margin": "auto"}, ), ], width=30, style={"overflow": "scroll"}, ), ddk.Card(id="census-time-series"), ] ), #ddk.Row(id="census-pie-charts"), ddk.Card( children=[ ddk.CardHeader( children=[ html.Div( "Table of selected tasks", style={"float": "left"}, ), html.Div( [ ddk.Modal( id="census-modal-btn-outer", children=[ html.Button( id="census-expand-modal", n_clicks=0, children="Take action", ) ], target_id="census-modal-content", hide_target=True, style={"float": "right"}, ), ddk.Block( id="census-modal-content", children=html.Div(id="census-modal-div"), style={ "width": "50%", "margin": "auto", "overflow": "scroll", }, ), ] ), ] ), ddk.Block( ddk.DataTable( columns=[ {"name": i.replace("_", " ").title(), "id": i} for i in data.columns if (i != 'BRANCH') ], filter_action="native", page_action="native", page_size=50, row_selectable="multi", id="census-data-table", style_cell={'fontSize': 12, 'font-family': 'sans-serif'} ), style={"overflow": "scroll"} ), ] ), ] ) return children
children=[ ddk.Header( style={ 'height': '7vh', 'background-color': '#163d47', 'opacity': '1', 'margin': '0' }, children=[ ddk.Logo(src='../assets/logo.gif'), ddk.Block( style={'text-align': 'right'}, children=[ dcc.Link('Главная', style={ 'color': 'azure', 'margin': '10px' }, href='/'), # dcc.Link('Карточка Матча', style={'color': '#fff', 'margin': '10px'}, href='/match_card'), # dcc.Link('МАТЧИ', style={'color': '#fff', 'margin': '10px'}, href='/all_matches') ]) ]), html.Div(id='page-content'), html.Div(id='table-container'), ]) ]) if __name__ == "__main__": # app.run_server(debug=True) app.run(debug=False)
def layout(): # load data for display orders_history_data = chart_utils.get_loaded_data("VW_ORDERS_HISTORY_FULL", "DATASET") remove_cols = ['BRANCH', 'COLUMN_MAPPING', 'COLUMN_PARAMETERS'] type_arr = chart_utils.get_options(orders_history_data, "TYPE") physician_arr = chart_utils.get_options(orders_history_data, "PHYSICIAN") patient_arr = chart_utils.get_options(orders_history_data, "TYPE") remove_cols = ['BRANCH', 'PAYOR', 'INTERNAL_REFERRAL_SOURCE',] max_date = datetime.now() pending_df = orders_history_data.loc[ orders_history_data["DATA_SOURCE_ARRAY"].str.contains(r'ORDERSPENDINGMDS', na=True)] history_df = orders_history_data.loc[ orders_history_data["DATA_SOURCE_ARRAY"].str.contains(r'ORDERSHISTORY', na=True)] tbs_df = orders_history_data.loc[ orders_history_data["DATA_SOURCE_ARRAY"].str.contains(r'ORDERSTOBESENT', na=True)] children = html.Div( [ ddk.Row( [ ddk.DataCard( id='orders_tobe_sent_count', value=tbs_df.shape[0], label = 'To Be Sent' ), ddk.DataCard( id='orders_pending_mds_count', value=pending_df.shape[0] , label='Pending MD Signature' ), ddk.DataCard( id='orders_history_count', value=history_df.shape[0] , label='Total Orders' ), ] ), ddk.Row( [ ddk.ControlCard( [ html.Details( [ html.Summary("About this app"), html.P( """Select attributes to fine tune graphs and tables.""" ), ] ), ddk.ControlItem( dcc.Dropdown( options=type_arr, multi=True, placeholder="Select Type", id="orders-type-selector" # value=["Not Yet Started", "Saved"], ) ), ddk.ControlItem( dcc.Dropdown( options=physician_arr, multi=True, placeholder="Select Physician", id="orders-physician-selector" # value=["Not Yet Started", "Saved"], ) ), ddk.ControlItem( dcc.Dropdown( options=patient_arr, multi=True, placeholder="Select Patient", id="orders-patient-selector" # value=["Not Yet Started", "Saved"], ) ), ddk.ControlItem( dcc.DatePickerRange( id="orders-date-picker", min_date_allowed=pd.to_datetime( orders_history_data["ORDER_DATE"].min() ), max_date_allowed=max_date, initial_visible_month=max_date, start_date=max_date - timedelta(days=700), end_date=max_date, ), ), ddk.ControlItem( html.Button( id="orders-select-all-rows", children="Select all matching records", style={"margin": "auto"}, n_clicks=0, ) ), ], width=25, style={"overflow": "scroll"}, ), ddk.Card( width=75, children=[ ddk.CardHeader( children=[ html.Div( "Combined Orders View", style={"float": "left"}, ), ] ), ddk.Block( ddk.DataTable( columns=[ {"name": i.replace("_", " ").title(), "id": i} for i in orders_history_data.columns if (i not in remove_cols) ], data=orders_history_data.sort_values(by="PHYSICIAN").to_dict("records"), filter_action="native", page_action="native", page_size=50, row_selectable="multi", id="orders-history-data-table", style_cell={'fontSize': 12, 'font-family': 'sans-serif'}, style_table = {'overflowX': 'auto'}, ), style={"overflow": "scroll"} ), ] ), ] ), ] ) return children
def layout(): # load data for display episodesummdata = chart_utils.get_loaded_data( "AXXESS_API.USER_INPUTS.VW_PENDING_ORDERS_TF_SIMPLE", "DATASET") #reorder the columns new_order = [ 'INS_CODE', 'INITIAL_TIMELY_FILING', 'MRN', 'PATIENT', 'PATIENT_STATUS', 'DATE_OF_BIRTH', 'EPISODE_START_DATE', 'EPISODE_END_DATE', 'PHYSICIAN_NAME', 'PHYSICIAN_PHONE', 'PHYSICIAN_FACSIMILE', 'ORDERS_DETAILS', 'CONSOLIDATED_COMMENTS', 'COLOR', 'USER_UPDATE_DATE', 'NEW_COMMENTS', 'EPISODE_UNEARNED_AMOUNT', 'EPISODE_EARNED_AMOUNT', 'EPISODE_BILLED_AMOUNT', 'EPISODE_ADJUSTMENTS' ] episodesummdata = episodesummdata[new_order] claimsdetailsdata = chart_utils.get_loaded_data( "AXXESS_API.RAW.VW_ALLPAYOR_BILLING_CLAIMS_DETAILS", "DATASET") # print(episodesummdata.columns) # print(claimsdetailsdata.columns) gl_mrn_arr = chart_utils.get_options(episodesummdata, "MRN") gl_ins_code_arr = chart_utils.get_options(episodesummdata, "INS_CODE") gl_patient_arr = chart_utils.get_options(episodesummdata, "PATIENT") gl_patient_status_arr = chart_utils.get_options(episodesummdata, "PATIENT_STATUS") remove_cols = ['BRANCH', 'COLUMN_MAPPING', 'COLUMN_PARAMETERS'] max_date = pd.to_datetime(episodesummdata['EPISODE_END_DATE']).max() min_date = pd.to_datetime(episodesummdata['EPISODE_END_DATE']).min() children = html.Div([ # block on the right ddk.Block( width=100, children=[ ddk.Row([ ddk.Block(children=[ ddk.ControlCard( orientation='horizontal', width=100, children=[ html.Details([ html.Summary("Filter here"), html. P("""Select attributes to fine tune tables.""" ), ]), ddk.ControlItem( dcc.Dropdown( options=gl_ins_code_arr, multi=True, placeholder="Select Ins code", id="op-ins-code-selector" # value=["Not Yet Started", "Saved"], )), ddk.ControlItem( dcc.Dropdown( options=gl_patient_arr, multi=True, placeholder="Select Patient", id="op-patient-selector" # value=["Not Yet Started", "Saved"], )), ddk.ControlItem( dcc.Dropdown( options=gl_mrn_arr, multi=True, placeholder="Select MRN", id="op-mrn-selector" # value=["Not Yet Started", "Saved"], )), ddk.ControlItem( dcc.DatePickerRange( id="op-episode-picker", min_date_allowed=pd.to_datetime( episodesummdata[ 'EPISODE_START_DATE'].min()), max_date_allowed=max_date, initial_visible_month=max_date, start_date=min_date, end_date=max_date), ), ddk.ControlItem( html.Button( id="op-select-all-rows", children="Select all matching records", style={"margin": "auto"}, n_clicks=0, )), ], ) ]), ]), ddk.Row([ ddk.Card(children=[ ddk.CardHeader( title="Pending Orders", children=[ html.Div([ ddk.Modal( id="op-modal-btn-outer", children=[ html.Button( id="op-expand-modal", n_clicks=0, children="Take action", ) ], target_id="op-modal-content", hide_target=True, style={"float": "right"}, ), ddk.Block( id="op-modal-content", children=html.Div(id="op-modal-div"), style={ "width": "50%", "margin": "auto", "overflow": "scroll", }, ), ]), ], ), ddk.Block(children=[ generate_table_layout( episodesummdata, "PENDING ORDERS", "pending_tf-table", "MRN", remove_cols) ]) ]), ]), ddk.Row([ ddk.Block(children=[ generate_table_layout( claimsdetailsdata, "CLAIMS DETAILS", "op_claims_details-table", "MRN", remove_cols) ]) ]), ]) ]) return children
def order_card(): card = [ html.Div(id={ 'type': 'show_test_order', 'index': '1' }), html.Div(id={ 'type': 'show_test_order', 'index': '2' }), html.Div(id={ 'type': 'show_test_order', 'index': '3' }), ddk.Card(width=100, children=[ ddk.Block(width=10, children="ALFA"), ddk.Block(width=20, children=dcc.Input(placeholder="сколько", id={ 'type': 'tamount', 'index': '1' }, style={ 'border': 'double', 'margin': '0', 'background-color': 'ivory', 'width': '-webkit-fill-available' })), ddk.Block(width=20, children=dcc.Input(placeholder="Цена", id={ 'type': 'tprice', 'index': '1' }, style={ 'border': 'double', 'margin': '0', 'background-color': 'ivory', 'width': '-webkit-fill-available' })), ddk.Block(width=20, children=html.Button('BUY', id={ 'type': 'tbuy_btn', 'index': '1' }, style={ 'text-align': 'center', 'max-width': '100px', "background-color": "palegreen", "border-radius": "20px", 'font-size': '15px' }, n_clicks=0)), ddk.Block(width=30, children=html.Button( 'SELL', id={ 'type': 'tsell_btn', 'index': '1' }, style={ 'text-align': 'center', 'max-width': '120px', "background-color": "tomato", "border-radius": "20px", 'font-size': '15px' }, n_clicks=0, )) ]), ddk.Card(width=100, children=[ ddk.Block(width=10, children="Live"), ddk.Block(width=20, children=dcc.Input(placeholder="сколько", id={ 'type': 'tamount', 'index': '2' }, style={ 'border': 'double', 'margin': '0', 'background-color': 'ivory', 'width': '-webkit-fill-available' })), ddk.Block(width=20, children=dcc.Input(placeholder="Цена", id={ 'type': 'tprice', 'index': '2' }, style={ 'border': 'double', 'margin': '0', 'background-color': 'ivory', 'width': '-webkit-fill-available' })), ddk.Block(width=20, children=html.Button('BUY', id={ 'type': 'tbuy_btn', 'index': '2' }, style={ 'text-align': 'center', 'max-width': '100px', "background-color": "palegreen", "border-radius": "20px", 'font-size': '15px' }, n_clicks=0)), ddk.Block(width=30, children=html.Button( 'SELL', id={ 'type': 'tsell_btn', 'index': '2' }, style={ 'text-align': 'center', 'max-width': '120px', "background-color": "tomato", "border-radius": "20px", 'font-size': '15px' }, n_clicks=0, )) ]), ddk.Card(width=100, children=[ ddk.Block(width=10, children="HOT"), ddk.Block(width=20, children=dcc.Input(placeholder="сколько", id={ 'type': 'tamount', 'index': '3' }, style={ 'border': 'double', 'margin': '0', 'background-color': 'ivory', 'width': '-webkit-fill-available' })), ddk.Block(width=20, children=dcc.Input(placeholder="Цена", id={ 'type': 'tprice', 'index': '3' }, style={ 'border': 'double', 'margin': '0', 'background-color': 'ivory', 'width': '-webkit-fill-available' })), ddk.Block(width=20, children=html.Button('BUY', id={ 'type': 'tbuy_btn', 'index': '3' }, style={ 'text-align': 'center', 'max-width': '100px', "background-color": "palegreen", "border-radius": "20px", 'font-size': '15px' }, n_clicks=0)), ddk.Block(width=30, children=html.Button( 'SELL', id={ 'type': 'tsell_btn', 'index': '3' }, style={ 'text-align': 'center', 'max-width': '120px', "background-color": "tomato", "border-radius": "20px", 'font-size': '15px' }, n_clicks=0, )) ]), ] return card
def new_table(Mid,Team1,Team2): live_scoreBD = pd.read_csv(main_path_data + '\\live_score.csv') filterBD = live_scoreBD[live_scoreBD["Mid"].isin([Mid])] Team1BD = filterBD.head(n=5) Team2BD = filterBD.tail(n=5) def team(TeamBD): score_table_item2 = [] score_table_item2.append(dbc.ListGroupItem(style={'line-height': '1', 'margin': '0', 'margin-right': '0', 'height': '40px', 'justify-content': 'center', 'vertical-align': '-webkit-baseline-middle', 'max-height': 'fit-content', 'padding': '0px', 'background-color':'#0e4e70', 'list-style': 'none','max-width':'100%', 'min-width':'700px', # 'min-width':'1000px', # 'overflowX':'scroll', 'align-items': 'center'}, children=[ dbc.Row( # width=100, style={'justify-content': 'center','margin': '0', 'vertical-align': '-webkit-baseline-middle', 'height': '40px'}, children=[dbc.Col( # width=15, style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'15%','word-wrap': 'normal',}, children=html.H2('PLAYER',style={'margin': '0', 'text-align': 'center', 'justify': 'center'})), dbc.Col( # width=15, style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'15%',}, children=html.H2('HERO',style={'margin': '0', 'text-align': 'center', 'justify': 'center'})), dbc.Col( # width=10, style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'10%',}, children=html.H2('KDA',style={'margin': '0', 'text-align': 'center', 'justify': 'center'})), dbc.Col( # width=20, style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'20%',}, children=html.H2('ITEMS',style={'margin': '0', 'text-align': 'center', 'justify': 'center'})), dbc.Col( # width=10, style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'10%',}, children=html.H2('GOLD',style={'margin': '0', 'text-align': 'center', 'justify': 'center'})), dbc.Col( # width=10, style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'10%',}, children=html.H2('LH/DN', style={ 'margin': '0', 'text-align': 'center', 'justify': 'center'})), dbc.Col( # width=10, style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'10%',}, children=html.H2('GPM/XPM',style={'margin': '0', 'text-align': 'center', 'justify': 'center'})), dbc.Col( # width=10, style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'10%',}, children=html.H2('NW',style={'margin': '0', 'text-align': 'center', 'justify': 'center'}))])])) for ind in TeamBD.index: hero_items = [] data = TeamBD['Hero_items'][ind].replace('"', '').replace("'", "") res = data.strip('][').split(', ') # print("######### hero_items ##############", "\n", hero_items) for i in res: # print("######### i SCORE TEBLE ##############", "\n", i) hitem = dbc.Col( # width=16, style={ 'padding': '0', 'margin': '0', 'max-width': '16%', 'max-height': '16px', 'height': '16px', 'width': 'fit-content'}, children=[ddk.Logo( src=i, style={ 'text-align': 'center', 'max-height': '16px', 'padding': '0', 'margin': '0', 'vertical-align': '-webkit-baseline-middle'})]) hero_items.append(hitem) ############## LIVE SCORE TABLES ################################### score_table_item = dbc.ListGroupItem( style={'line-height': '1', 'margin': '0', 'margin-right': '0', 'height': '70px', 'justify-content': 'center', 'vertical-align': '-webkit-baseline-middle', 'max-height': '30px', 'padding': '0px', 'list-style': 'none', 'min-width':'700px', 'align-items': 'center'}, children=[ dbc.Row( # width=100, style={'justify-content': 'center'}, children=[dbc.Col( # width=15, style={'vertical-align': '-webkit-baseline-middle','max-width':'15%','width':'15%', 'word-wrap': 'normal','overflow-x':'hidden'}, children=html.H6(TeamBD['Players'][ind],style={'margin': '0', 'text-align': 'center', 'justify': 'center'})), dbc.Col( # width=15, style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'15%'}, children=dbc.Col( # width=80, style={ 'max-height': '20px', 'height': '20px', 'width': 'fit-content', 'max-width': '80%',}, children=[ddk.Logo( src=TeamBD['Hero_pic'][ind], style={ 'text-align': 'center', 'max-height': '20px', 'padding': '0', 'margin': '0', 'vertical-align': '-webkit-baseline-middle'})])), dbc.Col( # width=10, style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'10%'}, children=html.H6(TeamBD['KDA'][ind], style={'margin': '0', 'text-align': 'center', 'justify': 'center'})), dbc.Col( # width=20, style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'20%'}, children=dbc.Row([i for i in hero_items]) ), dbc.Col( # width=10, style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'10%'}, children=html.H6(TeamBD['Hero_gold'][ind], style={'margin': '0', 'text-align': 'center', 'justify': 'center'})), dbc.Col( # width=10, style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'10%'}, children=html.H6(TeamBD['LH_DN'][ind], style={ 'margin': '0', 'text-align': 'center', 'justify': 'center'})), dbc.Col( # width=10, style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'10%'}, children=html.H6(TeamBD['GPM_XPM'][ind], style={'margin': '0', 'text-align': 'center', 'justify': 'center'})), dbc.Col( # width=10, style={'min-width':'fit-content','vertical-align': '-webkit-baseline-middle','width':'10%'}, children=html.H6(TeamBD['NW'][ind],style={'margin': '0', 'text-align': 'center', 'justify': 'center'}))])]) score_table_item2.append(score_table_item) score_table = ddk.Card(style={'width':'-webkit-fill-available', 'margin':'10px', # 'min-width':'fit-content', 'overflowX':'scroll', 'padding':'0', 'background-color': '#f9f9f91c',}, children=[dbc.ListGroup(flush=True, children= [i for i in score_table_item2])]) return score_table full_table = ddk.Block(children=[ ddk.Block(width=100, children=html.H2(Team1, style={'margin': '0px','min-width':'fit-content', # 'max-width':'100%', 'overflow-x':'scroll'})), team(Team1BD), ddk.Block(width=100, children=html.H2(Team2, style={'margin': '0px','min-width':'fit-content', # 'max-width':'100%', 'overflow-x':'scroll'})), team(Team2BD) ]) return full_table # new_table('371312','MMMTeam1','MMMTeam2')