Skip to content

Commit

Permalink
feat(calc): mlks
Browse files Browse the repository at this point in the history
  • Loading branch information
nckhell committed Feb 2, 2025
1 parent 7dde27a commit 9dc8713
Show file tree
Hide file tree
Showing 10 changed files with 132 additions and 154 deletions.
4 changes: 2 additions & 2 deletions src/scores/library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ import { acro } from './acro/acro'
import { Score } from '../classes'
import { ScoreType } from '../types'
// import { korq } from './korq/korq'
// import { mlks } from './mlks/mlks'
import { mlks } from './mlks/mlks'
// import { psqi } from './psqi/psqi'
import { test_calculation } from './test_calculation/test_caculation'

Expand Down Expand Up @@ -214,7 +214,7 @@ export const ScoreLibrary = createScoreLibrary({
// mds_updrs,
// mini_best_test,
// mfis,
// mlks,
mlks,
// mmse,
// moca,
// modified_caregiver_strain_index,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { type InputType } from '../../../src/types/calculations.types'
import { z } from 'zod'
import { ScoreInputSchemaType } from '../../../types'

export const ZERO = 0
export const TWO = 2
Expand All @@ -11,20 +12,16 @@ export const FIFTEEN = 15
export const TWENTY = 20
export const TWENTY_FIVE = 25

/**
* Make sure to update all the input labels with MLKS labels
*/
export const MLKS_INPUTS: Array<InputType> = [
{
input_id: 'Q01_LIMP',
export const MLKS_INPUTS = {
Q01_LIMP: {
label: {
en: 'Limp',
nl: 'Afwijkend looppatroon, mank lopen',
fr: 'Boiterie',
},
type: {
type: 'number',
allowed_answers: [
type: z.union([z.literal(FIVE), z.literal(THREE), z.literal(ZERO)]),
uiOptions: {
options: [
{
value: FIVE,
label: {
Expand Down Expand Up @@ -52,16 +49,15 @@ export const MLKS_INPUTS: Array<InputType> = [
],
},
},
{
input_id: 'Q02_CANE_OR_CRUTCHES',
Q02_CANE_OR_CRUTCHES: {
label: {
en: 'Using cane or crutches',
nl: 'Steun',
fr: 'Utiliser une canne ou des béquilles',
},
type: {
type: 'number',
allowed_answers: [
type: z.union([z.literal(FIVE), z.literal(TWO), z.literal(ZERO)]),
uiOptions: {
options: [
{
value: FIVE,
label: {
Expand Down Expand Up @@ -89,16 +85,21 @@ export const MLKS_INPUTS: Array<InputType> = [
],
},
},
{
input_id: 'Q03_LOCKING_KNEE',
Q03_LOCKING_KNEE: {
label: {
en: 'Locking sensation in the knee',
nl: 'Blokkades/slotverschijnselen',
fr: 'Sensation de blocage dans le genou',
},
type: {
type: 'number',
allowed_answers: [
type: z.union([
z.literal(FIFTEEN),
z.literal(TEN),
z.literal(SIX),
z.literal(TWO),
z.literal(ZERO),
]),
uiOptions: {
options: [
{
value: FIFTEEN,
label: {
Expand Down Expand Up @@ -142,16 +143,22 @@ export const MLKS_INPUTS: Array<InputType> = [
],
},
},
{
input_id: 'Q04_GIVING_WAY_SENSATION_KNEE',
Q04_GIVING_WAY_SENSATION_KNEE: {
label: {
en: 'Giving way sensation from the knee',
nl: 'Door de knie zakken',
fr: 'Sensation de cèder au niveau du genou',
},
type: {
type: 'number',
allowed_answers: [
type: z.union([
z.literal(TWENTY_FIVE),
z.literal(TWENTY),
z.literal(FIFTEEN),
z.literal(TEN),
z.literal(FIVE),
z.literal(ZERO),
]),
uiOptions: {
options: [
{
value: TWENTY_FIVE,
label: {
Expand Down Expand Up @@ -203,16 +210,22 @@ export const MLKS_INPUTS: Array<InputType> = [
],
},
},
{
input_id: 'Q05_PAIN',
Q05_PAIN: {
label: {
en: 'Pain',
nl: 'Pijn',
fr: 'Douleur',
},
type: {
type: 'number',
allowed_answers: [
type: z.union([
z.literal(TWENTY_FIVE),
z.literal(TWENTY),
z.literal(FIFTEEN),
z.literal(TEN),
z.literal(FIVE),
z.literal(ZERO),
]),
uiOptions: {
options: [
{
value: TWENTY_FIVE,
label: {
Expand Down Expand Up @@ -264,16 +277,20 @@ export const MLKS_INPUTS: Array<InputType> = [
],
},
},
{
input_id: 'Q06_SWELLING',
Q06_SWELLING: {
label: {
en: 'Swelling',
nl: 'Zwelling',
fr: 'Gonflement',
},
type: {
type: 'number',
allowed_answers: [
type: z.union([
z.literal(TEN),
z.literal(SIX),
z.literal(TWO),
z.literal(ZERO),
]),
uiOptions: {
options: [
{
value: TEN,
label: {
Expand Down Expand Up @@ -309,16 +326,20 @@ export const MLKS_INPUTS: Array<InputType> = [
],
},
},
{
input_id: 'Q07_CLIMBING_STAIRS',
Q07_CLIMBING_STAIRS: {
label: {
en: 'Climbing stairs',
nl: 'Traplopen',
fr: 'Monter les escaliers',
},
type: {
type: 'number',
allowed_answers: [
type: z.union([
z.literal(TEN),
z.literal(SIX),
z.literal(TWO),
z.literal(ZERO),
]),
uiOptions: {
options: [
{
value: TEN,
label: {
Expand Down Expand Up @@ -354,16 +375,20 @@ export const MLKS_INPUTS: Array<InputType> = [
],
},
},
{
input_id: 'Q08_SQUATTING',
Q08_SQUATTING: {
label: {
en: 'Squatting',
nl: 'Hurkzit',
fr: 'Accroupissement',
},
type: {
type: 'number',
allowed_answers: [
type: z.union([
z.literal(FIVE),
z.literal(FOUR),
z.literal(TWO),
z.literal(ZERO),
]),
uiOptions: {
options: [
{
value: FIVE,
label: {
Expand Down Expand Up @@ -399,4 +424,4 @@ export const MLKS_INPUTS: Array<InputType> = [
],
},
},
]
} satisfies ScoreInputSchemaType
8 changes: 8 additions & 0 deletions src/scores/mlks/definition/mlks_output.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { ScoreOutputSchemaType } from '../../../types'
import { z } from 'zod'
export const MLKS_OUTPUT = {
MLKS_TOTAL_SCORE: {
label: { en: 'Total score' },
type: z.number(),
},
} satisfies ScoreOutputSchemaType
Loading

0 comments on commit 9dc8713

Please sign in to comment.