Guest User

Untitled

a guest
Jul 17th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //*********************
  2. // *****Patient.h*****
  3. //*********************
  4. #import <UIKit/UIKit.h>
  5. #import <Foundation/Foundation.h>
  6. @interface Patient : NSObject
  7.  
  8. @property (nonatomic, strong) NSString* fname;
  9. @property (nonatomic, strong) NSString* mname;
  10. @property (nonatomic, strong) NSString* lname;
  11. @property (nonatomic, strong) NSString* age;
  12. @property (nonatomic, strong) NSString* weight;
  13. @property (nonatomic, strong) NSString* height;
  14.  
  15. @property (nonatomic, strong) NSMutableArray* conditions;
  16. @property (nonatomic, strong) NSMutableArray* history;
  17. /*
  18. -initWithFullName :(NSString*)first middleName:(NSString*) middle lastName:(NSString*) last;
  19. -initWithFirstLast:(NSString*)first   lastName:(NSString*) last;
  20. -initWithFirst    :(NSString*)first;
  21. -initWithLast     :(NSString*)last;
  22. -init;
  23. */
  24.  
  25. -(NSString*)print;
  26. @end
  27.  
  28. //*********************
  29. // *****Patient.m*****
  30. //*********************
  31. #import "Patient.h"
  32.  
  33. @implementation Patient
  34.  
  35. @synthesize fname;
  36. @synthesize mname;
  37. @synthesize lname;
  38. @synthesize age;
  39. @synthesize weight;
  40. @synthesize height;
  41. @synthesize conditions;
  42. @synthesize history;
  43. /*
  44. -(Patient*)initWithFullName:(NSString *)first middleName:(NSString*)middle lastName:(NSString *)last
  45. {
  46. //    self = [super initWithFullName:first middleName:middle lastName:last];
  47.     [self setFname     :first ];
  48.     [self setMname     :middle];
  49.     [self setLname     :last  ];
  50.     [self setAge       :nil   ];
  51.     [self setWeight    :nil   ];
  52.     [self setHeight    :nil   ];
  53.     [self setConditions:nil   ];
  54.     [self setHistory   :nil   ];
  55.    
  56.     return self;
  57. }
  58.  
  59. -(Patient*)initWithFirstLast:(NSString *)first lastName:(NSString *)last
  60. {
  61.     [super initWithFirstLast:first lastName:last];
  62.     [self setFname     :first];
  63.     [self setMname     :nil  ];
  64.     [self setLname     :last ];
  65.     [self setAge       :nil  ];
  66.     [self setWeight    :nil  ];
  67.     [self setHeight    :nil  ];
  68.     [self setConditions:nil  ];
  69.     [self setHistory   :nil  ];
  70.    
  71.     return self;
  72. }
  73.  
  74. -(Patient*)initWithFirst:(NSString *)first
  75. {
  76.     [super initWithFirst:first];
  77.     [self setFname     :first];
  78.     [self setMname     :nil  ];
  79.     [self setLname     :nil  ];
  80.     [self setAge       :nil  ];
  81.     [self setWeight    :nil  ];
  82.     [self setHeight    :nil  ];
  83.     [self setConditions:nil  ];
  84.     [self setHistory   :nil  ];
  85.     return self;
  86. }
  87. -(Patient*)initWithLast:(NSString *)last
  88. {
  89.     [super initWithLast:last];
  90.     [self setFname     :nil ];
  91.     [self setMname     :nil ];
  92.     [self setLname     :last];
  93.     [self setAge       :nil ];
  94.     [self setWeight    :nil ];
  95.     [self setHeight    :nil ];
  96.     [self setConditions:nil ];
  97.     [self setHistory   :nil ];
  98.    
  99.     return self;
  100. }
  101. -(Patient*)init
  102. {
  103.     [super init];
  104.     [self setFname     :nil];
  105.     [self setMname     :nil];
  106.     [self setLname     :nil];
  107.     [self setAge       :nil];
  108.     [self setWeight    :nil];
  109.     [self setHeight    :nil];
  110.     [self setConditions:nil];
  111.     [self setHistory   :nil];
  112.    
  113.     return self;
  114. }
  115. -(NSString*)print{
  116.     return [NSString stringWithFormat:@"Name: %@ %@ %@ /n Age: %@ /n Weight: %@ /n Height: %@"], [self fname], [self mname], [self lname], [self age], [self weight], [self height];
  117. }
  118. */
  119. @end
Add Comment
Please, Sign In to add comment