Exemplo n.º 1
0
def build_oxygen_card(_id, labs, m, content_dict, language):
    """Oxygen Saturation Card and Top Input Builder (Builds card and uppper text and dropdowns of last card.)"""
    model = 'mortality' if m else 'infection'
    lab_str = "labs" if labs else "nolabs"
    insert_data = [
        dbc.Row([
            dbc.Col(html.Div(langs[language].hasO2Value)),
            dbc.Col(
                dcc.Dropdown(id="oxygen-answer-{}".format(model),
                             options=[{
                                 'label': labs_ques(x, language),
                                 'value': x
                             } for x in [1, 0]],
                             value=0,
                             style={"width": 80},
                             className="dcc_dropdown",
                             clearable=False), )
        ]),
        dbc.Row(id="calc-numeric-{}-wrapper-{}-{}".format(_id, model,
                                                          lab_str), )
    ]

    card = [
        dbc.Row(insert_data, ),
        dbc.Tooltip(
            content_dict['explanation'],
            target="calc-numeric-{}-wrapper-{}-{}".format(_id, model, lab_str),
        ),
    ]
    return card
Exemplo n.º 2
0
def build_oxygen_card(id, labs, m, content_dict, language):
    model = 'mortality' if m else 'infection'
    l = "labs" if labs else "nolabs"
    q = [
        "Do you have the value for SpO2 or SaO2?",
        "¿Tiene el valor para SpO2 o SaO2?", "Hai il valore per SpO2 o SaO2?"
    ]
    insert_data = \
    [
        dbc.Row(
        [
            dbc.Col(html.Div(q[language])),
            dbc.Col(
                    dcc.Dropdown(
                        id="oxygen-answer-{}".format(model),
                        options = [{'label': labs_ques(x,language), 'value': x} for x in [1,0]],
                        value = 0,
                        style={"width":80}
                ),
            )
        ]
        )
    ]
    insert_data.append(
        dbc.Row(id="calc-numeric-{}-wrapper-{}-{}".format(id, model, l), ), )

    card = [
        dbc.Row(insert_data, ),
        dbc.Tooltip(
            content_dict['explanation'],
            target="calc-numeric-{}-wrapper-{}-{}".format(id, model, l),
        ),
    ]
    return card
Exemplo n.º 3
0
 def infection_labs_card_options(language):
     return [{'label': labs_ques(x, language), 'value': x} for x in [1, 0]]
Exemplo n.º 4
0
def mortality_labs_card(language):
    return [{'label': labs_ques(x, language), 'value': x} for x in [1, 0]]