void Destroy()
 {
     if (StorageHandle != 0)
     {
         DiagnosisService.CloseGlobalStorage(StorageHandle);
     }
 }
        public void ConfigureServices(IServiceCollection services)
        {
            // Examinations
            IExaminationRepository        examinationRepository        = new ExaminationSqlRepository(GetContextFactory());
            IShiftRepository              shiftRepository              = new ShiftSqlRepository(GetContextFactory());
            IExaminationSchedulingService examinationSchedulingService =
                new ExaminationSchedulingService(examinationRepository, shiftRepository);

            DoctorAvailabilityService availabilityService = new DoctorAvailabilityService(shiftRepository, examinationRepository);
            ExaminationService        examinationService  = new ExaminationService(examinationRepository, shiftRepository);

            IConnection             patientConnection       = CreateConnection(UserUrl, "user/patient");
            IConnection             doctorConnection        = CreateConnection(UserUrl, "user/doctor");
            IConnection             roomConnection          = CreateConnection(HospitalUrl, "hospital/room");
            ExaminationServiceProxy examinationServiceProxy =
                new ExaminationServiceProxy(
                    examinationService,
                    roomConnection, doctorConnection, patientConnection);

            // Recommendations
            IRecommendationService recommendationService =
                new RecommendationService(examinationRepository, shiftRepository, doctorConnection);

            // Diagnoses
            IDiagnosisRepository diagnosisRepository = new DiagnosisSqlRepository(GetContextFactory());
            IDiagnosisService    diagnosisService    = new DiagnosisService(diagnosisRepository);

            services.Add(new ServiceDescriptor(typeof(IDiagnosisService), diagnosisService));
            services.Add(new ServiceDescriptor(typeof(ExaminationServiceProxy), examinationServiceProxy));
            services.Add(new ServiceDescriptor(typeof(RecommendationService), recommendationService));
            services.Add(new ServiceDescriptor(typeof(DoctorAvailabilityService), availabilityService));
            services.Add(new ServiceDescriptor(typeof(IExaminationSchedulingService), examinationSchedulingService));

            services.AddControllers().AddNewtonsoftJson(x => x.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore);
        }
 public DoctorController(DoctorService doctorService, DiagnosisService diagnosisService, TherapyService therapyService, MedicalRecordService medicalRecordService)
 {
     _doctorService        = doctorService;
     _diagnosisService     = diagnosisService;
     _therapyService       = therapyService;
     _medicalRecordService = medicalRecordService;
 }
示例#4
0
        public ActionResult Delete(int id)
        {
            DiagnosisService service = new DiagnosisService();
            var model = service.GetDiagnosisById(id);

            return(View(model));
        }
        public IHttpActionResult Patch([FromODataUri] string key, Delta <DiagnosisEntity> patch)
        {
            DiagnosisService service = new DiagnosisService();
            object           id;

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            else if (patch.GetChangedPropertyNames().Contains("ID") && patch.TryGetPropertyValue("ID", out id) && (string)id != key)
            {
                return(BadRequest("The key from the url must match the key of the entity in the body"));
            }

            try
            {
                var query = service.GetEntity(key);
                patch.Patch(query);
                service.UpdateEntity(query);
                return(Updated(query));
            }
            catch (Exception)
            {
                return(NotFound());
            }
        }
示例#6
0
        public ActionResult DeleteDiagnosis(int id)
        {
            DiagnosisService service = new DiagnosisService();

            service.RemoveDiagnosis(id);
            return(RedirectToAction("Index"));
        }
 public PatientController(PatientService patientService, MedicalRecordService medicalRecordService, TherapyService therapyService, DiagnosisService diagnosisService)
 {
     _patientService       = patientService;
     _medicalRecordService = medicalRecordService;
     _therapyService       = therapyService;
     _diagnosisService     = diagnosisService;
 }
 public EditPatientView(CombinedPatientViewModel originalModel,
                        CombinedPatientViewModel patientModel,
                        PatientService patientService,
                        PersonService personService,
                        WardService wardService,
                        BedService bedService,
                        VisitService visitService,
                        TreatmentService treatmentService,
                        ProcedureService procedureService,
                        PhysicianService physicianService,
                        DiagnosisService diagnosisService,
                        ConditionService conditionService,
                        VitalRecordService vitalRecordService,
                        EmployeeService nurseService,
                        OrderServiceLayer orderServiceLayer,
                        OrderServiceService orderServiceService,
                        PatientOrderService patientOrderService,
                        OrderItemService orderItemService)
 {
     InitializeComponent();
     InfoTab.Content = new PatientInfoView(originalModel, patientModel, patientService, personService, wardService,
                                           bedService, visitService);
     TreatmentTab.Content = new TreatmentView(treatmentService, originalModel.PatientModel.PersonId, procedureService, physicianService);
     DiagnosisTab.Content = new DiagnosisView(diagnosisService, originalModel.PatientModel.PersonId,
                                              conditionService, physicianService);
     VitalRecordTab.Content =
         new VitalRecordView(vitalRecordService, originalModel.PatientModel.PersonId, nurseService);
     OrderTab.Content = new OrderView(orderServiceLayer, originalModel.PatientModel.PersonId, orderServiceService,
                                      physicianService);
     PatientOrderTab.Content = new PatientOrderView(patientOrderService, originalModel.PatientModel.PersonId, orderItemService);
 }
        public ActionResult GetBydia_patient(string dia_patient)
        {
            DiagnosisService pa = new DiagnosisService();
            var dia             = pa.GetBydia_patient(dia_patient);

            return(Json(dia));
        }
        public ActionResult Add(string doc_ID, string dia_patient, string visit_ID, string med_ID, int med_Num, string result)
        {
            DiagnosisService diagserve = new DiagnosisService();

            diagserve.AddNew1(doc_ID, dia_patient, visit_ID, med_ID, med_Num, result);
            return(Json("true"));
        }
 public AddPatientView(PatientListViewModel patientListViewModel,
                       PatientService patientService,
                       DiagnosisService diagnosisService,
                       PersonService personService,
                       EmployeeService employeeService,
                       WardService wardService,
                       BedService bedService,
                       PhysicianService physicianService,
                       VitalRecordService vitalRecordService,
                       ConditionService conditionService)
 {
     _toAddPatient = new AddPatientViewModel(patientListViewModel,
                                             patientService,
                                             personService,
                                             diagnosisService,
                                             physicianService,
                                             employeeService,
                                             wardService,
                                             bedService,
                                             vitalRecordService,
                                             conditionService);
     DataContext = _toAddPatient;
     InitializeComponent();
     InsuranceCheckBox.IsChecked = true;
 }
示例#12
0
        public override bool QueryActiveEntry(UIntPtr sourceHandle,
                                              int index,
                                              ref QueryBuffer entryBuffer)
        {
            unsafe {
                UInt32  offset;
                UIntPtr type;

                fixed(byte *ptr = &(entryBuffer.GetBuffer()[0]))
                {
                    bool success = DiagnosisService.ReadActiveSourceItem(sourceHandle,
                                                                         index,
                                                                         &type,
                                                                         ptr,
                                                                         entryBuffer.GetBufferSize());


                    entryBuffer.Type = type;

                    // the active entries do not have any header

                    entryBuffer.UserOffset = 0;

                    return(success);
                }
            }
        }
        public DiagnosisView(DiagnosisService diagnosisService, string patientId, ConditionService conditionService, PhysicianService physicianService)
        {
            InitializeComponent();
            _diagnosisService = diagnosisService;
            var diagnosisListViewModel = new DiagnosisListViewModel(_diagnosisService, patientId);

            DataContext = diagnosisListViewModel;
        }
        // GET: diagnosis
        public ActionResult Index()
        {
            DiagnosisService diaService = new DiagnosisService();
            //var pat =  patService.GetByID("001");
            var dia = diaService.GetAll();

            //return View(dia);
            return(Json(dia));
        }
示例#15
0
        public ActionResult Create(DiagnosisCreate model)
        {
            DiagnosisService service = new DiagnosisService();

            if (!ModelState.IsValid)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            service.CreateDiagnosis(model);
            return(RedirectToAction("Index"));
        }
示例#16
0
        public ActionResult Index(string search)
        {
            var service = new DiagnosisService();
            var model   = service.GetAllDiagnoses();

            if (!String.IsNullOrEmpty(search))
            {
                model = model.Where(s => s.Name.Contains(search));
            }
            return(View(model));
        }
示例#17
0
        public override bool GetSourceInformation(UIntPtr sourceHandle,
                                                  ref UIntPtr storageHandle,
                                                  ref UIntPtr eventType,
                                                  ref UInt16 count,
                                                  ref string bufferName)
        {
            UIntPtr      tmpStorageHandle;
            UIntPtr      tmpType;
            UInt16       tmpCount;
            const UInt16 MaxBufferSize = 256;
            bool         success       = false;

            char[] tmpBufferName = new char[MaxBufferSize];

            if (tmpBufferName != null)
            {
                unsafe
                {
                    fixed(char *ptrBytes = &tmpBufferName[0])
                    {
                        success = DiagnosisService.GetSourceInformation(sourceHandle,
                                                                        &tmpStorageHandle,
                                                                        &tmpType,
                                                                        &tmpCount,
                                                                        ptrBytes,
                                                                        MaxBufferSize);

                        if (success)
                        {
                            string fieldName = "";

                            if (fieldName != null)
                            {
                                for (int i = 0; i < MaxBufferSize; i++)
                                {
                                    if (tmpBufferName[i] == 0)
                                    {
                                        break;
                                    }

                                    fieldName += tmpBufferName[i];
                                }
                            }
                            eventType     = tmpType;
                            count         = tmpCount;
                            storageHandle = tmpStorageHandle;
                            bufferName    = fieldName;
                        }
                    }
                }
            }

            return(success);
        }
示例#18
0
        public override int QueryEventTypeList(UIntPtr [] buffer, int size)
        {
            int totalItems = 0;

            unsafe
            {
                fixed(UIntPtr *ptr = buffer)
                {
                    totalItems = DiagnosisService.QueryEventTypeList(ptr, size);
                }
            }
            return(totalItems);
        }
        /// <summary>
        /// 删除数据
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public IHttpActionResult Delete([FromODataUri] string key)
        {
            DiagnosisService service = new DiagnosisService();

            try
            {
                service.PhysicalDelRecord(key);
                return(Ok(true));
            }
            catch (Exception)
            {
                return(Ok(false));
            }
        }
示例#20
0
        public ActionResult Edit(int id)
        {
            DiagnosisService service = new DiagnosisService();
            var detail = service.GetDiagnosisById(id);
            var model  = new DiagnosisDetail
            {
                DiagnosisId = detail.DiagnosisId,
                Name        = detail.Name,
                Description = detail.Description,
                Symptoms    = detail.Symptoms,
                Treatments  = detail.Treatments
            };

            return(View(model));
        }
示例#21
0
 public override bool RegisterController()
 {
     unsafe
     {
         fixed(UIntPtr *ctr = &ControllerHandle, ctx = &ContextHandle)
         {
             if (LocalController.GetControllerHandle(ctr, ctx))
             {
                 return(DiagnosisService.RegisterEventingController(ControllerHandle,
                                                                    ContextHandle));
             }
         }
     }
     return(false);
 }
示例#22
0
        //
        //  Enum support for applications
        //

        public override bool RegisterEnum(string enumName,
                                          UInt16 type,
                                          ref UIntPtr eventHandle)
        {
            unsafe
            {
                fixed(UIntPtr *ptr = &eventHandle)
                {
                    fixed(char *name = enumName)
                    {
                        return(DiagnosisService.RegisterEnum(name, type, ptr));
                    }
                }
            }
        }
示例#23
0
 public override bool RegisterEnumValue(UIntPtr eventHandle,
                                        string valueName,
                                        UInt64 value,
                                        byte flagChar)
 {
     unsafe
     {
         fixed(char *name = valueName)
         {
             return(DiagnosisService.RegisterEnumValue(eventHandle,
                                                       name,
                                                       value,
                                                       flagChar));
         }
     }
 }
示例#24
0
 public override bool RegisterEventField(UIntPtr eventHandle,
                                         string fieldName,
                                         UInt16 offset,
                                         UInt16 type)
 {
     unsafe
     {
         fixed(char *name = fieldName)
         {
             return(DiagnosisService.RegisterEventField(eventHandle,
                                                        name,
                                                        offset,
                                                        type));
         }
     }
 }
示例#25
0
        private HospitalManager()
        {
            logger.Debug("Начинается инициализация управляющего блока.");

            if (SerializationService is null)
            {
                SerializationService = new JsonSerializationService();
            }
            EmployeeService  = new EmployeeService(new EmployeeRepository(SerializationService));
            DiagnosisService = new DiagnosisService(new DiagnosisRepository(SerializationService));
            TreatmentService = new TreatmentService(new TreatmentRepository(SerializationService));
            DiseaseService   = new DiseaseService(new DiseaseRepository(SerializationService));
            PatientService   = new PatientService(new PatientRepository(SerializationService));
            VisitService     = new VisitService(new VisitRepository(SerializationService));
            logger.Debug("Инициализация управляющего блока выполнена.");
        }
示例#26
0
        public override UIntPtr WalkEventDescriptor(UIntPtr eventHandle,
                                                    UIntPtr currentField,
                                                    ref UInt16 offset,
                                                    ref UInt16 type,
                                                    ref string bufferName)
        {
            UInt16       tmpOffset;
            UInt16       tmpType;
            const UInt16 MaxBufferSize = 256;

            char[] tmpBufferName = new char[MaxBufferSize];

            unsafe
            {
                fixed(char *ptrBytes = &tmpBufferName[0])
                {
                    currentField = DiagnosisService.WalkEventDescriptor(eventHandle,
                                                                        currentField,
                                                                        &tmpOffset,
                                                                        &tmpType,
                                                                        ptrBytes,
                                                                        MaxBufferSize);

                    if (currentField != 0)
                    {
                        string fieldName = "";

                        if (fieldName != null)
                        {
                            for (int i = 0; i < MaxBufferSize; i++)
                            {
                                if (tmpBufferName[i] == 0)
                                {
                                    break;
                                }

                                fieldName += tmpBufferName[i];
                            }
                        }
                        type       = tmpType;
                        offset     = tmpOffset;
                        bufferName = fieldName;
                    }
                }
            }
            return(currentField);
        }
        public void AddDiagnosisTest()
        {
            var serv = new DiagnosisService(new MVCHContext());

            serv.AddDiagnosis(new Diagnosis
            {
                Description = "Severe case",
                DateTime    = DateTime.Now,
                ConditionId = "001.0",
                PatientId   = "PER-000021",
                PhysicianId = "PER-000020"
            });
            serv.AddDiagnosis(new Diagnosis
            {
                Description = "Mild fever",
                DateTime    = DateTime.Now,
                ConditionId = "002.0",
                PatientId   = "PER-000022",
                PhysicianId = "PER-000019"
            });
            serv.AddDiagnosis(new Diagnosis
            {
                Description = "Masakit ang tiyan",
                DateTime    = DateTime.Now,
                ConditionId = "003.0",
                PatientId   = "PER-000023",
                PhysicianId = "PER-000018"
            });
            serv.AddDiagnosis(new Diagnosis
            {
                Description = "Moderate case",
                DateTime    = DateTime.Now,
                ConditionId = "001.1",
                PatientId   = "PER-000024",
                PhysicianId = "PER-000017"
            });
            serv.AddDiagnosis(new Diagnosis
            {
                Description = "Severe case",
                DateTime    = DateTime.Now,
                ConditionId = "001.9",
                PatientId   = "PER-000025",
                PhysicianId = "PER-000016"
            });
        }
示例#28
0
 public override bool RegisterEvent(string eventName,
                                    string eventDescription,
                                    ref UIntPtr eventHandle)
 {
     unsafe
     {
         fixed(UIntPtr *ptr = &eventHandle)
         {
             fixed(char *name = eventName)
             {
                 fixed(char *desc = eventDescription)
                 {
                     return(DiagnosisService.RegisterEvent(name, desc, ptr));
                 }
             }
         }
     }
 }
示例#29
0
        public AddPatientViewModel(PatientListViewModel patientListViewModel,
                                   PatientService patientService,
                                   PersonService personService,
                                   DiagnosisService diagnosisService,
                                   PhysicianService physicianService,
                                   EmployeeService employeeService,
                                   WardService wardService,
                                   BedService bedService,
                                   VitalRecordService vitalRecordService,
                                   ConditionService conditionService)
        {
            _patientListViewModel = patientListViewModel;
            _patientService       = patientService;
            _personService        = personService;
            _diagnosisService     = diagnosisService;
            _physicianService     = physicianService;
            _employeeService      = employeeService;
            _wardService          = wardService;
            _bedService           = bedService;
            _vitalRecordService   = vitalRecordService;
            _conditionService     = conditionService;

            ContactPersons = new ObservableCollection <Person>(_personService.GetPersons()
                                                               .Where(c => c.Discriminator == "Person"));

            SubscriberPersons = new ObservableCollection <Person>(_personService.GetPersons()
                                                                  .Where(c => c.Discriminator == "Person"));

            Nurses = new ObservableCollection <Nurse>(_employeeService.GetNurses());

            Physicians = new ObservableCollection <Physician>(_physicianService.GetPhysicians());

            Wards = new ObservableCollection <Ward>(_wardService.GetWards()
                                                    .Include(c => c.FacilityLink));

            Beds = new ObservableCollection <Bed>(_bedService.GetBeds()
                                                  .Include(c => c.WorkUnitLink));

            Conditions                   = new ObservableCollection <Condition>(_conditionService.GetConditions());
            PatientModel.BirthDate       = DateTime.Now;
            PatientModel.DateOfContact   = DateTime.Now;
            InpatientModel.DateAdmitted  = DateTime.Now;
            InpatientModel.DischargeDate = DateTime.Now;
        }
        public IHttpActionResult RecordPagination(Pagination pagination)
        {
            DiagnosisService service = new DiagnosisService();

            try
            {
                var query         = service.RecordPagination(pagination);
                var packageEntity = query.PackageEntityPaginations(pagination);
                return(Json(packageEntity));
            }
            catch (Exception)
            {
                PackageResultEntity <object> packageResultEntity = new PackageResultEntity <object>()
                {
                    list = null,
                    msg  = "failed"
                };
                return(Json(packageResultEntity));
            }
        }