Logo GenPRES

PatientData Module

Holds the empty patient data, the constructors, the readers and the validation of patient data, shared by the client and the server. Patient data can be incomplete, so validate checks only the minimum. This module calculates no age: the server sets the ages, the adult mark, the gestational age and the estimates with GenCORE, and ServerApi.Patient.toCore maps the patient data to GenCORE patient data. Patient logic that only the server needs belongs in GenFORM or GenCORE.

Nested modules

Modules Description

Age

Creates an age from years, months, weeks and days and reads each part of an age.

Functions and values

Function or value Description

apply f p

Full Usage: apply f p

Parameters:
Returns: 'a
Type parameters: 'a
f : PatientData -> 'a
p : PatientData
Returns: 'a

create years months weeks days weight height gw gd gend cvl gfr dep

Full Usage: create years months weeks days weight height gw gd gend cvl gfr dep

Parameters:
Returns: PatientData option
years : int<MeasureProduct<year, MeasureOne>> option
months : int<MeasureProduct<month, MeasureOne>> option
weeks : int<MeasureProduct<week, MeasureOne>> option
days : int<MeasureProduct<day, MeasureOne>> option
weight : int option
height : int option
gw : int<MeasureProduct<week, MeasureOne>> option
gd : int<MeasureProduct<day, MeasureOne>> option
gend : Gender
cvl : Access list
gfr : RenalFunction option
dep : string option
Returns: PatientData option

empty

Full Usage: empty

Returns: PatientData

Patient data with every field empty and the patient not marked as an adult.

Returns: PatientData

get

Full Usage: get

Returns: PatientData -> PatientData

getAge p

Full Usage: getAge p

Parameters:
Returns: Age option
p : PatientData
Returns: Age option

getAgeDays p

Full Usage: getAgeDays p

Parameters:
Returns: int<MeasureProduct<day, MeasureOne>> option
p : PatientData
Returns: int<MeasureProduct<day, MeasureOne>> option

getAgeMonths p

Full Usage: getAgeMonths p

Parameters:
Returns: int<MeasureProduct<month, MeasureOne>> option

getAgeWeeks p

Full Usage: getAgeWeeks p

Parameters:
Returns: int<MeasureProduct<week, MeasureOne>> option

getAgeYears p

Full Usage: getAgeYears p

Parameters:
Returns: int<MeasureProduct<year, MeasureOne>> option

getHeight pat

Full Usage: getHeight pat

Parameters:
Returns: int<MeasureProduct<cm, MeasureOne>> option

Returns the measured height, or the estimated height when there is no measured height.

pat : PatientData
Returns: int<MeasureProduct<cm, MeasureOne>> option

getWeight pat

Full Usage: getWeight pat

Parameters:
Returns: int<MeasureProduct<gram, MeasureOne>> option

Returns the measured weight, or the estimated weight when there is no measured weight.

pat : PatientData
Returns: int<MeasureProduct<gram, MeasureOne>> option

isAdult pat

Full Usage: isAdult pat

Parameters:
Returns: bool

Returns true when the patient is 18 years or older by the server mark, or the user marked the patient as an adult.

pat : PatientData
Returns: bool

sameValues a b

Full Usage: sameValues a b

Parameters:
Returns: bool

Returns true when two patient data have the same values. The options are left out, because they are the values the user picks from and not patient data.

a : PatientData
b : PatientData
Returns: bool

selectsRules pat

Full Usage: selectsRules pat

Parameters:
Returns: bool

Returns true when the rules can be selected for the patient: always for an adult, and for a child only with a measured or estimated weight. GenORDER and the server apply the same test.

pat : PatientData
Returns: bool

tryParse s

Full Usage: tryParse s

Parameters:
    s : string

Returns: int option
s : string
Returns: int option

validate pat

Full Usage: validate pat

Parameters:
Returns: Result<PatientData, PatientError>

Returns the patient data when the patient is an adult, has an age, or has a measured weight and a measured height. Otherwise returns NoAgeOrMeasuredWeightAndHeight.

pat : PatientData
Returns: Result<PatientData, PatientError>

Sets the estimated weight and height as P3, median and P97; None clears them. The measured values do not change.

ew : (int<MeasureProduct<gram, MeasureOne>> * int<MeasureProduct<gram, MeasureOne>> * int<MeasureProduct<gram, MeasureOne>>) option
eh : (int<MeasureProduct<cm, MeasureOne>> * int<MeasureProduct<cm, MeasureOne>> * int<MeasureProduct<cm, MeasureOne>>) option
pat : PatientData
Returns: PatientData

Type something to start searching.