Beispiel #1
0
        public List <Patient> getPatients()
        {
            UltrasoundProtocolsDataSetTableAdapters.Tbl_PatientsTableAdapter adapter =
                new UltrasoundProtocolsDataSetTableAdapters.Tbl_PatientsTableAdapter();
            List <Patient> patients = (from table in adapter.GetData() select table)
                                      .Select(x => new Patient(x.pat_id, x.pat_fullname, x.pat_gender, x.pat_birthdate, x.pat_numberambulatorycard))
                                      .ToList();

            return(patients);
        }
Beispiel #2
0
        public List <FullProtocol> getFullFilledProtocols()
        {
            UltrasoundProtocolsDataSetTableAdapters.Tbl_ProtocolsTableAdapter adapterProtocols =
                new UltrasoundProtocolsDataSetTableAdapters.Tbl_ProtocolsTableAdapter();
            UltrasoundProtocolsDataSetTableAdapters.Tbl_DoctorsTableAdapter adapterDoctors =
                new UltrasoundProtocolsDataSetTableAdapters.Tbl_DoctorsTableAdapter();
            UltrasoundProtocolsDataSetTableAdapters.Tbl_PatientsTableAdapter adapterPatients =
                new UltrasoundProtocolsDataSetTableAdapters.Tbl_PatientsTableAdapter();
            UltrasoundProtocolsDataSetTableAdapters.Tbl_MedicalEquipmentsTableAdapter adapterEquipments =
                new UltrasoundProtocolsDataSetTableAdapters.Tbl_MedicalEquipmentsTableAdapter();
            var fullFilledProtocols = (from protocols in adapterProtocols.GetData()
                                       join doctors in adapterDoctors.GetData() on protocols.prt_doctor equals doctors.dct_id
                                       join patients in adapterPatients.GetData() on protocols.prt_patient equals patients.pat_id
                                       join equipments in adapterEquipments.GetData() on protocols.prt_equipment equals equipments.meq_id
                                       select new { Id = protocols.prt_id, DateTime = protocols.prt_datetime, Doctor = doctors.dct_fullname,
                                                    Patient = patients.pat_fullname, Equipment = equipments.meq_name, Source = protocols.prt_source })
                                      .Select(x => new FullProtocol(x.Id, x.DateTime, x.Doctor, x.Patient, x.Equipment, x.Source))
                                      .ToList();

            return(fullFilledProtocols);
        }