Logo GenPRES

PatientCategory Module

Creates patient categories, tests whether one patient can be in two categories, tests whether a rule applies to the department and location of a patient, returns a sort value for a category, and returns a category as Dutch text.

Functions and values

Function or value Description

ageToString pat

Full Usage: ageToString pat

Parameters:
Returns: string

Prints the age of a category: volwassenen for an adult category, otherwise the age range.

pat : PatientCategory
Returns: string

canMeet a b

Full Usage: canMeet a b

Parameters:
    a : 'a option
    b : 'a option

Returns: bool
Type parameters: 'a (requires equality)

Returns true when the two values are equal, or when either value is None.

a : 'a option
b : 'a option
Returns: bool

canShare a b

Full Usage: canShare a b

Parameters:
Returns: bool

Whether one patient can be in both categories. Categories for a CVL and for a PVL have no patient in common, because the access device tells them apart. Department names are compared apart from capitals and surrounding spaces.

a : PatientCategory
b : PatientCategory
Returns: bool

departmentMatches rule patient

Full Usage: departmentMatches rule patient

Parameters:
    rule : string option
    patient : string option

Returns: bool

Returns true when a rule applies to the department of a patient. A rule without a department applies to every patient. A patient without a department matches only those rules; otherwise the names must be equal, apart from capitals and surrounding spaces.

rule : string option
patient : string option
Returns: bool

empty

Full Usage: empty

Returns: PatientCategory

getAge pat

Full Usage: getAge pat

Parameters:
Returns: MinMax

Returns the age range of a category: the absolute range, or for an adult category the range from the adult age of 18 years up.

pat : PatientCategory
Returns: MinMax

isEmpty p

Full Usage: isEmpty p

Parameters:
Returns: bool
p : PatientCategory
Returns: bool

locationMatches rule patient

Full Usage: locationMatches rule patient

Parameters:
    rule : string option
    patient : string option

Returns: bool

Returns true when a rule applies to the location of a patient. A rule without a location applies to every patient. A rule with a location applies only to a patient at that location, apart from capitals and surrounding spaces.

rule : string option
patient : string option
Returns: bool

ofAgeAndWeight minAge maxAge minWeight maxWeight

Full Usage: ofAgeAndWeight minAge maxAge minWeight maxWeight

Parameters:
Returns: PatientCategory

Returns a patient category with an age range in days and a weight range in grams, and no limit on any other value. Each range has an inclusive minimum and an exclusive maximum.

minAge : RationalX option
maxAge : RationalX option
minWeight : RationalX option
maxWeight : RationalX option
Returns: PatientCategory

printAge age

Full Usage: printAge age

Parameters:
Returns: string

Prints an age in days as a string, in its largest unit: days below one week, weeks up to 30 days, months below one year, years from 365 days, each count rounded down.

age : ValueUnit
Returns: string

printAgeMinMax age

Full Usage: printAgeMinMax age

Parameters:
Returns: string

Prints an age range as Dutch text, such as leeftijd vanaf 1 jaar. An empty range gives an empty string.

age : MinMax
Returns: string

printDaysToWeeks d

Full Usage: printDaysToWeeks d

Parameters:
Returns: string

Print days as weeks.

d : ValueUnit
Returns: string

printWeightMinMax weight

Full Usage: printWeightMinMax weight

Parameters:
Returns: string

Prints a weight range in kilograms as Dutch text, such as gewicht vanaf 2 kg. An empty range gives an empty string.

weight : MinMax
Returns: string

ranges pc

Full Usage: ranges pc

Parameters:
Returns: (string * MinMax) list

Returns the ranges of a patient category, each with its name. An adult category has no age range in the list.

pc : PatientCategory
Returns: (string * MinMax) list

sortBy pat

Full Usage: sortBy pat

Parameters:
Returns: int

Returns a sort value for a patient category. The value is the sum of the minimum age in days, plus 300 when above zero, the minimum gestational and post-menstrual age in days, term when absent, and the minimum weight divided by 1000.

pat : PatientCategory
Returns: int

toString pat

Full Usage: toString pat

Parameters:
Returns: string

Prints a patient category as Dutch text: the department, gender, neonatal ages, age and weight.

pat : PatientCategory
Returns: string

Type something to start searching.