psytools 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -16
- package/SOURCES.md +81 -0
- package/dist/cjs/assessment.d.ts +3 -2
- package/dist/cjs/assessment.js +13 -3
- package/dist/cjs/evaluation.d.ts +5 -3
- package/dist/cjs/evaluation.js +49 -8
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +6 -1
- package/dist/cjs/inventories/aq10.d.ts +12 -0
- package/dist/cjs/inventories/aq10.js +183 -0
- package/dist/cjs/inventories/asrs6.d.ts +11 -0
- package/dist/cjs/inventories/asrs6.js +130 -0
- package/dist/cjs/inventories/audit.d.ts +10 -0
- package/dist/cjs/inventories/audit.js +231 -0
- package/dist/cjs/inventories/dass21.js +3 -1
- package/dist/cjs/inventories/gad7.js +3 -1
- package/dist/cjs/inventories/index.d.ts +7 -2
- package/dist/cjs/inventories/index.js +16 -1
- package/dist/cjs/inventories/mini-ipip.d.ts +11 -0
- package/dist/cjs/inventories/mini-ipip.js +272 -0
- package/dist/cjs/inventories/phq9.js +3 -1
- package/dist/cjs/inventories/who5.d.ts +11 -0
- package/dist/cjs/inventories/who5.js +152 -0
- package/dist/cjs/types.d.ts +24 -2
- package/dist/esm/assessment.d.ts +3 -2
- package/dist/esm/assessment.js +13 -3
- package/dist/esm/evaluation.d.ts +5 -3
- package/dist/esm/evaluation.js +49 -8
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/inventories/aq10.d.ts +12 -0
- package/dist/esm/inventories/aq10.js +180 -0
- package/dist/esm/inventories/asrs6.d.ts +11 -0
- package/dist/esm/inventories/asrs6.js +127 -0
- package/dist/esm/inventories/audit.d.ts +10 -0
- package/dist/esm/inventories/audit.js +228 -0
- package/dist/esm/inventories/dass21.js +3 -1
- package/dist/esm/inventories/gad7.js +3 -1
- package/dist/esm/inventories/index.d.ts +7 -2
- package/dist/esm/inventories/index.js +11 -1
- package/dist/esm/inventories/mini-ipip.d.ts +11 -0
- package/dist/esm/inventories/mini-ipip.js +269 -0
- package/dist/esm/inventories/phq9.js +3 -1
- package/dist/esm/inventories/who5.d.ts +11 -0
- package/dist/esm/inventories/who5.js +149 -0
- package/dist/esm/types.d.ts +24 -2
- package/package.json +14 -3
- package/schema/assessment-definition.schema.json +27 -1
- package/src/assessment.ts +14 -3
- package/src/evaluation.ts +55 -9
- package/src/index.ts +7 -0
- package/src/inventories/aq10.ts +185 -0
- package/src/inventories/asrs6.ts +132 -0
- package/src/inventories/audit.ts +234 -0
- package/src/inventories/dass21.ts +4 -1
- package/src/inventories/gad7.ts +4 -1
- package/src/inventories/index.ts +20 -2
- package/src/inventories/mini-ipip.ts +274 -0
- package/src/inventories/phq9.ts +4 -1
- package/src/inventories/who5.ts +153 -0
- package/src/types.ts +26 -2
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.miniIpip = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Mini-IPIP — 20-item short form of the International Personality Item
|
|
6
|
+
* Pool Five-Factor Model measure (Donnellan et al., 2006).
|
|
7
|
+
*
|
|
8
|
+
* Measures the Big Five personality traits with 4 items each on a 1–5
|
|
9
|
+
* accuracy scale; half the items are reverse-keyed. Trait scores are
|
|
10
|
+
* descriptive (4–20 per trait, higher = more of the trait) — there are no
|
|
11
|
+
* clinical cutoffs, so no bands are defined. IPIP items are public domain.
|
|
12
|
+
*/
|
|
13
|
+
exports.miniIpip = {
|
|
14
|
+
id: "mini-ipip",
|
|
15
|
+
version: "1.0.0",
|
|
16
|
+
title: {
|
|
17
|
+
en: "Mini-IPIP Big Five Personality Scale",
|
|
18
|
+
tr: "Mini-IPIP Beş Faktör Kişilik Ölçeği",
|
|
19
|
+
de: "Mini-IPIP Big-Five-Persönlichkeitsskala",
|
|
20
|
+
},
|
|
21
|
+
description: {
|
|
22
|
+
en: "A 20-item public-domain measure of the Big Five personality traits (extraversion, agreeableness, conscientiousness, neuroticism, openness), drawn from the International Personality Item Pool.",
|
|
23
|
+
tr: "Uluslararası Kişilik Madde Havuzu'ndan (IPIP) türetilmiş, Beş Faktör kişilik özelliklerini (dışadönüklük, uyumluluk, sorumluluk, duygusal dengesizlik, deneyime açıklık) ölçen 20 maddelik kamu malı bir ölçek.",
|
|
24
|
+
de: "Ein gemeinfreies 20-Item-Instrument zur Messung der Big-Five-Persönlichkeitsmerkmale (Extraversion, Verträglichkeit, Gewissenhaftigkeit, Neurotizismus, Offenheit) aus dem International Personality Item Pool.",
|
|
25
|
+
},
|
|
26
|
+
instructions: {
|
|
27
|
+
en: "Describe yourself as you generally are now, not as you wish to be in the future. Indicate how accurately each statement describes you.",
|
|
28
|
+
tr: "Kendinizi gelecekte olmak istediğiniz gibi değil, şu anda genel olarak olduğunuz gibi tanımlayın. Her ifadenin sizi ne kadar doğru tanımladığını belirtin.",
|
|
29
|
+
de: "Beschreiben Sie sich so, wie Sie im Allgemeinen jetzt sind, nicht wie Sie in Zukunft sein möchten. Geben Sie an, wie zutreffend jede Aussage Sie beschreibt.",
|
|
30
|
+
},
|
|
31
|
+
defaultLocale: "en",
|
|
32
|
+
options: [
|
|
33
|
+
{
|
|
34
|
+
value: 1,
|
|
35
|
+
label: { en: "Very inaccurate", tr: "Bana hiç uymuyor", de: "Trifft überhaupt nicht zu" },
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
value: 2,
|
|
39
|
+
label: { en: "Moderately inaccurate", tr: "Bana pek uymuyor", de: "Trifft eher nicht zu" },
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
value: 3,
|
|
43
|
+
label: {
|
|
44
|
+
en: "Neither accurate nor inaccurate",
|
|
45
|
+
tr: "Ne uyuyor ne uymuyor",
|
|
46
|
+
de: "Weder zutreffend noch unzutreffend",
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
value: 4,
|
|
51
|
+
label: { en: "Moderately accurate", tr: "Bana oldukça uyuyor", de: "Trifft eher zu" },
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
value: 5,
|
|
55
|
+
label: { en: "Very accurate", tr: "Bana tamamen uyuyor", de: "Trifft voll und ganz zu" },
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
questions: [
|
|
59
|
+
{
|
|
60
|
+
id: "mini-ipip-1",
|
|
61
|
+
text: {
|
|
62
|
+
en: "I am the life of the party",
|
|
63
|
+
tr: "Bulunduğum ortamın neşe kaynağıyımdır",
|
|
64
|
+
de: "Ich bin der Mittelpunkt jeder Party",
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: "mini-ipip-2",
|
|
69
|
+
text: {
|
|
70
|
+
en: "I sympathize with others' feelings",
|
|
71
|
+
tr: "Başkalarının duygularını paylaşırım",
|
|
72
|
+
de: "Ich fühle mit anderen mit",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: "mini-ipip-3",
|
|
77
|
+
text: {
|
|
78
|
+
en: "I get chores done right away",
|
|
79
|
+
tr: "Günlük işlerimi hemen hallederim",
|
|
80
|
+
de: "Ich erledige anstehende Aufgaben sofort",
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: "mini-ipip-4",
|
|
85
|
+
text: {
|
|
86
|
+
en: "I have frequent mood swings",
|
|
87
|
+
tr: "Ruh halim sık sık değişir",
|
|
88
|
+
de: "Meine Stimmung schwankt häufig",
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
id: "mini-ipip-5",
|
|
93
|
+
text: {
|
|
94
|
+
en: "I have a vivid imagination",
|
|
95
|
+
tr: "Canlı bir hayal gücüm vardır",
|
|
96
|
+
de: "Ich habe eine lebhafte Fantasie",
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
id: "mini-ipip-6",
|
|
101
|
+
text: {
|
|
102
|
+
en: "I don't talk a lot",
|
|
103
|
+
tr: "Çok konuşmam",
|
|
104
|
+
de: "Ich rede nicht viel",
|
|
105
|
+
},
|
|
106
|
+
reverseScored: true,
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
id: "mini-ipip-7",
|
|
110
|
+
text: {
|
|
111
|
+
en: "I am not interested in other people's problems",
|
|
112
|
+
tr: "Başkalarının sorunlarıyla ilgilenmem",
|
|
113
|
+
de: "Die Probleme anderer Menschen interessieren mich nicht",
|
|
114
|
+
},
|
|
115
|
+
reverseScored: true,
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
id: "mini-ipip-8",
|
|
119
|
+
text: {
|
|
120
|
+
en: "I often forget to put things back in their proper place",
|
|
121
|
+
tr: "Eşyaları yerine koymayı sık sık unuturum",
|
|
122
|
+
de: "Ich vergesse oft, Dinge an ihren Platz zurückzulegen",
|
|
123
|
+
},
|
|
124
|
+
reverseScored: true,
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
id: "mini-ipip-9",
|
|
128
|
+
text: {
|
|
129
|
+
en: "I am relaxed most of the time",
|
|
130
|
+
tr: "Çoğu zaman rahat ve sakinimdir",
|
|
131
|
+
de: "Ich bin die meiste Zeit entspannt",
|
|
132
|
+
},
|
|
133
|
+
reverseScored: true,
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
id: "mini-ipip-10",
|
|
137
|
+
text: {
|
|
138
|
+
en: "I am not interested in abstract ideas",
|
|
139
|
+
tr: "Soyut fikirlerle ilgilenmem",
|
|
140
|
+
de: "Ich interessiere mich nicht für abstrakte Ideen",
|
|
141
|
+
},
|
|
142
|
+
reverseScored: true,
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
id: "mini-ipip-11",
|
|
146
|
+
text: {
|
|
147
|
+
en: "I talk to a lot of different people at parties",
|
|
148
|
+
tr: "Sosyal ortamlarda birçok farklı insanla konuşurum",
|
|
149
|
+
de: "Auf Partys spreche ich mit vielen verschiedenen Leuten",
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
id: "mini-ipip-12",
|
|
154
|
+
text: {
|
|
155
|
+
en: "I feel others' emotions",
|
|
156
|
+
tr: "Başkalarının duygularını hissederim",
|
|
157
|
+
de: "Ich spüre die Gefühle anderer",
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
id: "mini-ipip-13",
|
|
162
|
+
text: {
|
|
163
|
+
en: "I like order",
|
|
164
|
+
tr: "Düzeni severim",
|
|
165
|
+
de: "Ich mag Ordnung",
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
id: "mini-ipip-14",
|
|
170
|
+
text: {
|
|
171
|
+
en: "I get upset easily",
|
|
172
|
+
tr: "Kolayca keyfim kaçar",
|
|
173
|
+
de: "Ich rege mich leicht auf",
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
id: "mini-ipip-15",
|
|
178
|
+
text: {
|
|
179
|
+
en: "I have difficulty understanding abstract ideas",
|
|
180
|
+
tr: "Soyut fikirleri anlamakta zorlanırım",
|
|
181
|
+
de: "Es fällt mir schwer, abstrakte Ideen zu verstehen",
|
|
182
|
+
},
|
|
183
|
+
reverseScored: true,
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
id: "mini-ipip-16",
|
|
187
|
+
text: {
|
|
188
|
+
en: "I keep in the background",
|
|
189
|
+
tr: "Arka planda kalmayı tercih ederim",
|
|
190
|
+
de: "Ich halte mich im Hintergrund",
|
|
191
|
+
},
|
|
192
|
+
reverseScored: true,
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
id: "mini-ipip-17",
|
|
196
|
+
text: {
|
|
197
|
+
en: "I am not really interested in others",
|
|
198
|
+
tr: "Başkalarıyla pek ilgilenmem",
|
|
199
|
+
de: "Ich interessiere mich nicht wirklich für andere",
|
|
200
|
+
},
|
|
201
|
+
reverseScored: true,
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
id: "mini-ipip-18",
|
|
205
|
+
text: {
|
|
206
|
+
en: "I make a mess of things",
|
|
207
|
+
tr: "Ortalığı dağınık bırakırım",
|
|
208
|
+
de: "Bei mir geht alles drunter und drüber",
|
|
209
|
+
},
|
|
210
|
+
reverseScored: true,
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
id: "mini-ipip-19",
|
|
214
|
+
text: {
|
|
215
|
+
en: "I seldom feel blue",
|
|
216
|
+
tr: "Nadiren hüzünlenirim",
|
|
217
|
+
de: "Ich fühle mich selten niedergeschlagen",
|
|
218
|
+
},
|
|
219
|
+
reverseScored: true,
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
id: "mini-ipip-20",
|
|
223
|
+
text: {
|
|
224
|
+
en: "I do not have a good imagination",
|
|
225
|
+
tr: "İyi bir hayal gücüm yoktur",
|
|
226
|
+
de: "Ich habe keine gute Vorstellungskraft",
|
|
227
|
+
},
|
|
228
|
+
reverseScored: true,
|
|
229
|
+
},
|
|
230
|
+
],
|
|
231
|
+
scoring: {
|
|
232
|
+
kind: "subscales",
|
|
233
|
+
subscales: [
|
|
234
|
+
{
|
|
235
|
+
id: "extraversion",
|
|
236
|
+
label: { en: "Extraversion", tr: "Dışadönüklük", de: "Extraversion" },
|
|
237
|
+
questionIds: ["mini-ipip-1", "mini-ipip-6", "mini-ipip-11", "mini-ipip-16"],
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
id: "agreeableness",
|
|
241
|
+
label: { en: "Agreeableness", tr: "Uyumluluk", de: "Verträglichkeit" },
|
|
242
|
+
questionIds: ["mini-ipip-2", "mini-ipip-7", "mini-ipip-12", "mini-ipip-17"],
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
id: "conscientiousness",
|
|
246
|
+
label: { en: "Conscientiousness", tr: "Sorumluluk", de: "Gewissenhaftigkeit" },
|
|
247
|
+
questionIds: ["mini-ipip-3", "mini-ipip-8", "mini-ipip-13", "mini-ipip-18"],
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
id: "neuroticism",
|
|
251
|
+
label: { en: "Neuroticism", tr: "Duygusal Dengesizlik", de: "Neurotizismus" },
|
|
252
|
+
questionIds: ["mini-ipip-4", "mini-ipip-9", "mini-ipip-14", "mini-ipip-19"],
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
id: "openness",
|
|
256
|
+
label: {
|
|
257
|
+
en: "Openness (Intellect/Imagination)",
|
|
258
|
+
tr: "Deneyime Açıklık",
|
|
259
|
+
de: "Offenheit (Intellekt/Vorstellungskraft)",
|
|
260
|
+
},
|
|
261
|
+
questionIds: ["mini-ipip-5", "mini-ipip-10", "mini-ipip-15", "mini-ipip-20"],
|
|
262
|
+
},
|
|
263
|
+
],
|
|
264
|
+
},
|
|
265
|
+
meta: {
|
|
266
|
+
reference: "Donnellan, M. B., Oswald, F. L., Baird, B. M., & Lucas, R. E. (2006). The Mini-IPIP scales: tiny-yet-effective measures of the Big Five factors of personality. Psychological Assessment, 18(2), 192-203.",
|
|
267
|
+
license: "Free — public domain (International Personality Item Pool, ipip.ori.org), created explicitly to be free of copyright restrictions",
|
|
268
|
+
licenseFlag: "free",
|
|
269
|
+
translationProvenance: "en: reproduced from the original. tr/de: AI translation (Anthropic Claude, claude-fable-5) from the original English; official translations were not consulted and the texts are unverified. See SOURCES.md.",
|
|
270
|
+
note: "Descriptive personality traits, not a clinical screen — no cutoff bands are defined.",
|
|
271
|
+
},
|
|
272
|
+
};
|
|
@@ -150,7 +150,9 @@ exports.phq9 = {
|
|
|
150
150
|
},
|
|
151
151
|
meta: {
|
|
152
152
|
reference: "Kroenke, K., Spitzer, R. L., & Williams, J. B. (2001). The PHQ-9: validity of a brief depression severity measure. Journal of General Internal Medicine, 16(9), 606-613.",
|
|
153
|
-
license: "
|
|
153
|
+
license: "Free — no permission required to reproduce, translate, display or distribute (Pfizer educational grant)",
|
|
154
|
+
licenseFlag: "free",
|
|
155
|
+
translationProvenance: "en: reproduced from the original. tr/de: AI translation (Anthropic Claude, claude-fable-5) from the original English; official translations were not consulted and the texts are unverified. See SOURCES.md.",
|
|
154
156
|
timeframe: "past 2 weeks",
|
|
155
157
|
},
|
|
156
158
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AssessmentDefinition } from "../types.ts";
|
|
2
|
+
/**
|
|
3
|
+
* WHO-5 — World Health Organization Well-Being Index.
|
|
4
|
+
*
|
|
5
|
+
* 5 positively worded items, 0–5 frequency scale over the past two weeks.
|
|
6
|
+
* The raw sum (0–25) is multiplied by 4 and reported as a 0–100 percentage;
|
|
7
|
+
* higher scores mean better well-being. A score of 50 or below indicates
|
|
8
|
+
* reduced well-being and warrants screening for depression; 28 or below
|
|
9
|
+
* indicates likely depression (Topp et al., 2015). Free to use.
|
|
10
|
+
*/
|
|
11
|
+
export declare const who5: AssessmentDefinition;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.who5 = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* WHO-5 — World Health Organization Well-Being Index.
|
|
6
|
+
*
|
|
7
|
+
* 5 positively worded items, 0–5 frequency scale over the past two weeks.
|
|
8
|
+
* The raw sum (0–25) is multiplied by 4 and reported as a 0–100 percentage;
|
|
9
|
+
* higher scores mean better well-being. A score of 50 or below indicates
|
|
10
|
+
* reduced well-being and warrants screening for depression; 28 or below
|
|
11
|
+
* indicates likely depression (Topp et al., 2015). Free to use.
|
|
12
|
+
*/
|
|
13
|
+
exports.who5 = {
|
|
14
|
+
id: "who5",
|
|
15
|
+
version: "1.0.0",
|
|
16
|
+
title: {
|
|
17
|
+
en: "WHO-5 Well-Being Index",
|
|
18
|
+
tr: "WHO-5 İyilik Hali İndeksi",
|
|
19
|
+
de: "WHO-5-Index zum Wohlbefinden",
|
|
20
|
+
},
|
|
21
|
+
description: {
|
|
22
|
+
en: "A 5-item self-report scale measuring subjective psychological well-being over the past two weeks. Higher scores mean better well-being.",
|
|
23
|
+
tr: "Son iki hafta içindeki öznel psikolojik iyilik halini ölçen 5 maddelik bir öz bildirim ölçeği. Yüksek puan daha iyi bir iyilik haline işaret eder.",
|
|
24
|
+
de: "Eine Selbstbeurteilungsskala mit 5 Items zur Messung des subjektiven psychischen Wohlbefindens in den letzten zwei Wochen. Höhere Werte bedeuten besseres Wohlbefinden.",
|
|
25
|
+
},
|
|
26
|
+
instructions: {
|
|
27
|
+
en: "Please indicate for each of the five statements which is closest to how you have been feeling over the last two weeks.",
|
|
28
|
+
tr: "Lütfen aşağıdaki beş ifadenin her biri için, son iki hafta içinde kendinizi nasıl hissettiğinize en yakın olan seçeneği işaretleyin.",
|
|
29
|
+
de: "Bitte geben Sie für jede der fünf Aussagen an, welche Antwort Ihrem Befinden in den letzten zwei Wochen am nächsten kommt.",
|
|
30
|
+
},
|
|
31
|
+
defaultLocale: "en",
|
|
32
|
+
options: [
|
|
33
|
+
{
|
|
34
|
+
value: 0,
|
|
35
|
+
label: { en: "At no time", tr: "Hiçbir zaman", de: "Zu keinem Zeitpunkt" },
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
value: 1,
|
|
39
|
+
label: { en: "Some of the time", tr: "Bazen", de: "Ab und zu" },
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
value: 2,
|
|
43
|
+
label: {
|
|
44
|
+
en: "Less than half of the time",
|
|
45
|
+
tr: "Zamanın yarısından az",
|
|
46
|
+
de: "Etwas weniger als die Hälfte der Zeit",
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
value: 3,
|
|
51
|
+
label: {
|
|
52
|
+
en: "More than half of the time",
|
|
53
|
+
tr: "Zamanın yarısından çok",
|
|
54
|
+
de: "Etwas mehr als die Hälfte der Zeit",
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
value: 4,
|
|
59
|
+
label: { en: "Most of the time", tr: "Çoğu zaman", de: "Meistens" },
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
value: 5,
|
|
63
|
+
label: { en: "All of the time", tr: "Her zaman", de: "Die ganze Zeit" },
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
questions: [
|
|
67
|
+
{
|
|
68
|
+
id: "who5-1",
|
|
69
|
+
text: {
|
|
70
|
+
en: "I have felt cheerful and in good spirits",
|
|
71
|
+
tr: "Kendimi neşeli ve keyifli hissettim",
|
|
72
|
+
de: "Ich war froh und guter Laune",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: "who5-2",
|
|
77
|
+
text: {
|
|
78
|
+
en: "I have felt calm and relaxed",
|
|
79
|
+
tr: "Kendimi sakin ve rahatlamış hissettim",
|
|
80
|
+
de: "Ich habe mich ruhig und entspannt gefühlt",
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: "who5-3",
|
|
85
|
+
text: {
|
|
86
|
+
en: "I have felt active and vigorous",
|
|
87
|
+
tr: "Kendimi aktif ve dinç hissettim",
|
|
88
|
+
de: "Ich habe mich energisch und aktiv gefühlt",
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
id: "who5-4",
|
|
93
|
+
text: {
|
|
94
|
+
en: "I woke up feeling fresh and rested",
|
|
95
|
+
tr: "Uyandığımda kendimi dinlenmiş ve zinde hissettim",
|
|
96
|
+
de: "Ich habe mich beim Aufwachen frisch und ausgeruht gefühlt",
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
id: "who5-5",
|
|
101
|
+
text: {
|
|
102
|
+
en: "My daily life has been filled with things that interest me",
|
|
103
|
+
tr: "Günlük yaşamım ilgimi çeken şeylerle doluydu",
|
|
104
|
+
de: "Mein Alltag war voller Dinge, die mich interessieren",
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
scoring: {
|
|
109
|
+
kind: "sum",
|
|
110
|
+
multiplier: 4,
|
|
111
|
+
bands: [
|
|
112
|
+
{
|
|
113
|
+
id: "low",
|
|
114
|
+
min: 0,
|
|
115
|
+
max: 28,
|
|
116
|
+
label: {
|
|
117
|
+
en: "Low well-being — indicates likely depression, assessment recommended",
|
|
118
|
+
tr: "Düşük iyilik hali — olası depresyona işaret eder, değerlendirme önerilir",
|
|
119
|
+
de: "Niedriges Wohlbefinden — Hinweis auf wahrscheinliche Depression, Abklärung empfohlen",
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
id: "reduced",
|
|
124
|
+
min: 29,
|
|
125
|
+
max: 50,
|
|
126
|
+
label: {
|
|
127
|
+
en: "Reduced well-being — screening for depression recommended",
|
|
128
|
+
tr: "Azalmış iyilik hali — depresyon taraması önerilir",
|
|
129
|
+
de: "Vermindertes Wohlbefinden — Depressionsscreening empfohlen",
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
id: "good",
|
|
134
|
+
min: 51,
|
|
135
|
+
max: 100,
|
|
136
|
+
label: {
|
|
137
|
+
en: "Good well-being",
|
|
138
|
+
tr: "İyi düzeyde iyilik hali",
|
|
139
|
+
de: "Gutes Wohlbefinden",
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
],
|
|
143
|
+
},
|
|
144
|
+
meta: {
|
|
145
|
+
reference: "Topp, C. W., Østergaard, S. D., Søndergaard, S., & Bech, P. (2015). The WHO-5 Well-Being Index: a systematic review of the literature. Psychotherapy and Psychosomatics, 84(3), 167-176.",
|
|
146
|
+
license: "Free — may be used without permission (WHO Regional Office for Europe / Psychiatric Research Unit, Hillerød)",
|
|
147
|
+
licenseFlag: "free",
|
|
148
|
+
translationProvenance: "en: reproduced from the original. tr/de: AI translation (Anthropic Claude, claude-fable-5) from the original English; official translations were not consulted and the texts are unverified. See SOURCES.md.",
|
|
149
|
+
timeframe: "past 2 weeks",
|
|
150
|
+
note: "Positively worded: higher scores mean better well-being.",
|
|
151
|
+
},
|
|
152
|
+
};
|
package/dist/cjs/types.d.ts
CHANGED
|
@@ -60,7 +60,9 @@ export interface ScoreFlag {
|
|
|
60
60
|
/** Sums all answers into a single total score (PHQ-9, GAD-7, ...). */
|
|
61
61
|
export interface SumScoring {
|
|
62
62
|
kind: "sum";
|
|
63
|
-
/**
|
|
63
|
+
/** Multiplier applied to the raw sum (WHO-5 reports raw x 4 as 0-100). */
|
|
64
|
+
multiplier?: number;
|
|
65
|
+
/** Severity bands the (multiplied) total is matched against. */
|
|
64
66
|
bands?: ScoreBand[];
|
|
65
67
|
flags?: ScoreFlag[];
|
|
66
68
|
}
|
|
@@ -81,8 +83,28 @@ export interface SubscaleScoring {
|
|
|
81
83
|
subscales: SubscaleDefinition[];
|
|
82
84
|
flags?: ScoreFlag[];
|
|
83
85
|
}
|
|
86
|
+
/** One item of a `count` scoring: when it counts as screen-positive. */
|
|
87
|
+
export interface CountScoringItem {
|
|
88
|
+
questionId: string;
|
|
89
|
+
/**
|
|
90
|
+
* The item counts as positive when its answer value is >= this.
|
|
91
|
+
* `reverseScored` questions are inverted against their scale first.
|
|
92
|
+
*/
|
|
93
|
+
minValue: number;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Counts how many items cross their per-item threshold (ASRS v1.1,
|
|
97
|
+
* AQ-10, ...). The score is the number of positive items.
|
|
98
|
+
*/
|
|
99
|
+
export interface CountScoring {
|
|
100
|
+
kind: "count";
|
|
101
|
+
items: CountScoringItem[];
|
|
102
|
+
/** Bands the positive-item count is matched against. */
|
|
103
|
+
bands?: ScoreBand[];
|
|
104
|
+
flags?: ScoreFlag[];
|
|
105
|
+
}
|
|
84
106
|
/** Declarative, serializable scoring rules built into psytools. */
|
|
85
|
-
export type ScoringDefinition = SumScoring | SubscaleScoring;
|
|
107
|
+
export type ScoringDefinition = SumScoring | SubscaleScoring | CountScoring;
|
|
86
108
|
/**
|
|
87
109
|
* The complete, serializable description of an assessment.
|
|
88
110
|
*
|
package/dist/esm/assessment.d.ts
CHANGED
|
@@ -38,9 +38,10 @@ export declare class Assessment {
|
|
|
38
38
|
*
|
|
39
39
|
* When given an `AssessmentResponse`, its status must be `complete` or
|
|
40
40
|
* `submitted` — pass `allowIncomplete` to score partial responses anyway.
|
|
41
|
-
* Raw answer maps
|
|
41
|
+
* Raw answer maps skip the completeness check, but their values are
|
|
42
|
+
* still validated against the option scales.
|
|
42
43
|
*
|
|
43
|
-
* @throws PsytoolsError `incomplete_response` | `no_scoring`
|
|
44
|
+
* @throws PsytoolsError `incomplete_response` | `unknown_question` | `invalid_value` | `no_scoring`
|
|
44
45
|
*/
|
|
45
46
|
evaluate(response: AssessmentResponse | Record<string, number>, evaluator?: Evaluator, options?: {
|
|
46
47
|
allowIncomplete?: boolean;
|
package/dist/esm/assessment.js
CHANGED
|
@@ -73,7 +73,16 @@ export function validateDefinition(input) {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
|
|
76
|
+
if (scoring.kind === "count" && Array.isArray(scoring.items)) {
|
|
77
|
+
for (const item of scoring.items) {
|
|
78
|
+
if (!seen.has(item.questionId)) {
|
|
79
|
+
issues.push({ code: "unknown_question", message: `count scoring references unknown question "${item.questionId}"`, questionId: item.questionId });
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const flags = scoring.kind === "sum" || scoring.kind === "subscales" || scoring.kind === "count"
|
|
84
|
+
? scoring.flags ?? []
|
|
85
|
+
: [];
|
|
77
86
|
for (const flag of flags) {
|
|
78
87
|
if (!seen.has(flag.questionId)) {
|
|
79
88
|
issues.push({ code: "unknown_question", message: `flag "${flag.id}" references unknown question "${flag.questionId}"`, questionId: flag.questionId });
|
|
@@ -182,9 +191,10 @@ export class Assessment {
|
|
|
182
191
|
*
|
|
183
192
|
* When given an `AssessmentResponse`, its status must be `complete` or
|
|
184
193
|
* `submitted` — pass `allowIncomplete` to score partial responses anyway.
|
|
185
|
-
* Raw answer maps
|
|
194
|
+
* Raw answer maps skip the completeness check, but their values are
|
|
195
|
+
* still validated against the option scales.
|
|
186
196
|
*
|
|
187
|
-
* @throws PsytoolsError `incomplete_response` | `no_scoring`
|
|
197
|
+
* @throws PsytoolsError `incomplete_response` | `unknown_question` | `invalid_value` | `no_scoring`
|
|
188
198
|
*/
|
|
189
199
|
evaluate(response, evaluator, options) {
|
|
190
200
|
if (response instanceof AssessmentResponse) {
|
package/dist/esm/evaluation.d.ts
CHANGED
|
@@ -2,9 +2,11 @@ import type { AnswerMap, AssessmentDefinition, EvaluationResult, Evaluator } fro
|
|
|
2
2
|
/**
|
|
3
3
|
* Evaluates answers against an assessment definition.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Every answer is first validated against the assessment: the question must
|
|
6
|
+
* exist and the value must belong to its option scale. Then `evaluator` is
|
|
7
|
+
* used when given; otherwise the definition's declarative `scoring`
|
|
8
|
+
* (`sum` or `subscales`) applies.
|
|
7
9
|
*
|
|
8
|
-
* @throws PsytoolsError `
|
|
10
|
+
* @throws PsytoolsError `unknown_question` | `invalid_value` | `no_scoring`
|
|
9
11
|
*/
|
|
10
12
|
export declare function evaluate(definition: AssessmentDefinition, answers: AnswerMap, evaluator?: Evaluator): EvaluationResult;
|
package/dist/esm/evaluation.js
CHANGED
|
@@ -2,12 +2,15 @@ import { PsytoolsError } from "./errors.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* Evaluates answers against an assessment definition.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Every answer is first validated against the assessment: the question must
|
|
6
|
+
* exist and the value must belong to its option scale. Then `evaluator` is
|
|
7
|
+
* used when given; otherwise the definition's declarative `scoring`
|
|
8
|
+
* (`sum` or `subscales`) applies.
|
|
7
9
|
*
|
|
8
|
-
* @throws PsytoolsError `
|
|
10
|
+
* @throws PsytoolsError `unknown_question` | `invalid_value` | `no_scoring`
|
|
9
11
|
*/
|
|
10
12
|
export function evaluate(definition, answers, evaluator) {
|
|
13
|
+
assertValidAnswers(definition, answers);
|
|
11
14
|
if (evaluator)
|
|
12
15
|
return evaluator(definition, answers);
|
|
13
16
|
const scoring = definition.scoring;
|
|
@@ -16,7 +19,30 @@ export function evaluate(definition, answers, evaluator) {
|
|
|
16
19
|
}
|
|
17
20
|
switch (scoring.kind) {
|
|
18
21
|
case "sum":
|
|
19
|
-
return evaluateSum(definition, answers, scoring
|
|
22
|
+
return evaluateSum(definition, answers, scoring);
|
|
23
|
+
case "count": {
|
|
24
|
+
let score = 0;
|
|
25
|
+
for (const item of scoring.items) {
|
|
26
|
+
const question = requireQuestion(definition, item.questionId);
|
|
27
|
+
const answered = answers[question.id];
|
|
28
|
+
if (answered === undefined)
|
|
29
|
+
continue;
|
|
30
|
+
const values = (question.options ?? definition.options).map((o) => o.value);
|
|
31
|
+
const effective = question.reverseScored
|
|
32
|
+
? Math.max(...values) + Math.min(...values) - answered
|
|
33
|
+
: answered;
|
|
34
|
+
if (effective >= item.minValue)
|
|
35
|
+
score += 1;
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
kind: "scale",
|
|
39
|
+
score,
|
|
40
|
+
min: 0,
|
|
41
|
+
max: scoring.items.length,
|
|
42
|
+
...bandOf(score, scoring.bands),
|
|
43
|
+
flags: triggeredFlags(answers, scoring.flags),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
20
46
|
case "subscales": {
|
|
21
47
|
const scales = scoring.subscales.map((subscale) => {
|
|
22
48
|
const questions = subscale.questionIds.map((id) => requireQuestion(definition, id));
|
|
@@ -41,15 +67,30 @@ export function evaluate(definition, answers, evaluator) {
|
|
|
41
67
|
throw new PsytoolsError("no_scoring", `Unsupported scoring kind "${scoring.kind}"`);
|
|
42
68
|
}
|
|
43
69
|
}
|
|
44
|
-
function
|
|
45
|
-
const
|
|
70
|
+
function assertValidAnswers(definition, answers) {
|
|
71
|
+
const questions = new Map(definition.questions.map((q) => [q.id, q]));
|
|
72
|
+
for (const [questionId, value] of Object.entries(answers)) {
|
|
73
|
+
const question = questions.get(questionId);
|
|
74
|
+
if (!question) {
|
|
75
|
+
throw new PsytoolsError("unknown_question", `Answers reference unknown question "${questionId}" in assessment "${definition.id}"`);
|
|
76
|
+
}
|
|
77
|
+
const options = question.options ?? definition.options;
|
|
78
|
+
if (!options.some((option) => option.value === value)) {
|
|
79
|
+
const allowed = options.map((option) => option.value).join(", ");
|
|
80
|
+
throw new PsytoolsError("invalid_value", `Value ${value} is not a valid option for question "${questionId}" (allowed: ${allowed})`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function evaluateSum(definition, answers, scoring) {
|
|
85
|
+
const multiplier = scoring.multiplier ?? 1;
|
|
86
|
+
const { score, min, max } = sumQuestions(definition, definition.questions, answers, multiplier);
|
|
46
87
|
return {
|
|
47
88
|
kind: "scale",
|
|
48
89
|
score,
|
|
49
90
|
min,
|
|
50
91
|
max,
|
|
51
|
-
...bandOf(score, bands),
|
|
52
|
-
flags: triggeredFlags(answers, flags),
|
|
92
|
+
...bandOf(score, scoring.bands),
|
|
93
|
+
flags: triggeredFlags(answers, scoring.flags),
|
|
53
94
|
};
|
|
54
95
|
}
|
|
55
96
|
function sumQuestions(definition, questions, answers, multiplier) {
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export type { LocalizedText, AssessmentOption, AssessmentQuestion, AssessmentDefinition, ScoreBand, ScoreFlag, SumScoring, SubscaleDefinition, SubscaleScoring, ScoringDefinition, AnswerMap, ResponseStatus, ResponseData, ValidationIssue, ValidationResult, BandResult, TriggeredFlag, ScaleScore, ScaleResult, MultiScaleResult, CategoricalResult, CustomResult, EvaluationResult, Evaluator, LocalizedAssessmentView, } from "./types.ts";
|
|
1
|
+
export type { LocalizedText, AssessmentOption, AssessmentQuestion, AssessmentDefinition, ScoreBand, ScoreFlag, SumScoring, SubscaleDefinition, SubscaleScoring, CountScoringItem, CountScoring, ScoringDefinition, AnswerMap, ResponseStatus, ResponseData, ValidationIssue, ValidationResult, BandResult, TriggeredFlag, ScaleScore, ScaleResult, MultiScaleResult, CategoricalResult, CustomResult, EvaluationResult, Evaluator, LocalizedAssessmentView, } from "./types.ts";
|
|
2
2
|
export { PsytoolsError } from "./errors.ts";
|
|
3
3
|
export { localize, collectLocales } from "./i18n.ts";
|
|
4
4
|
export { Assessment, validateDefinition } from "./assessment.ts";
|
|
5
5
|
export { AssessmentResponse } from "./response.ts";
|
|
6
6
|
export { evaluate } from "./evaluation.ts";
|
|
7
|
-
export { phq9, gad7, dass21, inventories, loadInventory, twoWeekFrequencyOptions, twoWeekInstructions, } from "./inventories/index.ts";
|
|
7
|
+
export { phq9, gad7, dass21, who5, asrs6, aq10, audit, miniIpip, inventories, loadInventory, twoWeekFrequencyOptions, twoWeekInstructions, } from "./inventories/index.ts";
|
|
8
8
|
export type { InventoryId } from "./inventories/index.ts";
|
package/dist/esm/index.js
CHANGED
|
@@ -3,4 +3,4 @@ export { localize, collectLocales } from "./i18n.js";
|
|
|
3
3
|
export { Assessment, validateDefinition } from "./assessment.js";
|
|
4
4
|
export { AssessmentResponse } from "./response.js";
|
|
5
5
|
export { evaluate } from "./evaluation.js";
|
|
6
|
-
export { phq9, gad7, dass21, inventories, loadInventory, twoWeekFrequencyOptions, twoWeekInstructions, } from "./inventories/index.js";
|
|
6
|
+
export { phq9, gad7, dass21, who5, asrs6, aq10, audit, miniIpip, inventories, loadInventory, twoWeekFrequencyOptions, twoWeekInstructions, } from "./inventories/index.js";
|