Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel.DataAnnotations;
- using System.ComponentModel.DataAnnotations.Schema;
- using System.Linq;
- using System.Web;
- namespace MyMedicalRecord_2.Models
- {
- public class Patient
- {
- [Key]//primary key
- public int PatientID { get; set; }
- public int Height { get; set; }
- public int Age { get; set; }
- public string Name { get; set; }
- //adding primary key IDs so the controller sees the properties
- public int PatientWeightID { get; set; }
- public int PatientJabID { get; set; }
- public int PatientExercisesID { get; set; }
- public int PatientBloodTestID { get; set; }
- public int OperationID { get; set; }
- public int PatientAllergyID { get; set; }
- public int PatientHealthConditionID { get; set; }
- //establishing relationships
- public virtual ICollection<PatientAllergy> PatientAllergies { get; set; }
- public virtual PatientWeight Weight { get; set; }
- public virtual ICollection<PatientOperation> Operation { get; set; }
- public virtual ICollection<PatientHealthCondition> ConditionName { get; set; }
- public virtual ICollection<PatientBloodTest> test { get; set; }
- public virtual ICollection<PatientExercises> exercise { get; set; }
- public virtual ICollection<PatientJab> jab { get; set; }
- }
- }
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.ComponentModel.DataAnnotations;
- using System.ComponentModel.DataAnnotations.Schema;
- namespace MyMedicalRecord_2.Models
- {
- public class PatientAllergy
- {
- [Key]
- public int PatientAllergyID { get; set; }
- [ForeignKey("PatientID")]
- public int PatientID { get; set; }
- public string AllergyType { get; set; }
- public virtual ICollection<Patient> Patient { get; set; }
- }
- }
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.ComponentModel.DataAnnotations;
- using System.ComponentModel.DataAnnotations.Schema;
- namespace MyMedicalRecord_2.Models
- {
- public class PatientBloodTest
- {
- [Key]
- public int PatientBloodTestID { get; set; }
- [ForeignKey("PatientID")]
- public int PatientID { get; set; }
- public string TestType { get; set; }
- public DateTime DateTaken { get; set; }
- public virtual ICollection<Patient> Patient { get; set; }
- }
- }
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.ComponentModel.DataAnnotations;
- using System.ComponentModel.DataAnnotations.Schema;
- namespace MyMedicalRecord_2.Models
- {
- public class PatientExercises
- {
- [Key]
- public int PatientExercisesID { get; set; }
- [ForeignKey("PatientID")]
- public int PatientID { get; set; }
- public int Swimming { get; set; }
- public int Walking { get; set; }
- public int Gym { get; set; }
- public string Month { get; set; }
- public virtual ICollection<Patient> Patient { get; set; }
- }
- }
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.ComponentModel.DataAnnotations;
- using System.ComponentModel.DataAnnotations.Schema;
- namespace MyMedicalRecord_2.Models
- {
- public class PatientHealthCondition
- {
- [Key]
- public int PatientHealthConditionID { get; set; }
- [ForeignKey("PatientID")]
- public int PatientID { get; set; }
- public string Name { get; set; }
- public virtual ICollection<Patient> Patient { get; set; }
- }
- }
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.ComponentModel.DataAnnotations;
- using System.ComponentModel.DataAnnotations.Schema;
- namespace MyMedicalRecord_2.Models
- {
- public class PatientJab
- {
- [Key]
- public int PatientJabID { get; set; }
- [ForeignKey("PatientID")]
- public int PatientID { get; set; }
- public string Type { get; set; }
- public DateTime DateDone { get; set; }
- public virtual ICollection<Patient> Patient { get; set; }
- }
- }
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.ComponentModel.DataAnnotations;
- using System.ComponentModel.DataAnnotations.Schema;
- namespace MyMedicalRecord_2.Models
- {
- public class PatientOperation
- {
- [Key]
- public int OperationID { get; set; }
- [ForeignKey("PatientID")]
- public int PatientID { get; set; }
- public string Name { get; set; }
- public virtual ICollection<Patient> Patient { get; set; }
- }
- }
- using System;
- using System.Collections.Generic;
- using System.ComponentModel.DataAnnotations;
- using System.ComponentModel.DataAnnotations.Schema;
- using System.Linq;
- using System.Text;
- namespace MyMedicalRecord_2.Models
- {
- public class PatientWeight
- {
- [Key]
- public int PatientWeightID { get; set; }
- [ForeignKey("PatientID")]
- public int PatientID { get; set; }
- public DateTime DateChecked { get; set; }
- public double Weight { get; set; }
- public virtual Patient patient { get; set; }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement