Beispiel #1
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.
        }
        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();
        }
Beispiel #3
0
        public async Task <IHttpActionResult> GetPatients([FromUri] string patientId)
        {
            try
            {
                if (patientId != null)
                {
                    return(Json(await _manager.GetPatient(patientId)));
                }
                PatientPage patientPage = await _manager.GetPatients(new FindPatientModel { PatientId = patientId });

                return(patientPage.Patients.Count() > 0 ? Json(patientPage) : (IHttpActionResult)BadRequest("no patients found!"));
            }
            catch (Exception ex) { return(InternalServerError(ex)); }
        }
Beispiel #4
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();
        }