Skip to content

Commit 33ff33e

Browse files
giacomoaccursiandrea-acampora
authored andcommitted
chore: add method to get the healthcareUser from the dto
1 parent a5cecdc commit 33ff33e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/main/kotlin/application/presenter/serialization/HealthcareUserSerializer.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ import application.presenter.api.report.healthcareuser.PatientVitalSignsApiDto
1313
import application.presenter.api.report.measurements.ValueWithUnit
1414
import entity.surgeryreport.healthcareuser.HealthcareUser
1515
import entity.surgeryreport.healthcareuser.PatientVitalSigns
16+
import entity.surgeryreport.healthcareuser.TaxCode
17+
import entity.surgeryreport.healthcareuser.VitalSign
18+
import entity.surgeryreport.measurements.Percentage
19+
import entity.surgeryreport.measurements.Temperature
1620

1721
/**
1822
* Serializers for data to return to API.
@@ -27,6 +31,15 @@ object HealthcareUserSerializer {
2731
surname = this.surname,
2832
)
2933

34+
/**
35+
* Extension method to obtain the api dto of a healthcare user.
36+
*/
37+
fun HealthcareUserApiDto.toHealthcareUser(): HealthcareUser = HealthcareUser(
38+
taxCode = TaxCode(this.taxCode),
39+
name = this.name,
40+
surname = this.surname,
41+
)
42+
3043
/**
3144
* Extension method to obtain the api dto of patient vital signs.
3245
*/

0 commit comments

Comments
 (0)