From 64c3a14331276c88a0de2af75442cb4a461d2a26 Mon Sep 17 00:00:00 2001 From: b123400 Date: Tue, 7 Jan 2025 21:55:34 +0900 Subject: [PATCH 1/4] Fix issue with wrong birthday format --- AmiKoDesitin/EPrescription/EPrescription.m | 4 ++-- AmiKoDesitin/Prescription.m | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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/Prescription.m b/AmiKoDesitin/Prescription.m index cfc1794..9310c4d 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 From 5bb461c5330acb92b292da56935b9010776b5f6a Mon Sep 17 00:00:00 2001 From: b123400 Date: Tue, 7 Jan 2025 21:55:43 +0900 Subject: [PATCH 2/4] Fix issue with missing EAN --- AmiKoDesitin/EPrescription/ZurRosePrescriptorAddress.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; From e75839e5a89bd5f6809ef0be1c68baeebb19c95a Mon Sep 17 00:00:00 2001 From: b123400 Date: Tue, 7 Jan 2025 22:11:34 +0900 Subject: [PATCH 3/4] Add comment to posology --- AmiKoDesitin/EPrescription/ZurRosePosology.m | 9 +++++++++ AmiKoDesitin/Prescription.m | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) 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/Prescription.m b/AmiKoDesitin/Prescription.m index 9310c4d..9a1f955 100644 --- a/AmiKoDesitin/Prescription.m +++ b/AmiKoDesitin/Prescription.m @@ -252,7 +252,11 @@ - (ZurRosePrescription *)toZurRosePrescription { product.insuranceBillingType = 1; product.insuranceEanId = self.patient.insuranceGLN; product.repetition = NO; - product.posology = @[]; + + ZurRosePosology *pos = [[ZurRosePosology alloc] init]; + pos.posologyText = m.comment; + pos.label = 1; + product.posology = @[pos]; } prescription.products = products; From 5770f423491c0dd82738af35f6bc4dfb877d894c Mon Sep 17 00:00:00 2001 From: b123400 Date: Tue, 7 Jan 2025 22:32:41 +0900 Subject: [PATCH 4/4] Put package info in product description --- AmiKoDesitin/Prescription.m | 1 + 1 file changed, 1 insertion(+) diff --git a/AmiKoDesitin/Prescription.m b/AmiKoDesitin/Prescription.m index 9a1f955..18d8776 100644 --- a/AmiKoDesitin/Prescription.m +++ b/AmiKoDesitin/Prescription.m @@ -252,6 +252,7 @@ - (ZurRosePrescription *)toZurRosePrescription { product.insuranceBillingType = 1; product.insuranceEanId = self.patient.insuranceGLN; product.repetition = NO; + product.description_ = m.packageInfo; ZurRosePosology *pos = [[ZurRosePosology alloc] init]; pos.posologyText = m.comment;