コード例 #1
0
 public MainForm()
 {
     InitializeComponent();
     currentPriorityPos = new Point();
     config             = HospitalConfig.getInstance();
     initDtgPriority();
     initDtgTime();
     initQuantityProfessional();
     initNumberPatient();
 }
コード例 #2
0
ファイル: Hosp.cs プロジェクト: k-matsuda-85/dev-P-PC
        public static bool SetHospConfig(HospitalConfig hospconf)
        {
            bool ret = false;

            // DB接続
            using (var con = new AccDbConnection(Conf._settings))
            {
                ret = setHospConfig(con, hospconf);
            }

            return(ret);
        }
コード例 #3
0
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            // Geographic Entities
            ContinentConfig.SetEntityBuilder(modelBuilder.Entity <Continent>());
            CountryConfig.SetEntityBuilder(modelBuilder.Entity <Country>());
            RegionConfig.SetEntityBuilder(modelBuilder.Entity <Region>());


            // Administrative Entities
            AdminConfig.SetEntityBuilder(modelBuilder.Entity <Admin>());
            EventConfig.SetEntityBuilder(modelBuilder.Entity <Event>());

            // Measures Entities
            SanitaryMeasureConfig.SetEntityBuilder(modelBuilder.Entity <SanitaryMeasure>());
            ContainmentMeasureConfig.SetEntityBuilder(modelBuilder.Entity <ContainmentMeasure>());
            CmByCountry.SetEntityBuilder(modelBuilder.Entity <CountryContainmentMeasures>());
            SmByCountry.SetEntityBuilder(modelBuilder.Entity <CountrySanitaryMeasures>());

            // Hospital Entities
            HospitalConfig.SetEntityBuilder(modelBuilder.Entity <Hospital>());
            HEmployeeConfig.SetEntityBuilder(modelBuilder.Entity <HospitalEmployee>());
            MedicationConfig.SetEntityBuilder(modelBuilder.Entity <Medication>());

            // Person Entities
            PatientConfig.SetEntityBuilder(modelBuilder.Entity <Patient>());
            P_MedicationConfig.SetEntityBuilder(modelBuilder.Entity <PatientMedications>());
            Pt_PathologyConfig.SetEntityBuilder(modelBuilder.Entity <PatientPathologies>());
            PersonConfig.SetEntityBuilder(modelBuilder.Entity <ContactedPerson>());
            Ps_PathologyConfig.SetEntityBuilder(modelBuilder.Entity <PersonPathologies>());
            ContactsByPatientConfig.SetEntityBuilder(modelBuilder.Entity <PersonsContactedByPatient>());

            // Not related Entities
            PathologiesConfig.SetEntityBuilder(modelBuilder.Entity <Pathology>());
            Pharm_CompanyConfig.SetEntityBuilder(modelBuilder.Entity <PharmaceuticalCompany>());
            StatusConfig.SetEntityBuilder(modelBuilder.Entity <PatientStatus>());

            // Views and Stored Procedures
            modelBuilder.Entity <PatientView>().HasNoKey().ToView(null);
            modelBuilder.Entity <ExportPatient>().HasNoKey().ToView(null);
            modelBuilder.Entity <CasesView>().HasNoKey().ToView(null);
            modelBuilder.Entity <ReportView>().HasNoKey().ToView(null);
            modelBuilder.Entity <MeasureView>().HasNoKey().ToView(null);
            modelBuilder.Entity <MedicationView>().HasNoKey().ToView(null);
            modelBuilder.Entity <PatientMedicationView>().HasNoKey().ToView(null);
            modelBuilder.Entity <PathologyView>().HasNoKey().ToView(null);
            modelBuilder.Entity <ContactView>().HasNoKey().ToView(null);
        }
コード例 #4
0
ファイル: Hosp.cs プロジェクト: k-matsuda-85/dev-P-PC
        public static HospitalConfig GetHospConfig(int id)
        {
            HospitalConfig ret = new HospitalConfig();

            // DB接続
            using (var con = new AccDbConnection(Conf._settings))
            {
                ret = getHospConfig(con, id);

                if (ret.Conf.Length == 0)
                {
                    ret = getHospConfig(con, 0);
                }
            }

            return(ret);
        }
コード例 #5
0
ファイル: Hosp.cs プロジェクト: k-matsuda-85/dev-P-PC
        private static HospitalConfig getHospConfig(AccDbConnection con, int id)
        {
            HospitalConfig ret   = new HospitalConfig();
            List <Config>  confs = new List <Config>();

            // コマンドオブジェクト生成
            using (var cmd = con.CreateCommand())
            {
                // SQL生成
                // ----------------------------
                // SELECT key,value
                // FROM HospConfig
                // WHERE hosp_id=id
                // ----------------------------
                StringBuilder selSQL = new StringBuilder();
                selSQL.Append("SELECT");
                selSQL.Append(" key");
                selSQL.Append(",value");
                selSQL.Append(" FROM");
                selSQL.Append(" HospConfig");
                selSQL.Append(" WHERE");
                selSQL.Append(" hosp_id=");
                selSQL.Append(cmd.Add(id).ParameterName);

                cmd.CommandText = selSQL.ToString();

                // SQL実行
                using (var dr = cmd.ExecuteReader())
                    // 該当データがある場合、返却値を設定
                    while (dr.Read())
                    {
                        Config tmpConf = new Config();
                        tmpConf.Key = dr["key"].ToString();
                        if (dr["value"] != DBNull.Value)
                        {
                            tmpConf.Value = dr["value"].ToString();
                        }

                        confs.Add(tmpConf);
                    }
            }

            ret.Conf = confs.ToArray();

            return(ret);
        }
コード例 #6
0
        /// <summary>
        /// 施設毎の設定更新
        /// </summary>
        /// <param name="hosconf">施設設定クラス</param>
        /// <returns>処理結果クラス</returns>
        public ResultData SetHospConfig_Serv(HospitalConfig hosconf)
        {
            var ret = new ResultData();

            try
            {
                // 施設設定更新メソッド呼び出し(内部関数)
                ret.Result = Hosp.SetHospConfig(hosconf);
            }
            catch (Exception e)
            {
                LogControl.WriteLog(LogType.ERR, "SetHospConfig_Serv", e.Message);
                ret.Message = e.Message;
            }

            return(ret);
        }
コード例 #7
0
        /// <summary>
        /// 施設設定情報取得
        /// </summary>
        /// <param name="id">施設ID</param>
        /// <param name="hosCon">o:施設設定クラス</param>
        /// <returns>処理結果クラス</returns>
        public ResultData GetHospConf_Serv(int id, out HospitalConfig hosCon)
        {
            var ret = new ResultData();

            hosCon = new HospitalConfig();

            try
            {
                // 施設設定情報取得メソッド呼び出し(内部関数)
                hosCon = Hosp.GetHospConfig(id);

                ret.Result = true;
            }
            catch (Exception e)
            {
                LogControl.WriteLog(LogType.ERR, "GetHospConf_Serv", e.Message);
                ret.Message = e.Message;
            }

            return(ret);
        }
コード例 #8
0
ファイル: AzureRepository.cs プロジェクト: ihtnc/Bittn
 public AzureRepository(IOptions <HospitalConfig> options, IApiClient apiClient, IApiRequestProvider requestProvider)
 {
     _config          = options.Value ?? throw new InvalidOperationException("Missing config.");
     _apiClient       = apiClient;
     _requestProvider = requestProvider;
 }
コード例 #9
0
ファイル: Hosp.cs プロジェクト: k-matsuda-85/dev-P-PC
        private static bool setHospConfig(AccDbConnection con, HospitalConfig hospconf)
        {
            bool ret = false;

            Config[] conf = hospconf.Conf;

            using (var cmd = con.CreateCommand())
            {
                StringBuilder delSQL = new StringBuilder();
                delSQL.Append("DELETE");
                delSQL.Append(" FROM");
                delSQL.Append(" HospConfig");

                delSQL.Append(" WHERE");
                delSQL.Append(" hosp_id=");
                delSQL.Append(cmd.Add(hospconf.HospID).ParameterName);
                delSQL.Append(" AND");
                delSQL.Append(" key IN (");

                for (int i = 0; i < conf.Length; i++)
                {
                    if (i > 0)
                    {
                        delSQL.Append(',');
                    }

                    delSQL.Append(cmd.Add(conf[i].Key).ParameterName);
                }

                delSQL.Append(")");

                cmd.CommandText = delSQL.ToString();

                cmd.ExecuteNonQuery();
            }

            // コマンドオブジェクト生成
            using (var cmd = con.CreateCommand())
            {
                StringBuilder insSQL = new StringBuilder();
                insSQL.Append("INSERT");
                insSQL.Append(" INTO");
                insSQL.Append(" HospConfig");

                insSQL.Append(" (");
                insSQL.Append(" hosp_id");
                insSQL.Append(",key");
                insSQL.Append(",value");
                insSQL.Append(" )");

                insSQL.Append(" VALUES");

                for (int i = 0; i < conf.Length; i++)
                {
                    if (i > 0)
                    {
                        insSQL.Append(",");
                    }

                    insSQL.Append(" (");
                    insSQL.Append(cmd.Add(hospconf.HospID).ParameterName);
                    insSQL.Append(",");
                    insSQL.Append(cmd.Add(conf[i].Key).ParameterName);
                    insSQL.Append(",");
                    insSQL.Append(cmd.Add(conf[i].Value).ParameterName);
                    insSQL.Append(" )");
                }

                cmd.CommandText = insSQL.ToString();

                var retcnt = cmd.ExecuteNonQuery();
                if (retcnt > 0)
                {
                    ret = true;
                }
            }

            return(ret);
        }