|
| 1 | +import { defineInstrument } from '/runtime/v1/@opendatacapture/runtime-core'; |
| 2 | +import { sum } from '/runtime/v1/lodash-es@4.x'; |
| 3 | +import { z } from '/runtime/v1/zod@3.23.x'; |
| 4 | + |
| 5 | +export default defineInstrument({ |
| 6 | + kind: 'FORM', |
| 7 | + language: ['en', 'fr'], |
| 8 | + internal: { |
| 9 | + name: 'AUDIT-C', |
| 10 | + edition: 1 |
| 11 | + }, |
| 12 | + tags: { |
| 13 | + en: ['Alcohol', 'Health', 'Disorder'], |
| 14 | + fr: ['Alcool', 'Santé', 'Troubles'] |
| 15 | + }, |
| 16 | + clientDetails: { |
| 17 | + title: { |
| 18 | + en: 'Alcohol Use (AUDIT-C)', |
| 19 | + fr: "Consommation d'alcool (AUDIT-C)" |
| 20 | + } |
| 21 | + }, |
| 22 | + details: { |
| 23 | + description: { |
| 24 | + en: 'The Alcohol Use Disorders Identification Test (AUDIT-C) is an alcohol screen that can help identify patients who are hazardous drinkers or have active alcohol use disorders (including alcohol abuse or dependence).', |
| 25 | + fr: "Le test d'identification des troubles liés à la consommation d'alcool (AUDIT-C) est un test de dépistage de l'alcool qui permet d'identifier les patients qui sont des buveurs dangereux ou qui présentent des troubles liés à la consommation d'alcool (y compris l'abus d'alcool ou la dépendance)." |
| 26 | + }, |
| 27 | + estimatedDuration: 2, |
| 28 | + instructions: { |
| 29 | + en: ['Please respond to every question'], |
| 30 | + fr: ['Veuillez répondre à toutes les questions'] |
| 31 | + }, |
| 32 | + license: 'PUBLIC-DOMAIN', |
| 33 | + title: { |
| 34 | + en: 'Alcohol Use Disorders Identification Test (AUDIT-C)', |
| 35 | + fr: "Test d'identification des troubles liés à l'utilisation de l'alcool (AUDIT-C)" |
| 36 | + } |
| 37 | + }, |
| 38 | + content: { |
| 39 | + drinkingFrequency: { |
| 40 | + kind: 'number', |
| 41 | + label: { |
| 42 | + en: '1. How often do you have a drink containing alcohol?', |
| 43 | + fr: "1. A quelle fréquence vous arrive-t-il de consommer des boissons contenant de l'alcool?" |
| 44 | + }, |
| 45 | + options: { |
| 46 | + en: { |
| 47 | + 0: 'Never', |
| 48 | + 1: 'Monthly or Less', |
| 49 | + 2: '2 to 4 times a month', |
| 50 | + 3: '2 to 3 times a week', |
| 51 | + 4: '4 or more times a week' |
| 52 | + }, |
| 53 | + fr: { |
| 54 | + 0: 'Jamais', |
| 55 | + 1: 'Une fois par mois ou moins', |
| 56 | + 2: '2 à 4 fois par mois', |
| 57 | + 3: '2 à 3 fois par semaine', |
| 58 | + 4: '4 fois ou plus par semaine' |
| 59 | + } |
| 60 | + }, |
| 61 | + variant: 'radio' |
| 62 | + }, |
| 63 | + typicalDrinkQuantity: { |
| 64 | + kind: 'number', |
| 65 | + label: { |
| 66 | + en: '2. How many drinks containing alcohol do you have on a typical day when you are drinking?', |
| 67 | + fr: "2. Combien de verres standards buvez-vous au cours d'une journée ordinaire où vous buvez de l'alcool?" |
| 68 | + }, |
| 69 | + options: { |
| 70 | + en: { |
| 71 | + 0: '1 or 2', |
| 72 | + 1: '3 or 4', |
| 73 | + 2: '5 or 6', |
| 74 | + 3: '7 to 9', |
| 75 | + 4: '10 or more' |
| 76 | + }, |
| 77 | + fr: { |
| 78 | + 0: '1 ou 2', |
| 79 | + 1: '3 ou 4', |
| 80 | + 2: '5 ou 6', |
| 81 | + 3: '7 ou 9', |
| 82 | + 4: '10 ou plus' |
| 83 | + } |
| 84 | + }, |
| 85 | + variant: 'radio' |
| 86 | + }, |
| 87 | + bingeDrinkingFrequency: { |
| 88 | + kind: 'number', |
| 89 | + label: { |
| 90 | + en: '3. How often do you have six or more drinks on one occasion?', |
| 91 | + fr: "3. Au cours d'une même occasion, à quelle fréquence vous arrive-t-il de boire six verres standard ou plus?" |
| 92 | + }, |
| 93 | + options: { |
| 94 | + en: { |
| 95 | + 0: 'Never', |
| 96 | + 1: 'Less than monthly', |
| 97 | + 2: 'Monthly', |
| 98 | + 3: 'Weekly', |
| 99 | + 4: 'Daily or almost daily' |
| 100 | + }, |
| 101 | + fr: { |
| 102 | + 0: 'Jamais', |
| 103 | + 1: "Moins d'une fois par mois", |
| 104 | + 2: 'Une fois par mois', |
| 105 | + 3: 'Une fois par semaine', |
| 106 | + 4: 'Chaque jour ou presque' |
| 107 | + } |
| 108 | + }, |
| 109 | + variant: 'radio' |
| 110 | + } |
| 111 | + }, |
| 112 | + measures: { |
| 113 | + auditCScore: { |
| 114 | + kind: 'computed', |
| 115 | + label: { |
| 116 | + en: 'Total Score', |
| 117 | + fr: 'Score total' |
| 118 | + }, |
| 119 | + value: (data) => { |
| 120 | + return sum(Object.values(data)); |
| 121 | + } |
| 122 | + } |
| 123 | + }, |
| 124 | + validationSchema: z.object({ |
| 125 | + drinkingFrequency: z.number().int().min(0).max(4), |
| 126 | + typicalDrinkQuantity: z.number().int().min(0).max(4), |
| 127 | + bingeDrinkingFrequency: z.number().int().min(0).max(4) |
| 128 | + }) |
| 129 | +}); |
0 commit comments