Skip to content

Commit 0924916

Browse files
committed
feat: add OLDER_AMERICANS_RESOURCES_AND_SERVICES
1 parent f380c46 commit 0924916

File tree

1 file changed

+298
-0
lines changed
  • packages/instrument-library/src/forms/OLDER_AMERICANS_RESOURCES_AND_SERVICES

1 file changed

+298
-0
lines changed
Lines changed: 298 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,298 @@
1+
import { defineInstrument } from '/runtime/v1/@opendatacapture/runtime-core';
2+
import { z } from '/runtime/v1/[email protected]';
3+
4+
export default defineInstrument({
5+
kind: 'FORM',
6+
language: ['en', 'fr'],
7+
internal: {
8+
name: 'OLDER_AMERICANS_RESOURCES_AND_SERVICES',
9+
edition: 1
10+
},
11+
tags: {
12+
en: ['social'],
13+
fr: ['social']
14+
},
15+
content: {
16+
peopleYouKnowCanVisitTheirHome: {
17+
kind: 'string',
18+
variant: 'radio',
19+
label: {
20+
en: 'How many people do you know well enough to visit within their homes?',
21+
fr: 'Combien de personnes connaissez-vous assez bien pour leur rendre visite chez elles?'
22+
},
23+
options: {
24+
en: {
25+
'five or more': 'five or more',
26+
'three to four': 'three to four',
27+
'one to two': 'one to two',
28+
none: 'none',
29+
'prefer not to answer': 'prefer not to answer'
30+
},
31+
fr: {
32+
'five or more': 'cinq ou plus',
33+
'three to four': 'trois ou quatre',
34+
'one to two': 'une ou deux',
35+
none: 'personne',
36+
'prefer not to answer': 'préfère ne pas répondre'
37+
}
38+
}
39+
},
40+
numbersOfCallsLastWeek: {
41+
kind: 'string',
42+
variant: 'radio',
43+
label: {
44+
en: 'About how many times did you talk to someone (friends, relatives, or others) on the telephone in the past week? (either you called them or they called you) If you do not have a phone, the question still applies.',
45+
fr: "Combien de conversations téléphoniques avez-vous eues avec des amis, des membres de votre famille ou autres pendant la dernière semaine? (leur avez-vous téléphoné ou vous ont-ils téléphoné) La question s'applique même si vous n'avez pas de téléphone."
46+
},
47+
options: {
48+
en: {
49+
'once a day or more': 'once a day or more',
50+
'2 - 6 times': '2 - 6 times',
51+
once: 'once',
52+
'not at all': 'not at all',
53+
'prefer not to answer': 'prefer not to answer'
54+
},
55+
fr: {
56+
'once a day or more': 'une fois par jour ou plus',
57+
'2 - 6 times': 'de deux à six',
58+
once: 'une',
59+
'not at all': 'aucune',
60+
'prefer not to answer': 'préfère ne pas répondre'
61+
}
62+
}
63+
},
64+
numbersOfTimeSpentWithSomeoneLastWeek: {
65+
kind: 'string',
66+
variant: 'radio',
67+
label: {
68+
en: 'How many times during the past week did you spend some time with someone who does not live with you, that is you went to see them or they came to visit you or you went out to do things together?',
69+
fr: "Combien de fois pendant la dernière semaine avez-vous passé du temps avec une personne qui n'habite pas avec vous, c'est à dire que vous lui avez rendu visite ou qu'elle vous a rendu visite ou encore que vous êtes sortis ensemble pour faire quelque chose?"
70+
},
71+
options: {
72+
en: {
73+
'once a day or more': 'once a day or more',
74+
'2 - 6 times': '2 - 6 times',
75+
once: 'once',
76+
'not at all': 'not at all',
77+
'prefer not to answer': 'prefer not to answer'
78+
},
79+
fr: {
80+
'once a day or more': 'une fois par jour ou plus',
81+
'2 - 6 times': 'de deux à six',
82+
once: 'une',
83+
'not at all': 'aucune',
84+
'prefer not to answer': 'préfère ne pas répondre'
85+
}
86+
}
87+
},
88+
haveSomeoneYouTrust: {
89+
kind: 'string',
90+
variant: 'radio',
91+
label: {
92+
en: 'Do you have someone you trust and can confide in?',
93+
fr: 'Y a-t-il une personne en qui vous avez confiance et à laquelle vous pouvez-vous confier?'
94+
},
95+
options: {
96+
en: {
97+
yes: 'yes',
98+
no: 'no',
99+
'prefer not to answer': 'prefer not to answer'
100+
},
101+
fr: {
102+
yes: 'oui',
103+
no: 'non',
104+
'prefer not to answer': 'préfère ne pas répondre'
105+
}
106+
}
107+
},
108+
doYouFeelLonely: {
109+
kind: 'string',
110+
variant: 'radio',
111+
label: {
112+
en: 'Do you find yourself feeling lonely quite often, sometimes or almost never?',
113+
fr: 'Vous sentez-vous seul(e) assez souvent quelquefois ou presque jamais?'
114+
},
115+
options: {
116+
en: {
117+
'quite often': 'quite often',
118+
sometimes: 'sometimes',
119+
'almost never': 'almost never',
120+
'prefer not to answer': 'prefer not to answer'
121+
},
122+
fr: {
123+
'quite often': 'assez souvent',
124+
sometimes: 'quelquefois',
125+
'almost never': 'presque jamais',
126+
'prefer not to answer': 'préfère ne pas répondre'
127+
}
128+
}
129+
},
130+
seeFriendsAndRelativesAsYouWant: {
131+
kind: 'string',
132+
variant: 'radio',
133+
label: {
134+
en: 'Do you see your relatives and friends as often as you want to or are you somewhat unhappy about how little you see them?',
135+
fr: 'Voyez-vous votre famille et vos amis aussi souvent que vous le désirez, ou êtes-vous plutôt insatisfait(e) que vous les voyez rarement?'
136+
},
137+
options: {
138+
en: {
139+
'as often as wants to': 'as often as wants to',
140+
'somewhat unhappy about how little': 'somewhat unhappy about how little',
141+
'prefer not to answer': 'prefer not to answer'
142+
},
143+
fr: {
144+
'as often as wants to': 'aussi souvent que je le desire',
145+
'somewhat unhappy about how little': 'plutôt insatisfait(e) que je les vois rarement',
146+
'prefer not to answer': 'préfère ne pas répondre'
147+
}
148+
}
149+
},
150+
someoneTakeCareOfYouWhenNeeded: {
151+
kind: 'string',
152+
variant: 'radio',
153+
label: {
154+
en: 'Do you have someone you trust and can confide in?',
155+
fr: 'Y a-t-il une personne en qui vous avez confiance et à laquelle vous pouvez-vous confier?'
156+
},
157+
options: {
158+
en: {
159+
yes: 'yes',
160+
'no one willing and able': 'no one willing and able',
161+
'prefer not to answer': 'prefer not to answer'
162+
},
163+
fr: {
164+
yes: 'oui',
165+
'no one willing and able': "il n'y a personne qui disposerait ou qui soit en mesure de m'aider",
166+
'prefer not to answer': 'préfère ne pas répondre'
167+
}
168+
}
169+
},
170+
someoneTakeCareOfYouAsLongAsYouNeed: {
171+
kind: 'dynamic',
172+
deps: ['someoneTakeCareOfYouWhenNeeded'],
173+
render: (data) => {
174+
return data?.someoneTakeCareOfYouWhenNeeded === 'yes'
175+
? {
176+
kind: 'string',
177+
variant: 'radio',
178+
label: {
179+
en: 'Is there someone who would take care of you as long as you needed, or only for a short time, or only someone who would help you now and then (for example, taking you to the doctor or fixing lunch occasionally, etc.)?',
180+
fr: "Y a-t-il une personne qui prendrait soin de vous aussi longtemps qu'il le faudrait une courte période, ou qui vous aiderait de temps en temps seulement, par exemple, une personne qui vous conduirait chez le médcin ou vous ferait à déjeuner occasionnellement, etc."
181+
},
182+
options: {
183+
en: {
184+
'Someone who would take care of you indefinitely (as long as needed)':
185+
'Someone who would take care of you indefinitely (as long as needed)',
186+
'Someone who would take care of you for a short time (a few weeks to six months)':
187+
'Someone who would take care of you for a short time (a few weeks to six months)',
188+
'Someone who would help you now and then (taking you to the doctor, fixing lunch, etc.)':
189+
'Someone who would help you now and then (taking you to the doctor, fixing lunch, etc.)',
190+
'prefer not to answer': 'prefer not to answer'
191+
},
192+
fr: {
193+
'Someone who would take care of you indefinitely (as long as needed)':
194+
"une personne qui prendrait soin de vous indéfiniment (aussi longtemps qu'il le faudrait)",
195+
'Someone who would take care of you for a short time (a few weeks to six months)':
196+
'une personne qui prendrait soin de vous pendant une courte période (de quelques semaines à six mois)',
197+
'Someone who would help you now and then (taking you to the doctor, fixing lunch, etc.)':
198+
'une personne qui vous aiderait de temps en temps (qui vous conduirait chez le médecin ou vous ferait à déjeuner, etc.)',
199+
'prefer not to answer': 'préfère ne pas répondre'
200+
}
201+
}
202+
}
203+
: null;
204+
}
205+
}
206+
},
207+
details: {
208+
description: {
209+
en: 'Social Support: Now, we will ask you some questions about your family and friends. Reference: https://osf.io/94qv5/',
210+
fr: 'Soutien social: Nous allons maintenant vous poser quelques questions concernant votre famille et vos amis. Référence: https://osf.io/94qv5/'
211+
},
212+
estimatedDuration: 3,
213+
instructions: {
214+
en: ['Now, I would like to ask you some questions about your family and friends. Please complete all questions.'],
215+
fr: [
216+
"Maintenant, j'aimerais vous poser quelques questions sur votre famille et vos amis. Veuillez répondre à toutes les questions."
217+
]
218+
},
219+
license: 'CC-BY-4.0',
220+
title: {
221+
en: 'Older Americans Resources and Services Social Resource Scale',
222+
fr: 'Réseau social'
223+
}
224+
},
225+
validationSchema: z.object({
226+
peopleYouKnowCanVisitTheirHome: z.enum([
227+
'five or more',
228+
'three to four',
229+
'one to two',
230+
'none',
231+
'prefer not to answer'
232+
]),
233+
numbersOfCallsLastWeek: z.enum(['once a day or more', '2 - 6 times', 'once', 'not at all', 'prefer not to answer']),
234+
numbersOfTimeSpentWithSomeoneLastWeek: z.enum([
235+
'once a day or more',
236+
'2 - 6 times',
237+
'once',
238+
'not at all',
239+
'prefer not to answer'
240+
]),
241+
haveSomeoneYouTrust: z.enum(['yes', 'no', 'prefer not to answer']),
242+
doYouFeelLonely: z.enum(['quite often', 'sometimes', 'almost never', 'prefer not to answer']),
243+
seeFriendsAndRelativesAsYouWant: z.enum([
244+
'as often as wants to',
245+
'somewhat unhappy about how little',
246+
'prefer not to answer'
247+
]),
248+
someoneTakeCareOfYouWhenNeeded: z.enum(['yes', 'no one willing and able', 'prefer not to answer']),
249+
someoneTakeCareOfYouAsLongAsYouNeed: z
250+
.enum([
251+
'Someone who would take care of you indefinitely (as long as needed)',
252+
'Someone who would take care of you for a short time (a few weeks to six months)',
253+
'Someone who would help you now and then (taking you to the doctor, fixing lunch, etc.)',
254+
'prefer not to answer'
255+
])
256+
.optional()
257+
}),
258+
measures: {
259+
peopleYouKnowCanVisitTheirHome: {
260+
kind: 'const',
261+
ref: 'peopleYouKnowCanVisitTheirHome'
262+
},
263+
numbersOfCallsLastWeek: {
264+
kind: 'const',
265+
ref: 'numbersOfCallsLastWeek'
266+
},
267+
numbersOfTimeSpentWithSomeoneLastWeek: {
268+
kind: 'const',
269+
ref: 'numbersOfTimeSpentWithSomeoneLastWeek'
270+
},
271+
haveSomeoneYouTrust: {
272+
kind: 'const',
273+
ref: 'haveSomeoneYouTrust'
274+
},
275+
doYouFeelLonely: {
276+
kind: 'const',
277+
ref: 'doYouFeelLonely'
278+
},
279+
seeFriendsAndRelativesAsYouWant: {
280+
kind: 'const',
281+
ref: 'seeFriendsAndRelativesAsYouWant'
282+
},
283+
someoneTakeCareOfYouWhenNeeded: {
284+
kind: 'const',
285+
ref: 'someoneTakeCareOfYouWhenNeeded'
286+
},
287+
someoneTakeCareOfYouAsLongAsYouNeed: {
288+
kind: 'computed',
289+
label: {
290+
en: 'Is there someone who would take care of you as long as you needed, or only for a short time, or only someone who would help you now and then (for example, taking you to the doctor or fixing lunch occasionally, etc.)?',
291+
fr: "Y a-t-il une personne qui prendrait soin de vous aussi longtemps qu'il le faudrait une courte période, ou qui vous aiderait de temps en temps seulement, par exemple, une personne qui vous conduirait chez le médcin ou vous ferait à déjeuner occasionnellement, etc."
292+
},
293+
value: (data) => {
294+
return data.someoneTakeCareOfYouAsLongAsYouNeed ?? 'N/A';
295+
}
296+
}
297+
}
298+
});

0 commit comments

Comments
 (0)