Logo GenPRES

Dto Module

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.

Types

Type Description

Dto

Functions and values

Function or value Description

dto ()

Full Usage: dto ()

Parameters:
    () : unit

Returns: Dto
() : unit
Returns: Dto

fromDto today resources dto

Full Usage: fromDto today resources dto

Parameters:
Returns: Result<PatientData, ValidationErrors>

Validates a Dto as patient data and calculates the values that follow from it. With the resources, it also sets the estimates and the options. The calculated fields of the Dto are not read. A weight or height dated after today is an error.

today : DateTime
resources : PatientDataResources option
dto : Dto
Returns: Result<PatientData, ValidationErrors>

parseField field tryFromString s

Full Usage: parseField field tryFromString s

Parameters:
    field : string
    tryFromString : string -> 'a option
    s : string

Returns: Result<'a, ValidationErrors>
Type parameters: 'a

Parses a string with a function. Returns an error that names the field and the string when the function returns None.

field : string
tryFromString : string -> 'a option
s : string
Returns: Result<'a, ValidationErrors>

toDto dat

Full Usage: toDto dat

Parameters:
Returns: Dto

The Dto of patient data. MarkedAdult is true only for a patient that may be marked and is marked.

dat : PatientData
Returns: Dto

Type something to start searching.