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

Last change on this file since 1150 was 1112, checked in by Sam Habiel, 14 years ago

CGDocument: Minor Change: Add appointment ID to Appointment
CGDocumentManager: added parameter /culture to set Thread.CurrentThread.CurrentUICulture
CGView: Minor changes in CheckInAppointment: Printing of Routing Slip now always happens.

Routing slip now get parameter for patient order.

Patient: i18n of UserFriendlyAge
Printing: Extensive changes. Support for i18n; new routing slip and appt slip. i18n support only for appt slip.

File size: 1.9 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>
20 public class Patient
21 {
22 public int DFN { get; set; }
23 public string Name { get; set; }
[1110]24 public Sex Sex;
[1107]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; }
[1110]38 public TimeSpan Age
39 {
40 get
41 {
42 return (DateTime.Today - this.DOB);
43 }
44 }
45
[1111]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>
[1110]51 public string UserFriendlyAge
52 {
53 get
54 {
55 if (Age.TotalDays / 365.24 > 5)
[1112]56 return Math.Floor((Age.TotalDays / 365.24)).ToString() + " " + strings.years;
[1110]57 else
[1112]58 return Math.Floor((Age.TotalDays / 365.24)).ToString() + " " + strings.years + " " + strings.and + " "
59 + Math.Floor(Age.TotalDays % 365.24 / 30).ToString() + " " + strings.months;
[1110]60 }
61 }
[1107]62 }
63}
Note: See TracBrowser for help on using the repository browser.