Skip to content

Commit 5db25fe

Browse files
committed
Updated Data File
1 parent 2909697 commit 5db25fe

File tree

2 files changed

+113
-1
lines changed

2 files changed

+113
-1
lines changed

app/javascript/components/child-functioning-summary/child-functioning-summary-data.js

+108
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ const childFunctioningSummaryData = [
1010
label: "cases.child_functioning.difficulty_seeing_with_glasses",
1111
key: latestValue => `cfm_${latestValue?.cfm_age}_vision_difficulty_with_glasses`
1212
},
13+
{
14+
label: "cases.continue_hearing_section",
15+
key: latestValue => `cfm_${latestValue?.cfm_age}_hearing_display`
16+
},
1317
{
1418
label: "cases.child_functioning.child_wears_hearing_aid",
1519
key: latestValue => `cfm_${latestValue?.cfm_age}_hearing_uses_hearing_aid`
@@ -18,6 +22,10 @@ const childFunctioningSummaryData = [
1822
label: "cases.child_functioning.difficulty_hearing_with_hearing_aid",
1923
key: latestValue => `cfm_${latestValue?.cfm_age}_hearing_difficulty_with_hearing_aid`
2024
},
25+
{
26+
label: "cases.continue_mobility_section",
27+
key: latestValue => `cfm_${latestValue?.cfm_age}_mobility_display`
28+
},
2129
{
2230
label: "cases.child_functioning.child_uses_equipment_or_receive_assistance_for_walking",
2331
key: latestValue => `cfm_${latestValue?.cfm_age}_mobility_uses_equipment`
@@ -26,33 +34,133 @@ const childFunctioningSummaryData = [
2634
label: "cases.child_functioning.difficulty_walking_without_equipment",
2735
key: latestValue => `cfm_${latestValue?.cfm_age}_mobility_difficulty_without_equipment`
2836
},
37+
{
38+
label: "cases.mobility_difficulty_without_equipment_100m",
39+
key: latestValue => `cfm_${latestValue?.cfm_age}_mobility_difficulty_without_equipment_100m`
40+
},
41+
{
42+
label: "cases.mobility_difficulty_without_equipment_500m",
43+
key: latestValue => `cfm_${latestValue?.cfm_age}_mobility_difficulty_without_equipment_500m`
44+
},
2945
{
3046
label: "cases.child_functioning.difficulty_walking_with_equipment",
3147
key: latestValue => `cfm_${latestValue?.cfm_age}_mobility_difficulty_with_equipment`
3248
},
49+
{
50+
label: "cases.mobility_difficulty_with_equipment_100m",
51+
key: latestValue => `cfm_${latestValue?.cfm_age}_mobility_difficulty_with_equipment_100m`
52+
},
53+
{
54+
label: "cases.mobility_difficulty_with_equipment_500m",
55+
key: latestValue => `cfm_${latestValue?.cfm_age}_mobility_difficulty_with_equipment_500m`
56+
},
57+
{
58+
label: "cases.continue_dexterity_display_section",
59+
key: latestValue => `cfm_${latestValue?.cfm_age}_dexterity_display`
60+
},
3361
{
3462
label: "cases.child_functioning.difficulty_picking_up_small_objects_with_hand",
3563
key: latestValue => `cfm_${latestValue?.cfm_age}_dexterity_difficulty`
3664
},
65+
{
66+
label: "cases.self_care_display",
67+
key: latestValue => `cfm_${latestValue?.cfm_age}_self_care_display`
68+
},
69+
{
70+
label: "cases.self_care_difficulty",
71+
key: latestValue => `cfm_${latestValue?.cfm_age}_self_care_difficulty`
72+
},
73+
{
74+
label: "cases.communication_display_section",
75+
key: latestValue => `cfm_${latestValue?.cfm_age}_communication_display`
76+
},
3777
{
3878
label: "cases.child_functioning.child_have_difficulty_to_understand",
3979
key: latestValue => `cfm_${latestValue?.cfm_age}_communication_difficulty_understanding_you`
4080
},
81+
{
82+
label: "cases.child_have_difficulty_to_understanding_child_household",
83+
key: latestValue => `cfm_${latestValue?.cfm_age}_communication_difficulty_understanding_child_household`
84+
},
85+
{
86+
label: "cases.difficulty_to_understanding_child_others",
87+
key: latestValue => `cfm_${latestValue?.cfm_age}_communication_difficulty_understanding_child_others`
88+
},
4189
{
4290
label: "cases.child_functioning.difficulty_to_understand_the_child",
4391
key: latestValue => `cfm_${latestValue?.cfm_age}_communication_difficulty_understanding_child`
4492
},
93+
{
94+
label: "cases.learning_display_section",
95+
key: latestValue => `cfm_${latestValue?.cfm_age}_learning_display`
96+
},
4597
{
4698
label: "cases.child_functioning.child_have_difficulty_for_learning",
4799
key: latestValue => `cfm_${latestValue?.cfm_age}_learning_difficulty`
48100
},
101+
{
102+
label: "cases.playing_display_section",
103+
key: latestValue => `cfm_${latestValue?.cfm_age}_playing_display`
104+
},
49105
{
50106
label: "cases.child_functioning.child_have_difficulty_for_playing",
51107
key: latestValue => `cfm_${latestValue?.cfm_age}_playing_difficulty`
52108
},
109+
{
110+
label: "cases.remembering_display",
111+
key: latestValue => `cfm_${latestValue?.cfm_age}_remembering_display`
112+
},
113+
{
114+
label: "cases.remembering_difficulty",
115+
key: latestValue => `cfm_${latestValue?.cfm_age}_remembering_difficulty`
116+
},
117+
{
118+
label: "cases.concentrating_display",
119+
key: latestValue => `cfm_${latestValue?.cfm_age}_concentrating_display`
120+
},
121+
{
122+
label: "cases.concentrating_difficulty",
123+
key: latestValue => `cfm_${latestValue?.cfm_age}_concentrating_difficulty`
124+
},
125+
{
126+
label: "cases.accepting_change_display",
127+
key: latestValue => `cfm_${latestValue?.cfm_age}_accepting_change_display`
128+
},
129+
{
130+
label: "cases.accepting_change_difficulty",
131+
key: latestValue => `cfm_${latestValue?.cfm_age}_accepting_change_difficulty`
132+
},
133+
{
134+
label: "cases.controlling_behavior_display_section",
135+
key: latestValue => `cfm_${latestValue?.cfm_age}_controlling_behavior_display`
136+
},
53137
{
54138
label: "cases.child_functioning.difficulty_for_controlling_behaviour",
55139
key: latestValue => `cfm_${latestValue?.cfm_age}_controlling_behavior_difficulty`
140+
},
141+
{
142+
label: "cases.making_friends_display_section",
143+
key: latestValue => `cfm_${latestValue?.cfm_age}_making_friends_display`
144+
},
145+
{
146+
label: "cases.making_friends_difficulty",
147+
key: latestValue => `cfm_${latestValue?.cfm_age}_making_friends_difficulty`
148+
},
149+
{
150+
label: "cases.anxiety_display_section",
151+
key: latestValue => `cfm_${latestValue?.cfm_age}_anxiety_display`
152+
},
153+
{
154+
label: "cases.anxiety_how_often",
155+
key: latestValue => `cfm_${latestValue?.cfm_age}_anxiety_how_often`
156+
},
157+
{
158+
label: "cases.depression_display_section",
159+
key: latestValue => `cfm_${latestValue?.cfm_age}_depression_display`
160+
},
161+
{
162+
label: "cases.depression_how_often",
163+
key: latestValue => `cfm_${latestValue?.cfm_age}_depression_how_often`
56164
}
57165
];
58166

app/javascript/components/child-functioning-summary/component.jsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@ import childFunctioningSummaryData from "./child-functioning-summary-data";
88
const formatKey = key => key.replace(/_/g, " ").replace(/\b\w/g, char => char.toUpperCase());
99

1010
const formatValue = (key, value) => {
11+
if (typeof value === "boolean") {
12+
return value ? "Yes" : "No";
13+
}
1114
if (typeof value === "string") {
1215
if (value === "true") return "Yes";
1316
if (value === "false") return "No";
1417
if (key.includes("age") && value.includes("_")) return `${value.replace("_", " to ")} years`;
1518
if (value.includes("_")) return value.replace(/_/g, " ").replace(/\b\w/g, char => char.toUpperCase());
19+
1620
const parsedDate = new Date(value);
1721

1822
if (!Number.isNaN(parsedDate.getTime())) {
@@ -22,7 +26,7 @@ const formatValue = (key, value) => {
2226
return value;
2327
}
2428

25-
return value; // Handle non-string values
29+
return value; // Handle other data types (numbers, etc.)
2630
};
2731

2832
function Component({ values = null }) {

0 commit comments

Comments
 (0)