Exemplo n.º 1
0
        public override void Load()
        {
            DatabaseQuery query = new DatabaseQuery(Database.Tables.TEST_RESULTS);

            query.Add(Database.Tables.TestResults.PatientId);
            query.Add(Database.Tables.TestResults.MedicalLicenseNo);
            query.Add(Database.Tables.TestResults.Name);
            query.Add(Database.Tables.TestResults.Description);
            query.Add(Database.Tables.TestResults.Result);
            query.Add(Database.Tables.TestResults.Remark);

            MySqlDataReader reader = DoLoad(query);

            if (Loaded)
            {
                Patient          = PatientsManager.GetPatient(reader.GetInt32(0));
                MedicalLicenseNo = reader.GetString(1);
                Name             = reader.GetString(2);
                Description      = reader.GetString(3);
                Result           = reader.GetString(4);
                Remark           = reader.GetString(5);
                PatientsManager.Add(this);
            }

            reader.Close();
        }
Exemplo n.º 2
0
        public override void Load()
        {
            DatabaseQuery query = new DatabaseQuery(Database.Tables.PRESCRIPTIONS);

            query.Add(Database.Tables.Prescriptions.PrescriberId);
            query.Add(Database.Tables.Prescriptions.PatientId);
            query.Add(Database.Tables.Prescriptions.Name);
            query.Add(Database.Tables.Prescriptions.Remark);
            query.Add(Database.Tables.Prescriptions.StartDate);
            query.Add(Database.Tables.Prescriptions.EndDate);

            MySqlDataReader reader = DoLoad(query);

            if (Loaded)
            {
                Prescriber = StaffsManager.GetMedicalStaff(reader.GetInt32(0));
                Patient    = PatientsManager.GetPatient(reader.GetInt32(1));
                Name       = reader.GetString(2);
                Remark     = reader.GetString(3);
                StartDate  = reader.GetDateTime(4);
                EndDate    = reader.GetDateTime(5);
                PatientsManager.Add(this);
            }

            reader.Close();
            // TODO: Implement fetching prescription's medications.
        }
Exemplo n.º 3
0
        public override void Save()
        {
            DatabaseQuery query = new DatabaseQuery(Database.Tables.PATIENTS);

            query.Add(Database.Tables.Patients.DetailsId, Details);
            DoSave(query);
            PatientsManager.Add(this);
        }
        public override void Save()
        {
            DatabaseQuery query = new DatabaseQuery(Database.Tables.PRESCRIPTION_MEDICATIONS);

            query.Add(Database.Tables.PrescriptionMedications.PrescriptionId, Prescription);
            query.Add(Database.Tables.PrescriptionMedications.MedicationId, Base);
            DoSave(query);
            PatientsManager.Add(this);
        }
Exemplo n.º 5
0
        public override void Save()
        {
            DatabaseQuery query = new DatabaseQuery(Database.Tables.MEDICATIONS);

            query.Add(Database.Tables.Medications.Code, Code);
            query.Add(Database.Tables.Medications.Name, Name);
            DoSave(query);
            PatientsManager.Add(this);
        }
Exemplo n.º 6
0
        public override void Save()
        {
            DatabaseQuery query = new DatabaseQuery(Database.Tables.APPOINTMENTS);

            query.Add(Database.Tables.Appointments.MedicalStaffId, MedicalStaff);
            query.Add(Database.Tables.Appointments.PatientId, Patient);
            query.Add(Database.Tables.Appointments.Cancelled, Cancelled ? 1 : 0);
            query.Add(Database.Tables.Appointments.DateAppointed, DateAppointed);
            DoSave(query);
            PatientsManager.Add(this);
        }
Exemplo n.º 7
0
        public override void Save()
        {
            DatabaseQuery query = new DatabaseQuery(Database.Tables.PRESCRIPTIONS);

            query.Add(Database.Tables.Prescriptions.PrescriberId, Prescriber);
            query.Add(Database.Tables.Prescriptions.PatientId, Patient);
            query.Add(Database.Tables.Prescriptions.Name, Name);
            query.Add(Database.Tables.Prescriptions.Remark, Remark);
            query.Add(Database.Tables.Prescriptions.StartDate, QueryElement.DateOf(StartDate));
            query.Add(Database.Tables.Prescriptions.EndDate, QueryElement.DateOf(EndDate));
            DoSave(query);
            PatientsManager.Add(this);
        }
Exemplo n.º 8
0
        public override void Save()
        {
            DatabaseQuery query = new DatabaseQuery(Database.Tables.TEST_RESULTS);

            query.Add(Database.Tables.TestResults.PatientId, Patient);
            query.Add(Database.Tables.TestResults.MedicalLicenseNo, MedicalLicenseNo);
            query.Add(Database.Tables.TestResults.Name, Name);
            query.Add(Database.Tables.TestResults.Description, Description);
            query.Add(Database.Tables.TestResults.Result, Result);
            query.Add(Database.Tables.TestResults.Remark, Remark);
            DoSave(query);
            PatientsManager.Add(this);
        }
Exemplo n.º 9
0
        public override void Load()
        {
            DatabaseQuery query = new DatabaseQuery(Database.Tables.PATIENTS);

            query.Add(Database.Tables.Patients.DetailsId);

            MySqlDataReader reader = DoLoad(query);

            if (Loaded)
            {
                int detailsId = reader.GetInt32(0);
                Details = DetailsManager.GetPersonalDetail(detailsId);
                PatientsManager.Add(this);
            }

            reader.Close();
        }
Exemplo n.º 10
0
        public override void Load()
        {
            DatabaseQuery query = new DatabaseQuery(Database.Tables.MEDICATIONS);

            query.Add(Database.Tables.Medications.Code);
            query.Add(Database.Tables.Medications.Name);

            MySqlDataReader reader = DoLoad(query);

            if (Loaded)
            {
                Code = reader.GetString(0);
                Name = reader.GetString(1);
                PatientsManager.Add(this);
            }

            reader.Close();
        }
        public override void Load()
        {
            DatabaseQuery query = new DatabaseQuery(Database.Tables.PRESCRIPTION_MEDICATIONS);

            query.Add(Database.Tables.PrescriptionMedications.PrescriptionId);
            query.Add(Database.Tables.PrescriptionMedications.MedicationId);

            MySqlDataReader reader = DoLoad(query);

            if (Loaded)
            {
                Prescription = PatientsManager.GetPrescription(reader.GetInt32(0));
                Base         = PatientsManager.GetMedication(reader.GetInt32(1));
                Code         = Base.Code;
                Name         = Base.Name;
                PatientsManager.Add(this);
            }

            reader.Close();
        }
Exemplo n.º 12
0
        public override void Load()
        {
            DatabaseQuery query = new DatabaseQuery(Database.Tables.APPOINTMENTS);

            query.Add(Database.Tables.Appointments.MedicalStaffId);
            query.Add(Database.Tables.Appointments.PatientId);
            query.Add(Database.Tables.Appointments.Cancelled);
            query.Add(Database.Tables.Appointments.DateAppointed);

            MySqlDataReader reader = DoLoad(query);

            if (Loaded)
            {
                MedicalStaff  = StaffsManager.GetMedicalStaff(reader.GetInt32(0));
                Patient       = PatientsManager.GetPatient(reader.GetInt32(1));
                Cancelled     = reader.GetByte(2) > 0 ? true : false;
                DateAppointed = reader.GetDateTime(3);
                PatientsManager.Add(this);
            }

            reader.Close();
        }