-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPatientModel+CoreDataClass.m
56 lines (51 loc) · 1.53 KB
/
PatientModel+CoreDataClass.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//
// PatientModel+CoreDataClass.m
// AmikoDesitin
//
// Created by b123400 on 2020/03/19.
// Copyright © 2020 Ywesee GmbH. All rights reserved.
//
//
#import "PatientModel+CoreDataClass.h"
@implementation PatientModel
- (void)importFromPatient:(Patient *)p timestamp:(NSDate *)timestamp {
self.uniqueId = p.uniqueId;
self.timestamp = timestamp;
self.familyName = p.familyName;
self.givenName = p.givenName;
self.birthDate = p.birthDate;
self.gender = p.gender;
self.weightKg = p.weightKg;
self.heightCm = p.heightCm;
self.zipCode = p.zipCode;
self.city = p.city;
self.country = p.country;
self.postalAddress = p.postalAddress;
self.phoneNumber = p.phoneNumber;
self.emailAddress = p.emailAddress;
self.healthCardNumber = p.healthCardNumber;
self.insuranceGLN = p.insuranceGLN;
self.ahvNumber = p.ahvNumber;
}
- (Patient *)toPatient {
Patient *p = [[Patient alloc] init];
p.uniqueId = self.uniqueId;
p.familyName = self.familyName;
p.givenName = self.givenName;
p.birthDate = self.birthDate;
p.gender = self.gender;
p.weightKg = self.weightKg;
p.heightCm = self.heightCm;
p.zipCode = self.zipCode;
p.city = self.city;
p.country = self.country;
p.postalAddress = self.postalAddress;
p.phoneNumber = self.phoneNumber;
p.emailAddress = self.emailAddress;
p.timestamp = self.timestamp;
p.healthCardNumber = self.healthCardNumber;
p.insuranceGLN = self.insuranceGLN;
p.ahvNumber = self.ahvNumber;
return p;
}
@end