diff --git a/AmiKoDesitin/EPrescription/EPrescription.m b/AmiKoDesitin/EPrescription/EPrescription.m index 5534381..d2e9cda 100644 --- a/AmiKoDesitin/EPrescription/EPrescription.m +++ b/AmiKoDesitin/EPrescription/EPrescription.m @@ -294,7 +294,7 @@ - (NSString *)generatePatientUniqueID if (self.patientBirthdate) { NSDateComponents *components = [[NSCalendar currentCalendar] components:NSCalendarUnitDay | NSCalendarUnitMonth | NSCalendarUnitYear fromDate:self.patientBirthdate]; - birthDateString = [NSString stringWithFormat:@"%d.%d.%d", components.day, components.month, components.year]; + birthDateString = [NSString stringWithFormat:@"%ld.%ld.%ld", (long)components.day, (long)components.month, (long)components.year]; } // The UUID should be unique and should be based on familyname, givenname, and birthday @@ -305,7 +305,7 @@ - (NSString *)generatePatientUniqueID - (NSDictionary *)amkDict { NSDateFormatter *birthDateDateFormatter = [[NSDateFormatter alloc] init]; - birthDateDateFormatter.dateFormat = @"yyyy.MM.dd"; + birthDateDateFormatter.dateFormat = @"dd.MM.yyyy"; NSDateFormatter *placeDateFormatter = [[NSDateFormatter alloc] init]; placeDateFormatter.dateFormat = @"dd.MM.yyyy (HH:mm:ss)"; diff --git a/AmiKoDesitin/EPrescription/ZurRosePosology.m b/AmiKoDesitin/EPrescription/ZurRosePosology.m index ae6d74e..8ab8836 100644 --- a/AmiKoDesitin/EPrescription/ZurRosePosology.m +++ b/AmiKoDesitin/EPrescription/ZurRosePosology.m @@ -10,6 +10,15 @@ @implementation ZurRosePosology +- (instancetype)init { + self = [super init]; + self.qtyMorning = -1; + self.qtyMidday = -1; + self.qtyEvening = -1; + self.qtyNight = -1; + return self; +} + - (DDXMLElement *)toXML { DDXMLElement *e = [DDXMLElement elementWithName:@"posology"]; diff --git a/AmiKoDesitin/EPrescription/ZurRosePrescriptorAddress.m b/AmiKoDesitin/EPrescription/ZurRosePrescriptorAddress.m index 6244346..35616b4 100644 --- a/AmiKoDesitin/EPrescription/ZurRosePrescriptorAddress.m +++ b/AmiKoDesitin/EPrescription/ZurRosePrescriptorAddress.m @@ -17,7 +17,7 @@ - (DDXMLElement *)toXML { [e addAttribute:[DDXMLNode attributeWithName:@"langCode" stringValue:[@(self.langCode) stringValue]]]; [e addAttribute:[DDXMLNode attributeWithName:@"clientNrClustertec" stringValue:self.clientNrClustertec]]; [e addAttribute:[DDXMLNode attributeWithName:@"zsrId" stringValue:self.zsrId]]; - if (!self.eanId) { + if (self.eanId) { [e addAttribute:[DDXMLNode attributeWithName:@"eanId" stringValue:self.eanId]]; } return e; diff --git a/AmiKoDesitin/Prescription.m b/AmiKoDesitin/Prescription.m index cfc1794..18d8776 100644 --- a/AmiKoDesitin/Prescription.m +++ b/AmiKoDesitin/Prescription.m @@ -232,7 +232,7 @@ - (ZurRosePrescription *)toZurRosePrescription { patient.zipCode = self.patient.zipCode; { NSDateFormatter *birthDateDateFormatter = [[NSDateFormatter alloc] init]; - birthDateDateFormatter.dateFormat = @"yyyy.MM.dd"; + birthDateDateFormatter.dateFormat = @"dd.MM.yyyy"; patient.birthday = [birthDateDateFormatter dateFromString:self.patient.birthDate]; } patient.sex = [self.patient.gender isEqual:KEY_AMK_PAT_GENDER_M] ? 1 : 2; // same, 1 = m, 2 = f @@ -252,7 +252,12 @@ - (ZurRosePrescription *)toZurRosePrescription { product.insuranceBillingType = 1; product.insuranceEanId = self.patient.insuranceGLN; product.repetition = NO; - product.posology = @[]; + product.description_ = m.packageInfo; + + ZurRosePosology *pos = [[ZurRosePosology alloc] init]; + pos.posologyText = m.comment; + pos.label = 1; + product.posology = @[pos]; } prescription.products = products;