source: Scheduling/trunk/cs/bsdx0200GUISourceCode/Patient.cs@ 1111

Last change on this file since 1111 was 1111, checked in by Sam Habiel, 13 years ago

CGAppointment: Added Provider as a Member of Class. (auto property)
CGDocument: No changes
CGDocumentManager: Added UserPreferences as a member of a Class (private and property)
CGView: Changes to support printing of Routing Slip
DAppointPage: Changes to support UserPreferences member for auto printing the routing slips
DCheckIn: Extensive changes in load code (now uses LINQ instead of ADO.net). Changes to support UserPreferences member for auto printing the routing slips.
Patient: Documentation for UserFriendlyAge.
Provider: New class to represent Provider
UserPreferences: New class to represent User preferences. Does not interact with DB right now.

File size: 1.9 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5
6namespace IndianHealthService.ClinicalScheduling
7{
8
9 /// <summary>
10 /// You guessed it.
11 /// </summary>
12 public enum Sex
13 {
14 Male, Female
15 };
16
17 /// <summary>
18 /// Puppet standing for a Real Patient
19 /// </summary>
20 public class Patient
21 {
22 public int DFN { get; set; }
23 public string Name { get; set; }
24 public Sex Sex;
25 public DateTime DOB { get; set; }
26 public string ID { get; set; }
27 public string HRN { get; set; }
28 public List<CGAppointment> Appointments { get; set; }
29 public string Street { get; set; }
30 public string City { get; set; }
31 public string State { get; set; }
32 public string Zip { get; set; }
33 public string Country { get; set; }
34 public string Email { get; set; }
35 public string HomePhone { get; set; }
36 public string WorkPHone { get; set; }
37 public string CellPhone { get; set; }
38 public TimeSpan Age
39 {
40 get
41 {
42 return (DateTime.Today - this.DOB);
43 }
44 }
45
46 /// <summary>
47 /// Returns User Friendly Age. If Age < 5, then Years and Months
48 /// If Age > 5, then only Years.
49 /// Humans tend to round down their ages. So I follow the same rule here.
50 /// </summary>
51 public string UserFriendlyAge
52 {
53 get
54 {
55 if (Age.TotalDays / 365.24 > 5)
56 return Math.Floor((Age.TotalDays / 365.24)).ToString() + " years";
57 else
58 return Math.Floor((Age.TotalDays / 365.24)).ToString() + " years & "
59 + Math.Floor(Age.TotalDays % 365.24 / 30).ToString() + " months";
60 }
61 }
62 }
63}
Note: See TracBrowser for help on using the repository browser.