File size: 2,044 Bytes
ba4003c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import streamlit as st

def calculate_bmi(weight, height):
    return weight / ((height / 100) ** 2)

def determine_weight_status(bmi):
    if bmi < 18.5:
        return 'Underweight'
    elif 18.5 <= bmi < 25:
        return 'Normal'
    elif 25 <= bmi < 30:
        return 'Overweight'
    else:
        return 'Obese'

def determine_height_status(height, age_months):
    # You'd typically use growth charts or specific data for this calculation
    # Here's a placeholder example
    if age_months < 60:
        if height < 110:
            return 'Stunted (Low Height-for-Age)'
        elif 110 <= height <= 150:
            return 'Normal Height'
        else:
            return 'Tall for Age'
    else:
        return 'Height Status Not Applicable'

def poshan_tracker_calculator(gender, age_months, weight, height):
    bmi = calculate_bmi(weight, height)
    weight_status = determine_weight_status(bmi)
    height_status = determine_height_status(height, age_months)

    st.write(f"Child Gender: {gender.capitalize()}")
    st.write(f"Child Age: {age_months} Months")
    st.write(f"Child Weight: {weight:.2f} kg")
    st.write(f"Child Height: {height:.2f} cm")
    st.write(f"Child BMI: {bmi:.2f}")
    st.write(f"Weight Status: {weight_status}")
    st.write(f"Height Status: {height_status}")
    st.write("Recommended Height Range: 110 - 150 cm")  # Placeholder range
    st.write("Growth Status: Abnormal Growth")  # Placeholder status
    st.write("Disclaimer: Don't Rely on the calculator, Consult With Medical Professional")

# Streamlit UI
st.title('Poshan Tracker Calculator')

gender = st.radio('Select Child Gender:', ('Male', 'Female'))
age_months = st.number_input('Enter Child Age in Months:', min_value=0, max_value=300, value=24)
weight = st.number_input('Enter Child Weight in kg:', min_value=0.1, max_value=200.0, value=10.0)
height = st.number_input('Enter Child Height in cm:', min_value=30, max_value=200, value=100)

if st.button('Calculate'):
    poshan_tracker_calculator(gender, age_months, weight, height)