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

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

Absorbed all changed from Radiology Support branch.
Patient and Provider classes now serializable to address new bug: Availablity slots cannot be saved b/c these classes are not serializable.

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