File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/main/kotlin/application/presenter/serialization Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -51,4 +51,17 @@ object HealthcareUserSerializer {
5151 saturationPercentage = this .saturationPercentage?.percentage?.value,
5252 bodyTemperature = this .bodyTemperature?.temperature?.let { ValueWithUnit (it.value, it.unit.toString()) },
5353 )
54+
55+ /* *
56+ * Extension method to obtain the vital signs from dto.
57+ */
58+ fun PatientVitalSignsApiDto.toPatientVitalSigns (): PatientVitalSigns = PatientVitalSigns (
59+ heartBeat = this .heartBeat?.let { VitalSign .HeartBeat (it) },
60+ diastolicBloodPressure = this .diastolicBloodPressure?.let { VitalSign .DiastolicBloodPressure (it) },
61+ systolicBloodPressure = this .systolicBloodPressure?.let { VitalSign .SystolicBloodPressure (it) },
62+ respiratoryRate = this .respiratoryRate?.let { VitalSign .RespiratoryRate (it) },
63+ saturationPercentage = this .saturationPercentage?.let { Percentage (it) }
64+ ?.let { VitalSign .SaturationPercentage (it) },
65+ bodyTemperature = this .bodyTemperature?.let { Temperature (it.value) }?.let { VitalSign .BodyTemperature (it) },
66+ )
5467}
You can’t perform that action at this time.
0 commit comments