1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 |
|
---|
6 | namespace 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() + " " + strings.years;
|
---|
57 | else
|
---|
58 | return Math.Floor((Age.TotalDays / 365.24)).ToString() + " " + strings.years + " " + strings.and + " "
|
---|
59 | + Math.Floor(Age.TotalDays % 365.24 / 30).ToString() + " " + strings.months;
|
---|
60 | }
|
---|
61 | }
|
---|
62 | }
|
---|
63 | }
|
---|