@baravak/risloo-profile-cli 4.26.0 → 4.28.0

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.
@@ -0,0 +1,316 @@
1
+ {
2
+ "id": "$X1HXXXXX",
3
+ "scale": {
4
+ "id": "$PCL5-93",
5
+ "title": "چک لیست نشانه‌های استرس پس از سانحه (PCL-5)"
6
+ },
7
+ "chain": null,
8
+ "version": "2",
9
+ "edition": "",
10
+ "edition_version": null,
11
+ "client": {
12
+ "id": "GH966XXXX",
13
+ "name": "مراجع"
14
+ },
15
+ "room": {
16
+ "id": "RS96XXXX",
17
+ "manager": {
18
+ "id": "GH9XXXXX",
19
+ "name": "درمانگر",
20
+ "user_id": "IR9XXXX"
21
+ },
22
+ "center": {
23
+ "id": "RS966XXXX",
24
+ "acceptation": null,
25
+ "status": "active",
26
+ "type": "personal_clinic",
27
+ "detail": {
28
+ "title": "درمانگر"
29
+ }
30
+ },
31
+ "acceptation": null,
32
+ "status": "active",
33
+ "type": "personal_clinic"
34
+ },
35
+ "case": null,
36
+ "code": null,
37
+ "created_at": 1694157079,
38
+ "started_at": 1694157198,
39
+ "scored_at": 1694242467,
40
+ "closed_at": 1694160574,
41
+ "total_amount": 100000,
42
+ "prepayment": true,
43
+ "purchased": true,
44
+ "amount": 100000,
45
+ "description": "# دستورالعمل:\n\nدر ادامه فهرستی از مشکلاتی آمده است که برخی افراد در واکنش به یک تجربه بسیار استرس‌زا ممکن است داشته باشند.\n\nبا در نظر داشتن بدترین رویدادی که تجربه کرده‌اید، هر مورد را با دقت بخوانید و عددی را انتخاب کنید که نشان دهد **در ماه گذشته تا چه اندازه آن مشکل شما را آزار داده است**.",
46
+ "psychologist_description": null,
47
+ "items": [
48
+ {
49
+ "type": "text",
50
+ "text": "خاطرات مکرر، آزاردهنده و ناخواسته‌ی تجربه استرس‌‌زا",
51
+ "answer": {
52
+ "type": "optional",
53
+ "options": ["اصلاً", "کمی", "تا حدی (متوسط)", "زیاد", "بسیار زیاد"]
54
+ },
55
+ "user_answered": "4"
56
+ },
57
+ {
58
+ "type": "text",
59
+ "text": "رؤیاهای مکرر و آشفته‌کننده‌ی تجربه استرس‌زا",
60
+ "answer": {
61
+ "type": "optional",
62
+ "options": ["اصلاً", "کمی", "تا حدی (متوسط)", "زیاد", "بسیار زیاد"]
63
+ },
64
+ "user_answered": "1"
65
+ },
66
+ {
67
+ "type": "text",
68
+ "text": "ناگهان طوری احساس و رفتار کردن، انگار که تجربه استرس‌آور دوباره اتفاق می‏افتد (انگار واقعاً به آن زمان برگشته‌اید و دوباره آن را تجربه می‌کنید)",
69
+ "answer": {
70
+ "type": "optional",
71
+ "options": ["اصلاً", "کمی", "تا حدی (متوسط)", "زیاد", "بسیار زیاد"]
72
+ },
73
+ "user_answered": "5"
74
+ },
75
+ {
76
+ "type": "text",
77
+ "text": "احساس آشفتگی شدید وقتی چیزی شما را یاد آن تجربه استرس‌آور می‌اندازد",
78
+ "answer": {
79
+ "type": "optional",
80
+ "options": ["اصلاً", "کمی", "تا حدی (متوسط)", "زیاد", "بسیار زیاد"]
81
+ },
82
+ "user_answered": "1"
83
+ },
84
+ {
85
+ "type": "text",
86
+ "text": "داشتن واکنش‌های فیزیکی شدید وقتی چیزی شما را یاد تجربه استرس‌زا می‏اندازد (برای مثال، تپش قلب، دشواری در نفس کشیدن، عرق کردن)",
87
+ "answer": {
88
+ "type": "optional",
89
+ "options": ["اصلاً", "کمی", "تا حدی (متوسط)", "زیاد", "بسیار زیاد"]
90
+ },
91
+ "user_answered": "4"
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "اجتناب از خاطرات، افکار، یا احساسات مرتبط با تجربه استرس‌زا",
96
+ "answer": {
97
+ "type": "optional",
98
+ "options": ["اصلاً", "کمی", "تا حدی (متوسط)", "زیاد", "بسیار زیاد"]
99
+ },
100
+ "user_answered": "1"
101
+ },
102
+ {
103
+ "type": "text",
104
+ "text": "اجتناب از یادآورهای بیرونی تجربه استرس‌زا (برای مثال، مردم، مکان‌ها، گفتگوها، فعالیت‌ها، اشیاء، یا موقعیت‌ها)",
105
+ "answer": {
106
+ "type": "optional",
107
+ "options": ["اصلاً", "کمی", "تا حدی (متوسط)", "زیاد", "بسیار زیاد"]
108
+ },
109
+ "user_answered": "3"
110
+ },
111
+ {
112
+ "type": "text",
113
+ "text": "مشکل در یادآوری بخش‌های مهم تجربه استرس‌زا",
114
+ "answer": {
115
+ "type": "optional",
116
+ "options": ["اصلاً", "کمی", "تا حدی (متوسط)", "زیاد", "بسیار زیاد"]
117
+ },
118
+ "user_answered": "2"
119
+ },
120
+ {
121
+ "type": "text",
122
+ "text": "باورهای منفی عمیق نسبت به خود، افراد، یا دنیا (برای مثال، داشتن افکاری از قبیل این که: من بد هستم، یک جای کارم ایراد اساسی دارد، هیچ کس قابل اعتماد نیست، دنیا کاملاً خطرناک است)",
123
+ "answer": {
124
+ "type": "optional",
125
+ "options": ["اصلاً", "کمی", "تا حدی (متوسط)", "زیاد", "بسیار زیاد"]
126
+ },
127
+ "user_answered": "3"
128
+ },
129
+ {
130
+ "type": "text",
131
+ "text": "سرزنش شدید خود و افراد دیگر به خاطر تجربه استرس‌زا و اتفاق‌های بعد از آن",
132
+ "answer": {
133
+ "type": "optional",
134
+ "options": ["اصلاً", "کمی", "تا حدی (متوسط)", "زیاد", "بسیار زیاد"]
135
+ },
136
+ "user_answered": "2"
137
+ },
138
+ {
139
+ "type": "text",
140
+ "text": "احساسات منفی شدید مانند ترس، خشم، احساس گناه، یا شرم",
141
+ "answer": {
142
+ "type": "optional",
143
+ "options": ["اصلاً", "کمی", "تا حدی (متوسط)", "زیاد", "بسیار زیاد"]
144
+ },
145
+ "user_answered": "3"
146
+ },
147
+ {
148
+ "type": "text",
149
+ "text": "از دست دادن علاقه نسبت به فعالیت‌هایی که قبلاً از آن‌ها لذت می‌برده‌اید",
150
+ "answer": {
151
+ "type": "optional",
152
+ "options": ["اصلاً", "کمی", "تا حدی (متوسط)", "زیاد", "بسیار زیاد"]
153
+ },
154
+ "user_answered": "1"
155
+ },
156
+ {
157
+ "type": "text",
158
+ "text": "احساس فاصله گرفتن یا بریدن از دیگران",
159
+ "answer": {
160
+ "type": "optional",
161
+ "options": ["اصلاً", "کمی", "تا حدی (متوسط)", "زیاد", "بسیار زیاد"]
162
+ },
163
+ "user_answered": "3"
164
+ },
165
+ {
166
+ "type": "text",
167
+ "text": "مشکل در تجربه احساسات مثبت (برای مثال، ناتوانی در داشتن احساسات عاشقانه نسبت به افراد نزدیک، یا احساس بی‌حسی عاطفی)",
168
+ "answer": {
169
+ "type": "optional",
170
+ "options": ["اصلاً", "کمی", "تا حدی (متوسط)", "زیاد", "بسیار زیاد"]
171
+ },
172
+ "user_answered": "1"
173
+ },
174
+ {
175
+ "type": "text",
176
+ "text": "احساس تحریک‌پذیری، خشم، یا خشونت",
177
+ "answer": {
178
+ "type": "optional",
179
+ "options": ["اصلاً", "کمی", "تا حدی (متوسط)", "زیاد", "بسیار زیاد"]
180
+ },
181
+ "user_answered": "1"
182
+ },
183
+ {
184
+ "type": "text",
185
+ "text": "خطر کردن شدید در انجام کارهای آسیب‌زننده",
186
+ "answer": {
187
+ "type": "optional",
188
+ "options": ["اصلاً", "کمی", "تا حدی (متوسط)", "زیاد", "بسیار زیاد"]
189
+ },
190
+ "user_answered": "2"
191
+ },
192
+ {
193
+ "type": "text",
194
+ "text": "احساس «هشیاری مفرط»، مراقبت یا آماده باش",
195
+ "answer": {
196
+ "type": "optional",
197
+ "options": ["اصلاً", "کمی", "تا حدی (متوسط)", "زیاد", "بسیار زیاد"]
198
+ },
199
+ "user_answered": "2"
200
+ },
201
+ {
202
+ "type": "text",
203
+ "text": "احساس تلاطم، یا به آسانی وحشت‌زده شدن",
204
+ "answer": {
205
+ "type": "optional",
206
+ "options": ["اصلاً", "کمی", "تا حدی (متوسط)", "زیاد", "بسیار زیاد"]
207
+ },
208
+ "user_answered": "5"
209
+ },
210
+ {
211
+ "type": "text",
212
+ "text": "مشکل در تمرکز",
213
+ "answer": {
214
+ "type": "optional",
215
+ "options": ["اصلاً", "کمی", "تا حدی (متوسط)", "زیاد", "بسیار زیاد"]
216
+ },
217
+ "user_answered": "1"
218
+ },
219
+ {
220
+ "type": "text",
221
+ "text": "مشکل در به خواب رفتن یا تداوم خواب",
222
+ "answer": {
223
+ "type": "optional",
224
+ "options": ["اصلاً", "کمی", "تا حدی (متوسط)", "زیاد", "بسیار زیاد"]
225
+ },
226
+ "user_answered": "3"
227
+ }
228
+ ],
229
+ "prerequisites": [
230
+ {
231
+ "type": "text",
232
+ "label": "gender",
233
+ "text": "جنسیت",
234
+ "answer": {
235
+ "type": "select",
236
+ "options": ["زن", "مرد"]
237
+ },
238
+ "alias": "gender",
239
+ "force": true,
240
+ "user_answered": "1"
241
+ },
242
+ {
243
+ "type": "text",
244
+ "label": "age",
245
+ "text": "سن",
246
+ "answer": {
247
+ "type": "number"
248
+ },
249
+ "alias": "age",
250
+ "force": true,
251
+ "user_answered": "44"
252
+ },
253
+ {
254
+ "type": "text",
255
+ "label": "education",
256
+ "text": "تحصیلات",
257
+ "answer": {
258
+ "type": "select",
259
+ "options": [
260
+ "ابتدایی اول",
261
+ "ابتدایی دوم",
262
+ "متوسطه اول",
263
+ "متوسطه دوم",
264
+ "دیپلم",
265
+ "کارشناسی",
266
+ "کارشناسی ارشد",
267
+ "پزشکی عمومی",
268
+ "متخصص",
269
+ "دکتری تخصصی",
270
+ "حوزوی مقدمات",
271
+ "حوزوی سطح۱",
272
+ "حوزوی سطح۲",
273
+ "حوزوی سطح۳",
274
+ "حوزوی سطح۴"
275
+ ]
276
+ },
277
+ "alias": "education",
278
+ "force": true,
279
+ "user_answered": "12"
280
+ },
281
+ {
282
+ "type": "text",
283
+ "label": "marital_status",
284
+ "text": "وضعیت تأهل",
285
+ "answer": {
286
+ "type": "select",
287
+ "options": ["مجرد", "متأهل"]
288
+ },
289
+ "alias": "marital_status",
290
+ "force": true,
291
+ "user_answered": "1"
292
+ }
293
+ ],
294
+ "cornometer": 2,
295
+ "score": {
296
+ "intrusion_raw": 10,
297
+ "intrusion_percentage": 0.5,
298
+ "intrusion_dsm_mode": "positive",
299
+ "avoidance_raw": 2,
300
+ "avoidance_percentage": 0.25,
301
+ "avoidance_dsm_mode": "positive",
302
+ "negative_mood_raw": 6,
303
+ "negative_mood_percentage": 0.38,
304
+ "negative_mood_dsm_mode": "positive",
305
+ "arousal_reactivity_raw": 8,
306
+ "arousal_reactivity_percentage": 0.5,
307
+ "arousal_reactivity_dsm_mode": "positive",
308
+ "emotional_numbing_raw": 2,
309
+ "emotional_numbing_percentage": 0.1,
310
+ "total_raw": 28,
311
+ "total_percentage": 0.35,
312
+ "status": "moderate"
313
+ },
314
+ "score_current_version": "1.0.0",
315
+ "score_last_version": "1.0.0"
316
+ }
@@ -0,0 +1,99 @@
1
+ const { Profile, FS } = require("../Profile");
2
+
3
+
4
+ class JSGS93 extends Profile {
5
+ // Number of pages
6
+ static pages = 1;
7
+
8
+ // Labels of the sample
9
+ labels = {
10
+
11
+ L1_1: { eng: "god_image_raw", fr: "خداپنداره", max:56, color:"#64748B"},
12
+ L1_2: { eng: "god_image_percentage"},
13
+ L2_1: { eng: "god_concept_raw", fr: "خداپنداشت", max:44, color:"#0284C7"},
14
+ L2_2: { eng: "god_concept_percentage"},
15
+
16
+ L3_1: { eng: "self_image_raw", fr: "خودپنداره", max:28, color:"#64748B"},
17
+ L3_2: { eng: "self_image_percentage"},
18
+ L4_1: { eng: "self_concept_raw", fr: "خودپنداشت", max:32, color:"#65A30D"},
19
+ L4_2: { eng: "self_concept_percentage"},
20
+
21
+ };
22
+
23
+ profileSpec = {
24
+ /* "sample" determines some important info about the sample and profile */
25
+ /* Default prerequisites: 1. gender, 2. age, 3. education */
26
+ /* "prerequisites" is synonym to "fields" in our program */
27
+ sample: {
28
+ name: "پرسشنامه خودپنداره - خداپنداره جان‌بزرگی" /* Name of the sample */,
29
+ multiProfile: false /* Whether the sample has multiple profiles or not */,
30
+ questions: true /* Determines whether to get questions from inital dataset or not */,
31
+ defaultFields: true /* Determines whether to have default prerequisites in the profile or not */,
32
+ fields: [] /* In case you want to get some additional fields and show in the profile */,
33
+ },
34
+ /* "profile" determines the dimensions of the drawn profile (to be used in svg tag viewbox) */
35
+ /* calculating its dimensions carefully is of great importance */
36
+ profile: {
37
+ get dimensions() {
38
+ return {
39
+ width: 401 + 2 * this.padding.x,
40
+ height: 501 + 2 * this.padding.y,
41
+ };
42
+ },
43
+ padding: {
44
+ x: 251,
45
+ y: 106.5,
46
+ },
47
+ },
48
+ /* "labels" part which has to be provided for each profile */
49
+ labels: Object.values(this.labels),
50
+ };
51
+ circle (data){
52
+ data.mark = data.mark?? 0;
53
+ data.percentage = data.percentage?? 0;
54
+ const circleData = {
55
+ R: 80 ,
56
+ r: 80 * .7,
57
+ angles: {
58
+ start: FS.toRadians(-90),
59
+ end: FS.toRadians(180),
60
+ },
61
+ direction: false,
62
+ get totalAngle() {
63
+ return this.direction
64
+ ? 2 * Math.PI - (this.angles.end - this.angles.start)
65
+ : this.angles.end - this.angles.start;
66
+ },
67
+ }
68
+ return {
69
+ circle: circleData,
70
+ mark: data.mark,
71
+ label: data.label.fr,
72
+ bg: data.label.bg,
73
+ color: data.label.color,
74
+ max: data.label.max,
75
+ percentage: Math.round(data.percentage * 100),
76
+ zeta: (data.mark / data.label.max) * circleData.totalAngle + circleData.angles.start,
77
+ };
78
+ }
79
+ constructor(dataset, options, config = {}) {
80
+ super();
81
+ this._init(dataset, options, config);
82
+ }
83
+ _calcContext() {
84
+ const {
85
+ dataset,
86
+ } = this;
87
+
88
+ return [{
89
+ god_image: this.circle({...dataset.score[0], mark: dataset.score[0].mark ?? 0, percentage: dataset.score[1].mark ?? 0}),
90
+ god_concept: this.circle({...dataset.score[2], mark: dataset.score[2].mark ?? 0, percentage: dataset.score[3].mark ?? 0}),
91
+ self_image: this.circle({...dataset.score[4], mark: dataset.score[4].mark ?? 0, percentage: dataset.score[5].mark ?? 0}),
92
+ self_concept: this.circle({...dataset.score[6], mark: dataset.score[6].mark ?? 0, percentage: dataset.score[7].mark ?? 0}),
93
+ }];
94
+ }
95
+ }
96
+
97
+
98
+
99
+ module.exports = JSGS93;
@@ -0,0 +1,187 @@
1
+ const { Profile } = require("../Profile");
2
+ const list = ["intrusion", "avoidance", "negative_mood", "arousal_reactivity", "emotional_numbing"];
3
+ const segments = [
4
+ { limit: 19, multiplier: 5 }, // 95
5
+ { limit: 27, multiplier: 12 }, // 191
6
+ { limit: 32, multiplier: 20 }, // 291
7
+ { limit: 80, multiplier: 3 }, // 435
8
+ ];
9
+ const alerts = {
10
+ minimal: {
11
+ colors: ["#475569", "#CBD5E1", "#475569", "#475569", "#F8FAFC"],
12
+ title: "علائم ناچیز",
13
+ description: "نیازی به مداخله نیست. توصیه به آموزش‌های عمومی تاب‌آوری.",
14
+ },
15
+ mild: {
16
+ colors: ["#EAB308", "#FDE047", "#EAB308", "#FEF9C3", "#FEFCE8"],
17
+ title: "علائم خفیف",
18
+ description: "مانیتورینگ یا مشاوره اولیه گروهی یا فردی.",
19
+ },
20
+ moderate: {
21
+ colors: ["#EA580C", "#FDBA74", "#EA580C", "#FFEDD5", "#FFF7ED"],
22
+ title: "علائم متوسط",
23
+ description: "نیازمند ارزیابی تخصصی؛ ارجاع به روان‌شناس بالینی.",
24
+ },
25
+ severe: {
26
+ colors: ["#E11D48", "#E11D48", "#E11D48", "#FFE4E6", "#FFF1F2"],
27
+ title: "علائم شدید",
28
+ description: "احتمال بالای بالینی؛ ارجاع فوری به درمان تخصصی.",
29
+ },
30
+ };
31
+ class PCL593 extends Profile {
32
+ // Number of pages
33
+ static pages = 2;
34
+
35
+ // Labels of the sample
36
+ labels = {
37
+ L1_1: { eng: "intrusion_raw", short: "B", title: ["تجربه‌های", "مزاحم"], max: 20, dsm_count: 5 },
38
+ L1_2: { eng: "intrusion_percentage" },
39
+ L1_3: { eng: "intrusion_dsm_mode" },
40
+
41
+ L2_1: { eng: "avoidance_raw", short: "C", title: ["اجتناب"], max: 8, dsm_count: 2 },
42
+ L2_2: { eng: "avoidance_percentage" },
43
+ L2_3: { eng: "avoidance_dsm_mode" },
44
+
45
+ L3_1: { eng: "negative_mood_raw", short: "D", title: ["تغییرات منفی", "خلقی"], max: 16, dsm_count: 7 },
46
+ L3_2: { eng: "negative_mood_percentage" },
47
+ L3_3: { eng: "negative_mood_dsm_mode" },
48
+
49
+ L4_1: { eng: "arousal_reactivity_raw", short: "E", title: ["برانگیختگی", "و بی‌قراری"], max: 16, dsm_count: 6 },
50
+ L4_2: { eng: "arousal_reactivity_percentage" },
51
+ L4_3: { eng: "arousal_reactivity_dsm_mode" },
52
+
53
+ L5_1: { eng: "emotional_numbing_raw", short: "F", title: ["بی‌حسی", "عاطفی"], max: 20 },
54
+ L5_2: { eng: "emotional_numbing_percentage" },
55
+
56
+ L6_1: { eng: "total_raw", short: "", title: "", max: 80 },
57
+ L6_2: { eng: "total_percentage" },
58
+
59
+ L7: { eng: "status" },
60
+ };
61
+
62
+ profileSpec = {
63
+ /* "sample" determines some important info about the sample and profile */
64
+ /* Default prerequisites: 1. gender, 2. age, 3. education */
65
+ /* "prerequisites" is synonym to "fields" in our program */
66
+ sample: {
67
+ name: "چک لیست نشانه‌های استرس پس از سانحه (PCL-5)" /* Name of the sample */,
68
+ multiProfile: false /* Whether the sample has multiple profiles or not */,
69
+ questions: true /* Determines whether to get questions from inital dataset or not */,
70
+ defaultFields: true /* Determines whether to have default prerequisites in the profile or not */,
71
+ fields: [] /* In case you want to get some additional fields and show in the profile */,
72
+ },
73
+ /* "profile" determines the dimensions of the drawn profile (to be used in svg tag viewbox) */
74
+ /* calculating its dimensions carefully is of great importance */
75
+ profile: {
76
+ get dimensions() {
77
+ return [
78
+ {
79
+ width: 526 + 2 * this.padding.x,
80
+ height: 559 + 2 * this.padding.y,
81
+ },
82
+ {
83
+ width: 760 + 2 * this.padding.x,
84
+ height: 706 + 2 * this.padding.y,
85
+ },
86
+ ];
87
+ },
88
+ padding: [
89
+ {
90
+ x: 189,
91
+ y: 78,
92
+ },
93
+ {
94
+ x: 19,
95
+ y: 4,
96
+ },
97
+ ],
98
+ },
99
+ /* "labels" part which has to be provided for each profile */
100
+ labels: Object.values(this.labels),
101
+ };
102
+
103
+ constructor(dataset, options, config = {}) {
104
+ super();
105
+ this._init(dataset, options, config);
106
+ }
107
+
108
+ _calcContext() {
109
+ const { dataset } = this;
110
+
111
+ const factors = {};
112
+ for (const item of dataset.score) {
113
+ const group = list.find((i) => item.label.eng.startsWith(i));
114
+ if (group === undefined) continue;
115
+ const type = item.label.eng.substring(group.length + 1);
116
+ if (type === "raw") {
117
+ factors[group] = {
118
+ mark: item.mark ?? 0,
119
+ label: {
120
+ ...item.label,
121
+ eng: group,
122
+ },
123
+ };
124
+ } else if (type === "percentage") {
125
+ factors[group].label[type] = item.mark ?? 0;
126
+ factors[group].label.percentageT = Math.round((item.mark ?? 0) * 100);
127
+ } else {
128
+ factors[group].label[type] = item.mark ?? 0;
129
+ }
130
+ }
131
+
132
+ const total = {
133
+ mark: dataset.score[14].mark ?? 0,
134
+ len: calculateSegmentedLength(dataset.score[14].mark ?? 0),
135
+ label: {
136
+ ...dataset.score[14],
137
+ percentage: Math.round((dataset.score[15].mark ?? 0) * 100),
138
+ },
139
+ };
140
+
141
+ const status = {
142
+ mark: dataset.score[16].mark,
143
+ style: alerts[dataset.score[16].mark],
144
+ };
145
+ let lastItem = 0
146
+ let top = 0
147
+ const factorWithQuestions = Object.values(factors).map((factor, i) => {
148
+ if(i === 4) return factor
149
+ const itemCount = factor.label.dsm_count
150
+ factor.items = dataset.questions.slice(lastItem, itemCount + lastItem).map(item => ({
151
+ ...item,
152
+ text: item.text.replace(/\([^\(\)]*\)/, '')
153
+ }))
154
+ const height = (itemCount * 29) - 3 + 16
155
+ factor.itemOption = {
156
+ height,
157
+ startItem: lastItem + 1,
158
+ top
159
+ }
160
+ top += height
161
+ lastItem += itemCount
162
+ return factor
163
+ })
164
+ return [{ factors: factorWithQuestions, total, status }, {
165
+ factors: factorWithQuestions.filter(item => item.items !== undefined),
166
+ questions: dataset.questions,
167
+ titleAppend: ' - براساس DSM-5'
168
+ }];
169
+ }
170
+ }
171
+
172
+ function calculateSegmentedLength(n) {
173
+ n = Math.max(Math.min(0, n), n);
174
+ let total = 0;
175
+ let current = 1;
176
+
177
+ for (const { limit, multiplier } of segments) {
178
+ if (n < current) break;
179
+ const upper = Math.min(n, limit);
180
+ const count = upper - current + 1;
181
+ total += count * multiplier;
182
+ current = limit + 1;
183
+ }
184
+
185
+ return total;
186
+ }
187
+ module.exports = PCL593;
@@ -0,0 +1,50 @@
1
+ {{#> layout}}
2
+ <g transform="translate({{spec.profile.padding.x}}, {{spec.profile.padding.y}})">
3
+ <g transform="translate(80,80)">
4
+ {{#with god_concept}}
5
+ {{gauge circle.R circle.r (object tl=6 tr=6 bl=6 br=6) (object start=circle.angles.start end=circle.angles.end) direction fill="#F3F4F6"}}
6
+ {{gauge circle.R circle.r (object tl=6 tr=0 bl=6 br=0) (object start=circle.angles.start end=zeta) direction fill=color}}
7
+ <text y="-10" text-anchor="middle" dy=".3em" font-size="32" font-weight="500" fill="{{color}}">٪{{percentage}}</text>
8
+ <text y="20" text-anchor="middle" dy=".3em" font-size="18" font-weight="400" fill="{{color}}">{{mark}}</text>
9
+ <text y="-68" x="-12" text-anchor="middle" dy=".3em" font-size="14" font-weight="500" fill="#6B7280">0</text>
10
+ <text y="-14" x="-68" text-anchor="middle" dy=".3em" font-size="14" font-weight="500" fill="#6B7280">{{max}}</text>
11
+ <text y="98" text-anchor="middle" dy=".90em" font-size="18" font-weight="500" fill="{{color}}">{{label}}</text>
12
+ {{/with}}
13
+ </g>
14
+ <g transform="translate(340,80)">
15
+ {{#with god_image}}
16
+ {{gauge circle.R circle.r (object tl=6 tr=6 bl=6 br=6) (object start=circle.angles.start end=circle.angles.end) direction fill="#F3F4F6"}}
17
+ {{gauge circle.R circle.r (object tl=6 tr=0 bl=6 br=0) (object start=circle.angles.start end=zeta) direction fill=color}}
18
+ <text y="-10" text-anchor="middle" dy=".3em" font-size="32" font-weight="500" fill="{{color}}">٪{{percentage}}</text>
19
+ <text y="20" text-anchor="middle" dy=".3em" font-size="18" font-weight="400" fill="{{color}}">{{mark}}</text>
20
+ <text y="-68" x="-12" text-anchor="middle" dy=".3em" font-size="14" font-weight="500" fill="#6B7280">0</text>
21
+ <text y="-14" x="-68" text-anchor="middle" dy=".3em" font-size="14" font-weight="500" fill="#6B7280">{{max}}</text>
22
+ <text y="98" text-anchor="middle" dy=".90em" font-size="18" font-weight="500" fill="{{color}}">{{label}}</text>
23
+ {{/with}}
24
+ </g>
25
+ <line x1="0" x2="400" y1="250" y2="250" stroke="#F3F4F6" />
26
+ <g transform="translate(80,379)">
27
+ {{#with self_concept}}
28
+ {{gauge circle.R circle.r (object tl=6 tr=6 bl=6 br=6) (object start=circle.angles.start end=circle.angles.end) direction fill="#F3F4F6"}}
29
+ {{gauge circle.R circle.r (object tl=6 tr=0 bl=6 br=0) (object start=circle.angles.start end=zeta) direction fill=color}}
30
+ <text y="-10" text-anchor="middle" dy=".3em" font-size="32" font-weight="500" fill="{{color}}">٪{{percentage}}</text>
31
+ <text y="20" text-anchor="middle" dy=".3em" font-size="18" font-weight="400" fill="{{color}}">{{mark}}</text>
32
+ <text y="-68" x="-12" text-anchor="middle" dy=".3em" font-size="14" font-weight="500" fill="#6B7280">0</text>
33
+ <text y="-14" x="-68" text-anchor="middle" dy=".3em" font-size="14" font-weight="500" fill="#6B7280">{{max}}</text>
34
+ <text y="98" text-anchor="middle" dy=".90em" font-size="18" font-weight="500" fill="{{color}}">{{label}}</text>
35
+ {{/with}}
36
+ </g>
37
+ <g transform="translate(340,379)">
38
+ {{#with self_image}}
39
+ {{gauge circle.R circle.r (object tl=6 tr=6 bl=6 br=6) (object start=circle.angles.start end=circle.angles.end) direction fill="#F3F4F6"}}
40
+ {{gauge circle.R circle.r (object tl=6 tr=0 bl=6 br=0) (object start=circle.angles.start end=zeta) direction fill=color}}
41
+ <text y="-10" text-anchor="middle" dy=".3em" font-size="32" font-weight="500" fill="{{color}}">٪{{percentage}}</text>
42
+ <text y="20" text-anchor="middle" dy=".3em" font-size="18" font-weight="400" fill="{{color}}">{{mark}}</text>
43
+ <text y="-68" x="-12" text-anchor="middle" dy=".3em" font-size="14" font-weight="500" fill="#6B7280">0</text>
44
+ <text y="-14" x="-68" text-anchor="middle" dy=".3em" font-size="14" font-weight="500" fill="#6B7280">{{max}}</text>
45
+ <text y="98" text-anchor="middle" dy=".90em" font-size="18" font-weight="500" fill="{{color}}">{{label}}</text>
46
+ {{/with}}
47
+ </g>
48
+ </g>
49
+
50
+ {{/layout}}