Example #1
0
 public OrderEntryForm2(SetupTableData setupTableData, GetSqlServer getSqlServer, Hospital hospital)
     : base(setupTableData, getSqlServer, hospital)
 {
     Load += orderentry_Load;
     InitializeComponent();
     groupTestToIndividualTest = new GroupTestToIndividualTest(getSqlServer);
 }
Example #2
0
 static void Main()
 {
     Console.Write("Version 3, Obertyshev Anatoliy IS-4120");
     Console.Write("\n");
     Hospital hospital = new Hospital();
     Console.ReadKey();
 }
Example #3
0
 public void UpdateHospital(Hospital hospital)
 {
     Db.Hospitals.SqlQuery(@"UPDATE Hospital SET Name=@name, Description=@desc,
     Town=@town, Addesse=@adress WHERE Id=@id", hospital.Name, hospital.Description
                           , hospital.Town, hospital.Address, hospital.Id);
     Db.SaveChanges();
 }
 public void a_Criar_hospital()
 {
     var hospitais = new Hospitais();
     var quintador = new Hospital { Nome = "Hospital Quinta DOR" };
     var barraDor = new Hospital { Nome = "Hospital Barra DOR" };
     hospitais.Salvar(quintador);
     hospitais.Salvar(barraDor);
 }
Example #5
0
	/**
	 * Construct an empty village.
	 *
	 * @param level the
	 * @param lab   the unique label for the village
	 * @param p     a reference to the "parent" village
	 * @param s     the user supplied seed value
	 */
	public Village(int level, int l, bool isRootV, int s)
	{
		rootVillage = isRootV;
		label = l;
		forward = new Village[4];
		seed = label * (IQ + s);
		hospital = new Hospital(level);
		returned = new List<Patient>();
	}
Example #6
0
        public static bool StartPlasticSurgeryCAS(Sim sim, Hospital.SurgeryTypes type)
        {
            CASChangeReporter.Instance.ClearChanges();

            SimDescription simDescription = sim.SimDescription;
            if (simDescription == null)
            {
                throw new Exception("EditSimInCAS:  sim doesn't have a description!");
            }

            switch (sim.CurrentOutfitCategory)
            {
                case OutfitCategories.Everyday:
                case OutfitCategories.Formalwear:
                case OutfitCategories.Sleepwear:
                case OutfitCategories.Swimwear:
                case OutfitCategories.Athletic:
                    break;
                default:
                    SimpleMessageDialog.Show(Cheats.LocalizeString("EditSimInCAS", new object[0x0]), Cheats.LocalizeString("CommonOutfitCategoryRequired", new object[0x0]), ModalDialog.PauseMode.PauseSimulator);
                    return false;
            }

            switch (type)
            {
                case Hospital.SurgeryTypes.PlasticSurgeryFaceCheap:
                case Hospital.SurgeryTypes.PlasticSurgeryFaceExpensive:
                    new Sims.Advanced.SurgeryFace().Perform(new GameHitParameters<GameObject>(sim, sim, GameObjectHit.NoHit));
                    break;

                case Hospital.SurgeryTypes.PlasticSurgeryBodyCheap:
                case Hospital.SurgeryTypes.PlasticSurgeryBodyExpensive:
                    new Sims.Advanced.SurgeryBody().Perform(new GameHitParameters<GameObject>(sim, sim, GameObjectHit.NoHit));
                    break;

                default:
                    throw new Exception("PlasticSurgery: Option not defined!");
            }

            while (GameStates.NextInWorldStateId != InWorldState.SubState.LiveMode)
            {
                SpeedTrap.Sleep();
            }

            bool flag = !CASChangeReporter.Instance.CasCancelled;
            CASChangeReporter.Instance.ClearChanges();
            return flag;
        }
Example #7
0
        private void OK_Click(System.Object sender, System.EventArgs e)
        {
            //valid = AD.Authenticate(Me.UsernameTextBox.Text, Me.PasswordTextBox.Text)

            if (valid && !string.IsNullOrEmpty(this.comboBoxHospital.Text))
            {
                userName = UsernameTextBox.Text;
                hospital = (this.comboBoxHospital.Text == "Highland") ? Hospital.Highland : Hospital.Strong;
                this.Close();
            }
            else
            {
               var response = Interaction.MsgBox("invalid username, password, or hospital", MsgBoxStyle.OkOnly, "MsgBox");
                if (response == MsgBoxResult.Ok)
                    UsernameTextBox.Focus();
            }
        }
Example #8
0
        public SetupTableData(GetSqlServer getSqlServer, Hospital hospital)
        {
            wards = getSqlServer.FilledColumn("select Clinic_code from [CLINIC]");

              DISpecimenTranslation = getSqlServer.FilledDictionary("SELECT [type], [translation] FROM [downtime].[dbo].[diTranslation]").ToReadOnly();

            #if DEBUG
              var dr = new GetPathDirectory().Labels.GetLabelersListOfIPs_byGroup(string.Format("/{0}/Specimen Management", Enum.GetName(typeof(Hospital), hospital)));
              if (hospital == Hospital.Highland)
              {
              dr.Add("C42", "172.16.60.252");
              }
               LabelersByIp = dr.ToReadOnly();
            #else
               LabelersByIp = new GetPathDirectory().Labels.GetLabelersListOfIPs_byGroup(string.Format("/{0}/Specimen Management", Enum.GetName(typeof(Hospital), hospital))).ToReadOnly();
            #endif
        }
Example #9
0
        public MainMenu(Hospital hospital)
            : base()
        {
            InitializeComponent();
            this.hospital = hospital;
            var setupTableData = new SetupTableData(getSqlServer, hospital);

            //setup buttons handlers
            new FormStart(ButtonOrderEntry, () => new OrderEntryForm2(setupTableData, getSqlServer, hospital));
            new FormStart(ButtonSmsArchiveTracking, () => new TrackSmsForm(getSqlServer));
            new FormStart(ButtonAliquotReprint, () => new AliquotForm(setupTableData,getSqlServer,hospital));
               //     new FormStart(ButtonPlaceAddon, () => new AddOnForm(setupTableData, getSqlServer, hospital));
            new FormStart(ButtonHemArchiveTracking, () => new TrackHemForm(getSqlServer));
            new FormStart(ButtonUrineHemTracking, () => new TrackUrineHemForm(getSqlServer));
            new FormStart(ButtonUrineChemTracking, () => new TrackUrineChemForm(getSqlServer));
            new FormStart(ButtonCoagArchiveTracking, () => new TrackCoagForm(getSqlServer));
            new FormStart(ButtonDowntimeRecovery, () => new RecoveryForm(getSqlServer));
            new FormStart(ButtonMolisEntry, () => new MolisEntry(getSqlServer));

            queries.Add("STAT Query", attributeQuery("WHERE o.priority = 'S'"));

            interactions.Add("Last Name Query", () => Interaction.InputBox("LastName", "EnterLastName"));
            queries.Add("Last Name Query", attributeQuery("WHERE o.LASTNAME='{0}'"));

            interactions.Add("Tracking Query", () => Interaction.InputBox("ordernumber", "enterordernumber"));
            queries.Add("Tracking Query", "SELECT [dttracking].ordernumber, dttracking.TRACKING, dttracking.TRACKINGCOMMENT, dttracking.tracklocation, dttracking.TIMESTAMP, dttracking.tracktechid FROM (dttracking) where dttracking.ordernumber = '{0}';");
            queries.Add("Tracking Query*", "SELECT * FROM dttracking where tracklocation = 'OT->STOR';");

            interactions.Add("Med Req Query", () => Interaction.InputBox("Med Req Number (Must Enter All 12 Digits - ############)", "EnterMedReqNumber"));
            queries.Add("Med Req Query", attributeQuery("WHERE o.mrn = '{0}'"));

            queries.Add("Coag Query", extensionQuery("23"));

            queries.Add("Chemistry Query",extensionQuery("00","79","40","19"));

            queries.Add("Bloodgas Query", extensionQuery("20"));

            queries.Add("Hematology Query", extensionQuery("18"));

            queries.Add("Urinalisys Query", extensionQuery("UA", "38", "26"));
        }
Example #10
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Hospital hp = new Hospital();
            hp.nombre = txtNom_hos.Text = "Pablo Tobón Uribe";
            hp.direccion = txtDir_hos.Text ="calle 43 A 43-09";
            hp.secciones = txtSec.Text = "5";
            hp.medicos = txtN_med.Text = "30";
            hp.enfermeras = txtN_enf.Text = "17";

            Especialidad ep = new Especialidad();
            ep.especiali1 = txtEspe1.Text ="Neurologia";
            ep.eespeciali2 = txtEspe2.Text="Cirujano";
            ep.especiali3 = txtEspe3.Text="Ortopedista";
            ep.especiali4 = txtEspe4.Text="Cardiologia";
            ep.especiali5 = txtEspe5.Text="Oncologia";

            Habitacion hb = new Habitacion();
            hb.hospital = txtHos_hab.Text = txtNom_hos.Text;
            hb.ciudad = txtCiu_hos.Text = "Medellín";
            hb.piso = txtPiso.Text = "3";
            hb.numero = txtNum_pis.Text = "301 - A";
            hb.tipo = txtTipo.Text = "Cuidados intensivos";

            Farmacia fm = new Farmacia();
            fm.nombre = txtNom_far.Text = "Farmacia Tobón Uribe";
            fm.ciudad = txtCiu_far.Text = txtCiu_hos.Text;
            fm.direccion = txtDir_far.Text = txtDir_hos.Text;
            fm.medicamento = txtMedicamento.Text = "Aspirinas 100 Mg";
            fm.precio = txtPrecio.Text = "500";

            Paciente pa = new Paciente();
            pa.nombre = txtNom_pac.Text = "Alberto";
            pa.apellido = txtAp_pac.Text = "Martinez Hernandez";
            pa.documento = txtNum_pac.Text = "30945298";
            pa.edad = txtEd_pac.Text = "27";
            pa.ciudad = txtCiu_pac.Text = txtCiu_hos.Text;
        }
Example #11
0
        public OrderBaseForm(SetupTableData setupTableData, GetSqlServer getSqlServer, Hospital hospital)
            : base()
        {
            InitializeComponent();
            this.setupTableData = setupTableData;
            this.getSqlServer = getSqlServer;
            this.hospital = hospital;
            #if DEBUG
            this.DebugButtonFill.Visible = true;
            #endif
            this.TextBoxTechId.Text = GlobalMutableState.userName;

            ComboboxPrinter.Items.AddRange(setupTableData.LabelersByIp.Keys.ToArray());
            comboBoxWard.Items.AddRange(setupTableData.wards);

            ComboboxPrinter.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            ComboboxPrinter.AutoCompleteSource = AutoCompleteSource.ListItems;
            comboBoxWard.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            comboBoxWard.AutoCompleteSource = AutoCompleteSource.ListItems;

            //use SchemaFilledTable to load the table layout
            testTable = getSqlServer.SchemaFilledTable("SELECT TOP 1 [Id], [Name], [Tube], [Location], [Extension], [DiTranslation] FROM [dbo].[TestsWithSpecimenExtension]");
            this.dataGridTests.DataSource = testTable;
        }
Example #12
0
        public async Task<IHttpActionResult> UpdateHospital(Hospital user)
        {

            IHttpActionResult result = null;
            try
            {
                int modifiedCount = await IHospitalManager.RegisterNewOrUpdateDetailsAsync(user);
                if (modifiedCount > 0)
                {
                    result = Ok("Hospital details update succeded");

                }
                else
                {
                    result = Ok("Hospital details update failed.Please retry.");

                }
            }
            catch (Exception ex)
            {
                result = InternalServerError(ex);
            }
            return result;
        }
Example #13
0
 //reserved
 //public StructDoctor()
 //{
 //}
 public StructDoctor(Hospital hp, int docID, string docName)
 {
     this.hp = hp;
     this.docID = docID;
     this.docName = docName;
 }
Example #14
0
 public override string GetInteractionName(Sim a, Hospital target, InteractionObjectPair interaction)
 {
     if (this.name != string.Empty)
     {
         return this.name;
     }
     return Localization.LocalizeString(a.IsFemale, "Gameplay/Objects/RabbitHoles/Hospital/CreateBabyWith:InteractionName", new object[] { Hospital.CreateBabyWith.kCostOfBabyMaking });
 }
 public bool ILastHospitalSuccess(Hospital hospital)
 {
     this.h = hospital;
     return(true);
 }
Example #16
0
 private Hospital GetHospitalById(Hospital hospitalId, IEnumerable <Hospital> hospitals)
 => hospitalId == null ? null : hospitals.SingleOrDefault(h => h.GetId() == hospitalId.GetId());
Example #17
0
 public bool DataReadSuccess(Hospital h)
 {
     this.hospital = h;
     return(true);
 }
Example #18
0
 public void Add(Hospital hospital)
 {
     this.hospitals.Add(hospital);
     this.hospitals.SaveChanges();
 }
Example #19
0
 partial void UpdateHospital(Hospital instance);
        public static string KiemTraCLS(Hospital _data, int maBN, string strTimkiem, int ploaiTKiem, double kq, List <string> TenRG)
        {
            string          ktra   = "center";
            List <DichVuct> _lDVct = new List <DichVuct>();

            if (ploaiTKiem == 0)
            {
                int stt = 0;
                int.TryParse(strTimkiem, out stt);
                var q1 = (from tenrg in TenRG
                          join tndv in _data.TieuNhomDVs on tenrg equals tndv.TenRG
                          join dv in _data.DichVus on tndv.IdTieuNhom equals dv.IdTieuNhom
                          join dvct in _data.DichVucts.Where(p => p.STT == stt) on dv.MaDV equals dvct.MaDV
                          select dvct).ToList();
                _lDVct.AddRange(q1);
            }
            if (ploaiTKiem == 1)
            {
                var q1 = (from tenrg in TenRG
                          join tndv in _data.TieuNhomDVs on tenrg equals tndv.TenRG
                          join dv in _data.DichVus on tndv.IdTieuNhom equals dv.IdTieuNhom
                          join dvct in _data.DichVucts.Where(p => p.MaDVct == strTimkiem) on dv.MaDV equals dvct.MaDV
                          select dvct).ToList();
                _lDVct.AddRange(q1);
            }
            var q = _data.BenhNhans.Where(p => p.MaBNhan == maBN).Select(p => p.GTinh);

            if (q.Count() > 0 && q.First() != null)
            {
                int GTinh = 0;
                GTinh = q.First().Value;
                if (q.First() != null && GTinh == 0)//Nếu là nữ
                {
                    if (_lDVct.Count() > 0)
                    {
                        String TSBTnu = _lDVct.First().TSBTnu;
                        if (TSBTnu != null && TSBTnu != "") // Nếu có TSBTnu
                        {
                            String TSnuTu  = _lDVct.First().TSnuTu;
                            String TSnuDen = _lDVct.First().TSnuDen;
                            if (!String.IsNullOrEmpty(TSnuTu) && !String.IsNullOrEmpty(TSnuDen))
                            {
                                double nuTu  = 0;
                                double nuDen = 0;
                                if (!double.TryParse(TSnuTu, out nuTu) || !double.TryParse(TSnuDen, out nuDen))
                                {
                                    return("center");
                                }

                                if (double.TryParse(TSnuTu, out nuTu) && double.TryParse(TSnuDen, out nuDen) && kq >= nuTu && kq <= nuDen)
                                {
                                    ktra = "center";
                                }
                                else if (double.TryParse(TSnuTu, out nuTu) && kq < nuTu)
                                {
                                    ktra = "left";
                                }
                                else if (double.TryParse(TSnuDen, out nuDen) && kq > nuDen)
                                {
                                    ktra = "right";
                                }
                            }
                            else
                            {
                                if (!String.IsNullOrEmpty(TSnuTu))
                                {
                                    double nuTu = 0;
                                    if (double.TryParse(TSnuTu, out nuTu))
                                    {
                                        if (TSBTnu.Contains(">"))
                                        {
                                            if (kq > nuTu)
                                            {
                                                ktra = "center";
                                            }
                                            else
                                            {
                                                ktra = "left";
                                            }
                                        }
                                        else
                                        {
                                            if (kq >= nuTu)
                                            {
                                                ktra = "center";
                                            }
                                            else
                                            {
                                                ktra = "left";
                                            }
                                        }
                                    }
                                }
                                else
                                {
                                    if (!String.IsNullOrEmpty(TSnuDen))
                                    {
                                        double nuDen = 0;
                                        if (double.TryParse(TSnuDen, out nuDen))
                                        {
                                            if (TSBTnu.Contains("<"))
                                            {
                                                if (kq < nuDen)
                                                {
                                                    ktra = "center";
                                                }
                                                else
                                                {
                                                    ktra = "right";
                                                }
                                            }
                                            else
                                            {
                                                if (kq <= nuDen)
                                                {
                                                    ktra = "center";
                                                }
                                                else
                                                {
                                                    ktra = "right";
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        else // Nếu không có TSBTnu
                        {
                            GTinh = 1;
                        }
                    }
                }
                if (q.First() != null && GTinh == 1)// Nếu là nam
                {
                    if (_lDVct.Count() > 0)
                    {
                        String TSBTn = "";
                        if (_lDVct.First().TSBTn != null)
                        {
                            TSBTn = _lDVct.First().TSBTn;
                        }
                        String TSnTu  = _lDVct.First().TSnTu;
                        String TSnDen = _lDVct.First().TSnDen;
                        if (!String.IsNullOrEmpty(TSnTu) && !String.IsNullOrEmpty(TSnDen))
                        {
                            double nTu  = 0;
                            double nDen = 0;
                            if (!double.TryParse(TSnTu, out nTu) || !double.TryParse(TSnDen, out nDen))
                            {
                                return("center");
                            }
                            if (double.TryParse(TSnTu, out nTu) && double.TryParse(TSnDen, out nDen) && kq >= nTu && kq <= nDen)
                            {
                                ktra = "center";
                            }
                            else if (double.TryParse(TSnTu, out nTu) && kq < nTu)
                            {
                                ktra = "left";
                            }
                            else if (double.TryParse(TSnDen, out nDen) && kq > nDen)
                            {
                                ktra = "right";
                            }
                        }
                        else
                        {
                            if (!String.IsNullOrEmpty(TSnTu))
                            {
                                double nTu = 0;
                                if (double.TryParse(TSnTu, out nTu))
                                {
                                    if (TSBTn.Contains(">"))
                                    {
                                        if (kq > nTu || nTu == 0)
                                        {
                                            ktra = "center";
                                        }
                                        else
                                        {
                                            ktra = "left";
                                        }
                                    }
                                    else
                                    {
                                        if (kq >= nTu || nTu == 0)
                                        {
                                            ktra = "center";
                                        }
                                        else if (kq < nTu)
                                        {
                                            ktra = "left";
                                        }
                                    }
                                }
                            }
                            else
                            {
                                if (!String.IsNullOrEmpty(TSnDen))
                                {
                                    double nDen = 0;
                                    if (double.TryParse(TSnDen, out nDen))
                                    {
                                        if (TSBTn.Contains("<"))
                                        {
                                            if (kq < nDen || nDen == 0)
                                            {
                                                ktra = "center";
                                            }
                                            else
                                            {
                                                ktra = "right";
                                            }
                                        }
                                        else
                                        {
                                            if (kq <= nDen || nDen == 0)
                                            {
                                                ktra = "center";
                                            }
                                            else
                                            {
                                                ktra = "right";
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return(ktra);
        }
Example #21
0
        static void Main(string[] args)
        {
            Hospital hs = new Hospital("Chirurgia Poznanska");

            hs.Add(new Administrator("admin", "admin", "admin", "admin", "admin"));
            Employee emp;

            Console.WriteLine($"Welcome to hospital : {hs.HospitalName}");

            while (true)
            {
                try
                {
                    Console.Write("Enter Username : "******"Enter Password : "******"Is admin");
                emp.ShowMenu();
                int n;
                n = int.Parse(Console.ReadLine());

                switch (n)
                {
                case 1:
                    Console.WriteLine("Users : ");
                    hs.PrintEmployees();
                    break;

                case 2:
                    Console.WriteLine("Editing : ");
                    while (true)
                    {
                        try
                        {
                            Console.WriteLine("Provide speciality : ");
                            string[] specialities = new string[] { "administrator" };
                            string   speciality   = Console.ReadLine().ToLower();
                            if (!specialities.Contains(speciality))
                            {
                                throw new Exception("There is no such speciality");
                            }
                            Console.Write("Enter first name : ");
                            string firstname = Console.ReadLine();

                            Console.Write("Enter last name : ");
                            string lastname = Console.ReadLine();
                            Console.Write("Enter ID : ");
                            string idNumber = Console.ReadLine();
                            Console.Write("Enter Username : "******"Enter Password : "******"administrator")
                            {
                                Console.Write("Enter new first name : ");
                                string newfirstname = Console.ReadLine();
                                emp.ChangeName(newfirstname);
                                Console.Write("Enter new last name : ");
                                string newlastname = Console.ReadLine();
                                emp.ChangeSurname(newlastname);
                                Console.Write("Enter new ID : ");
                                string newidNumber = Console.ReadLine();
                                emp.ChangeIdNumber(newidNumber);
                                Console.Write("Enter new Username : "******"Enter new Password : "******"There is no such speciality  1111111111111");
                            }
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.Message);
                        }
                    }
                    break;

                case 3:
                    Console.WriteLine("Adding : ");
                    while (true)
                    {
                        try
                        {
                            Console.WriteLine("Provide speciality : ");
                            string[] specialities = new string[] { "adminstrator", "doctor", "nurse", "urologist", "cardiologist", "laryngologist", "neuorologist" };
                            string   speciality   = Console.ReadLine().ToLower();
                            if (!specialities.Contains(speciality))
                            {
                                throw new Exception("There is no such speciality");
                            }
                            Console.Write("Enter first name : ");
                            string firstname = Console.ReadLine();
                            Console.Write("Enter last name : ");
                            string lastname = Console.ReadLine();
                            Console.Write("Enter ID : ");
                            string idNumber = Console.ReadLine();
                            Console.Write("Enter Username : "******"Enter Password : "******"nurse")
                            {
                                hs.Add(new Nurse(firstname, lastname, idNumber, username, password));
                                break;
                            }

                            else if (speciality == "administrator")
                            {
                                hs.Add(new Administrator(firstname, lastname, idNumber, username, password));
                                break;
                            }

                            else if (speciality == "urologist" || speciality == "cardiologist" || speciality == "laryngologist" || speciality == "neurologist")
                            {
                                Console.Write("Provide GMC : ");
                                string GMC = Console.ReadLine();

                                switch (speciality)
                                {
                                case "urologist":
                                    hs.Add(new Urologist(GMC, firstname, lastname, idNumber, username, password));
                                    break;

                                case "cardiologist":
                                    hs.Add(new Cardiologist(GMC, firstname, lastname, idNumber, username, password));
                                    break;

                                case "laryngologist":
                                    hs.Add(new Laryngologist(GMC, firstname, lastname, idNumber, username, password));
                                    break;

                                case "neurologist":
                                    hs.Add(new Neurologist(GMC, firstname, lastname, idNumber, username, password));
                                    break;

                                default:
                                    break;
                                }
                            }

                            else
                            {
                                throw new Exception("There is no such speciality");
                            }
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.Message);
                        }
                    }
                    break;

                case 4:
                    Console.WriteLine("Exit");
                    break;
                }
                //hs.Choose();
                break;

            case false:
                Console.WriteLine("Is not admin");
                emp.ShowMenu();
                //hs.PrintEmployees();
                break;
            }

            /*switch(IsAdministrator)
             * {
             *  case 1:
             *
             * }*/
        }
        /*
         * Starts a transfer to the hospital closest to the given selectedRecipient and adds the helicopter to the map
         */
        public async Task NewTransfer(DonatableOrgan currentOrgan, User selectedRecipient, Position donorPosition)
        {
            OrganTransfer newOrganTransfer = new OrganTransfer();

            newOrganTransfer.id         = currentOrgan.id;
            newOrganTransfer.receiverId = selectedRecipient.id;

            //Find the position of the donor
            newOrganTransfer.startLat = donorPosition.Latitude;
            newOrganTransfer.startLon = donorPosition.Longitude;

            Hospital receiverHospital = null;

            //await InitialiseHospitalsWithoutAddingToMap();
            foreach (Hospital hospital in hospitals)
            {
                if (hospital.region.Equals(selectedRecipient.region))
                {
                    receiverHospital = hospital;
                }
            }

            //Find the nearest hospital
            newOrganTransfer.endLat = receiverHospital.latitude;
            newOrganTransfer.endLon = receiverHospital.longitude;

            newOrganTransfer.organType = OrganExtensions.ToOrgan(currentOrgan.organType);

            Position HospitalPosition = new Position(receiverHospital.latitude, receiverHospital.longitude);

            newOrganTransfer.arrivalTime = new CustomDateTime(DateTime.Now.AddSeconds(distance(donorPosition.Latitude, HospitalPosition.Latitude,
                                                                                               donorPosition.Longitude, HospitalPosition.Longitude, 0, 0) / 70));

            TransplantListAPI transplantListAPI = new TransplantListAPI();

            if (await transplantListAPI.InsertTransfer(newOrganTransfer) != HttpStatusCode.OK)
            {
                await DisplayAlert("", "Failed to start transfer (failed to insert transfer)", "OK");

                return;
            }

            if (await transplantListAPI.SetInTransfer(currentOrgan.id, 1) != true)
            {
                await DisplayAlert("", "Failed to start transfer (failed to set in transfer)", "OK");

                return;
            }

            int TTA = (int)newOrganTransfer.arrivalTime.ToDateTimeWithSeconds().Subtract(DateTime.Now).TotalSeconds;

            //int waitingListId = await transplantListAPI.GetWaitingListId((int)newOrganTransfer.receiverId, newOrganTransfer.organType);
            //if (waitingListId == 0) {
            //    await DisplayAlert("", "Failed to start transfer (failed to get waiting list id)", "OK");
            //    return;
            //}

            int waitingListId = 0;

            foreach (WaitingListItem item in selectedRecipient.waitingListItems)
            {
                if (item.organType == OrganExtensions.ToOrgan(currentOrgan.organType))
                {
                    waitingListId = item.id;
                }
            }

            AddHelicopter(donorPosition,
                          HospitalPosition,
                          newOrganTransfer.organType,
                          TTA,
                          newOrganTransfer.receiverId,
                          waitingListId,
                          newOrganTransfer.id
                          );
        }
Example #23
0
        private void BigSwitch()
        {
            switch (currentState)
            {
            case State.Patrol:
                actionName = "Noname";
                if (_agent.isOnNavMesh == false)
                {
                    Debug.LogError("nu este pe navmesh", this);
                }
                if (_agent.isStopped)
                {
                    _agent.isStopped = false;
                }
                if (_agent.enabled == false)
                {
                    _agent.enabled = true;
                }
                // in caz ca agentul intra in stare de patrol iar agent este oprit/dezactivat
                // aleg destinatia
                // folosesc startPatroling pentru a putea sa intru in starea de patrol la prima iteratie
                if (_startPatroling == false ||
                    Vector3.Distance(transform.position, _currentDestination) < stoppingDistance)
                {
                    if (randomLocations)     // aleg pozitii random
                    {
                        var
                            randomLocation =
                            RandomLoc();         // o functie care returneaza o pozitie random valida in pe baza randomRange
                        _currentDestination = randomLocation;
                        // folosesc currentDestination care este de tip Vector3 pentru a retine mereu care este destinatie curenta
                        // uneori agent.destination nu imi spune care este exact destinatia
                        _agent.SetDestination(_currentDestination);
                    }
                    else
                    {
                        // aleg pozitiile din patrolPositions care este setat in inspector
                        _agent.SetDestination(patrolPositions[_currentIndexPatrol].transform.position);
                        _currentDestination =
                            patrolPositions[_currentIndexPatrol].transform
                            .position;         // nu uit sa pun currentDestination;
                        _currentIndexPatrol++; // cresc indexul din vector
                        if (_currentIndexPatrol >= patrolPositions.Length)
                        {
                            _currentIndexPatrol = 0;     // resetez indexul
                        }
                    }

                    _startPatroling = true;
                }

                // Tranzitia 1 in starea de MEET
                /// daca cooldown-ul a trecut de la ultima intalnire sau daca initial nu am avut nicio intalnire
                if (Time.time - _lastFinishedMeetingTime >= cooldownMeeting || _lastFinishedMeetingTime == 0)
                {
                    if (!cured || cured && Vector3.Distance(transform.position, _bedPosition) > 100f)
                    {
                        // daca nu e vindecat sau daca e vindecat si e departe de spital{
                        TryMeetBot();     /// incearca sa gaseasca partener
                        if (inMeeting)
                        {
                            return;
                        }
                    }
                }

                /// Tranzitia 2 in starea de GOTOHOSPITAL
                if (infectionLevel > 5)     // un anumit nivel
                // find a free hospital place
                {
                    foreach (var currentHospital in Hospital.ListHospitals)
                    {
                        if (currentHospital.Free())
                        {
                            // tuple care reprezinta pozitia unde se afla patul si indexul din vectorul de paturi din clasa de Hospital
                            // folosesc si indexul pentru a putea "elibera" patul mai incolo, daca nu as retine si indexul ar fi mai greu
                            // clasa Hospital retine o lista cu toate spitalele din mapa
                            // de asemenea o lista de in care indentifica fiecare pozitie in spatiu(vector3) cu un index al patului
                            var tuple = currentHospital.BedPosition();
                            if (tuple.Item2 != -1)
                            {
                                _currentDestination = tuple.Item1;
                                _bedIndex           = tuple.Item2;
                                _hospital           = currentHospital;
                                _bedPosition        = _currentDestination;
                                _agent.SetDestination(_currentDestination);
                                currentState = State.Hospital;
                                return;
                            }
                        }
                    }
                }

                // Tranzitia 3 in stareaFind Action
                TryFindNewAction();

                break;

            case State.Meet:
                if (Vector3.Distance(transform.position, _meetingPoint) < 1f)
                {
                    _agent.enabled = false;
                }
                if (!_agent.enabled && !meetingBot._agent.enabled)
                {
                    Debug.Log("Enabling obstacle for : " + name);
                    talking           = true;
                    _obstacle.enabled = true;
                    _animator.SetBool(AnimatorTalking, true);
                    Talk();
                }

                break;

            case State.Hospital:
                if (Vector3.Distance(transform.position, _currentDestination) < 5f)
                {
                    infectionLevel = 0;
                    _hospital.LeaveBed(_bedIndex);
                    _startPatroling = false;
                    cured           = true;
                    currentState    = State.Patrol;
                }

                break;

            case State.AnyAction:
                if (_currentAction != null)
                {
                    actionName = _currentAction.name;
                }
                if (_startAction == false && _actionPathPending == false) // if there is no action right now
                {
                    if (TryFindNewAction() == false)                      // if we fail to find any action then go to patrol
                    {
                        currentState    = State.Patrol;
                        _startPatroling = true;
                    }
                }

                if (_actionPathPending)
                {
                    // if the bot is going towards the action destination
                    if (_startAction == false && Vector3.Distance(transform.position, _currentDestination) <
                        _currentAction.stopDistance + 0.1f)
                    {
                        _startAction = true;     // now the action starts!
                        // snap to the disired position and rotation
                        transform.position = _currentDestination;
                        transform.rotation = _currentAction.rotation;
                        _agent.isStopped   = true;
                        Action start = null;
                        Action end   = null;
                        int    waitTime;

                        Debug.Log("<color=green> Start Action " + _currentAction.name + "</color>");
                        if (_currentAction.name == typingAction.name)
                        {
                            Debug.Log("<color=green>entered typing</color>");
                            start    = () => _animator.SetBool(AnimatorTyping, true);
                            end      = () => _animator.SetBool(AnimatorTyping, false);
                            waitTime = UnityEngine.Random.Range(10, 15);
                        }
                        else if (_currentAction.name == lookAtSphereAction.name)
                        {
                            Debug.Log("<color=green>entered looking</color>");
                            start    = () => { transform.LookAt(_currentAction.targetTransform); };
                            waitTime = 5;
                        }
                        else
                        {
                            Debug.Assert(_currentAction.name != "typingAction" &&
                                         _currentAction.name != "lookAtSphereAction");
                            Debug.Log("<color=green>entered other</color>", this);
                            waitTime = 8;
                        }

                        StartCoroutine(AbstractCoroutine(start, end, waitTime));
                    }
                }

                break;
            }
        }
Example #24
0
 public virtual Hospital Add(Hospital hospital)
 {
     return(_dbContext.Set <Hospital>().Add(hospital));
 }
 public int UpdateHospital(Hospital hospital)
 {
     return(new DataAccessClass().UpdateHospitalToDB(hospital));
 }
Example #26
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            Dialog.SetCanceledOnTouchOutside(false);

            var caption = string.Empty;

            if (HospitalData == null)
            {
                caption = "НОВОЕ ЛПУ";
            }
            else
            {
                Hospital = MainDatabase.GetEntity <Hospital>(HospitalData.Hospital);
                caption  = "ЛПУ : " + Hospital.Name;
            }

            Dialog.SetTitle(caption);

            View view = inflater.Inflate(Resource.Layout.HospitalDialog, container, false);

            view.FindViewById <EditText>(Resource.Id.hdNameET).Append(Hospital == null ? string.Empty : Hospital.Name);

            AutoCompleteTextView addressACTV = view.FindViewById <AutoCompleteTextView>(Resource.Id.hdAddressACTV);

            addressACTV.Append(Hospital == null ? @"Москва" : Hospital.Address);
            //addressACTV.AfterTextChanged += (object sender, Android.Text.AfterTextChangedEventArgs e) =>
            //{
            //	if (addressACTV.Text.Contains(" "))
            //	{
            //		//var suggestions = new List<SuggestAddressResponse.Suggestions>();
            //		//try {
            //		//	var response = Api.QueryAddress(addressACTV.Text);
            //		//	suggestions = response.suggestionss;
            //		//} catch (Exception ex) {
            //		//	System.Diagnostics.Debug.WriteLine(ex.Message);
            //		//}
            //		//addressACTV.Adapter = new AddressSuggestionAdapter(Activity, suggestions);
            //		//if (addressACTV.IsShown) {
            //		//	addressACTV.DismissDropDown();
            //		//}
            //		//addressACTV.ShowDropDown();
            //	}
            //};
            //addressACTV.ItemClick += (sender, e) => {
            //	var item = (((AutoCompleteTextView)sender).Adapter as AddressSuggestionAdapter)[e.Position];
            //	((AutoCompleteTextView)sender).SetTag(Resource.String.fias_id, item.data.fias_id);
            //	((AutoCompleteTextView)sender).SetTag(Resource.String.qc_geo, item.data.qc_geo);
            //	((AutoCompleteTextView)sender).SetTag(Resource.String.geo_lat, item.data.geo_lat);
            //	((AutoCompleteTextView)sender).SetTag(Resource.String.geo_lon, item.data.geo_lon);
            //};

            view.FindViewById <Button>(Resource.Id.hdCloseB).Click += (s, e) => {
                Dismiss();
            };

            view.FindViewById <Button>(Resource.Id.hdSaveB).Click += (s, e) => {
                //Toast.MakeText(context, "SAVE BUTTON CLICKED", ToastLength.Short).Show()

                var transaction = MainDatabase.BeginTransaction();
                if (HospitalData == null)
                {
                    var hospital = MainDatabase.Create2 <Hospital>();
                    hospital.CreatedAt = DateTimeOffset.Now;
                    hospital.UpdatedAt = DateTimeOffset.Now;
                    hospital.Name      = view.FindViewById <EditText>(Resource.Id.hdNameET).Text;
                    hospital.Address   = view.FindViewById <EditText>(Resource.Id.hdAddressACTV).Text;

                    var hospitalData = MainDatabase.Create2 <HospitalData>();
                    hospitalData.Pharmacy = Pharmacy.UUID;
                    hospitalData.Hospital = hospital.UUID;
                }
                else
                {
                    //var hospital = MainDatabase.GetEntity<Hospital>(HospitalData.Hospital);
                    //hospital.UpdatedAt = DateTimeOffset.Now;
                    //hospital.Name = view.FindViewById<EditText>(Resource.Id.hdNameET).Text;
                    //hospital.Address = view.FindViewById<EditText>(Resource.Id.hdAddressACTV).Text;

                    Hospital.UpdatedAt = DateTimeOffset.Now;
                    Hospital.Name      = view.FindViewById <EditText>(Resource.Id.hdNameET).Text;
                    Hospital.Address   = view.FindViewById <EditText>(Resource.Id.hdAddressACTV).Text;

                    if (!Hospital.IsManaged)
                    {
                        MainDatabase.SaveEntity(transaction, Hospital);
                    }
                }

                transaction.Commit();
                //var sync = new SyncItem()
                //{
                //	Path = @"Hospital",
                //	ObjectUUID = hospital.UUID,
                //	JSON = JsonConvert.SerializeObject(hospital)
                //};

                //MainDatabase.AddToQueue(sync);

                //Context.StartService(new Intent("com.xamarin.SyncService"));

                OnAfterSaved(EventArgs.Empty);

                Dismiss();
            };

            return(view);
        }
 public int AddHospital(Hospital hospital)
 {
     return(new DataAccessClass().AddHospitalToDB(hospital));
 }
        private void FormEditHospital_Load(object sender, EventArgs e)
        {
            //Узнаем данные в таблицу поликлитнника нужно записывать или только обновлять
            string    queryFlagInsert = "select * from Поликлинника";
            DataTable dt = ТаблицаБД.GetTable(queryFlagInsert, ConnectionDB.ConnectionString(), "Поликлинника");

            // Узнаем есть ли в таблице колонка номер телефона и e-mail.
            if (dt.Columns.Count == 24)
            {
                string queryUpdate = "ALTER TABLE Поликлинника ADD COLUMN НомерТелефона TEXT(50), COLUMN email TEXT(50),COLUMN Исполнитель TEXT(50) ";

                // Внесем изменения в структуру таблицы.
                ТаблицаБД.AlterTableПоликлинника(queryUpdate, ConnectionDB.ConnectionString(), "Поликлинника");

                // Не очень красиво , но получим таблицу с новой структурой.
                dt = ТаблицаБД.GetTable(queryFlagInsert, ConnectionDB.ConnectionString(), "Поликлинника");
            }

            int countRow = dt.Rows.Count;

            if (dt.Rows.Count != 0)
            {
                if (dt.Rows[0]["НачальныйНомерДоговора"].ToString() != "")
                {
                    this.txtNumDog.Text = dt.Rows[0]["НачальныйНомерДоговора"].ToString();
                }
                else
                {
                    this.txtNumDog.Text = "0";
                }
            }
            else
            {
                this.txtNumDog.Text = "0";
            }
            //заполним combo box-ы
            string queryВрачи = "select id_главВрач,ФИО_ГлавВрач from ГлавВрач";

            this.cmbВрачи.DataSource    = ТаблицаБД.GetTable(queryВрачи, ConnectionDB.ConnectionString(), "ГлавВрач");
            this.cmbВрачи.ValueMember   = "id_главВрач";
            this.cmbВрачи.DisplayMember = "ФИО_ГлавВрач";

            string queryБух = "select id_главБух,ФИО_ГлавБух from ГлавБух";

            this.cmbБух.DataSource    = ТаблицаБД.GetTable(queryБух, ConnectionDB.ConnectionString(), "ГлавВрач");
            this.cmbБух.ValueMember   = "id_главБух";
            this.cmbБух.DisplayMember = "ФИО_ГлавБух";


            //узнаем добавлять записи или только обновлять
            if (countRow == 0)
            {
                //записей в таблице нет значит добьавляем новую запись
                flagInsert = true;
            }
            else
            {
                //записи в таблице есть значит форма работает на обновление записи
                flagInsert = false;
            }

            //Получим реквизиты поликлинники
            Hospital hospital = new Hospital();

            foreach (DataRow row in dt.Rows)
            {
                hospital.НаименованиеПоликлинники = row["НаименованиеПоликлинники"].ToString();
                hospital.КодПоликлинники          = row["КодПоликлинники"].ToString();
                hospital.ЮридическийАдрес         = row["ЮридическийАдрес"].ToString();

                hospital.ФактическийАдрес = row["ФактическийАдрес"].ToString();
                hospital.id_главВрач      = Convert.ToInt32(row["id_главВрач"]);
                hospital.id_главБух       = Convert.ToInt32(row["id_главБух"]);

                hospital.СвидетельствоРегистрации = row["СвидетельствоРегистрации"].ToString();
                hospital.ИНН = row["ИНН"].ToString();
                hospital.КПП = row["КПП"].ToString();
                hospital.БИК = row["БИК"].ToString();

                hospital.НаименованиеБанка = row["НаименованиеБанка"].ToString();
                hospital.асчётСчёт         = row["РасчётныйСчёт"].ToString();
                hospital.ЛицевойСчёт       = row["ЛицевойСчёт"].ToString();
                hospital.НомерЛицензии     = row["НомерЛицензии"].ToString();

                hospital.ДатаРегистрацииЛицензии = row["ДатаРегистрацииЛицензии"].ToString();
                hospital.ОГРН = row["ОГРН"].ToString();
                hospital.СвидетельствоРегистрацииЕГРЮЛ = row["СвидетельствоРегистрацииЕГРЮЛ"].ToString();
                //hospital.ОрганВыдавшийСвидетельство = row["ОрганВыдавшийЛицензию"].ToString();
                hospital.ОрганВыдавшийЛицензию = row["ОрганВыдавшийЛицензию"].ToString();

                hospital.Постановление = row["Постановление"].ToString();
                hospital.ОКПО          = row["ОКПО"].ToString();
                hospital.ОКАТО         = row["ОКАТО"].ToString();

                //string s1 = row["НомерТелефона"].ToString();
                //string s2 = row["email"].ToString();

                hospital.Phone = row["НомерТелефона"].ToString();
                hospital.Email = row["email"].ToString();

                hospital.Исполнитель = row["Исполнитель"].ToString();
            }

            //отобразим данные на форме
            this.textBox1.Text = hospital.НаименованиеПоликлинники;
            this.textBox2.Text = hospital.КодПоликлинники;
            this.textBox3.Text = hospital.ЮридическийАдрес;
            this.textBox4.Text = hospital.ФактическийАдрес;

            //отобразим combo box-ы
            string qГЛавВрач = "select ФИО_ГлавВрач from ГлавВрач where id_главВрач = " + hospital.id_главВрач + " ";

            DataTable tabHosp = ТаблицаБД.GetTable(qГЛавВрач, ConnectionDB.ConnectionString(), "ГлавВрач");

            //переменная для хранения ФИО глав врача
            string главВрач = string.Empty;

            if (tabHosp.Rows.Count != 0)
            {
                //string главВрач = ТаблицаБД.GetTable(qГЛавВрач, ConnectionDB.ConnectionString(), "ГлавВрач").Rows[0][0].ToString().Trim();
                главВрач = tabHosp.Rows[0][0].ToString().Trim();
            }
            this.cmbВрачи.Text = главВрач;


            string qГЛавБух = "select ФИО_ГлавБух from ГлавБух where id_главБух = " + hospital.id_главБух + " ";

            DataTable tabBux = ТаблицаБД.GetTable(qГЛавБух, ConnectionDB.ConnectionString(), "ГлавВрач");

            //переменная для хранения ФИО глав буха
            string главБух = string.Empty;

            if (tabBux.Rows.Count != 0)
            {
                главБух = tabBux.Rows[0][0].ToString().Trim();
                //string главБух = ТаблицаБД.GetTable(qГЛавБух, ConnectionDB.ConnectionString(), "ГлавВрач").Rows[0][0].ToString().Trim();
            }
            this.cmbБух.Text = главБух;

            this.maskedTextBox1.Text = hospital.ИНН;
            this.maskedTextBox8.Text = hospital.ОГРН;

            this.maskedTextBox6.Text = hospital.ОКПО;
            this.maskedTextBox7.Text = hospital.ОКАТО;

            this.textBox6.Text = hospital.НомерЛицензии;

            if (hospital.ДатаРегистрацииЛицензии != null)
            {
                this.dateTimePicker1.Value = Convert.ToDateTime(hospital.ДатаРегистрацииЛицензии);
            }

            this.textBox7.Text = hospital.ОрганВыдавшийЛицензию;
            this.textBox5.Text = hospital.НаименованиеБанка;

            this.maskedTextBox4.Text = hospital.асчётСчёт;

            // В связи с изменениями в лицевом счёте (появились буквы).
            //this.maskedTextBox5.Text = hospital.ЛицевойСчёт;
            this.txtЛицевойСчёт.Text = hospital.ЛицевойСчёт;


            this.maskedTextBox2.Text = hospital.КПП;
            this.maskedTextBox3.Text = hospital.БИК;

            this.textBox10.Text = hospital.Постановление;

            // Отобразим номер телефона.
            this.maskedTextBox5.Text = hospital.Phone.Trim();

            // От образим e-mail.
            this.textBox8.Text = hospital.Email.Trim();

            this.textBox9.Text = hospital.Исполнитель.Trim();

            //Прочитаем файл конфигурации Config.dll (для конфигурирования выгрузки реестра в файл)
            using (FileStream fs = File.OpenRead("Config.dll"))
                using (TextReader read = new StreamReader(fs))
                {
                    string sConfig = read.ReadLine();
                    if (sConfig == "1")
                    {
                        //Разрешаем выгрузку реестра в файл
                        this.chkВыгрузки.Checked = true;
                    }
                    else
                    {
                        //запрещаем выгрузку реестра в файл
                        this.chkВыгрузки.Checked = false;
                    }
                }
        }
Example #29
0
 public void Delete(Hospital hospital)
 {
     this.hospitals.Delete(hospital);
     this.hospitals.SaveChanges();
 }
Example #30
0
        private void GenerateSpecialtiesHospitals_Click(object sender, EventArgs e)
        {
            using (var unitOfWork = new UnitOfWork())
            {
                var hospital1 = new Hospital {
                    Name = "Hospital 1"
                };
                var hospital2 = new Hospital {
                    Name = "Hospital 2"
                };
                var hospital3 = new Hospital {
                    Name = "Hospital 3"
                };
                var hospital4 = new Hospital {
                    Name = "Hospital 4"
                };
                var hospital5 = new Hospital {
                    Name = "Hospital 5"
                };

                var hospitals = new[]
                {
                    hospital1,
                    hospital2,
                    hospital3,
                    hospital4,
                    hospital5
                };

                var specialty1 = new Specialty {
                    Code = "100", Name = "GENERAL SURGERY", Hospitals = hospitals
                };
                var specialty2 = new Specialty {
                    Code = "101", Name = "UROLOGY", Hospitals = hospitals
                };
                var specialty3 = new Specialty {
                    Code = "110", Name = "TRAUMA & ORTHOPAEDICS", Hospitals = hospitals
                };
                var specialty4 = new Specialty {
                    Code = "120", Name = "ENT", Hospitals = hospitals
                };
                var specialty5 = new Specialty {
                    Code = "130", Name = "OPHTHALMOLOGY", Hospitals = hospitals
                };
                var specialty6 = new Specialty {
                    Code = "140", Name = "ORAL SURGERY", Hospitals = hospitals
                };
                var specialty7 = new Specialty {
                    Code = "141", Name = "RESTORATIVE DENTISTRY", Hospitals = hospitals
                };
                var specialty8 = new Specialty {
                    Code = "142", Name = "PAEDIATRIC DENTISTRY", Hospitals = hospitals
                };
                var specialty9 = new Specialty {
                    Code = "143", Name = "ORTHODONTICS", Hospitals = hospitals
                };
                var specialty10 = new Specialty {
                    Code = "145", Name = "ORAL & MAXILLO FACIAL SURGERY", Hospitals = hospitals
                };
                var specialty11 = new Specialty {
                    Code = "146", Name = "ENDODONTICS", Hospitals = hospitals
                };
                var specialty12 = new Specialty {
                    Code = "147", Name = "PERIODONTICS", Hospitals = hospitals
                };
                var specialty13 = new Specialty {
                    Code = "148", Name = "PROSTHODONTICS", Hospitals = hospitals
                };
                var specialty14 = new Specialty {
                    Code = "149", Name = "SURGICAL DENTISTRY", Hospitals = hospitals
                };
                var specialty15 = new Specialty {
                    Code = "150", Name = "NEUROSURGERY", Hospitals = hospitals
                };
                var specialty16 = new Specialty {
                    Code = "160", Name = "PLASTIC SURGERY", Hospitals = hospitals
                };
                var specialty17 = new Specialty {
                    Code = "170", Name = "CARDIOTHORACIC SURGERY", Hospitals = hospitals
                };
                var specialty18 = new Specialty {
                    Code = "171", Name = "PAEDIATRIC SURGERY", Hospitals = hospitals
                };
                var specialty19 = new Specialty {
                    Code = "180", Name = "ACCIDENT & EMERGENCY", Hospitals = hospitals
                };
                var specialty20 = new Specialty {
                    Code = "190", Name = "ANAESTHETICS", Hospitals = hospitals
                };
                var specialty21 = new Specialty {
                    Code = "191", Name = NoLongerInUse, Hospitals = hospitals
                };
                var specialty22 = new Specialty {
                    Code = "192", Name = "CRITICAL CARE MEDICINE", Hospitals = hospitals
                };
                var specialty23 = new Specialty {
                    Code = "199", Name = "Non-UK provider; specialty function not known, treatment mainly surgical", Hospitals = hospitals
                };
                var specialty24 = new Specialty {
                    Code = "300", Name = "GENERAL MEDICINE", Hospitals = hospitals
                };
                var specialty25 = new Specialty {
                    Code = "301", Name = "GASTROENTEROLOGY", Hospitals = hospitals
                };
                var specialty26 = new Specialty {
                    Code = "302", Name = "ENDOCRINOLOGY", Hospitals = hospitals
                };
                var specialty27 = new Specialty {
                    Code = "303", Name = "CLINICAL HAEMATOLOGY", Hospitals = hospitals
                };
                var specialty28 = new Specialty {
                    Code = "304", Name = "CLINICAL PHYSIOLOGY", Hospitals = hospitals
                };
                var specialty29 = new Specialty {
                    Code = "305", Name = "CLINICAL PHARMACOLOGY", Hospitals = hospitals
                };
                var specialty30 = new Specialty {
                    Code = "310", Name = "AUDIOLOGICAL MEDICINE", Hospitals = hospitals
                };
                var specialty31 = new Specialty {
                    Code = "311", Name = "CLINICAL GENETICS", Hospitals = hospitals
                };
                var specialty32 = new Specialty {
                    Code = "312", Name = "CLINICAL CYTOGENETICS and MOLECULAR GENETICS", Hospitals = hospitals
                };
                var specialty33 = new Specialty {
                    Code = "313", Name = "CLINICAL IMMUNOLOGY and ALLERGY", Hospitals = hospitals
                };
                var specialty34 = new Specialty {
                    Code = "314", Name = "REHABILITATION", Hospitals = hospitals
                };
                var specialty35 = new Specialty {
                    Code = "315", Name = "PALLIATIVE MEDICINE", Hospitals = hospitals
                };
                var specialty36 = new Specialty {
                    Code = "320", Name = "CARDIOLOGY", Hospitals = hospitals
                };
                var specialty37 = new Specialty {
                    Code = "321", Name = "PAEDIATRIC CARDIOLOGY", Hospitals = hospitals
                };
                var specialty38 = new Specialty {
                    Code = "325", Name = "SPORTS AND EXERCISE MEDICINE ", Hospitals = hospitals
                };
                var specialty39 = new Specialty {
                    Code = "326", Name = "ACUTE INTERNAL MEDICINE", Hospitals = hospitals
                };
                var specialty40 = new Specialty {
                    Code = "330", Name = "DERMATOLOGY", Hospitals = hospitals
                };
                var specialty41 = new Specialty {
                    Code = "340", Name = "RESPIRATORY MEDICINE (also known as thoracic medicine)", Hospitals = hospitals
                };
                var specialty42 = new Specialty {
                    Code = "350", Name = "INFECTIOUS DISEASES", Hospitals = hospitals
                };
                var specialty43 = new Specialty {
                    Code = "352", Name = "TROPICAL MEDICINE", Hospitals = hospitals
                };
                var specialty44 = new Specialty {
                    Code = "360", Name = "GENITOURINARY MEDICINE", Hospitals = hospitals
                };
                var specialty45 = new Specialty {
                    Code = "361", Name = "NEPHROLOGY", Hospitals = hospitals
                };
                var specialty46 = new Specialty {
                    Code = "370", Name = "MEDICAL ONCOLOGY", Hospitals = hospitals
                };
                var specialty47 = new Specialty {
                    Code = "371", Name = "NUCLEAR MEDICINE", Hospitals = hospitals
                };
                var specialty48 = new Specialty {
                    Code = "400", Name = "NEUROLOGY", Hospitals = hospitals
                };
                var specialty49 = new Specialty {
                    Code = "401", Name = "CLINICAL NEURO-PHYSIOLOGY", Hospitals = hospitals
                };
                var specialty50 = new Specialty {
                    Code = "410", Name = "RHEUMATOLOGY", Hospitals = hospitals
                };
                var specialty51 = new Specialty {
                    Code = "420", Name = "PAEDIATRICS", Hospitals = hospitals
                };
                var specialty52 = new Specialty {
                    Code = "421", Name = "PAEDIATRIC NEUROLOGY", Hospitals = hospitals
                };
                var specialty53 = new Specialty {
                    Code = "430", Name = "GERIATRIC MEDICINE", Hospitals = hospitals
                };
                var specialty54 = new Specialty {
                    Code = "450", Name = "DENTAL MEDICINE SPECIALTIES", Hospitals = hospitals
                };
                var specialty55 = new Specialty {
                    Code = "451", Name = "SPECIAL CARE DENTISTRY", Hospitals = hospitals
                };
                var specialty56 = new Specialty {
                    Code = "460", Name = "MEDICAL OPHTHALMOLOGY", Hospitals = hospitals
                };
                var specialty57 = new Specialty {
                    Code = "499", Name = "Non-UK provider; specialty function not known, treatment mainly medical", Hospitals = hospitals
                };
                var specialty58 = new Specialty {
                    Code = "500", Name = "OBSTETRICS and GYNAECOLOGY", Hospitals = hospitals
                };
                var specialty59 = new Specialty {
                    Code = "501", Name = "OBSTETRICS", Hospitals = hospitals
                };
                var specialty60 = new Specialty {
                    Code = "502", Name = "GYNAECOLOGY", Hospitals = hospitals
                };
                var specialty61 = new Specialty {
                    Code = "504", Name = "COMMUNITY SEXUAL AND REPRODUCTIVE HEALTH", Hospitals = hospitals
                };
                var specialty62 = new Specialty {
                    Code = "510", Name = NoLongerInUse, Hospitals = hospitals
                };
                var specialty63 = new Specialty {
                    Code = "520", Name = NoLongerInUse, Hospitals = hospitals
                };
                var specialty64 = new Specialty {
                    Code = "560", Name = "MIDWIFE EPISODE", Hospitals = hospitals
                };
                var specialty65 = new Specialty {
                    Code = "600", Name = "GENERAL MEDICAL PRACTICE", Hospitals = hospitals
                };
                var specialty66 = new Specialty {
                    Code = "601", Name = "GENERAL DENTAL PRACTICE", Hospitals = hospitals
                };
                var specialty67 = new Specialty {
                    Code = "610", Name = NoLongerInUse, Hospitals = hospitals
                };
                var specialty68 = new Specialty {
                    Code = "620", Name = NoLongerInUse, Hospitals = hospitals
                };
                var specialty69 = new Specialty {
                    Code = "700", Name = "LEARNING DISABILITY", Hospitals = hospitals
                };
                var specialty70 = new Specialty {
                    Code = "710", Name = "ADULT MENTAL ILLNESS", Hospitals = hospitals
                };
                var specialty71 = new Specialty {
                    Code = "711", Name = "CHILD and ADOLESCENT PSYCHIATRY", Hospitals = hospitals
                };
                var specialty72 = new Specialty {
                    Code = "712", Name = "FORENSIC PSYCHIATRY", Hospitals = hospitals
                };
                var specialty73 = new Specialty {
                    Code = "713", Name = "PSYCHOTHERAPY", Hospitals = hospitals
                };
                var specialty74 = new Specialty {
                    Code = "715", Name = "OLD AGE PSYCHIATRY", Hospitals = hospitals
                };
                var specialty75 = new Specialty {
                    Code = "800", Name = "CLINICAL ONCOLOGY (previously RADIOTHERAPY)", Hospitals = hospitals
                };
                var specialty76 = new Specialty {
                    Code = "810", Name = "RADIOLOGY", Hospitals = hospitals
                };
                var specialty77 = new Specialty {
                    Code = "820", Name = "GENERAL PATHOLOGY", Hospitals = hospitals
                };
                var specialty78 = new Specialty {
                    Code = "821", Name = "BLOOD TRANSFUSION", Hospitals = hospitals
                };
                var specialty79 = new Specialty {
                    Code = "822", Name = "CHEMICAL PATHOLOGY", Hospitals = hospitals
                };
                var specialty80 = new Specialty {
                    Code = "823", Name = "HAEMATOLOGY", Hospitals = hospitals
                };
                var specialty81 = new Specialty {
                    Code = "824", Name = "HISTOPATHOLOGY", Hospitals = hospitals
                };
                var specialty82 = new Specialty {
                    Code = "830", Name = "IMMUNOPATHOLOGY", Hospitals = hospitals
                };
                var specialty83 = new Specialty {
                    Code = "831", Name = "MEDICAL MICROBIOLOGY AND VIROLOGY", Hospitals = hospitals
                };
                var specialty84 = new Specialty {
                    Code = "832", Name = NoLongerInUse, Hospitals = hospitals
                };
                var specialty85 = new Specialty {
                    Code = "833", Name = "MEDICAL MICROBIOLOGY (also known as Microbiology and Bacteriology)", Hospitals = hospitals
                };
                var specialty86 = new Specialty {
                    Code = "834", Name = "MEDICAL VIROLOGY", Hospitals = hospitals
                };
                var specialty87 = new Specialty {
                    Code = "900", Name = "COMMUNITY MEDICINE", Hospitals = hospitals
                };
                var specialty88 = new Specialty {
                    Code = "901", Name = "OCCUPATIONAL MEDICINE", Hospitals = hospitals
                };
                var specialty89 = new Specialty {
                    Code = "902", Name = "COMMUNITY HEALTH SERVICES DENTAL", Hospitals = hospitals
                };
                var specialty90 = new Specialty {
                    Code = "903", Name = "PUBLIC HEALTH MEDICINE", Hospitals = hospitals
                };
                var specialty91 = new Specialty {
                    Code = "904", Name = "PUBLIC HEALTH DENTAL", Hospitals = hospitals
                };
                var specialty92 = new Specialty {
                    Code = "950", Name = "NURSING EPISODE", Hospitals = hospitals
                };
                var specialty93 = new Specialty {
                    Code = "960", Name = "ALLIED HEALTH PROFESSIONAL EPISODE", Hospitals = hospitals
                };
                var specialty94 = new Specialty {
                    Code = "990", Name = NoLongerInUse, Hospitals = hospitals
                };

                hospital1.Specialties = new[] { specialty1, specialty2, specialty3, specialty4, specialty5, specialty6, specialty7, specialty8, specialty9, specialty10, specialty11, specialty12, specialty13, specialty14, specialty15, specialty16, specialty17, specialty18, specialty19, specialty20, specialty21, specialty22, specialty23, specialty24, specialty25, specialty26, specialty27, specialty28, specialty29, specialty30, specialty31, specialty32, specialty33, specialty34, specialty35, specialty36, specialty37, specialty38, specialty39, specialty40, specialty41, specialty42, specialty43, specialty44, specialty45, specialty46, specialty47, specialty48, specialty49, specialty50, specialty51, specialty52, specialty53, specialty54, specialty55, specialty56, specialty57, specialty58, specialty59, specialty60, specialty61, specialty62, specialty63, specialty64, specialty65, specialty66, specialty67, specialty68, specialty69, specialty70, specialty71, specialty72, specialty73, specialty74, specialty75, specialty76, specialty77, specialty78, specialty79, specialty80, specialty81, specialty82, specialty83, specialty84, specialty85, specialty86, specialty87, specialty88, specialty89, specialty90, specialty91, specialty92, specialty93, specialty94 };
                hospital2.Specialties = new[] { specialty1, specialty2, specialty3, specialty4, specialty5, specialty6, specialty7, specialty8, specialty9, specialty10, specialty11, specialty12, specialty13, specialty14, specialty15, specialty16, specialty17, specialty18, specialty19, specialty20, specialty21, specialty22, specialty23, specialty24, specialty25, specialty26, specialty27, specialty28, specialty29, specialty30, specialty31, specialty32, specialty33, specialty34, specialty35, specialty36, specialty37, specialty38, specialty39, specialty40, specialty41, specialty42, specialty43, specialty44, specialty45, specialty46, specialty47, specialty48, specialty49, specialty50, specialty51, specialty52, specialty53, specialty54, specialty55, specialty56, specialty57, specialty58, specialty59, specialty60, specialty61, specialty62, specialty63, specialty64, specialty65, specialty66, specialty67, specialty68, specialty69, specialty70, specialty71, specialty72, specialty73, specialty74, specialty75, specialty76, specialty77, specialty78, specialty79, specialty80, specialty81, specialty82, specialty83, specialty84, specialty85, specialty86, specialty87, specialty88, specialty89, specialty90, specialty91, specialty92, specialty93, specialty94 };
                hospital3.Specialties = new[] { specialty1, specialty2, specialty3, specialty4, specialty5, specialty6, specialty7, specialty8, specialty9, specialty10, specialty11, specialty12, specialty13, specialty14, specialty15, specialty16, specialty17, specialty18, specialty19, specialty20, specialty21, specialty22, specialty23, specialty24, specialty25, specialty26, specialty27, specialty28, specialty29, specialty30, specialty31, specialty32, specialty33, specialty34, specialty35, specialty36, specialty37, specialty38, specialty39, specialty40, specialty41, specialty42, specialty43, specialty44, specialty45, specialty46, specialty47, specialty48, specialty49, specialty50, specialty51, specialty52, specialty53, specialty54, specialty55, specialty56, specialty57, specialty58, specialty59, specialty60, specialty61, specialty62, specialty63, specialty64, specialty65, specialty66, specialty67, specialty68, specialty69, specialty70, specialty71, specialty72, specialty73, specialty74, specialty75, specialty76, specialty77, specialty78, specialty79, specialty80, specialty81, specialty82, specialty83, specialty84, specialty85, specialty86, specialty87, specialty88, specialty89, specialty90, specialty91, specialty92, specialty93, specialty94 };
                hospital4.Specialties = new[] { specialty1, specialty2, specialty3, specialty4, specialty5, specialty6, specialty7, specialty8, specialty9, specialty10, specialty11, specialty12, specialty13, specialty14, specialty15, specialty16, specialty17, specialty18, specialty19, specialty20, specialty21, specialty22, specialty23, specialty24, specialty25, specialty26, specialty27, specialty28, specialty29, specialty30, specialty31, specialty32, specialty33, specialty34, specialty35, specialty36, specialty37, specialty38, specialty39, specialty40, specialty41, specialty42, specialty43, specialty44, specialty45, specialty46, specialty47, specialty48, specialty49, specialty50, specialty51, specialty52, specialty53, specialty54, specialty55, specialty56, specialty57, specialty58, specialty59, specialty60, specialty61, specialty62, specialty63, specialty64, specialty65, specialty66, specialty67, specialty68, specialty69, specialty70, specialty71, specialty72, specialty73, specialty74, specialty75, specialty76, specialty77, specialty78, specialty79, specialty80, specialty81, specialty82, specialty83, specialty84, specialty85, specialty86, specialty87, specialty88, specialty89, specialty90, specialty91, specialty92, specialty93, specialty94 };
                hospital5.Specialties = new[] { specialty1, specialty2, specialty3, specialty4, specialty5, specialty6, specialty7, specialty8, specialty9, specialty10, specialty11, specialty12, specialty13, specialty14, specialty15, specialty16, specialty17, specialty18, specialty19, specialty20, specialty21, specialty22, specialty23, specialty24, specialty25, specialty26, specialty27, specialty28, specialty29, specialty30, specialty31, specialty32, specialty33, specialty34, specialty35, specialty36, specialty37, specialty38, specialty39, specialty40, specialty41, specialty42, specialty43, specialty44, specialty45, specialty46, specialty47, specialty48, specialty49, specialty50, specialty51, specialty52, specialty53, specialty54, specialty55, specialty56, specialty57, specialty58, specialty59, specialty60, specialty61, specialty62, specialty63, specialty64, specialty65, specialty66, specialty67, specialty68, specialty69, specialty70, specialty71, specialty72, specialty73, specialty74, specialty75, specialty76, specialty77, specialty78, specialty79, specialty80, specialty81, specialty82, specialty83, specialty84, specialty85, specialty86, specialty87, specialty88, specialty89, specialty90, specialty91, specialty92, specialty93, specialty94 };

                Console.WriteLine("Persisting UOW to DB...");
                var specialties = new List <Specialty> {
                    specialty1, specialty2, specialty3, specialty4, specialty5, specialty6, specialty7, specialty8, specialty9, specialty10, specialty11, specialty12, specialty13, specialty14, specialty15, specialty16, specialty17, specialty18, specialty19, specialty20, specialty21, specialty22, specialty23, specialty24, specialty25, specialty26, specialty27, specialty28, specialty29, specialty30, specialty31, specialty32, specialty33, specialty34, specialty35, specialty36, specialty37, specialty38, specialty39, specialty40, specialty41, specialty42, specialty43, specialty44, specialty45, specialty46, specialty47, specialty48, specialty49, specialty50, specialty51, specialty52, specialty53, specialty54, specialty55, specialty56, specialty57, specialty58, specialty59, specialty60, specialty61, specialty62, specialty63, specialty64, specialty65, specialty66, specialty67, specialty68, specialty69, specialty70, specialty71, specialty72, specialty73, specialty74, specialty75, specialty76, specialty77, specialty78, specialty79, specialty80, specialty81, specialty82, specialty83, specialty84, specialty85, specialty86, specialty87, specialty88, specialty89, specialty90, specialty91, specialty92, specialty93, specialty94
                };
                foreach (var specialty in specialties)
                {
                    var existingSpecialty = unitOfWork.Specialties.FirstOrDefault(s => s.Code == specialty.Code);
                    if (existingSpecialty != null)
                    {
                        unitOfWork.Specialties.Remove(existingSpecialty);
                    }
                    unitOfWork.Specialties.Add(specialty);
                }

                unitOfWork.SaveChanges();
                Console.WriteLine("Done adding hospitals and specialties!");
            }
        }
Example #31
0
        private bool cachmoi()
        {
            //add lại danh mục cũ thay mã mới
            dataContext = new Hospital();
            List <NhomDV> _lnhom = new List <NhomDV>();

            _lnhom = dataContext.NhomDVs.ToList();

            foreach (var item in _lnhom)
            {
                int idcu  = item.IDNhom;
                int idmoi = 0;
                for (int j = 20; j < 100; j++)
                {
                    if (dataContext.NhomDVs.Where(p => p.IDNhom == j).ToList().Count <= 0)
                    {
                        idmoi = j;
                        break;
                    }
                }
                var kt = (from a in Vssoft.Data.Common.NhomDVQD
                          where a.IDNhom == item.IDNhom && item.TenNhomCT == a.TenNhomCT
                          select new { IDNhom_moi = a.IDNhom, item.IDNhom }).ToList();
                if (kt.Count <= 0)
                {
                    NhomDV moi = new NhomDV();
                    moi.IDNhom    = idmoi;
                    moi.TenNhom   = item.TenNhom;
                    moi.TenNhomCT = item.TenNhomCT;
                    moi.Status    = item.Status;
                    moi.STT       = item.STT;
                    dataContext.NhomDVs.Add(moi);
                    dataContext.SaveChanges();
                    _thaythe(idcu, idmoi);
                    var xoa = dataContext.NhomDVs.Single(p => p.IDNhom == idcu);
                    dataContext.NhomDVs.Remove(xoa);
                    dataContext.SaveChanges();
                }
            }
            // add mã theo CV9324
            dataContext = new Hospital();
            foreach (var item in Vssoft.Data.Common.NhomDVQD)
            {
                var kt = dataContext.NhomDVs.Where(p => p.TenNhomCT == item.TenNhomCT).ToList();
                if (kt.Count <= 0)
                {
                    NhomDV moi = new NhomDV();
                    moi.IDNhom    = item.IDNhom;
                    moi.TenNhom   = item.TenNhom;
                    moi.TenNhomCT = item.TenNhomCT;
                    moi.Status    = item.Status;
                    moi.STT       = item.STT;
                    dataContext.NhomDVs.Add(moi);
                    dataContext.SaveChanges();
                }
            }
            //update
            dataContext = new Hospital();
            var nhom = dataContext.NhomDVs.ToList();
            var ds   = (from a in Vssoft.Data.Common.NhomDVQD
                        join b in nhom on a.Tennhomcu equals b.TenNhomCT
                        select new { IDNhom_moi = a.IDNhom, b.IDNhom }).ToList();

            foreach (var item in ds)
            {
                _thaythe(item.IDNhom, item.IDNhom_moi);
                var xoa = dataContext.NhomDVs.Single(p => p.IDNhom == item.IDNhom);
                dataContext.NhomDVs.Remove(xoa);
                dataContext.SaveChanges();
            }

            dataContext = new Hospital();
            var nhom2 = dataContext.NhomDVs.ToList();
            var ds2   = (from a in Vssoft.Data.Common.NhomDVQD
                         join b in nhom2 on a.TenNhomCT equals b.TenNhomCT
                         where a.IDNhom != b.IDNhom
                         select new { IDNhom_moi = a.IDNhom, b.IDNhom }).ToList();

            foreach (var item in ds2)
            {
                _thaythe(item.IDNhom, item.IDNhom_moi);
                var xoa = dataContext.NhomDVs.Single(p => p.IDNhom == item.IDNhom);
                dataContext.NhomDVs.Remove(xoa);
                dataContext.SaveChanges();
            }
            return(true);
        }
Example #32
0
        public void Run()
        {
            Hospital hospital = new Hospital();
            string   command;

            while ((command = Console.ReadLine()) != "Output")
            {
                string[] tokens         = command.Split();
                string   departmentName = tokens[0];
                string   doctorName     = $"{tokens[1]} {tokens[2]}";
                string   patientName    = tokens[3];

                if (!(hospital.Departments.Any(n => n.Name == departmentName)))
                {
                    Department department = new Department(departmentName);
                    hospital.AddDepartment(department);
                }

                if (!(hospital.Doctors.Any(n => n.Name == doctorName)))
                {
                    Doctor doctor = new Doctor(doctorName);
                    hospital.AddDoctor(doctor);
                }

                Patient patient = new Patient(patientName);

                hospital.Departments.FirstOrDefault(n => n.Name == departmentName)
                .AddPatientToDepartment(patient);
                if (patient.Status == "Added")
                {
                    hospital.Doctors.FirstOrDefault(n => n.Name == doctorName).AddPatient(patient);
                }
            }

            while ((command = Console.ReadLine()) != "End")
            {
                string[] tokens = command.Split();

                if (tokens.Length == 1)
                {
                    string departmentName = tokens[0];
                    foreach (var department in hospital.Departments.Where(n => n.Name == departmentName))
                    {
                        foreach (var room in department.Rooms)
                        {
                            foreach (var patient in room.Patients)
                            {
                                Console.WriteLine(patient.Name);
                            }
                        }
                    }
                }
                else
                {
                    if (int.TryParse(tokens[1], out int result))
                    {
                        string departmentName = tokens[0];
                        int    roomNumber     = int.Parse(tokens[1]);

                        foreach (var department in hospital.Departments.Where(n => n.Name == departmentName))
                        {
                            foreach (var room in department.Rooms.Where(r => r.Number == roomNumber))
                            {
                                foreach (var patient in room.Patients.OrderBy(p => p.Name))
                                {
                                    Console.WriteLine(patient.Name);
                                }
                            }
                        }
                    }
                    else
                    {
                        foreach (var doctor in hospital.Doctors.Where(d => d.Name == command.TrimEnd()))
                        {
                            foreach (var patient in doctor.Patients.OrderBy(p => p.Name))
                            {
                                Console.WriteLine(patient.Name);
                            }
                        }
                    }
                }
            }
        }
Example #33
0
 public bool HospitalUpdateSuccess(Hospital h)
 {
     this.hospital = h;
     onHospitalRatingUpdateSuccess();
     return(true);
 }
Example #34
0
 public void CreateHospital(Hospital hospital)
 {
     Db.Hospitals.Add(hospital);
     Db.SaveChanges();
 }
        /// <summary>
        /// Write patients in the CSV file.
        /// </summary>
        public static void WritePatientToCSV(Hospital hospital, ICollection <Patient> patients)
        {
            if (patients == null)
            {
                return;
            }
            foreach (var obj in patients)
            {
                StringBuilder sb   = new StringBuilder();
                var           line = hospital.Name + "; "; //Doctor's Hospital Name
                foreach (var prop in typeof(Patient).GetProperties())
                {
                    if (prop.Name == "Address")
                    {
                        foreach (var propaux in typeof(Address).GetProperties())
                        {
                            line += propaux.GetValue(obj.Address, null) + "; ";
                        }
                        continue;
                    }
                    if (prop.Name == "Doctors")
                    {
                        foreach (var doctor in obj.Doctors)
                        {
                            line += doctor.IdentityCard + ", ";
                        }
                        line += "; ";
                        continue;
                    }
                    if (prop.Name == "Diseases")
                    {
                        foreach (var disease in obj.Diseases)
                        {
                            line += disease.Name.ToString() + ", ";
                        }
                        line += "; ";
                        continue;
                    }
                    if (prop.Name == "Room")
                    {
                        line += obj.Room.Number.ToString() + "; ";
                        continue;
                    }
                    if (prop.Name == "Notes")
                    {
                        continue;
                    }

                    line += prop.GetValue(obj, null).ToString() + "; ";
                }
                line = line.Substring(0, line.Length - 2);
                sb.AppendLine(line);

                try
                {
                    TextWriter sw = new StreamWriter(patientPath, true);
                    sw.Write(sb.ToString());
                    sw.Close();
                } catch (IOException e)
                {
                    Console.WriteLine(e.Message);
                }
            }
        }
Example #36
0
 public void Update(Hospital hospital)
 {
     this.hospitals.Update(hospital);
     this.hospitals.SaveChanges();
 }
Example #37
0
 public override void AddInteractions(InteractionObjectPair iop, Sim actor, Hospital target, List<InteractionObjectPair> results)
 {
     string parent = Localization.LocalizeString(actor.IsFemale, "Gameplay/Objects/RabbitHoles/Hospital/CreateBabyWith:InteractionName", new object[] { Hospital.CreateBabyWith.kCostOfBabyMaking });
     results.Add(new InteractionObjectPair(new Definition(parent, Localization.LocalizeString(actor.IsFemale, "Gameplay/Objects/RabbitHoles/Hospital/CreateBabyWith:Customize", new object[0]), true), iop.Target));
     results.Add(new InteractionObjectPair(new Definition(parent, Localization.LocalizeString(actor.IsFemale, "Gameplay/Objects/RabbitHoles/Hospital/CreateBabyWith:Randomize", new object[0]), false), iop.Target));
 }
 public void Add(Hospital hospital)
 {
     this.hospitals.Add(hospital);
     this.hospitals.SaveChanges();
 }
Example #39
0
 public override bool Test(Sim a, Hospital target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
 {
     if ((a.IsRobot || a.OccultManager.HasOccultType(OccultTypes.Mummy)) || a.OccultManager.HasOccultType(OccultTypes.PlantSim))
     {
         return false;
     }
     if (a.FamilyFunds < Hospital.CreateBabyWith.kCostOfBabyMaking)
     {
         greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(LocalizationHelper.InsufficientFunds);
         return false;
     }
     /*
     if (!a.SimDescription.Household.CanAddSpeciesToHousehold(CASAgeGenderFlags.None | CASAgeGenderFlags.Human, 1, true))
     {
         greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString(a.IsFemale, "Gameplay/Objects/RabbitHoles/Hospital/CreateBabyWith:HouseholdFull", new object[0]));
         return false;
     }
      */
     if (this.GetSims(a).Count == 0)
     {
         greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString(a.IsFemale, "Gameplay/Objects/RabbitHoles/Hospital/CreateBabyWith:NoFriendsNearBy", new object[0]));
         return false;
     }
     if ((a.CurrentInteraction == null) || (!a.InteractionQueue.HasInteractionOfType(this) && !a.InteractionQueue.HasInteractionOfType(Hospital.BeForcedToMakeBabyWith.Singleton)))
     {
         return true;
     }
     greyedOutTooltipCallback = InteractionInstance.CreateTooltipCallback(Localization.LocalizeString(a.IsFemale, "Gameplay/Objects/RabbitHoles/Hospital/CreateBabyWith:HaveToWait", new object[0]));
     return false;
 }
 public void Update(Hospital hospital)
 {
     this.hospitals.Update(hospital);
     this.hospitals.SaveChanges();
 }
Example #41
0
 ////////////////////////////////////////////////////////////////////////
 // Name:       Hospital::Hospital(const Hospital& oldHospital)
 // Purpose:    Implementation of Hospital::Hospital()
 // Parameters:
 // - oldHospital
 // Return:
 ////////////////////////////////////////////////////////////////////////
 public Hospital(Hospital oldHospital)
 {
     Console.Write("Copying constructor for Hospital has been launched.");
        Console.Write("\n");
       name = oldHospital.name;
 }
Example #42
0
 public override bool Test(Sim a, Hospital target, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
 {                
     return true;
 }
        /// <summary>
        /// Loads a form to the panel
        /// </summary>
        /// <param name="tag">The tag of the button - Here is stored what type of form is supposed to be opened</param>
        private void LoadForm(string tag)
        {
            var yEnd = new YearEnd();

            if (yEnd.InventoryRequired(false))
            {
                switch (VisibilitySetting.HandleUnits)
                {
                case 1:
                    yEnd.GenerateAutomaticInventory();
                    break;

                case 2:
                    yEnd.GenerateAutomaticInventoryByUnit();
                    break;

                case 3:
                    yEnd.GenerateAutomaticInventoryByUnit();
                    break;
                }
            }

            Form frm;

            switch (tag)
            {
            case "Receives":
                frm = new ReceivingForm();
                AddTab("Receiving Form", frm);
                break;

            case "Issues":
                frm = new IssueForm();
                AddTab("Issue Form", frm);
                break;

            case "AMCs":
                frm = new AMCView();
                AddTab("AMC Report", frm);
                break;

            case "menuItemPriceOnlyReport":
                frm = new ItemPriceOnlyReport();
                AddTab("Item Price Only", frm);
                break;

            case "stockoutindexer":
                frm = new StockOutIndicesBuilder();
                AddTab("Stockout Indices Builder", frm);
                break;

            case "Facility Settings":
                frm = new Hospital();
                AddTab("Facility Settings", frm);
                break;

            case "Drug List":
                frm = new ManageItems();
                AddTab("Manage Drug List", frm);
                break;

            case "Supplies List":
                //frm = new ManageItems();
                frm = new ManageSupplies();
                AddTab("Manage Supplies List", frm);
                break;

            case "Item Consolidator":
                //frm = new ManageItems();
                frm = new ItemConsolidator();
                AddTab("Update Items List From The Directory Service", frm);
                break;

            case "Customize Druglist":
                frm = new CustomDrugList();
                AddTab("Customize Drug List", frm);
                break;

            case "System Settings":
                frm = new SystemSetting();
                AddTab("System Settings", frm);
                break;

            case "Facility Details":
                frm = new HospitalSettings();
                AddTab("Facility Details", frm);
                break;

            case "User Accounts":
                frm = new UserAccounts();
                AddTab("Manage Users", frm);
                break;

            case "Pipeline":
                frm = new Pipeline();
                AddTab("Pipeline", frm);
                break;

            case "Change Password":
                frm = new ChangePassword(UserId);
                AddTab("Change Password", frm);
                break;
                break;

            case "Transfer Log":
                frm = new LogTransfer();
                AddTab("Transfer Log", frm);
                break;

            case "Losses/Adjustment":
                frm = new LossesAdjustment();
                AddTab("Losses and Adjustment", frm);
                break;

            case "Receive Log":
                frm = new LogReceive();
                AddTab("Receive Transaction Log", frm);
                break;

            case "Issue Log":
                frm = new LogIssues();
                AddTab("Issue Transaction Log", frm);
                break;

            case "Adjustment Log":
                frm = new LogAdjustment();
                AddTab("Loss / Adjustment Transaction Log", frm);
                break;

            case "Inventory Log":
                frm = new LogInventory();
                AddTab("Inventory Log", frm);
                break;

            case "Stock Status":
                frm = new ItemReport();
                AddTab("Stock Status", frm);
                break;

            case "Over Stocked":
                frm = new OtherItemReport("Over Stocked");
                AddTab("Over Stock Items", frm);
                break;

            case "Transfers":
                frm = new TransferForm();
                AddTab("Transfer Form", frm);
                break;

            case "Stock Out":
                frm = new OtherItemReport("Stock Out");
                AddTab("Stocked Out Items", frm);
                break;

            case "ConsumptionTrend":
                frm = new ConsumptionTrendReport();
                AddTab("Consumption Trend", frm);
                break;

            case "Issues By Receiving Unit":
                frm = new IssuesByDep();
                AddTab("Issues By Receiving Unit", frm);
                break;

            case "Expired Products":
                frm = new ExpiredProducts();
                AddTab("Expired Products", frm);
                break;

            case "Near Expiry":
                frm = new NearlyExpired();
                AddTab("Near Expiry Products", frm);
                break;

            case "SOH Trend":
                frm = new SOHTrend();
                AddTab("SOH Trend", frm);
                break;

            case "Receive Trend":
                frm = new ReceiveTrend();
                AddTab("Receive Trend", frm);
                break;

            case "Balance":
                frm = new BalanceReport();
                AddTab("Balance", frm);
                break;

            case "Summary Report":
                frm = new GeneralReport();
                AddTab("Summary Report", frm);
                break;

            case "Cost Summary":
                frm = new GeneralCostChart();
                AddTab("Cost Summary", frm);
                break;

            case "Summary Chart":
                frm = new GeneralChart();
                AddTab("General Chart", frm);
                break;

            case "ECLS":
                frm = new ECLS();
                AddTab("CS Stock Status", frm);
                break;

            case "Year End Process":
                frm = new YearEndProcess();
                AddTab("Inventory", frm);
                break;

            case "Default Year End Process":
                frm = new YearEndProcess(true);
                AddTab("Inventory", frm);
                break;

            case "Stock Expiry Status":
                frm = new GeneralExpiryChart();
                AddTab("Stock Expiry Status", frm);
                break;

            case "DataBase":
                frm = new DatabaseActions();
                AddTab("Database Actions", frm);
                break;

            case "PDA":
                frm = new ItemReport();
                AddTab("Stock Status", frm);
                break;

            case "Consumables List":
                frm = new ManageSupplies();
                AddTab("Supplies List", frm);
                break;

            case "RRF Form":
                frm = new RRFForm();
                AddTab("Report and Requisition Form", frm);
                break;

            case "LossReport":
                frm = new ExpiredProductsReport();
                AddTab("Loss / Adjustment Reporting View", frm);
                break;

            case "CostReport":
                frm = new CostReport();
                AddTab("Cost Report", frm);
                break;

            case "ConsumptionByUnit":
                frm = new ConsumptionByUnits();
                AddTab("Consumption By Dispensary Unit", frm);
                break;

            case "About":
                Program.ShowHCMISVersionInfoMessageBox();
                break;
            }
        }
Example #44
0
 public ICuartel crearCuartel()
 {
     return(Hospital.getInstance());
     // return new Hospital();
 }
Example #45
0
 public void DeleteHospital(Hospital hospital)
 {
     Db.Hospitals.Remove(hospital);
     Db.SaveChanges();
 }
 public ActionResult Delete(int id, Hospital hospital)
 {
     _hospitalService.Delete(hospital);
     _logger.LogInformation("The hospital was deleted!");
     return(RedirectToAction(nameof(Index)));
 }
Example #47
0
 public SpecimenType getSpecimenType(Hospital hospital, SetupTableData tableData)
 {
     return (hospital == Hospital.Strong)
        ?  new SpecimenType { extension = this.SpecimenExtension, diSpecimenType = tableData.DISpecimenTranslation.get(this.SpecimenType) }
        : new SpecimenType { extension = this.SpecimenExtensionHighland, diSpecimenType = tableData.DISpecimenTranslation.get(this.SpecimenTypeHighland) };
 }
Example #48
0
 static void Main(string[] args)
 {
     Hospital.Run();
 }
 public void Delete(Hospital hospital)
 {
     this.hospitals.Delete(hospital);
     this.hospitals.SaveChanges();
 }
Example #50
0
 public int AddHospital(Hospital entity)
 {
     entity.AddTime = TimeHelper.GetTime(entity.AddTime.ToString());
     entity.LastUpdateTime = TimeHelper.GetTime(entity.LastUpdateTime.ToString());
     return dal.AddEntity(entity);
 }
Example #51
0
 public override string GetInteractionName(Sim actor, Hospital target, InteractionObjectPair iop)
 {
     return base.GetInteractionName(actor, target, iop);
 }
        public ActionResult Create(Hospital objHospital, FormCollection f)
        {
            eCareSendEmail objsendEmail = new eCareSendEmail();
            bool           isSent       = false;
            String         fileName     = Server.MapPath("~/App_Data/hospitalCredentialEmail.txt");

            if (ModelState.IsValid)
            {
                HttpFileCollectionBase file = Request.Files;
                string HospitalLogoo        = Path.GetFileName(file[0].FileName);
                if (Request.Files["Filebutton"] != null && Request.Files["Filebutton"].ContentLength > 0)

                {
                    string path = Path.Combine(Server.MapPath(ConfigurationManager.AppSettings["HospitalLogoPath"].ToString()), HospitalLogoo);
                    HospitalLogoo = Path.GetFileName(Request.Files["Filebutton"].FileName);
                    Request.Files["Filebutton"].SaveAs(path);
                }
                SqlConnection con = new SqlConnection(cs);
                try
                {
                    con.Open();
                    SqlCommand cmd = new SqlCommand("pInsertHospitalMaster", con)
                    {
                        CommandType = CommandType.StoredProcedure
                    };
                    cmd.Parameters.AddWithValue("@HospitalName", objHospital.HospitalName);
                    cmd.Parameters.AddWithValue("@HospitalAddress", objHospital.HospitalAddress);
                    cmd.Parameters.AddWithValue("@HospitalCity", objHospital.HospitalCity);
                    cmd.Parameters.AddWithValue("@HospitalState", objHospital.HospitalState);
                    cmd.Parameters.AddWithValue("@HospitalCountry", objHospital.HospitalCountry);
                    cmd.Parameters.AddWithValue("@HospitalPhone", objHospital.HospitalPhone);
                    cmd.Parameters.AddWithValue("@HospitalEmail", objHospital.HospitalEmail);
                    cmd.Parameters.AddWithValue("@HospitalLogo", HospitalLogoo);

                    //if (objHospital.HospitalLogo != null && objHospital.HospitalLogo.ContentLength > 0)
                    //{

                    //    string FileName = Path.GetFileName(objHospital.HospitalLogo.FileName);
                    //    FileName = DateTime.Now.ToString("yyyyMMdd") + "-" + FileName;
                    //    string UploadPath = Path.Combine(Server.MapPath(ConfigurationManager.AppSettings["HospitalLogoPath"].ToString()), FileName);
                    //    objHospital.HospitalLogo.SaveAs(UploadPath);
                    //    cmd.Parameters.AddWithValue("@HospitalLogo", (DateTime.Now.ToString("yyyyMMdd") + "-" + objHospital.HospitalLogo.FileName));
                    //}
                    cmd.Parameters.AddWithValue("@IsActive", objHospital.IsActive);
                    cmd.Parameters.AddWithValue("@EntryDateTime", DateTime.Now);
                    cmd.Parameters.AddWithValue("@EntryBy", objHospital.EntryBy);
                    //password generate
                    string pass = generatePassword.CreateRandomPassword(10);

                    objHospital.Password = pass;
                    cmd.Parameters.AddWithValue("@HospitalPassword", objHospital.Password);
                    int i = cmd.ExecuteNonQuery();

                    if (i >= 1)
                    {
                        ViewBag.SuccessMessage = "success";
                        isSent = objsendEmail.SendEmail(objHospital.HospitalEmail, objHospital.HospitalName, objHospital.Password, fileName);
                    }
                    else
                    {
                        ViewBag.ErrorMessage = "Email Already Exist,Please Try Different Email";
                    }

                    ModelState.Clear();
                    return(RedirectToAction("Index", "HospitalMaster"));
                }

                catch (SqlException ex)
                {
                    TempData["Message"]  = "'EMAIL' already exists. Enter a different one.";
                    ViewBag.ErrorMessage = "Email Already Exist,Please Try Different Email";
                }
                finally
                {
                    con.Close();
                }
                ModelState.Clear();
            }
            return(View());
        }
Example #53
0
 partial void InsertHospital(Hospital instance);
Example #54
0
        public async Task AddHospitalAsync(Hospital hospital)
        {
            await _context.Hospitals.AddAsync(SqlHospital.FromDomain(hospital));

            await _context.SaveChangesAsync();
        }
Example #55
0
 partial void DeleteHospital(Hospital instance);
Example #56
0
 private void frm_UpdateGiaDV_Load(object sender, EventArgs e)
 {
     _data = new Hospital();
     TimKiem("");
 }
Example #57
0
 public void Update(Hospital hospital)
 {
     DbOperations.ExecuteCommand(_context.CONNECTION_STRING, "dbo.Hospitals_Update", hospital.GenerateSqlParametersFromModel().ToArray());
 }
Example #58
0
 public AliquotForm(SetupTableData setupTableData, GetSqlServer getSqlServer, Hospital hospital)
     : base(setupTableData, getSqlServer, hospital)
 {
     InitializeComponent();
 }
Example #59
0
 public void InitializeHospital()
 {
     Hospital.InitializeData();
 }
Example #60
-1
 public bool AddHospital(Hospital hospital)
 {
     try
     {
         entities.Hospitals.Add(hospital);
         entities.SaveChanges();
         return true;
     }
     catch (Exception x)
     {
         FileLogger.LogError(x); return false;
     }
 }