Children's hospital is a health service that organizes preventive, diacostic, curative and rehabilitative medical services through outpatient and residential care activities aimed at children. Children themselves are categorized as ranging in age from 0 to 12 years, this age is an age that is experiencing a fairly rapid growth and development process, even said to be the initial foundation of child development which has a range and determines the next stage. Children have different characteristics depending on their age and stage of development. In general, children have a desire to explore and learn about the world around them. Architecture can help children's development. Architecture in pediatric hospitals has its own challenges in meeting their needs and characteristics. One of them is to create a hospital atmosphere that does not give a scary impression to children. However, in fact, many hospitals are not familiar environments for most children, especially for those who have to undergo hospitalization. The unfamiliar and often frightening environment can affect the psychological condition and also affect the child's recovery period. Several studies have shown that children's fear of hallways in the hospital environment can be one of the factors that cause anxiety and stress in children. The purpose of this research is to focus on the role of architecture in helping to reduce children's fear of hallways and hospital environments. Therefore, further study is needed on the factors that cause fear in children and the psychological effects on children and how architecture can play a role to overcome this. This research method will use a qualitative method with a literature study approach, interviews, site surveys, and observations. This research is expected to be a new breakthrough in designing a pediatric hospital that is friendly to pediatric patients.
Are there any grammatical errors or mistakes in this text?
@Composable
fun ExpenseGraph(expenseData: List<Expense>, selectedInterval: TimeInterval) {
val data = generateData(expenseData, selectedInterval)
LineChart(
data = data,
xAxis = ChartAxis.Labelled(data.xLabels),
yAxis = ChartAxis.Labelled(data.yLabels),
selection = Selection.None,
backgroundColor = MaterialTheme.colors.background,
lineColors = listOf(MaterialTheme.colors.primary),
lineWidth = 2.dp,
insetValue = 32.dp,
legend = null
)
}
private fun generateData(expenseData: List<Expense>, interval: TimeInterval): ChartData {
// Generate data and labels for the selected interval
val data = when (interval) {
TimeInterval.Daily -> generateDataForInterval(expenseData, ChronoUnit.DAYS)
TimeInterval.Weekly -> generateDataForInterval(expenseData, ChronoUnit.WEEKS)
TimeInterval.Monthly -> generateDataForInterval(expenseData, ChronoUnit.MONTHS)
TimeInterval.Yearly -> generateDataForInterval(expenseData, ChronoUnit.YEARS)
}
// Generate labels for the x-axis
val xLabels = when (interval) {
TimeInterval.Daily -> data.xValues.map { it.dayOfMonth.toString() }
TimeInterval.Weekly -> data.xValues.map { "Week ${it.get(IsoFields.WEEK_OF_WEEK_BASED_YEAR)}" }
TimeInterval.Monthly -> data.xValues.map { Month.of(it.monthValue).name.take(3) }
TimeInterval.Yearly -> data.xValues.map { it.year.toString() }
}
// Generate labels for the y-axis
val yLabels = data.yValues.map { it.toString() }
return ChartData(
xLabels = xLabels,
yLabels = yLabels,
xValues = data.xValues,
points = data.yValues.mapIndexed { i, value -> Point(i, value.toFloat()) },
)
}
private fun generateDataForInterval(expenseData: List<Expense>, interval: TemporalUnit): ChartDataEntry {
val start = expenseData.firstOrNull()?.date ?: Instant.now()
val end = expenseData.lastOrNull()?.date ?: Instant.now()
val tempDate = LocalDate.ofInstant(start, ZoneOffset.UTC).with(TemporalAdjusters.startOf(interval))
val endTempDate = LocalDate.ofInstant(end, ZoneOffset.UTC)
val xVals = mutableListOf<LocalDate>()
val yVals = mutableListOf<Double>()
while (!tempDate.isAfter(endTempDate)) {
val expensesForPeriod = expenseData.filter { LocalDate.ofInstant(it.date, ZoneOffset.UTC).isBefore(tempDate.plus(1, interval)) }
val totalExpenses = expensesForPeriod.sumOf { it.amount }
xVals.add(tempDate)
yVals.add(totalExpenses)
tempDate = tempDate.plus(1, interval)
}
return ChartDataEntry(xVals, yVals)
}
enum class TimeInterval {
Daily,
Weekly,
Monthly,
Yearly
}
In this example, the ExpenseGraph composable function takes in the expense data and the selected interval as its parameters. It then generates the data and labels for the selected interval using the generateData function, which creates a ChartData object containing the x and y axis labels and data points.
The generateDataForInterval function generates the data for the selected interval by filtering the expense data and calculating the total expenses for each time interval. The x-axis labels and values are created based on the selected interval, while the y-axis labels are generated based on the total expenses for each interval.