Skip to content

Commit

Permalink
add phq-8
Browse files Browse the repository at this point in the history
  • Loading branch information
sharlotta93 committed Oct 14, 2024
1 parent 9a3f90a commit ffe28bc
Show file tree
Hide file tree
Showing 10 changed files with 577 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/calculation_suite/calculations/calculation_library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ import { pdi } from './pdi/pdi'
import { pdq_8 } from './pdq_8/pdq_8'
import { phq_2 } from './phq_2/phq_2'
import { phq_4 } from './phq_4/phq_4'
import { phq_8 } from './phq_8/phq_8'
import { phq_9 } from './phq_9/phq_9'
import { physical_activity_measurement } from './physical_activity_measurements/physical_activity_measurements'
import { posas_observer } from './posas_observer/posas_observer'
Expand Down Expand Up @@ -220,6 +221,7 @@ export const CALCULATIONS: CalculationsLibraryType = {
pdq_8,
phq_2,
phq_4,
phq_8,
phq_9,
physical_activity_measurement,
posas_observer,
Expand Down
24 changes: 24 additions & 0 deletions src/calculation_suite/calculations/phq_8/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Patient Health Questionnaire‐8 (PHQ‐8)

## Introduction

The PHQ-8 is a validated, 8-question tool to assess for the degree of depression present in an individual.

## Calculation

All 8 questions are simply summed to obtain the total score.

## Interpretation

| Score | Depression severity | Comments |
|-------|---------------------|-----------------------------------------------------------------------------------------------------|
| 0-4 | Minimal or none | Monitor; may not require treatment |
| 5-9 | Mild | Use clinical judgment (symptom duration, functional impairment) to determine necessity of treatment |
| 10-14 | Moderate | Use clinical judgment (symptom duration, functional impairment) to determine necessity of treatment |
| 15-19 | Moderately severe | Warrants active treatment with psychotherapy, medications, or combination |
| 20-24 | Severe | Warrants active treatment with psychotherapy, medications, or combination |

## References

[1] Kroenke K, Spitzer RL, Williams JB. The PHQ-8: validity of a brief depression severity measure. J Gen Intern Med. 2001 Sep;16(9):606-13. PubMed PMID: 11556941; PubMed Central PMCID: PMC1495268.
[2] [Instruction manual](https://www.ons.org/sites/default/files/PHQandGAD7_InstructionManual.pdf)
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
export const best_response = {
PHQ8_Q01: 0,
PHQ8_Q02: 0,
PHQ8_Q03: 0,
PHQ8_Q04: 0,
PHQ8_Q05: 0,
PHQ8_Q06: 0,
PHQ8_Q07: 0,
PHQ8_Q08: 0,
}

export const worst_response = {
PHQ8_Q01: 3,
PHQ8_Q02: 3,
PHQ8_Q03: 3,
PHQ8_Q04: 3,
PHQ8_Q05: 3,
PHQ8_Q06: 3,
PHQ8_Q07: 3,
PHQ8_Q08: 3,
}

/**
* Expected score: 7 == Mild depression
*/
export const random_response = {
PHQ8_Q01: 3,
PHQ8_Q02: 0,
PHQ8_Q03: 1,
PHQ8_Q04: 2,
PHQ8_Q05: 0,
PHQ8_Q06: 0,
PHQ8_Q07: 1,
PHQ8_Q08: 0,
}
3 changes: 3 additions & 0 deletions src/calculation_suite/calculations/phq_8/definition/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { PHQ8_INPUTS } from './phq_8_inputs'
export { PHQ8_OUTPUT } from './phq_8_output'
export { PHQ8_INTERPRATION_TABLE } from './phq8_interpretation'
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
type DepressionSeverityType =
| 'None/minimal depression'
| 'Mild depression'
| 'Moderate depression'
| 'Moderately severe depression'
| 'Severe depression'

export const PHQ8_INTERPRATION_TABLE: {
[key in string]: DepressionSeverityType
} = {
'0': 'None/minimal depression',
'1': 'None/minimal depression',
'2': 'None/minimal depression',
'3': 'None/minimal depression',
'4': 'None/minimal depression',
'5': 'Mild depression',
'6': 'Mild depression',
'7': 'Mild depression',
'8': 'Mild depression',
'9': 'Mild depression',
'10': 'Moderate depression',
'11': 'Moderate depression',
'12': 'Moderate depression',
'13': 'Moderate depression',
'14': 'Moderate depression',
'15': 'Moderately severe depression',
'16': 'Moderately severe depression',
'17': 'Moderately severe depression',
'18': 'Moderately severe depression',
'19': 'Moderately severe depression',
'20': 'Severe depression',
'21': 'Severe depression',
'22': 'Severe depression',
'23': 'Severe depression',
'24': 'Severe depression',
}
252 changes: 252 additions & 0 deletions src/calculation_suite/calculations/phq_8/definition/phq_8_inputs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,252 @@
import type { InputType } from '../../../../types/calculations.types'

export const PHQ8_INPUTS: Array<InputType> = [
{
input_id: 'PHQ8_Q01',
input_label: {
en: 'Over the last 2 weeks, how often have you been bothered by little interest or pleasure in doing things?',
nl: 'Hoe vaak hebt u in de afgelopen 2 weken last gehad van weinig interesse of plezier in activiteiten?',
},
input_type: {
type: 'number',
allowed_answers: [
{
label: { en: 'Not at all', nl: 'Helemaal niet' },
value: 0,
},
{
label: { en: 'Several days', nl: 'Meerdere dagen' },
value: 1,
},
{
label: {
en: 'More than half the days',
nl: 'Meer dan de helft van de dagen',
},
value: 2,
},
{
label: { en: 'Nearly every day', nl: 'Bijna elke dag' },
value: 3,
},
],
},
},
{
input_id: 'PHQ8_Q02',
input_label: {
en: 'Over the last 2 weeks, how often have you been bothered by feeling down, depressed, or hopeless?',
nl: 'Hoe vaak hebt u in de afgelopen 2 weken last gehad van u neerslachtig, depressief of wanhopig voelen?',
},
input_type: {
type: 'number',
allowed_answers: [
{
label: { en: 'Not at all', nl: 'Helemaal niet' },
value: 0,
},
{
label: { en: 'Several days', nl: 'Meerdere dagen' },
value: 1,
},
{
label: {
en: 'More than half the days',
nl: 'Meer dan de helft van de dagen',
},
value: 2,
},
{
label: { en: 'Nearly every day', nl: 'Bijna elke dag' },
value: 3,
},
],
},
},
{
input_id: 'PHQ8_Q03',
input_label: {
en: 'Over the last 2 weeks, how often have you been bothered by trouble falling or staying asleep, or sleeping too much?',
nl: 'Hoe vaak hebt u in de afgelopen 2 weken last gehad van moeilijk inslapen, moeilijk doorslapen of te veel slapen?',
},
input_type: {
type: 'number',
allowed_answers: [
{
label: { en: 'Not at all', nl: 'Helemaal niet' },
value: 0,
},
{
label: { en: 'Several days', nl: 'Meerdere dagen' },
value: 1,
},
{
label: {
en: 'More than half the days',
nl: 'Meer dan de helft van de dagen',
},
value: 2,
},
{
label: { en: 'Nearly every day', nl: 'Bijna elke dag' },
value: 3,
},
],
},
},
{
input_id: 'PHQ8_Q04',
input_label: {
en: 'Over the last 2 weeks, how often have you been bothered by feeling tired or having little energy?',
nl: 'Hoe vaak hebt u in de afgelopen 2 weken last gehad van u moe voelen of gebrek aan energie hebben?',
},
input_type: {
type: 'number',
allowed_answers: [
{
label: { en: 'Not at all', nl: 'Helemaal niet' },
value: 0,
},
{
label: { en: 'Several days', nl: 'Meerdere dagen' },
value: 1,
},
{
label: {
en: 'More than half the days',
nl: 'Meer dan de helft van de dagen',
},
value: 2,
},
{
label: { en: 'Nearly every day', nl: 'Bijna elke dag' },
value: 3,
},
],
},
},
{
input_id: 'PHQ8_Q05',
input_label: {
en: 'Over the last 2 weeks, how often have you been bothered by poor appetite or overeating?',
nl: 'Hoe vaak hebt u in de afgelopen 2 weken last gehad van weinig eetlust of overmatig eten.?',
},
input_type: {
type: 'number',
allowed_answers: [
{
label: { en: 'Not at all', nl: 'Helemaal niet' },
value: 0,
},
{
label: { en: 'Several days', nl: 'Meerdere dagen' },
value: 1,
},
{
label: {
en: 'More than half the days',
nl: 'Meer dan de helft van de dagen',
},
value: 2,
},
{
label: { en: 'Nearly every day', nl: 'Bijna elke dag' },
value: 3,
},
],
},
},
{
input_id: 'PHQ8_Q06',
input_label: {
en: 'Over the last 2 weeks, how often have you been bothered by feeling bad about yourself or that you are a failure or have let yourself or your family down?',
nl: 'Hoe vaak hebt u in de afgelopen 2 weken last gehad van een slecht gevoel hebben over uzelf, het gevoel hebben dat u een mislukkeling bent of dat u zichzelf of uw familie teleurgesteld hebt?',
},
input_type: {
type: 'number',
allowed_answers: [
{
label: { en: 'Not at all', nl: 'Helemaal niet' },
value: 0,
},
{
label: { en: 'Several days', nl: 'Meerdere dagen' },
value: 1,
},
{
label: {
en: 'More than half the days',
nl: 'Meer dan de helft van de dagen',
},
value: 2,
},
{
label: { en: 'Nearly every day', nl: 'Bijna elke dag' },
value: 3,
},
],
},
},
{
input_id: 'PHQ8_Q07',
input_label: {
en: 'Over the last 2 weeks, how often have you been bothered by trouble concentrating on things, such as reading the newspaper or watching television?',
nl: 'Hoe vaak hebt u in de afgelopen 2 weken last gehad van problemen om u te concentreren, bijvoorbeeld om de krant te lezen of om tv te kijken?',
},
input_type: {
type: 'number',
allowed_answers: [
{
label: { en: 'Not at all', nl: 'Helemaal niet' },
value: 0,
},
{
label: { en: 'Several days', nl: 'Meerdere dagen' },
value: 1,
},
{
label: {
en: 'More than half the days',
nl: 'Meer dan de helft van de dagen',
},
value: 2,
},
{
label: { en: 'Nearly every day', nl: 'Bijna elke dag' },
value: 3,
},
],
},
},
{
input_id: 'PHQ8_Q08',
input_label: {
en: 'Over the last 2 weeks, how often have you been bothered by moving or speaking so slowly that other people could have noticed. Or the opposite being so fidgety or restless that you have been moving around a lot more than usual?',
nl: 'Hoe vaak hebt u in de afgelopen 2 weken last gehad van zo traag bewegen of zo langzaam spreken dat andere mensen dit opgemerkt hebben? Of het tegenovergestelde: zo zenuwachtig of rusteloos zijn dat u veel meer bewoog dan gebruikelijk?',
},
input_type: {
type: 'number',
allowed_answers: [
{
label: { en: 'Not at all', nl: 'Helemaal niet' },
value: 0,
},
{
label: { en: 'Several days', nl: 'Meerdere dagen' },
value: 1,
},
{
label: {
en: 'More than half the days',
nl: 'Meer dan de helft van de dagen',
},
value: 2,
},
{
label: { en: 'Nearly every day', nl: 'Bijna elke dag' },
value: 3,
},
],
},
},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { CalculationOutputDefinition } from '../../../../types/calculations.types'

export const PHQ8_OUTPUT: CalculationOutputDefinition[] = [
{
subresult_id: 'PHQ8_SCORE',
label: { en: 'PHQ-8 Score' },
type: 'number',
},
{
subresult_id: 'PHQ8_INTERPRETATION',
label: { en: 'PHQ-8 Interpretation' },
type: 'string',
},
]
Loading

0 comments on commit ffe28bc

Please sign in to comment.