Beispiel #1
0
def main():
    """Main."""
    a = parse_args()

    p = Parameters(
        current_hospitalized=a.current_hospitalized,
        doubling_time=a.doubling_time,
        known_infected=a.known_infected,
        market_share=a.market_share,
        relative_contact_rate=a.relative_contact_rate,
        susceptible=a.susceptible,
        n_days=a.n_days,
        hospitalized=RateLos(a.hospitalized_rate, a.hospitalized_los),
        icu=RateLos(a.icu_rate, a.icu_los),
        ventilated=RateLos(a.ventilated_rate, a.ventilated_los),
    )

    raw_df = DataFrame({
        "Susceptible": p.susceptible_v,
        "Infected": p.infected_v,
        "Recovered": p.recovered_v,
    })

    admits_df = build_admissions_df(p)
    census_df = build_census_df(admits_df, p)

    prefix = a.prefix
    for df, name in (
        (raw_df, "raw"),
        (admits_df, "admits"),
        (census_df, "census"),
    ):
        df.to_csv(prefix + name + ".csv")
Beispiel #2
0
if st.checkbox("Show more info about this tool"):
    notes = "The total size of the susceptible population will be the entire catchment area for Penn Medicine entities (HUP, PAH, PMC, CCH)"
    show_more_info_about_this_tool(
        st=st,
        parameters=p,
        inputs=DEFAULTS,
        notes=notes
    )

# PRESENTATION
# Two more combination variable initialization / input element creation
as_date = st.checkbox(label="Present result as dates instead of days", value=False)
display_n_days_slider(st, p, DEFAULTS)

# begin format data
admissions_df = build_admissions_df(p=p) # p.n_days, *p.dispositions)
census_df = build_census_df(admissions_df, parameters=p)
# end format data

st.subheader("New Admissions")
st.markdown("Projected number of **daily** COVID-19 admissions at Penn hospitals")
st.altair_chart(
    new_admissions_chart(alt, admissions_df, parameters=p, as_date=as_date), use_container_width=True
)
if st.checkbox("Show Projected Admissions in tabular form"):
    draw_projected_admissions_table(st, admissions_df, as_date=as_date)
st.subheader("Admitted Patients (Census)")
st.markdown(
    "Projected **census** of COVID-19 patients, accounting for arrivals and discharges at Penn hospitals"
)
st.altair_chart(