-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #182 from b123400/fix-179
Send any prescription to ZurRose, convert BAG to GLN
- Loading branch information
Showing
27 changed files
with
461 additions
and
91 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// MLSendToZurRoseActivity.h | ||
// AmikoDesitin | ||
// | ||
// Created by b123400 on 2024/12/23. | ||
// Copyright © 2024 Ywesee GmbH. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
#import "EPrescription/ZurRosePrescription.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface MLSendToZurRoseActivity : UIActivity | ||
|
||
@property (nonatomic, strong) ZurRosePrescription *zurRosePrescription; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// | ||
// MLSendToZurRoseActivity.m | ||
// AmikoDesitin | ||
// | ||
// Created by b123400 on 2024/12/23. | ||
// Copyright © 2024 Ywesee GmbH. All rights reserved. | ||
// | ||
|
||
#import "MLSendToZurRoseActivity.h" | ||
|
||
@implementation MLSendToZurRoseActivity | ||
|
||
- (NSString *)activityTitle { | ||
return NSLocalizedString(@"Send to ZurRose", @""); | ||
} | ||
|
||
- (UIImage *)activityImage { | ||
return [UIImage systemImageNamed:@"paperplane"]; | ||
} | ||
|
||
- (BOOL)canPerformWithActivityItems:(NSArray *)activityItems { | ||
return YES; | ||
} | ||
|
||
- (void)prepareWithActivityItems:(NSArray *)activityItems { | ||
|
||
} | ||
|
||
- (void)performActivity { | ||
[self.zurRosePrescription sendToZurRoseWithCompletion:^(NSHTTPURLResponse * _Nonnull res, NSError * _Nonnull error) { | ||
dispatch_async(dispatch_get_main_queue(), ^{ | ||
UIViewController *root = [[UIApplication sharedApplication].keyWindow rootViewController]; | ||
if (error || res.statusCode != 200) { | ||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Error", @"") | ||
message:[error localizedDescription] ?: [NSString stringWithFormat:NSLocalizedString(@"Error Code: %ld", @""), res.statusCode] | ||
preferredStyle:UIAlertControllerStyleAlert]; | ||
[alert addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"") | ||
style:UIAlertActionStyleDefault | ||
handler:nil]]; | ||
[root presentViewController:alert animated:YES completion:nil]; | ||
} else { | ||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil | ||
message:NSLocalizedString(@"Prescription is sent to ZurRose", @"") | ||
preferredStyle:UIAlertControllerStyleAlert]; | ||
[alert addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"") | ||
style:UIAlertActionStyleDefault | ||
handler:nil]]; | ||
[root presentViewController:alert animated:YES completion:nil]; | ||
} | ||
}); | ||
}]; | ||
} | ||
|
||
- (UIActivityCategory)activityCategory { | ||
return UIActivityCategoryShare; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.