예제 #1
0
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
예제 #2
0
def create_pie(value, name, color='rgba(59, 64, 72, 100)', **card_props):
    # TODO: Read in bgcolor from theme
    fig = {
        'data': [{
            'values': value,
            'textinfo': 'none',
            'hoverinfo': 'value+percent',
            'type': 'pie',
            'hole': 0.5,
            'marker': {
                'colors': [color, 'var(--border)'],
                'line': {
                    'width': 20,
                    'color': 'var(--background)'
                }
            }
        }],
        'layout': {
            'margin': {
                'l': 10,
                'r': 10,
                't': 10,
                'b': 10
            },
            'showlegend': False,
            'height': 200,
        }
    }

    pie = ddk.Graph(id='id' + name,
                    figure=fig,
                    config={'displayModeBar': False})

    return ddk.Card(pie, **card_props)
예제 #3
0
def create_percent_table(percent,
                         col,
                         bar_color='var(--accent)',
                         row_height=40,
                         **card_props):
    # TODO: GET TEXT WRAPPING FOR HIGH OR LOW %
    row_style = {
        'height': row_height,
        'borderBottom': 'thin gray solid',
        'display': 'inline-block',
        'lineHeight': str(row_height) + 'px'
    }
    child_divs = []

    for i in range(len(percent)):
        child_divs.append(
            html.Div([
                html.Div(col[i],
                         style=_merge(
                             row_style, {
                                 'width': str(percent[i]) + '%',
                                 'backgroundColor': bar_color,
                                 'padding-left': 10
                             })),
                html.Div(children=[html.B(str(percent[i]) + '%')],
                         style=_merge(
                             row_style, {
                                 'width': str(100 - percent[i]) + '%',
                                 'textAlign': 'right',
                                 'padding-right': 10
                             }))
            ]))
    ptable = html.Div(children=child_divs, style={'border': 'thin gray solid'})

    return ddk.Card(ptable, **card_props)
예제 #4
0
def news_items():
    newsBD = pd.read_csv(main_path_data + '\\news.csv')
    cards = []

    for ind in newsBD.index:
        ##########################    NEWS CARD   ###################################
        news_item = dbc.ListGroupItem(
            href='/news/{}'.format(newsBD['Mid'][ind]),
            id={
                'type': 'news-card',
                'index': str(newsBD['Mid'][ind])
            },
            style={
                'padding': '0px',
                'margin-bottom': "10px",
                'margin-top': "10px",
                'border': 'none'
            },
            children=[
                ddk.Card(style={
                    'background-color': '#073642',
                    'max-height': '100px',
                    'min-height': '100px',
                    'overflowY': 'hidden',
                    'text-align': 'center',
                    'margin': '0',
                    'padding': '0px'
                },
                         card_hover=True,
                         children=[
                             ddk.CardHeader(newsBD['name'][ind],
                                            style={
                                                'text-align': 'left',
                                                'font-size': '12px',
                                                'height': '40px',
                                                'max-height': '40px',
                                                'overflow-y': 'hidden',
                                                'background-color':
                                                'transparent',
                                            }),
                             html.H6(newsBD['disc'][ind],
                                     style={
                                         'margin': '0',
                                         'padding-bottom': '5px',
                                         'color': 'lightslategrey'
                                     })
                         ])
            ])

        cards.append(news_item)
    return cards
예제 #5
0
def update_charts(selected_status, selected_clinicians, selected_patients, start_date, end_date, selected_task, selected_task_category):
    data = chart_utils.get_loaded_data('CENSUS_VISITS_BY_STATUS')
    patient_roster_data = chart_utils.get_loaded_data('PATIENT_ROSTER')

    if start_date:
        data = data.loc[data["SCHEDULED_DATE"] >= start_date]
    if end_date:
        data = data.loc[data["SCHEDULED_DATE"] < end_date]
    if selected_clinicians:
        data = data.loc[data["ASSIGNED_TO"].isin(selected_clinicians)]
    if selected_status:
        data = data.loc[data["STATUS"].isin(selected_status)]
    if selected_patients:
        data = data.loc[data["PATIENT"].isin(selected_patients)]
    if selected_task:
        data = data.loc[data["TASK"].isin(selected_task)]
    if selected_task_category:
        data = data.loc[data["TASK_CATEGORY"].isin(selected_task_category)]

    pie_charts = [
        ddk.Card(
            [
                ddk.CardHeader("Overview of {}".format(column.title())),
                chart_utils.generate_pie(data, column),
            ],
        )
        for column in ["PAYOR", "STATUS"]
    ]

    time_series = [
        ddk.DataCard(
            id='visits_by_status_count',
            value=data.shape[0]
        ),
        ddk.CardHeader("Status of tasks for selected clinicians, dates, and status"),
        chart_utils.generate_census_bar(data),
    ]
    data_table = data.sort_values(by="SCHEDULED_DATE").to_dict("records")

    patient_roster_chart = [
        ddk.DataCard(
            id='census_count',
            value=patient_roster_data.shape[0]
        ),
        ddk.CardHeader("Patient Roster Chart"),
        chart_utils.generate_patient_roster_bar(patient_roster_data),
    ]
    return patient_roster_chart, data_table, time_series, 0
예제 #6
0
def update_charts(
    selected_status, selected_clinicians, selected_patients, start_date, end_date
):
    data = chart_utils.get_loaded_data("SCHEDULEREPORTS_VISITSBYSTATUS","DATASET")
    #print(data.columns)
    if start_date:
        data = data.loc[data["SCHEDULED_DATE"] > start_date]
    if end_date:
        data = data.loc[data["SCHEDULED_DATE"] < end_date]
    if selected_clinicians:
        data = data.loc[data["ASSIGNED_TO"].isin(selected_clinicians)]
    if selected_status:
        data = data.loc[data["STATUS"].isin(selected_status)]
    if selected_patients:
        data = data.loc[data["PATIENT"].isin(selected_patients)]

    pie_charts = [
        ddk.Card(
            [
                ddk.CardHeader(title="Overview of {}".format(column.title())),
                chart_utils.generate_pie(data, column),
            ],
        )
        for column in ["PAYOR", "STATUS"]
    ]

    time_series = [
        ddk.DataCard(
            id='total_visits_count',
            value=data.shape[0]
        ),
        ddk.CardHeader(
            title="Status of tasks for selected clinicians, dates, and status"
        ),
        chart_utils.generate_bar(data),
    ]
    data_table = data.sort_values(by="SCHEDULED_DATE").to_dict("records")

    return pie_charts, data_table, time_series, 0
예제 #7
0
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
예제 #8
0
import dash_core_components as dcc
from dash.dependencies import Input, Output
import plotly.graph_objs as go
import requests
from datetime import datetime as dt
r = requests.get("https://financialmodelingprep.com/api/v3/quote/BTCUSD")

time = []
price = []

app = dash.Dash()

server = app.server

app.layout = ddk.App(children=[
    ddk.Card(ddk.Graph(id="graph")),
    dcc.Interval(id="liveupdate", interval=10000, n_intervals=0),
])


@app.callback(Output("graph", "figure"), [Input("liveupdate", "n_intervals")])
def gaph_update(n):

    price.append(
        requests.get("https://financialmodelingprep.com/api/v3/quote/BTCUSD").
        json()[0]["price"])
    time.append(
        dt.utcfromtimestamp(
            int(
                requests.get(
                    "https://financialmodelingprep.com/api/v3/quote/BTCUSD").
예제 #9
0
 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
예제 #10
0
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
예제 #11
0
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
예제 #12
0
    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="-"),
    ]),
    ddk.Block(children=[
        ddk.Card(rounded=True,
                 children=[
                     ddk.Graph(
                         id="graph",
                         figure={
                             "data": [
                                 go.Scatter(x=iex.get_prices(
                                     "AAPL", "2015-01-01", "2016-01-01").index,
                                            y=iex.get_prices(
                                                "AAPL", "2015-01-01",
                                                "2016-01-01")["Adj Close"])
                             ],
                             "layout":
                             go.Layout(xaxis={'showgrid': False},
                                       yaxis={'showgrid': False})
                         })
                 ])
    ])
])


@app.callback([
    Output("graph", "figure"),
    Output("dc4", "value"),
예제 #13
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
예제 #14
0
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
예제 #15
0
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
     ddk.Logo(src=app.get_asset_url('logo.png'), style={
         'max-height': 100,
         'width': 'auto'
     }),
     ddk.Title('TELONAS2'),
     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)])
                                                 ]
                                                 )
                                        ]
                              )
예제 #17
0
def Graphs():
    df_streamtube = ddk.datasets.df_streamtube()
    df_choropleth = ddk.datasets.df_choropleth()
    df_scattergeo = ddk.datasets.df_scattergeo()
    df_iris = ddk.datasets.df_iris()

    x = [1, 2, 3]
    labels = ['Montreal', 'Tofu Bowl', 'Tropical Beaches']
    labels_long = [
        'Montreal', 'New York City', 'Tokyo',
        'Cincinatti', 'Miami', 'London', 'Vancouver'
    ]
    values_long = [1, 2, 3, 1, 5, 6, 7]
    y1 = [3, 1, 2]
    y2 = [4, 10, 4]
    y3 = [5, 2, 3]
    y4 = [9, 3, 8]
    y5 = [10, 5, 12]
    y6 = [11, 8, 10]
    y7 = [1, 2, 1]
    y8 = [5, 3, 1]
    z = [5, 3, 1]
    matrix = [
        [1, 2, 3],
        [4, 1, 2],
        [1, 3, 4]
    ]

    open = [33.0, 33.3, 33.5, 33.0, 34.1]
    high = [33.1, 33.3, 33.6, 33.2, 34.8]
    low = [32.7, 32.7, 32.8, 32.6, 32.8]
    close = [33.0, 32.9, 33.3, 33.1, 33.1]
    dates = [dt(year=2013, month=10, day=10),
             dt(year=2013, month=11, day=10),
             dt(year=2013, month=12, day=10),
             dt(year=2014, month=1, day=10),
             dt(year=2014, month=2, day=10)]

    r = [0.5, 1, 2, 2.5, 3, 4]
    theta = [35, 70, 120, 155, 205, 240]


    datas = [
        [
            {'type': 'scatter', 'x': x, 'y': y1, 'mode': 'lines'},
            {'type': 'scatter', 'x': x, 'y': y2, 'mode': 'lines'},
        ],

        [
            {'type': 'scatter', 'x': x, 'y': y1, 'mode': 'lines'},
            {'type': 'scatter', 'x': x, 'y': y2, 'mode': 'lines'},
            {'type': 'scatter', 'x': x, 'y': y3, 'mode': 'lines'},
            {'type': 'scatter', 'x': x, 'y': y4, 'mode': 'lines'},
        ],

        [
            {'type': 'scatter', 'x': x, 'y': y1, 'mode': 'lines'},
            {'type': 'scatter', 'x': x, 'y': y2, 'mode': 'lines'},
            {'type': 'scatter', 'x': x, 'y': y3, 'mode': 'lines'},
            {'type': 'scatter', 'x': x, 'y': y4, 'mode': 'lines'},
            {'type': 'scatter', 'x': x, 'y': y5, 'mode': 'lines'},
            {'type': 'scatter', 'x': x, 'y': y6, 'mode': 'lines'},
            {'type': 'scatter', 'x': x, 'y': y7, 'mode': 'lines'},
            {'type': 'scatter', 'x': x, 'y': y8, 'mode': 'lines'},
        ],

        [
            {'type': 'scatter', 'x': x, 'y': y1, 'mode': 'markers'},
            {'type': 'scatter', 'x': x, 'y': y2, 'mode': 'markers'},
        ],

        [
            {'type': 'scatter', 'x': x, 'y': y1, 'mode': 'markers'},
            {'type': 'scatter', 'x': x, 'y': y2, 'mode': 'markers'},
            {'type': 'scatter', 'x': x, 'y': y3, 'mode': 'markers'},
            {'type': 'scatter', 'x': x, 'y': y4, 'mode': 'markers'},
        ],

        [
            {'type': 'scatter', 'x': x, 'y': y1, 'mode': 'markers'},
            {'type': 'scatter', 'x': x, 'y': y2, 'mode': 'markers'},
            {'type': 'scatter', 'x': x, 'y': y3, 'mode': 'markers'},
            {'type': 'scatter', 'x': x, 'y': y4, 'mode': 'markers'},
            {'type': 'scatter', 'x': x, 'y': y5, 'mode': 'markers'},
            {'type': 'scatter', 'x': x, 'y': y6, 'mode': 'markers'},
            {'type': 'scatter', 'x': x, 'y': y7, 'mode': 'markers'},
            {'type': 'scatter', 'x': x, 'y': y8, 'mode': 'markers'},
        ],

        [
            {
                'type': 'scatter', 'x': x, 'y': y1, 'marker': {'color': y2},
                'mode': 'markers'
            },
        ],

        [
            {'type': 'scatter', 'x': x, 'y': y1, 'mode': 'lines+markers'},
            {'type': 'scatter', 'x': x, 'y': y2, 'mode': 'lines+markers'},
        ],

        [
            {'type': 'bar', 'x': labels, 'y': y1},
            {'type': 'bar', 'x': labels, 'y': y2},
        ],

        [
            {'type': 'bar', 'x': labels, 'y': y1},
            {'type': 'bar', 'x': labels, 'y': y2},
            {'type': 'bar', 'x': labels, 'y': y3},
            {'type': 'bar', 'x': labels, 'y': y4},
        ],

        [
            {'type': 'bar', 'x': labels, 'y': y1},
            {'type': 'bar', 'x': labels, 'y': y2},
            {'type': 'bar', 'x': labels, 'y': y3},
            {'type': 'bar', 'x': labels, 'y': y4},
            {'type': 'bar', 'x': labels, 'y': y5},
            {'type': 'bar', 'x': labels, 'y': y6},
            {'type': 'bar', 'x': labels, 'y': y7},
            {'type': 'bar', 'x': labels, 'y': y8},
        ],

        [
            {'type': 'scatter', 'x': x, 'y': y1, 'mode': 'lines', 'fill': 'tonexty'},
            {'type': 'scatter', 'x': x, 'y': y2, 'mode': 'lines', 'fill': 'tonexty'},
        ],

        [
            {'type': 'heatmap', 'z': matrix}
        ],

        [
            {'type': 'contour', 'z': matrix}
        ],

        [
            {'type': 'histogram2d', 'x': x, 'y': y1}
        ],

        [
            {'type': 'histogram2dcontour', 'x': x, 'y': y1}
        ],

        [
            {'type': 'pie', 'labels': labels, 'values': y1}
        ],

        [
            {'type': 'pie', 'labels': labels_long, 'values': values_long}
        ],

        [
            {'type': 'box', 'y': y1},
            {'type': 'box', 'y': y2}
        ],

        [
            {'type': 'box', 'y': y1, 'boxpoints': 'all'},
            {'type': 'box', 'y': y2, 'boxpoints': 'all'}
        ],

        [
            {'type': 'violin', 'y': y1},
            {'type': 'violin', 'y': y2}
        ],

        [
            {'type': 'violin', 'y': y1, 'points': 'all'},
            {'type': 'violin', 'y': y2, 'points': 'all'}
        ],

        [
            {'type': 'histogram', 'y': y1}
        ],

        [
            {'type': 'scatter3d', 'x': x, 'y': y1, 'z': z, 'mode': 'markers'},
            {'type': 'scatter3d', 'x': x, 'y': y2, 'z': z, 'mode': 'markers'}
        ],

        [
            {'type': 'scatter3d', 'x': x, 'y': y1, 'z': z, 'mode': 'lines'},
            {'type': 'scatter3d', 'x': x, 'y': y2, 'z': z, 'mode': 'lines'}
        ],

        [
            {'type': 'scatter3d', 'x': x, 'y': y1, 'z': z, 'mode': 'markers+lines'},
            {'type': 'scatter3d', 'x': x, 'y': y2, 'z': z, 'mode': 'markers+lines'}
        ],

        [
            {'type': 'surface', 'z': matrix}
        ],

        [
            {
                'type': 'cone',
                'x': [row[0] for row in cone_data],
                'y': [row[1] for row in cone_data],
                'z': [row[2] for row in cone_data],
                'u': [row[3] for row in cone_data],
                'v': [row[4] for row in cone_data],
                'w': [row[5] for row in cone_data],
            }
        ],

        [
            {
                'type': 'streamtube',
                'x': df_streamtube['x'],
                'y': df_streamtube['y'],
                'z': df_streamtube['z'],
                'u': df_streamtube['u'],
                'v': df_streamtube['v'],
                'w': df_streamtube['w'],
                'sizeref': 0.5
            }
        ],

        [
            {
                'type': 'choropleth',
                'z': df_choropleth['GDP (BILLIONS)'],
                'locations': df_choropleth['CODE'],
                'text': df_choropleth['COUNTRY']
            }
        ],

        [
            {
                'type': 'scattergeo',
                'lon': df_scattergeo['long'],
                'lat': df_scattergeo['lat'],
                'mode': 'markers',
            }
        ],

        [
            {
                'type': 'scattermapbox',
                'lon': df_scattergeo['long'],
                'lat': df_scattergeo['lat'],
                'mode': 'markers',
            }
        ],

        [
            {
                'type': 'candlestick',
                'open': open,
                'high': high,
                'low': low,
                'close': close
            }
        ],

        [
            {
                'type': 'ohlc',
                'open': open,
                'high': high,
                'low': low,
                'close': close
            }
        ],

        [
            {'type': 'scatterternary', 'a': x, 'b': y1, 'c': y2, 'mode': 'markers'},
        ],

        [
            {'type': 'scatterternary', 'a': x, 'b': y1, 'c': y2, 'mode': 'lines'},
        ],

        [
            {'type': 'scatterpolar', 'r': r, 'theta': theta, 'mode': 'markers'},
        ],
        [
            {'type': 'scatterpolar', 'r': r, 'theta': theta, 'mode': 'lines'},
        ],

        [
            dict(
                type='parcoords',
                dimensions=list([
                    dict(range=[0,8],
                        constraintrange=[4,8],
                        label='Sepal Length', values=df_iris['sepal_length']),
                    dict(range=[0,8],
                        label='Sepal Width', values=df_iris['sepal_width']),
                    dict(range=[0,8],
                        label='Petal Length', values=df_iris['petal_length']),
                    dict(range=[0,8],
                        label='Petal Width', values=df_iris['petal_width'])
                ])
            )
        ],

        [
            dict(
                type='sankey',
                node=dict(
                    label=["Nuclear", "Wind Energy", "Thermal", "Bio Conversion", "Airline Industry", "Losses"],
                ),
                link=dict(
                    source=[0, 1, 0, 2, 3, 3],
                    target=[2, 3, 3, 4, 4, 5],
                    value=[8, 4, 2, 8, 4, 2]
                )
            )
        ],

        [
            {
                'type': 'carpet',
                'a': [4, 4, 4, 4.5, 4.5, 4.5, 5, 5, 5, 6, 6, 6],
                'b': [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3],
                'y': [2, 3.5, 4, 3, 4.5, 5, 5.5, 6.5, 7.5, 8, 8.5, 10],
            }
        ],

        [
            {
                'type': 'contourcarpet',
                '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],
                'z': [1, 1.96, 2.56, 3.0625, 4, 5.0625, 1, 7.5625, 9, 12.25, 15.21, 14.0625],
            },
            {
                'type': 'carpet',
                '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)
    ])
예제 #18
0
     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',
                                label='Power',
                                trace_x=ddk.datasets.timeseries().x1,
                                trace_y=ddk.datasets.timeseries().y1,
                                width=25),
                   ddk.DataCard(value='5.4',
                                label='Efficiency',
                                trace_x=ddk.datasets.timeseries().x2,
                                trace_y=ddk.datasets.timeseries().y2,
                                width=25),
               ]),
예제 #19
0
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
예제 #20
0
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
예제 #21
0
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
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
예제 #23
0
import dash
import dash_design_kit as ddk
import plotly.express as px
import pandas as pd

app = dash.Dash(__name__)
server = app.server  # expose server variable for Procfile

df = pd.DataFrame({
    "Fruit": ["Apples", "Oranges", "Bananas", "Apples", "Oranges", "Bananas"],
    "Amount": [4, 1, 2, 2, 4, 5],
    "City": ["SF", "SF", "SF", "Montreal", "Montreal", "Montreal"]
})

fig = px.bar(df, x="Fruit", y="Amount", color="City", barmode="group")

app.layout = ddk.App(
    show_editor=True,
    children=[
        ddk.Header([ddk.Title('Hello Dash')]),
        ddk.Card(children=[
            ddk.CardHeader(
                title='Dash: A Web application framework for Python.'),
            ddk.Graph(figure=fig)
        ])
    ])
예제 #24
0
                ])
            ]),
        ddk.ControlCard(
            width=25,
            children=[
                ddk.ControlItem(children=[
                    dcc.Dropdown(id="dd2", options=time, value="15min")
                ])
            ]),
        ddk.ControlCard(
            width=25,
            children=[
                ddk.ControlItem(
                    children=[dcc.Input(id="Input_Value", value=5)])
            ]),
        ddk.Card(children=[ddk.Graph(id="graph")])
    ])


@app.callback(Output("graph", "figure"), [
    Input("dd1", "value"),
    Input("dd2", "value"),
    Input("Input_Value", "value")
])
def update_graph(dd1, dd2, Input_Value):
    r = requests.get(
        "https://financialmodelingprep.com/api/v3/historical-chart/%s/%s" %
        (dd2, dd1))
    df = pd.DataFrame.from_dict(r.json())
    df["date"] = pd.to_datetime(df["date"])
    df["SMA"] = df["close"].rolling(int(Input_Value)).mean()
        var_list.append({'label': var, 'value': var})

    vars[set] = var_list

external_stylesheets = ['https://codepen.io./chriddyp/pen/bWLwgP.css']
app = dash.Dash(__name__)

app.layout = html.Div([
    #Baro
    html.Div([
        html.Label(['Barometric Pressure']),
        ddk.Card(width=100,
                 children=[ddk.Graph(id='baro-graphic',
                                     figure = px.scatter(data['baro'],
                                                         y=data['baro']['BaroPres'],
                                                         x=data['baro']['time']
                                                        )
                                    )],
                 )
            ]),
    html.Div([
        #html.H3('Column 1'),
        html.Label(['Scientific Data']),
        dcc.Dropdown(
            id="select_sci",
            options=vars['sci'],
            value=vars['sci'][0]['value']
            #multi=True
        ),
        ddk.Card(width=100,
                 children=[ddk.Graph(id='sci-graphic')],
예제 #26
0
from dash.dependencies import Input, Output

app = dash.Dash(__name__)
server = app.server  # expose server variable for Procfile

app.layout = ddk.App([
    ddk.Header([
        ddk.Logo(src=app.get_asset_url('logo.png')),
        ddk.Title('Dash Enterprise Sample Application'),
    ]),
    ddk.Row(children=[
        ddk.Card(children=ddk.Graph(figure={
            'data': [{
                'x': [1, 2, 3, 4],
                'y': [4, 1, 6, 9],
                'line': {
                    'shape': 'spline'
                }
            }]
        }, )),
    ]),
    ddk.Row(children=[
        ddk.Card(width=50,
                 children=ddk.Graph(figure={
                     'data': [{
                         'x': [1, 2, 3, 4],
                         'y': [4, 1, 6, 9],
                         'line': {
                             'shape': 'spline'
                         }
                     }]
예제 #27
0
                                        searchable=True,
                                        ),
                                        html.Div(id="Period-dropdown"),
                                        html.Label('Dino Type', style={'fontSize':30, 'textAlign':'center'}),
                                        dcc.Dropdown(id='display-type', options=[], multi=True, value=[]),
                                        
                                ]
                                )
                        ),
                        width=8,
                        ),

                        ddk.Card(
                        width=24,
                        children=[
                                ddk.CardHeader(title='Total Fossils Found Across All Periods'),
                                ddk.DataCard(value=totalFossilsFounds,
                                        style={'width':'fit-content'}),
                        ]
                        ),
                        # ddk.Card(
                        # width=24,
                        # children=[
                        #         ddk.CardHeader(title='Total Fossils Found'),
                        #         ddk.DataCard(
                        #                 id='total-fossils',
                        #                 value='',
                        #                 style={'width':'fit-content'}),
                        # ]
                        # ),

                        # ddk.Card(
예제 #28
0
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
예제 #29
0
    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