public void Edit(PatientFile entity)
 {
     if (AuthorizedUsers["Edit"].SingleOrDefault(x => x == Role) != null)
     {
         PatientFileController.Edit(entity);
     }
 }
예제 #2
0
    private void OnPatientChange(PatientFile obj)
    {
        if (_spawnObject == null)
        {
            throw new ArgumentNullException("SpawnObject");
        }
        if (obj.Prefab == null)
        {
            throw new ArgumentNullException("Patient Prefab");
        }

        // TODO: Spawn particle so it doesn't just "plop" in

        GameObject _patient = Instantiate(obj.Prefab);
        Patient    _data    = _patient.GetComponent <Patient>();

        if (_data == null)
        {
            throw new ArgumentNullException("Patient Data");
        }

        _data.PatientFile            = obj;
        _data.PatientFile.GameObject = _patient;

        _spawnObject.PlacePatient(_data);
    }
예제 #3
0
 public Hospitalization AddHospitalization(Hospitalization hospitalization, PatientFile patientFile)
 {
     hospitalization = _hospitalizationService.Save(hospitalization);
     patientFile.Hospitalization.Add(hospitalization);
     Edit(patientFile);
     return(hospitalization);
 }
예제 #4
0
 public Operation AddOperation(Operation operation, PatientFile patientFile)
 {
     operation = _operationService.Save(operation);
     patientFile.Operation.Add(operation);
     Edit(patientFile);
     return(operation);
 }
 public void Delete(PatientFile entity)
 {
     if (AuthorizedUsers["Delete"].SingleOrDefault(x => x == Role) != null)
     {
         PatientFileController.Delete(entity);
     }
 }
예제 #6
0
 private void OnPatientDone(PatientFile obj)
 {
     if (PatientSystem.Instance.GetNextPatient() == null)
     {
         transform.GetChild(0).gameObject.SetActive(true);
     }
 }
예제 #7
0
    private PatientFile[] DeletePatient(LevelObject _levelObject, PatientFile patientFile)
    {
        List <PatientFile> patientFiles = _levelObject.PatientFiles.ToList();

        patientFiles.Remove(patientFile);

        return(patientFiles.ToArray());
    }
예제 #8
0
    private PatientFile[] AddPatientToLevel(LevelObject _levelObject, PatientFile patientFile)
    {
        List <PatientFile> patientFiles = _levelObject.PatientFiles.ToList();

        patientFiles.Add(patientFile);

        return(patientFiles.ToArray());
    }
예제 #9
0
 private void OnPatientDone(PatientFile obj)
 {
     if (TutorialSystem.Instance.ActiveTutorial.TutorialID == "first-program" &&
         _activeSection.Name == "heal-patient")
     {
         // Correct. Move to next section.
         _tutorialUI.NextSection();
     }
 }
 public Allergy AddAllergy(Allergy allergy, PatientFile patientFile)
 {
     if (AuthorizedUsers["AddAllergy"].SingleOrDefault(x => x == Role) != null)
     {
         return(PatientFileController.AddAllergy(allergy, patientFile));
     }
     else
     {
         return(null);
     }
 }
예제 #11
0
 public List <Therapy> GenerateTherapyTimetableReport(PatientFile patientFile)
 {
     if (AuthorizedUsers["GenerateTherapyTimetableReport"].SingleOrDefault(x => x == Role) != null)
     {
         return(ReportController.GenerateTherapyTimetableReport(patientFile));
     }
     else
     {
         return(null);
     }
 }
예제 #12
0
        public void GetPatientFiles_WithInvalidFiles_ShouldReturnEmptyPatientFileCollection()
        {
            var options = new DbContextOptionsBuilder <DentHubContext>()
                          .UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString()) // Give a Unique name to the DB
                          .Options;
            var dbContext = new DentHubContext(options);

            var patient = new DentHubUser
            {
                Id        = "1",
                IsActive  = true,
                FirstName = "Patient 1",
                LastName  = "Test",
            };

            var patient2 = new DentHubUser
            {
                Id        = "2",
                IsActive  = true,
                FirstName = "Patient 2",
                LastName  = "Test2"
            };

            var file1 = new PatientFile
            {
                Id        = 1,
                PatientId = "1"
            };

            var file2 = new PatientFile
            {
                Id        = 2,
                PatientId = "1"
            };

            var file3 = new PatientFile
            {
                Id        = 3,
                PatientId = "2"
            };

            dbContext.DentHubUsers.Add(patient);
            dbContext.DentHubUsers.Add(patient2);
            dbContext.PatientFiles.Add(file1);
            dbContext.PatientFiles.Add(file2);
            dbContext.PatientFiles.Add(file3);
            dbContext.SaveChanges();

            var patuientFilesRepository = new DbRepository <PatientFile>(dbContext);
            var service = new PatientFileService(patuientFilesRepository);
            var result  = service.GetPatientFiles("3");

            Assert.Empty(result);
        }
예제 #13
0
        public Patient GetEager(long id)
        {
            Patient     patient     = Get(id);
            PatientFile patientfile = _patientFleRepository.GetEager(patient.patientFile.GetId());

            patient.patientFile        = patientfile;
            patient.Address            = _addressRepository.GetEager(patient.Address.GetId());
            patient.Address.Town       = _townRepository.GetEager(patient.Address.Town.GetId());
            patient.Address.Town.State = _stateRepository.GetEager(patient.Address.Town.State.GetId());
            return(patient);
        }
예제 #14
0
    private void OnPatientDone(PatientFile obj)
    {
        if (LevelSystem.Instance.ActiveLevel.NextLevel != string.Empty)
        {
            LevelObject _level = LevelSystem.Instance.GetLevel(LevelSystem.Instance.ActiveLevel.NextLevel);
            LevelSystem.Instance.ChangeLevel(_level);
        }

        // TODO: Open level success menu!
        LevelSystem.Instance.ChangeToMainMenu(true);
    }
 public Operation AddOperation(Operation operations, PatientFile patientFile)
 {
     if (AuthorizedUsers["AddOperation"].SingleOrDefault(x => x == Role) != null)
     {
         return(PatientFileController.AddOperation(operations, patientFile));
     }
     else
     {
         return(null);
     }
 }
 public Hospitalization AddHospitalization(Hospitalization hospitalization, PatientFile patientFile)
 {
     if (AuthorizedUsers["AddHospitalization"].SingleOrDefault(x => x == Role) != null)
     {
         return(PatientFileController.AddHospitalization(hospitalization, patientFile));
     }
     else
     {
         return(null);
     }
 }
 public Examination AddExamination(Examination examination, PatientFile patientFile)
 {
     if (AuthorizedUsers["AddExamination"].SingleOrDefault(x => x == Role) != null)
     {
         return(PatientFileController.AddExamination(examination, patientFile));
     }
     else
     {
         return(null);
     }
 }
 public void PostDeleteMethod(int id)
 {
     using (var Filerepo = new UploadRepository())
     {
         if (id != 0)
         {
             PatientFile _file = Filerepo.GetById(id);
             Filerepo.Delete(_file);
         }
     }
 }
 public PatientFile Save(PatientFile entity)
 {
     if (AuthorizedUsers["Save"].SingleOrDefault(x => x == Role) != null)
     {
         return(PatientFileController.Save(entity));
     }
     else
     {
         return(null);
     }
 }
 public bool DeleteAllergy(Allergy allergy, PatientFile patientFile)
 {
     if (AuthorizedUsers["DeleteAllergy"].SingleOrDefault(x => x == Role) != null)
     {
         return(PatientFileController.DeleteAllergy(allergy, patientFile));
     }
     else
     {
         return(false);
     }
 }
예제 #21
0
 private void ParseOptions(PatientFile _target)
 {
     _popupOptions.Clear();
     _popupOptions.Add("-- SELECT ITEM --");
     foreach (Objective objective in _objectives)
     {
         if (!_target.Objectives.Contains(objective) && objective.Active)
         {
             _popupOptions.Add(objective.InternalName);
         }
     }
 }
예제 #22
0
        public List <Therapy> GenerateTherapyTimetableReport(PatientFile patientFile)
        {
            List <Therapy> ret = new List <Therapy>();

            foreach (Examination examination in patientFile.Examination)
            {
                if (validateDates(examination.Therapy))
                {
                    ret.Add(examination.Therapy);
                }
            }
            return(ret);
        }
예제 #23
0
        /// <summary>
        /// Deserializes the specified XML.
        /// </summary>
        /// <param name="xml">The XML.</param>
        /// <returns>An instance of <see cref="PatientFile"/> represented by the passed in <paramref name="xml"/>.</returns>
        public PatientFile Deserialize(string xml)
        {
            PatientFile patientFile = null;

            try
            {
                patientFile = xml.Deserialize <PatientFile>();
            }
            catch (Exception ex)
            {
                ConsoleD.WriteError("Error occured deserializing patient file data.", ex);
            }

            return(patientFile);
        }
예제 #24
0
    private void AddToObjectives(PatientFile _target, string _objectiveName)
    {
        Objective objective = _objectives.Find(o => o.InternalName == _objectiveName);

        if (objective == null)
        {
            Debug.LogError("Tried to add invalid objective to patient file");
        }
        else
        {
            List <Objective> _targetObjectives = _target.Objectives.ToList();
            _targetObjectives.Add(objective);
            _target.Objectives = _targetObjectives.ToArray();
        }
    }
예제 #25
0
 public Patient(long id, String name, String surname, String jmbg, String email, String phone, DateTime birth, Address address, String username, String password, Uri img, PatientFile patientFile, Boolean guest)
 {
     this.Id          = id;
     this.FirstName   = name;
     this.LastName    = surname;
     this.Jmbg        = jmbg;
     this.Email       = email;
     this.Phone       = phone;
     this.DateOfBirth = birth;
     this.Address     = address;
     this.Username    = username;
     this.Password    = password;
     this.Image       = img;
     this.patientFile = patientFile;
     this.Guest       = guest;
 }
예제 #26
0
 public bool DeleteAllergy(PatientFile patientFile, Allergy allergy)
 {
     if (patientFile.Allergy == null)
     {
         return(false);
     }
     foreach (var help in patientFile.Allergy)
     {
         if (help.Name.Equals(allergy.Name))
         {
             patientFile.Allergy.Remove(help);
             return(true);
         }
     }
     return(false);
 }
예제 #27
0
    private void UpdateUI(PatientFile obj)
    {
        StringBuilder _data = new StringBuilder();

        _data.Append($"Naam: {obj.PatientName}\n");
        _data.Append($"Leeftijd: {obj.Age}\n");

        _dataObject.SetText(_data);

        DeleteCurrentObjectives();

        foreach (Objective _objective in obj.Objectives)
        {
            AddObjective(_objective);
        }
    }
예제 #28
0
        public async Task CreateFileAsync(string name, FileType fileType, string patientId,
                                          string fileUri, string description, string createdById, DateTime dateCreated)
        {
            var patientFile = new PatientFile
            {
                CreatedById = createdById,
                DateCreated = dateCreated,
                Description = description,
                FileType    = fileType,
                Name        = name,
                PatientId   = patientId,
                FileUrl     = fileUri,
            };

            await this.AddAsync(patientFile);

            await this.SaveChangesAsync();;
        }
예제 #29
0
        public async Task CreateFileAsync_WithValidPrerequisites_ShouldCreateFile()
        {
            var options = new DbContextOptionsBuilder <DentHubContext>()
                          .UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString()) // Give a Unique name to the DB
                          .Options;
            var dbContext = new DentHubContext(options);

            var patientFile = new PatientFile
            {
                CreatedById = "1",
                DateCreated = new DateTime(2019, 1, 1, 10, 30, 0),
                Description = "description",
                FileType    = FileType.Assesment,
                Name        = "Name",
                PatientId   = "1",
                FileUrl     = "examplefile.com/pic/1564",
            };

            var createdById = "1";
            var dateCreated = new DateTime(2019, 1, 1, 10, 30, 0);
            var description = "description";
            var fileType    = FileType.Assesment;
            var name        = "Name";
            var patientId   = "1";
            var fileUrl     = "examplefile.com/pic/1564";

            dbContext.PatientFiles.Add(patientFile);
            dbContext.SaveChanges();

            var patientFileRepository = new DbRepository <PatientFile>(dbContext);
            var service = new PatientFileService(patientFileRepository);
            await service.CreateFileAsync(name,
                                          fileType, patientId, fileUrl,
                                          description, createdById, dateCreated);

            var result = dbContext.PatientFiles
                         .FirstOrDefaultAsync(f => f.FileUrl == fileUrl)
                         .GetAwaiter()
                         .GetResult();

            Assert.Equal(patientFile, result);
        }
        public void InsertMethod(FileUploadDBModel model, int PatientId)
        {
            PatientFile       fileUpload = new PatientFile();
            PatientRepository pr         = new PatientRepository();

            //add loop for multiple file upload at same time
            using (var Filerepo = new UploadRepository())
            {
                var name = pr.GetAll().Find(x => x.PatientId == PatientId);
                foreach (var item in model.File)
                {
                    byte[] uploadfile = new byte[item.InputStream.Length];
                    item.InputStream.Read(uploadfile, 0, uploadfile.Length);

                    fileUpload.FileName    = item.FileName;
                    fileUpload.File        = uploadfile;
                    fileUpload.PatientId   = PatientId;
                    fileUpload.patientName = name.FullName + " " + name.Surname;
                    Filerepo.Insert(fileUpload);
                }
            }
        }
예제 #31
0
        public ActionResult Management(Models.Drmanagments Tempmanage)
        {
            if (Session["UserEmail"].ToString().Contains("@dentappsys.com"))
            {
                if (Tempmanage.appmodel != null)
                {
                    using (var db = new MaindbModelDataContext())
                    {
                        var app = db.Appointments.FirstOrDefault(u => u.AppNo == Tempmanage.appmodel.AppNo);
                        if (app != null)
                        {
                            app.Status = Tempmanage.appmodel.Status;
                            app.DrDescription = Tempmanage.appmodel.DrDescription;
                            db.SubmitChanges();

                            ViewBag.ChangeResultApp = "Done !";
                            return View();
                        }
                        else
                        {
                            ViewBag.ChangeResultApp = "Check your appointment number then try again !";
                            return View();
                        }
                    }
                }
                else
                {
                    if (Tempmanage.resultdoc != null)
                    {
                        using (var db = new MaindbModelDataContext())
                        {
                            var app = db.PatientFiles.FirstOrDefault(u => u.AppNo == Tempmanage.resultdoc.AppID && u.PatientNo == Tempmanage.resultdoc.PatientID);
                            if (app == null)
                            {
                                var tempapp = new PatientFile();
                                tempapp.AppNo = Tempmanage.resultdoc.AppID;
                                tempapp.PatientNo = Tempmanage.resultdoc.PatientID;
                                tempapp.Prescription = Tempmanage.resultdoc.Prescription;
                                tempapp.Status = Tempmanage.resultdoc.Status;
                                tempapp.TreatmentDetails = Tempmanage.resultdoc.TreatmentDis;
                                db.PatientFiles.InsertOnSubmit(tempapp);
                                db.SubmitChanges();

                                ViewBag.ChangeResultDoc = "Done !";
                                return View();
                            }
                            else
                            {
                                ViewBag.ChangeResultDoc = "Check your appointment number or patient number then try again !";
                                return View();
                            }

                        }

                    }
                    else
                    {
                        return View();
                    }

                }
            }
            else
            {
                return RedirectToAction("RegAndLogin", "User");
            }
        }