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 |
|
Creates an age from years, months, weeks and days and reads each part of an age. |
Functions and values
| Function or value |
Description
|
Full Usage:
apply f p
Parameters:
PatientData -> 'a
p : PatientData
Returns: 'a
Type parameters: 'a |
|
Full Usage:
create years months weeks days weight height gw gd gend cvl gfr dep
Parameters:
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
|
|
|
Patient data with every field empty and the patient not marked as an adult.
|
|
|
|
|
Full Usage:
getAgeDays p
Parameters:
PatientData
Returns: int<MeasureProduct<day, MeasureOne>> option
|
|
Full Usage:
getAgeMonths p
Parameters:
PatientData
Returns: int<MeasureProduct<month, MeasureOne>> option
|
|
Full Usage:
getAgeWeeks p
Parameters:
PatientData
Returns: int<MeasureProduct<week, MeasureOne>> option
|
|
Full Usage:
getAgeYears p
Parameters:
PatientData
Returns: int<MeasureProduct<year, MeasureOne>> option
|
|
Full Usage:
getHeight pat
Parameters:
PatientData
Returns: int<MeasureProduct<cm, MeasureOne>> option
|
Returns the measured height, or the estimated height when there is no measured height.
|
Full Usage:
getWeight pat
Parameters:
PatientData
Returns: int<MeasureProduct<gram, MeasureOne>> option
|
Returns the measured weight, or the estimated weight when there is no measured weight.
|
|
Returns true when the patient is 18 years or older by the server mark, or the user marked the patient as an adult.
|
|
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.
|
|
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.
|
Full Usage:
tryParse s
Parameters:
string
Returns: int option
|
|
|
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.
|
Full Usage:
withEstimates ew eh pat
Parameters:
(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
|
Sets the estimated weight and height as P3, median and P97; None clears them. The measured values do not change.
|
GenPRES