Logo GenPRES

PatientData Module

Creates patient data and sets the values derived from the age, the weight and the height: adult mark, post-menstrual age, estimates and body surface area.

Nested modules

Modules Description

Dto

Holds the Dto of the patient data, without the patient identity, and converts patient data to and from the Dto. Returns the validation errors of an invalid Dto.

Functions and values

Function or value Description

ageInDays dat

Full Usage: ageInDays dat

Parameters:
Returns: ValueUnit option

The age as a time value in days; none without an age.

dat : PatientData
Returns: ValueUnit option

bodySurfaceArea dat

Full Usage: bodySurfaceArea dat

Parameters:
Returns: ValueUnit option

Returns the body surface area in m2 that is set on the patient data.

dat : PatientData
Returns: ValueUnit option

calcBsa formula dat

Full Usage: calcBsa formula dat

Parameters:
Returns: 'b option
Type parameters: 'a, 'b

Calculates the body surface area with a formula from the calculation weight and height, measured or estimated; None without both.

formula : 'a option -> decimal<MeasureProduct<kg, MeasureOne>> -> decimal<MeasureProduct<cm, MeasureOne>> -> 'b
dat : PatientData
Returns: 'b option

calculateBodySurfaceArea dat

Full Usage: calculateBodySurfaceArea dat

Parameters:
Returns: PatientData

Sets the body surface area by the Du Bois formula, rounded to 2 significant digits. The body surface area is None without a calculation weight and height.

dat : PatientData
Returns: PatientData

calculatePostMenstrualAge dat

Full Usage: calculatePostMenstrualAge dat

Parameters:
Returns: PatientData

Sets the post-menstrual age to the age in days plus the gestational age; None without either.

dat : PatientData
Returns: PatientData

checkMinimumData dat

Full Usage: checkMinimumData dat

Parameters:
Returns: Result<PatientData, PatientDataError>

Returns the patient data when it is enough to select rules with, and NoAgeOrMeasuredWeightAndHeight otherwise.

dat : PatientData
Returns: Result<PatientData, PatientDataError>

create dep diagn gend age wght hght gest

Full Usage: create dep diagn gend age wght hght gest

Parameters:
Returns: PatientData

Creates patient data without a location, an access, a renal function or a mark of the user. The adult mark and the need for the gestational age follow from the age. The post-menstrual age is None until determineGestationalAndPostMenstrualAge sets it. Without the resources, the estimates are none and the options are the options without resources.

dep : Department
diagn : string[]
gend : Gender
age : AgeValue option
wght : Weight
hght : Height
gest : AgeWeeksDays option
Returns: PatientData

determineAdultMarkAndGestationalAgeNeed dat

Full Usage: determineAdultMarkAndGestationalAgeNeed dat

Parameters:
Returns: PatientData

Sets the adult mark and the need for the gestational age from the age. A patient marked as an adult keeps the mark when the age allows it.

dat : PatientData
Returns: PatientData

determineAgeValues dat

Full Usage: determineAgeValues dat

Parameters:
Returns: PatientData

Sets the values that follow from the age: the adult mark, the need for the gestational age, the gestational age when it is used, and the post-menstrual age.

dat : PatientData
Returns: PatientData

determineGestationalAndPostMenstrualAge dat

Full Usage: determineGestationalAndPostMenstrualAge dat

Parameters:
Returns: PatientData

Removes the gestational age when the gestational age is not used, then calculates the post-menstrual age.

dat : PatientData
Returns: PatientData

emergencyInterventions dat

Full Usage: emergencyInterventions dat

Parameters:
Returns: Calculation list

Calculates the interventions of the emergency list that are not medication, from the age and from the calculation weight, measured or estimated.

dat : PatientData
Returns: Calculation list

estimate resources dat

Full Usage: estimate resources dat

Parameters:
Returns: PatientData

Sets the estimates and the options from the resources. A measured calculation weight or height is rounded to the nearest calculation value; any other becomes the estimated mean, without a date, or none without an estimate. Without the resources, the patient data is returned unchanged.

resources : PatientDataResources option
dat : PatientData
Returns: PatientData

fromAgeType gend at

Full Usage: fromAgeType gend at

Parameters:
Returns: PatientData

Creates patient data with the age at the start of an age type, and the normal weight and height of that age type for a gender as undated estimates.

gend : Gender
at : AgeType
Returns: PatientData

gestationalAgeInDays dat

Full Usage: gestationalAgeInDays dat

Parameters:
Returns: ValueUnit option

The gestational age as a time value in days; none without one.

dat : PatientData
Returns: ValueUnit option

heightInCm dat

Full Usage: heightInCm dat

Parameters:
Returns: ValueUnit option

The calculation height in cm, measured or estimated; none without one.

dat : PatientData
Returns: ValueUnit option

ignoreGestationalAge dat

Full Usage: ignoreGestationalAge dat

Parameters:
Returns: PatientData

Removes the gestational age when the gestational age is not used.

dat : PatientData
Returns: PatientData

markAsAdult marked dat

Full Usage: markAsAdult marked dat

Parameters:
Returns: PatientData

Sets the adult mark from the age and the mark the user asks for. The mark is ignored when the age does not allow it.

marked : bool
dat : PatientData
Returns: PatientData

meetsMinimumData dat

Full Usage: meetsMinimumData dat

Parameters:
Returns: bool

True when the patient data has an age, an adult mark, or a measured weight with a measured height.

dat : PatientData
Returns: bool

postMenstrualAgeInDays dat

Full Usage: postMenstrualAgeInDays dat

Parameters:
Returns: ValueUnit option

The post-menstrual age as a time value in days; none without one.

dat : PatientData
Returns: ValueUnit option

roundMeasured steps valueOf dateOf ofStep actual calculation

Full Usage: roundMeasured steps valueOf dateOf ofStep actual calculation

Parameters:
    steps : decimal<'u>[]
    valueOf : 'a -> decimal<'u>
    dateOf : 'a -> 'b
    ofStep : 'b -> decimal<'u> -> 'a
    actual : 'a list
    calculation : Source<'a> option

Returns: 'a list * Source<'a> option
Type parameters: 'a, 'b, 'u (requires equality)

Rounds a measured calculation value to the nearest step and keeps the measurement date. The exact measurement is added to the actual values when none of them has the same date and the same value. A value that is not measured, or that is already a step, is returned unchanged.

steps : decimal<'u>[]
valueOf : 'a -> decimal<'u>
dateOf : 'a -> 'b
ofStep : 'b -> decimal<'u> -> 'a
actual : 'a list
calculation : Source<'a> option
Returns: 'a list * Source<'a> option

unknown

Full Usage: unknown

Returns: PatientData

The patient data with nothing known.

Returns: PatientData

weightInKg dat

Full Usage: weightInKg dat

Parameters:
Returns: ValueUnit option

The calculation weight in kg, measured or estimated; none without one.

dat : PatientData
Returns: ValueUnit option

Type something to start searching.