psytools 0.3.0 → 0.3.1

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.
Files changed (42) hide show
  1. package/README.md +34 -16
  2. package/SOURCES.md +53 -0
  3. package/dist/cjs/assessment.d.ts +3 -2
  4. package/dist/cjs/assessment.js +13 -3
  5. package/dist/cjs/evaluation.d.ts +5 -3
  6. package/dist/cjs/evaluation.js +49 -8
  7. package/dist/cjs/index.d.ts +2 -2
  8. package/dist/cjs/index.js +4 -1
  9. package/dist/cjs/inventories/aq10.d.ts +12 -0
  10. package/dist/cjs/inventories/aq10.js +181 -0
  11. package/dist/cjs/inventories/asrs6.d.ts +11 -0
  12. package/dist/cjs/inventories/asrs6.js +128 -0
  13. package/dist/cjs/inventories/index.d.ts +5 -2
  14. package/dist/cjs/inventories/index.js +10 -1
  15. package/dist/cjs/inventories/who5.d.ts +11 -0
  16. package/dist/cjs/inventories/who5.js +150 -0
  17. package/dist/cjs/types.d.ts +24 -2
  18. package/dist/esm/assessment.d.ts +3 -2
  19. package/dist/esm/assessment.js +13 -3
  20. package/dist/esm/evaluation.d.ts +5 -3
  21. package/dist/esm/evaluation.js +49 -8
  22. package/dist/esm/index.d.ts +2 -2
  23. package/dist/esm/index.js +1 -1
  24. package/dist/esm/inventories/aq10.d.ts +12 -0
  25. package/dist/esm/inventories/aq10.js +178 -0
  26. package/dist/esm/inventories/asrs6.d.ts +11 -0
  27. package/dist/esm/inventories/asrs6.js +125 -0
  28. package/dist/esm/inventories/index.d.ts +5 -2
  29. package/dist/esm/inventories/index.js +7 -1
  30. package/dist/esm/inventories/who5.d.ts +11 -0
  31. package/dist/esm/inventories/who5.js +147 -0
  32. package/dist/esm/types.d.ts +24 -2
  33. package/package.json +10 -3
  34. package/schema/assessment-definition.schema.json +27 -1
  35. package/src/assessment.ts +14 -3
  36. package/src/evaluation.ts +55 -9
  37. package/src/index.ts +5 -0
  38. package/src/inventories/aq10.ts +181 -0
  39. package/src/inventories/asrs6.ts +128 -0
  40. package/src/inventories/index.ts +8 -2
  41. package/src/inventories/who5.ts +150 -0
  42. package/src/types.ts +26 -2
@@ -0,0 +1,178 @@
1
+ /**
2
+ * AQ-10 — Autism Spectrum Quotient, 10-item version (adults).
3
+ *
4
+ * Recommended by NICE (UK) for quick screening of autistic traits in
5
+ * adults. Each item is answered on a 4-point agree/disagree scale but
6
+ * scores binary: one point per item answered in the trait direction
7
+ * ("agree" on items 1, 7, 8, 10; "disagree" on the rest, modeled here as
8
+ * `reverseScored`). A total of 6 or more suggests referral for a
9
+ * specialist autism assessment (Allison et al., 2012). Free to use.
10
+ */
11
+ export const aq10 = {
12
+ id: "aq10",
13
+ version: "1.0.0",
14
+ title: {
15
+ en: "Autism Spectrum Quotient (AQ-10) — Adult",
16
+ tr: "Otizm Spektrum Anketi (AQ-10) — Yetişkin",
17
+ de: "Autismus-Spektrum-Quotient (AQ-10) — Erwachsene",
18
+ },
19
+ description: {
20
+ en: "A 10-item screening questionnaire for autistic traits in adults, condensed from the 50-item Autism Spectrum Quotient.",
21
+ tr: "50 maddelik Otizm Spektrum Anketi'nden kısaltılmış, yetişkinlerde otistik özellikleri taramak için 10 maddelik bir ölçek.",
22
+ de: "Ein 10-Item-Screeningfragebogen für autistische Merkmale bei Erwachsenen, verkürzt aus dem 50-Item-Autismus-Spektrum-Quotienten.",
23
+ },
24
+ instructions: {
25
+ en: "For each statement, select the answer that best describes you.",
26
+ tr: "Her ifade için sizi en iyi tanımlayan yanıtı işaretleyin.",
27
+ de: "Wählen Sie zu jeder Aussage die Antwort, die Sie am besten beschreibt.",
28
+ },
29
+ defaultLocale: "en",
30
+ options: [
31
+ {
32
+ value: 0,
33
+ label: { en: "Definitely disagree", tr: "Kesinlikle katılmıyorum", de: "Stimme überhaupt nicht zu" },
34
+ },
35
+ {
36
+ value: 1,
37
+ label: { en: "Slightly disagree", tr: "Biraz katılmıyorum", de: "Stimme eher nicht zu" },
38
+ },
39
+ {
40
+ value: 2,
41
+ label: { en: "Slightly agree", tr: "Biraz katılıyorum", de: "Stimme eher zu" },
42
+ },
43
+ {
44
+ value: 3,
45
+ label: { en: "Definitely agree", tr: "Kesinlikle katılıyorum", de: "Stimme voll und ganz zu" },
46
+ },
47
+ ],
48
+ questions: [
49
+ {
50
+ id: "aq10-1",
51
+ text: {
52
+ en: "I often notice small sounds when others do not",
53
+ tr: "Başkalarının fark etmediği küçük sesleri sıklıkla fark ederim",
54
+ de: "Ich nehme oft leise Geräusche wahr, die andere nicht bemerken",
55
+ },
56
+ },
57
+ {
58
+ id: "aq10-2",
59
+ text: {
60
+ en: "I usually concentrate more on the whole picture, rather than the small details",
61
+ tr: "Genellikle küçük ayrıntılardan çok resmin bütününe odaklanırım",
62
+ de: "Ich konzentriere mich meist mehr auf das Gesamtbild als auf die kleinen Details",
63
+ },
64
+ reverseScored: true,
65
+ },
66
+ {
67
+ id: "aq10-3",
68
+ text: {
69
+ en: "I find it easy to do more than one thing at once",
70
+ tr: "Aynı anda birden fazla iş yapmak benim için kolaydır",
71
+ de: "Es fällt mir leicht, mehrere Dinge gleichzeitig zu tun",
72
+ },
73
+ reverseScored: true,
74
+ },
75
+ {
76
+ id: "aq10-4",
77
+ text: {
78
+ en: "If there is an interruption, I can switch back to what I was doing very quickly",
79
+ tr: "Bir kesinti olursa, yapmakta olduğum işe çok hızlı bir şekilde geri dönebilirim",
80
+ de: "Wenn ich unterbrochen werde, kann ich sehr schnell zu meiner Tätigkeit zurückkehren",
81
+ },
82
+ reverseScored: true,
83
+ },
84
+ {
85
+ id: "aq10-5",
86
+ text: {
87
+ en: "I find it easy to 'read between the lines' when someone is talking to me",
88
+ tr: "Biri benimle konuşurken 'satır aralarını okumak' benim için kolaydır",
89
+ de: "Es fällt mir leicht, 'zwischen den Zeilen zu lesen', wenn jemand mit mir spricht",
90
+ },
91
+ reverseScored: true,
92
+ },
93
+ {
94
+ id: "aq10-6",
95
+ text: {
96
+ en: "I know how to tell if someone listening to me is getting bored",
97
+ tr: "Beni dinleyen birinin sıkılmaya başladığını nasıl anlayacağımı bilirim",
98
+ de: "Ich erkenne, ob jemand, der mir zuhört, sich zu langweilen beginnt",
99
+ },
100
+ reverseScored: true,
101
+ },
102
+ {
103
+ id: "aq10-7",
104
+ text: {
105
+ en: "When I'm reading a story I find it difficult to work out the characters' intentions",
106
+ tr: "Bir öykü okurken karakterlerin niyetlerini anlamakta zorlanırım",
107
+ de: "Wenn ich eine Geschichte lese, fällt es mir schwer, die Absichten der Figuren zu erkennen",
108
+ },
109
+ },
110
+ {
111
+ id: "aq10-8",
112
+ text: {
113
+ en: "I like to collect information about categories of things (e.g. types of car, types of bird, types of train, types of plant etc)",
114
+ tr: "Belirli kategorilerdeki şeyler hakkında bilgi toplamayı severim (örneğin araba türleri, kuş türleri, tren türleri, bitki türleri vb.)",
115
+ de: "Ich sammle gern Informationen über Kategorien von Dingen (z. B. Auto-, Vogel-, Zug- oder Pflanzenarten)",
116
+ },
117
+ },
118
+ {
119
+ id: "aq10-9",
120
+ text: {
121
+ en: "I find it easy to work out what someone is thinking or feeling just by looking at their face",
122
+ tr: "Sadece yüzüne bakarak birinin ne düşündüğünü ya da hissettiğini anlamak benim için kolaydır",
123
+ de: "Es fällt mir leicht, allein am Gesicht abzulesen, was jemand denkt oder fühlt",
124
+ },
125
+ reverseScored: true,
126
+ },
127
+ {
128
+ id: "aq10-10",
129
+ text: {
130
+ en: "I find it difficult to work out people's intentions",
131
+ tr: "İnsanların niyetlerini anlamakta zorlanırım",
132
+ de: "Es fällt mir schwer, die Absichten anderer Menschen zu erkennen",
133
+ },
134
+ },
135
+ ],
136
+ scoring: {
137
+ kind: "count",
138
+ items: [
139
+ { questionId: "aq10-1", minValue: 2 },
140
+ { questionId: "aq10-2", minValue: 2 },
141
+ { questionId: "aq10-3", minValue: 2 },
142
+ { questionId: "aq10-4", minValue: 2 },
143
+ { questionId: "aq10-5", minValue: 2 },
144
+ { questionId: "aq10-6", minValue: 2 },
145
+ { questionId: "aq10-7", minValue: 2 },
146
+ { questionId: "aq10-8", minValue: 2 },
147
+ { questionId: "aq10-9", minValue: 2 },
148
+ { questionId: "aq10-10", minValue: 2 },
149
+ ],
150
+ bands: [
151
+ {
152
+ id: "below-threshold",
153
+ min: 0,
154
+ max: 5,
155
+ label: {
156
+ en: "Below screening threshold",
157
+ tr: "Tarama eşiğinin altında",
158
+ de: "Unterhalb der Screening-Schwelle",
159
+ },
160
+ },
161
+ {
162
+ id: "above-threshold",
163
+ min: 6,
164
+ max: 10,
165
+ label: {
166
+ en: "At or above threshold — consider referral for a specialist autism assessment",
167
+ tr: "Eşikte ya da üzerinde — uzman otizm değerlendirmesine yönlendirme düşünülmelidir",
168
+ de: "An oder über der Schwelle — Überweisung zu einer spezialisierten Autismus-Diagnostik erwägen",
169
+ },
170
+ },
171
+ ],
172
+ },
173
+ meta: {
174
+ reference: "Allison, C., Auyeung, B., & Baron-Cohen, S. (2012). Toward brief \"Red Flags\" for autism screening: The Short Autism Spectrum Quotient and the Short Quantitative Checklist in 1,000 cases and 3,000 controls. Journal of the American Academy of Child & Adolescent Psychiatry, 51(2), 202-212.",
175
+ license: "Free to use (Autism Research Centre, University of Cambridge)",
176
+ note: "Each item scores 1 point in the trait direction; disagree-scored items are modeled as reverseScored.",
177
+ },
178
+ };
@@ -0,0 +1,11 @@
1
+ import type { AssessmentDefinition } from "../types.ts";
2
+ /**
3
+ * ASRS v1.1 — Adult ADHD Self-Report Scale, 6-item screener (Part A).
4
+ *
5
+ * Developed by the WHO and the Workgroup on Adult ADHD (Harvard Medical
6
+ * School / NYU). Items 1–3 count as screen-positive from "Sometimes" and
7
+ * items 4–6 from "Often"; four or more positive items indicate symptoms
8
+ * highly consistent with adult ADHD and warrant further investigation
9
+ * (Kessler et al., 2005). Free to distribute and score.
10
+ */
11
+ export declare const asrs6: AssessmentDefinition;
@@ -0,0 +1,125 @@
1
+ /**
2
+ * ASRS v1.1 — Adult ADHD Self-Report Scale, 6-item screener (Part A).
3
+ *
4
+ * Developed by the WHO and the Workgroup on Adult ADHD (Harvard Medical
5
+ * School / NYU). Items 1–3 count as screen-positive from "Sometimes" and
6
+ * items 4–6 from "Often"; four or more positive items indicate symptoms
7
+ * highly consistent with adult ADHD and warrant further investigation
8
+ * (Kessler et al., 2005). Free to distribute and score.
9
+ */
10
+ export const asrs6 = {
11
+ id: "asrs6",
12
+ version: "1.0.0",
13
+ title: {
14
+ en: "Adult ADHD Self-Report Scale (ASRS-v1.1) Screener",
15
+ tr: "Erişkin DEHB Kendi Bildirim Ölçeği (ASRS-v1.1) Tarama Formu",
16
+ de: "Selbstbeurteilungsskala für ADHS bei Erwachsenen (ASRS-v1.1) Screener",
17
+ },
18
+ description: {
19
+ en: "A 6-item screener for adult attention-deficit/hyperactivity disorder, drawn from the WHO's full 18-item ASRS.",
20
+ tr: "DSÖ'nün 18 maddelik tam ASRS ölçeğinden türetilmiş, erişkin dikkat eksikliği/hiperaktivite bozukluğu için 6 maddelik bir tarama aracı.",
21
+ de: "Ein 6-Item-Screener für Aufmerksamkeitsdefizit-/Hyperaktivitätsstörung bei Erwachsenen, abgeleitet aus der vollständigen 18-Item-ASRS der WHO.",
22
+ },
23
+ instructions: {
24
+ en: "As you answer each question, select the option that best describes how you have felt and conducted yourself over the past 6 months.",
25
+ tr: "Her soruyu yanıtlarken, son 6 ay içinde kendinizi nasıl hissettiğinizi ve nasıl davrandığınızı en iyi tanımlayan seçeneği işaretleyin.",
26
+ de: "Wählen Sie bei jeder Frage die Option, die am besten beschreibt, wie Sie sich in den letzten 6 Monaten gefühlt und verhalten haben.",
27
+ },
28
+ defaultLocale: "en",
29
+ options: [
30
+ { value: 0, label: { en: "Never", tr: "Hiçbir zaman", de: "Nie" } },
31
+ { value: 1, label: { en: "Rarely", tr: "Nadiren", de: "Selten" } },
32
+ { value: 2, label: { en: "Sometimes", tr: "Bazen", de: "Manchmal" } },
33
+ { value: 3, label: { en: "Often", tr: "Sık sık", de: "Oft" } },
34
+ { value: 4, label: { en: "Very often", tr: "Çok sık", de: "Sehr oft" } },
35
+ ],
36
+ questions: [
37
+ {
38
+ id: "asrs6-1",
39
+ text: {
40
+ en: "How often do you have trouble wrapping up the final details of a project, once the challenging parts have been done?",
41
+ tr: "Bir işin zor kısımlarını tamamladıktan sonra, son ayrıntıları toparlayıp işi bitirmekte ne sıklıkla güçlük yaşarsınız?",
42
+ de: "Wie oft haben Sie Schwierigkeiten, die letzten Details eines Projekts abzuschließen, nachdem die schwierigen Teile erledigt sind?",
43
+ },
44
+ },
45
+ {
46
+ id: "asrs6-2",
47
+ text: {
48
+ en: "How often do you have difficulty getting things in order when you have to do a task that requires organization?",
49
+ tr: "Organizasyon gerektiren bir iş yapmanız gerektiğinde, işleri sıraya koymakta ne sıklıkla güçlük çekersiniz?",
50
+ de: "Wie oft haben Sie Schwierigkeiten, Ordnung in Dinge zu bringen, wenn Sie eine Aufgabe erledigen müssen, die Organisation erfordert?",
51
+ },
52
+ },
53
+ {
54
+ id: "asrs6-3",
55
+ text: {
56
+ en: "How often do you have problems remembering appointments or obligations?",
57
+ tr: "Randevularınızı ya da yükümlülüklerinizi hatırlamakta ne sıklıkla güçlük çekersiniz?",
58
+ de: "Wie oft haben Sie Probleme, sich an Termine oder Verpflichtungen zu erinnern?",
59
+ },
60
+ },
61
+ {
62
+ id: "asrs6-4",
63
+ text: {
64
+ en: "When you have a task that requires a lot of thought, how often do you avoid or delay getting started?",
65
+ tr: "Çok fazla düşünmeyi gerektiren bir işiniz olduğunda, başlamayı ne sıklıkla erteler ya da başlamaktan kaçınırsınız?",
66
+ de: "Wie oft vermeiden oder verzögern Sie den Beginn einer Aufgabe, die viel Nachdenken erfordert?",
67
+ },
68
+ },
69
+ {
70
+ id: "asrs6-5",
71
+ text: {
72
+ en: "How often do you fidget or squirm with your hands or feet when you have to sit down for a long time?",
73
+ tr: "Uzun süre oturmanız gerektiğinde, ne sıklıkla ellerinizi ya da ayaklarınızı kıpırdatır veya yerinizde kımıldanırsınız?",
74
+ de: "Wie oft zappeln Sie mit Händen oder Füßen, wenn Sie längere Zeit sitzen müssen?",
75
+ },
76
+ },
77
+ {
78
+ id: "asrs6-6",
79
+ text: {
80
+ en: "How often do you feel overly active and compelled to do things, like you were driven by a motor?",
81
+ tr: "Ne sıklıkla, sanki bir motor tarafından sürülüyormuşçasına kendinizi aşırı hareketli ve bir şeyler yapmaya zorlanmış hissedersiniz?",
82
+ de: "Wie oft fühlen Sie sich übermäßig aktiv und getrieben, Dinge zu tun, als würden Sie von einem Motor angetrieben?",
83
+ },
84
+ },
85
+ ],
86
+ scoring: {
87
+ kind: "count",
88
+ items: [
89
+ { questionId: "asrs6-1", minValue: 2 },
90
+ { questionId: "asrs6-2", minValue: 2 },
91
+ { questionId: "asrs6-3", minValue: 2 },
92
+ { questionId: "asrs6-4", minValue: 3 },
93
+ { questionId: "asrs6-5", minValue: 3 },
94
+ { questionId: "asrs6-6", minValue: 3 },
95
+ ],
96
+ bands: [
97
+ {
98
+ id: "negative",
99
+ min: 0,
100
+ max: 3,
101
+ label: {
102
+ en: "Symptoms not consistent with adult ADHD",
103
+ tr: "Belirtiler erişkin DEHB ile uyumlu değil",
104
+ de: "Symptome nicht mit ADHS im Erwachsenenalter vereinbar",
105
+ },
106
+ },
107
+ {
108
+ id: "positive",
109
+ min: 4,
110
+ max: 6,
111
+ label: {
112
+ en: "Symptoms highly consistent with adult ADHD — further investigation warranted",
113
+ tr: "Belirtiler erişkin DEHB ile yüksek düzeyde uyumlu — ileri değerlendirme gerekir",
114
+ de: "Symptome in hohem Maße mit ADHS im Erwachsenenalter vereinbar — weitere Abklärung angezeigt",
115
+ },
116
+ },
117
+ ],
118
+ },
119
+ meta: {
120
+ reference: "Kessler, R. C., Adler, L., Ames, M., Demler, O., Faraone, S., Hiripi, E., et al. (2005). The World Health Organization Adult ADHD Self-Report Scale (ASRS): a short screening scale for use in the general population. Psychological Medicine, 35(2), 245-256.",
121
+ license: "Free to distribute and score (WHO / Workgroup on Adult ADHD)",
122
+ timeframe: "past 6 months",
123
+ note: "The score counts screen-positive items, not symptom severity.",
124
+ },
125
+ };
@@ -3,11 +3,14 @@ import { Assessment } from "../assessment.ts";
3
3
  import { phq9 } from "./phq9.ts";
4
4
  import { gad7 } from "./gad7.ts";
5
5
  import { dass21 } from "./dass21.ts";
6
- export { phq9, gad7, dass21 };
6
+ import { who5 } from "./who5.ts";
7
+ import { asrs6 } from "./asrs6.ts";
8
+ import { aq10 } from "./aq10.ts";
9
+ export { phq9, gad7, dass21, who5, asrs6, aq10 };
7
10
  export { twoWeekFrequencyOptions, twoWeekInstructions } from "./common.ts";
8
11
  /** All predefined inventory definitions shipped with psytools, by id. */
9
12
  export declare const inventories: Readonly<Record<string, AssessmentDefinition>>;
10
- export type InventoryId = "phq9" | "gad7" | "dass21";
13
+ export type InventoryId = "phq9" | "gad7" | "dass21" | "who5" | "asrs6" | "aq10";
11
14
  /**
12
15
  * Instantiates a predefined inventory as an `Assessment`.
13
16
  * @throws PsytoolsError `unknown_inventory`
@@ -3,13 +3,19 @@ import { PsytoolsError } from "../errors.js";
3
3
  import { phq9 } from "./phq9.js";
4
4
  import { gad7 } from "./gad7.js";
5
5
  import { dass21 } from "./dass21.js";
6
- export { phq9, gad7, dass21 };
6
+ import { who5 } from "./who5.js";
7
+ import { asrs6 } from "./asrs6.js";
8
+ import { aq10 } from "./aq10.js";
9
+ export { phq9, gad7, dass21, who5, asrs6, aq10 };
7
10
  export { twoWeekFrequencyOptions, twoWeekInstructions } from "./common.js";
8
11
  /** All predefined inventory definitions shipped with psytools, by id. */
9
12
  export const inventories = {
10
13
  phq9,
11
14
  gad7,
12
15
  dass21,
16
+ who5,
17
+ asrs6,
18
+ aq10,
13
19
  };
14
20
  /**
15
21
  * Instantiates a predefined inventory as an `Assessment`.
@@ -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,147 @@
1
+ /**
2
+ * WHO-5 — World Health Organization Well-Being Index.
3
+ *
4
+ * 5 positively worded items, 0–5 frequency scale over the past two weeks.
5
+ * The raw sum (0–25) is multiplied by 4 and reported as a 0–100 percentage;
6
+ * higher scores mean better well-being. A score of 50 or below indicates
7
+ * reduced well-being and warrants screening for depression; 28 or below
8
+ * indicates likely depression (Topp et al., 2015). Free to use.
9
+ */
10
+ export const who5 = {
11
+ id: "who5",
12
+ version: "1.0.0",
13
+ title: {
14
+ en: "WHO-5 Well-Being Index",
15
+ tr: "WHO-5 İyilik Hali İndeksi",
16
+ de: "WHO-5-Index zum Wohlbefinden",
17
+ },
18
+ description: {
19
+ en: "A 5-item self-report scale measuring subjective psychological well-being over the past two weeks. Higher scores mean better well-being.",
20
+ 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.",
21
+ de: "Eine Selbstbeurteilungsskala mit 5 Items zur Messung des subjektiven psychischen Wohlbefindens in den letzten zwei Wochen. Höhere Werte bedeuten besseres Wohlbefinden.",
22
+ },
23
+ instructions: {
24
+ en: "Please indicate for each of the five statements which is closest to how you have been feeling over the last two weeks.",
25
+ 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.",
26
+ 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.",
27
+ },
28
+ defaultLocale: "en",
29
+ options: [
30
+ {
31
+ value: 0,
32
+ label: { en: "At no time", tr: "Hiçbir zaman", de: "Zu keinem Zeitpunkt" },
33
+ },
34
+ {
35
+ value: 1,
36
+ label: { en: "Some of the time", tr: "Bazen", de: "Ab und zu" },
37
+ },
38
+ {
39
+ value: 2,
40
+ label: {
41
+ en: "Less than half of the time",
42
+ tr: "Zamanın yarısından az",
43
+ de: "Etwas weniger als die Hälfte der Zeit",
44
+ },
45
+ },
46
+ {
47
+ value: 3,
48
+ label: {
49
+ en: "More than half of the time",
50
+ tr: "Zamanın yarısından çok",
51
+ de: "Etwas mehr als die Hälfte der Zeit",
52
+ },
53
+ },
54
+ {
55
+ value: 4,
56
+ label: { en: "Most of the time", tr: "Çoğu zaman", de: "Meistens" },
57
+ },
58
+ {
59
+ value: 5,
60
+ label: { en: "All of the time", tr: "Her zaman", de: "Die ganze Zeit" },
61
+ },
62
+ ],
63
+ questions: [
64
+ {
65
+ id: "who5-1",
66
+ text: {
67
+ en: "I have felt cheerful and in good spirits",
68
+ tr: "Kendimi neşeli ve keyifli hissettim",
69
+ de: "Ich war froh und guter Laune",
70
+ },
71
+ },
72
+ {
73
+ id: "who5-2",
74
+ text: {
75
+ en: "I have felt calm and relaxed",
76
+ tr: "Kendimi sakin ve rahatlamış hissettim",
77
+ de: "Ich habe mich ruhig und entspannt gefühlt",
78
+ },
79
+ },
80
+ {
81
+ id: "who5-3",
82
+ text: {
83
+ en: "I have felt active and vigorous",
84
+ tr: "Kendimi aktif ve dinç hissettim",
85
+ de: "Ich habe mich energisch und aktiv gefühlt",
86
+ },
87
+ },
88
+ {
89
+ id: "who5-4",
90
+ text: {
91
+ en: "I woke up feeling fresh and rested",
92
+ tr: "Uyandığımda kendimi dinlenmiş ve zinde hissettim",
93
+ de: "Ich habe mich beim Aufwachen frisch und ausgeruht gefühlt",
94
+ },
95
+ },
96
+ {
97
+ id: "who5-5",
98
+ text: {
99
+ en: "My daily life has been filled with things that interest me",
100
+ tr: "Günlük yaşamım ilgimi çeken şeylerle doluydu",
101
+ de: "Mein Alltag war voller Dinge, die mich interessieren",
102
+ },
103
+ },
104
+ ],
105
+ scoring: {
106
+ kind: "sum",
107
+ multiplier: 4,
108
+ bands: [
109
+ {
110
+ id: "low",
111
+ min: 0,
112
+ max: 28,
113
+ label: {
114
+ en: "Low well-being — indicates likely depression, assessment recommended",
115
+ tr: "Düşük iyilik hali — olası depresyona işaret eder, değerlendirme önerilir",
116
+ de: "Niedriges Wohlbefinden — Hinweis auf wahrscheinliche Depression, Abklärung empfohlen",
117
+ },
118
+ },
119
+ {
120
+ id: "reduced",
121
+ min: 29,
122
+ max: 50,
123
+ label: {
124
+ en: "Reduced well-being — screening for depression recommended",
125
+ tr: "Azalmış iyilik hali — depresyon taraması önerilir",
126
+ de: "Vermindertes Wohlbefinden — Depressionsscreening empfohlen",
127
+ },
128
+ },
129
+ {
130
+ id: "good",
131
+ min: 51,
132
+ max: 100,
133
+ label: {
134
+ en: "Good well-being",
135
+ tr: "İyi düzeyde iyilik hali",
136
+ de: "Gutes Wohlbefinden",
137
+ },
138
+ },
139
+ ],
140
+ },
141
+ meta: {
142
+ 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.",
143
+ license: "Free to use (WHO Regional Office for Europe / Psychiatric Research Unit, Hillerød)",
144
+ timeframe: "past 2 weeks",
145
+ note: "Positively worded: higher scores mean better well-being.",
146
+ },
147
+ };
@@ -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
- /** Severity bands the total is matched against. */
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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "psytools",
3
- "version": "0.3.0",
4
- "description": "Zero-dependency toolkit for psychological assessments: data models, response validation, scoring, and predefined inventories (PHQ-9, GAD-7, DASS-21) in multiple languages.",
3
+ "version": "0.3.1",
4
+ "description": "Zero-dependency toolkit for psychological assessments: data models, response validation, scoring, and predefined inventories (PHQ-9, GAD-7, DASS-21, WHO-5, ASRS, AQ-10) in multiple languages.",
5
5
  "keywords": [
6
6
  "psychology",
7
7
  "assessment",
@@ -10,6 +10,12 @@
10
10
  "phq-9",
11
11
  "gad-7",
12
12
  "dass-21",
13
+ "who-5",
14
+ "asrs",
15
+ "aq-10",
16
+ "adhd",
17
+ "autism",
18
+ "well-being",
13
19
  "mental-health",
14
20
  "therapy",
15
21
  "screening",
@@ -43,7 +49,8 @@
43
49
  "files": [
44
50
  "dist",
45
51
  "src",
46
- "schema"
52
+ "schema",
53
+ "SOURCES.md"
47
54
  ],
48
55
  "sideEffects": false,
49
56
  "engines": {
@@ -26,7 +26,8 @@
26
26
  "scoring": {
27
27
  "oneOf": [
28
28
  { "$ref": "#/$defs/sumScoring" },
29
- { "$ref": "#/$defs/subscaleScoring" }
29
+ { "$ref": "#/$defs/subscaleScoring" },
30
+ { "$ref": "#/$defs/countScoring" }
30
31
  ]
31
32
  },
32
33
  "meta": { "type": "object" }
@@ -91,6 +92,7 @@
91
92
  "additionalProperties": false,
92
93
  "properties": {
93
94
  "kind": { "const": "sum" },
95
+ "multiplier": { "type": "number" },
94
96
  "bands": { "type": "array", "items": { "$ref": "#/$defs/scoreBand" } },
95
97
  "flags": { "type": "array", "items": { "$ref": "#/$defs/scoreFlag" } }
96
98
  }
@@ -111,6 +113,30 @@
111
113
  "bands": { "type": "array", "items": { "$ref": "#/$defs/scoreBand" } }
112
114
  }
113
115
  },
116
+ "countScoringItem": {
117
+ "type": "object",
118
+ "required": ["questionId", "minValue"],
119
+ "additionalProperties": false,
120
+ "properties": {
121
+ "questionId": { "type": "string", "minLength": 1 },
122
+ "minValue": { "type": "number" }
123
+ }
124
+ },
125
+ "countScoring": {
126
+ "type": "object",
127
+ "required": ["kind", "items"],
128
+ "additionalProperties": false,
129
+ "properties": {
130
+ "kind": { "const": "count" },
131
+ "items": {
132
+ "type": "array",
133
+ "minItems": 1,
134
+ "items": { "$ref": "#/$defs/countScoringItem" }
135
+ },
136
+ "bands": { "type": "array", "items": { "$ref": "#/$defs/scoreBand" } },
137
+ "flags": { "type": "array", "items": { "$ref": "#/$defs/scoreFlag" } }
138
+ }
139
+ },
114
140
  "subscaleScoring": {
115
141
  "type": "object",
116
142
  "required": ["kind", "subscales"],
package/src/assessment.ts CHANGED
@@ -83,7 +83,17 @@ export function validateDefinition(input: unknown): ValidationResult {
83
83
  }
84
84
  }
85
85
  }
86
- const flags = scoring.kind === "sum" || scoring.kind === "subscales" ? scoring.flags ?? [] : [];
86
+ if (scoring.kind === "count" && Array.isArray(scoring.items)) {
87
+ for (const item of scoring.items) {
88
+ if (!seen.has(item.questionId)) {
89
+ issues.push({ code: "unknown_question", message: `count scoring references unknown question "${item.questionId}"`, questionId: item.questionId });
90
+ }
91
+ }
92
+ }
93
+ const flags =
94
+ scoring.kind === "sum" || scoring.kind === "subscales" || scoring.kind === "count"
95
+ ? scoring.flags ?? []
96
+ : [];
87
97
  for (const flag of flags) {
88
98
  if (!seen.has(flag.questionId)) {
89
99
  issues.push({ code: "unknown_question", message: `flag "${flag.id}" references unknown question "${flag.questionId}"`, questionId: flag.questionId });
@@ -210,9 +220,10 @@ export class Assessment {
210
220
  *
211
221
  * When given an `AssessmentResponse`, its status must be `complete` or
212
222
  * `submitted` — pass `allowIncomplete` to score partial responses anyway.
213
- * Raw answer maps are scored as-is (low-level escape hatch).
223
+ * Raw answer maps skip the completeness check, but their values are
224
+ * still validated against the option scales.
214
225
  *
215
- * @throws PsytoolsError `incomplete_response` | `no_scoring`
226
+ * @throws PsytoolsError `incomplete_response` | `unknown_question` | `invalid_value` | `no_scoring`
216
227
  */
217
228
  evaluate(
218
229
  response: AssessmentResponse | Record<string, number>,