Created
November 20, 2016 19:34
-
-
Save Fahrni/ed5c386bec659985b439306ac67cabd3 to your computer and use it in GitHub Desktop.
Objective-C++ bridge to C++ Creatinine Clearance calculation
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
#import "PKMCreatinineClearance.h" | |
#import "PKMConvert.h" | |
#import "CreatinineClearance.h" | |
@interface PKMCreatinineClearance () | |
@property (nonatomic, assign) PKMath::CreatinineClearance* ccInstance; | |
@end | |
@implementation PKMCreatinineClearance | |
- (nullable instancetype)initWith:(double)age | |
height:(double)height | |
weight:(double)weight | |
scr:(double)scr | |
gender:(PKMGender)gender | |
{ | |
if (self = [super init]) { | |
Gender pkGender = [PKMConvert genderFromPKMGender:gender]; | |
_ccInstance = new PKMath::CreatinineClearance(age, height, weight, scr, pkGender); | |
} | |
return self; | |
} | |
- (void)dealloc | |
{ | |
delete _ccInstance; | |
} | |
- (double)calculate | |
{ | |
return self.ccInstance->Calculate(); | |
} | |
- (BOOL)clampedClcr | |
{ | |
return self.ccInstance->ClampedClcr(); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment