public PrescriptionModel(mp_prescription prescription, mp_pharmacy mp_pharmacy)
        {
            id           = prescription.id;
            profile_id   = prescription.profile_id;
            created_at   = prescription.created_at;
            comment      = prescription.comment;
            clinician_id = prescription.clinician_id;

            if (prescription.pharmacy_id.HasValue)
            {
                pharmacy         = mp_pharmacy.name;
                pharmacy_email   = mp_pharmacy.email;
                pharmacy_address = mp_pharmacy.address;
                pharmacy_phone   = mp_pharmacy.phone;
            }
            clinician = new DoctorModel(prescription.clinician_);
            profile   = new MemberModel(prescription.profile_);
            drugs     = new List <DrugModel>();

            foreach (var drug in prescription.mp_prescription_drug)
            {
                drugs.Add(new DrugModel(drug));
            }
            drug_count = drugs.Count;
        }
Ejemplo n.º 2
0
 public AppointmentModel(mp_appointment appointment)
 {
     id              = appointment.id;
     title           = appointment.appointment_typeNavigation.name;
     doctor          = new DoctorModel(appointment.clinician_);
     appointmentDate = appointment.start_date;
     member          = new MemberModel(appointment.client_);
     service         = appointment.appointment_serviceNavigation.name;
     duration        = appointment.appointment_serviceNavigation.time_minutes;
 }
        public ReferralModel(mp_referral referral)
        {
            id               = referral.id;
            clinician_id     = referral.clinician_id;
            profile_id       = referral.profile_id;
            created_at       = referral.created_at;
            created_by       = referral.created_by;
            profile_match_id = referral.profile_match_id;
            referred_by      = ProfileUtil.get_profile_name(referral.created_by, "role");

            clinician     = new DoctorModel(referral.clinician_);
            profile       = new MemberModel(referral.profile_);
            profile_match = new ProfileMatchModel(referral.profile_match_);
        }
        public ProfileMatchModel(mp_profile_match match)
        {
            profile_id                  = match.profile_id;
            clinician_id                = match.clinician_id;
            appointment_type_id         = match.appointment_type_id;
            appointment_type            = match.appointment_type_.name;
            appointment_activity_id     = match.appointment_activity_id;
            appointment_activity        = match.appointment_activity_.name;
            appointment_activity_sub_id = match.appointment_activity_sub_id;
            appointment_activity_sub    = match.appointment_activity_sub_.name;

            created_at = match.created_at;

            clinician = new DoctorModel(match.clinician_);
            profile   = new MemberModel(match.profile_);
        }