Exemple #1
0
 public PSSeries(DbDataReader reader) : base(reader)
 {
     IntSerID     = (uint)reader["IntSerID"];
     IntStuID     = (uint)reader["IntStuID"];
     SerSizeKB    = (uint)reader["SerSizeKB"];
     LastUsedTime = PSDatabase.GetDateTimeFromDbDatetime(reader["LastUsedTime"]);
 }
Exemple #2
0
 public PSStudySnapshot(DbDataReader reader)
 {
     StuInstID    = (string)reader["StuInstID"];
     StuDateTime  = PSDatabase.GetDateTimeFromDbDateAndTimeStrings(reader["StuDate"].ToString(), reader["StuTime"].ToString());
     AccessionNum = (string)reader["AccessionNum"];
     Modality     = (string)reader["Modality"];
     StuDesc      = (string)reader["StuDesc"];
 }
Exemple #3
0
 public PSSeriesSnapshot(DbDataReader reader)
 {
     SerInstID   = (string)reader["SerInstID"];
     NumImages   = Convert.ToInt32(reader["SeriesNumImages"]);
     SerDateTime = PSDatabase.GetDateTimeFromDbDateAndTimeStrings(reader["SerDate"].ToString(), reader["SerTime"].ToString());
     SerNum      = Convert.ToInt32(reader["SerNum"]);
     Modality    = (string)reader["Modality"];
     SerDesc     = (string)reader["SerDesc"];
     BodyPart    = (string)reader["BodyPart"];
 }
Exemple #4
0
 public PSImage(DbDataReader reader)
 {
     ImaInstID        = (string)reader["ImaInstID"];
     IntSerID         = Convert.ToUInt32(reader["IntSerID"]);
     SOPClassID       = (string)reader["SOPClassID"];
     TransferSyntaxID = (string)reader["TransferSyntaxID"];
     ImaNum           = Convert.ToUInt32(reader["ImaNum"]);
     FileSizeKB       = Convert.ToUInt32(reader["FileSizeKB"]);
     Path             = (string)reader["Path"];
     SendingAE        = (string)reader["SendingAE"];
     LastUsedTime     = PSDatabase.GetDateTimeFromDbDatetime(reader["LastUsedTime"]);
 }
Exemple #5
0
 public PSPatient(DbDataReader reader)
 {
     IntPatID     = Convert.ToInt32(reader["IntPatID"]);
     PatID        = (string)reader["PatID"];
     PatName      = (string)reader["PatName"];
     PatBirthDate = PSDatabase.GetDateTimeFromDbDateAndTimeStrings(reader["PatBirthDate"].ToString());
     PatSex       = (string)reader["PatSex"];
     NumStudies   = Convert.ToInt32(reader["NumStudies"]);
     NumSeries    = Convert.ToInt32(reader["PatientsNumSeries"]);
     NumImages    = Convert.ToInt32(reader["PatientsNumImages"]);
     PatSizeKB    = Convert.ToSingle(reader["PatSizeKB"]);
     LastUsedTime = PSDatabase.GetDateTimeFromDbDatetime(reader["LastUsedTime"]);
 }
Exemple #6
0
 public PSStudy(DbDataReader reader) : base(reader)
 {
     IntStuID     = Convert.ToInt32(reader["IntStuID"]);
     IntPatID     = Convert.ToInt32(reader["IntPatID"]);
     PatID        = (string)reader["PatID"];
     NumSeries    = Convert.ToInt32(reader["StudiesNumSeries"]);
     NumImages    = Convert.ToInt32(reader["StudiesNumImages"]);
     StuSizeKB    = Convert.ToInt32(reader["StuSizeKB"]);
     StuID        = (string)reader["StuID"];
     RefPhysician = (string)reader["RefPhysician"];
     DeptName     = (string)reader["DeptName"];
     LastUsedTime = PSDatabase.GetDateTimeFromDbDatetime(reader["LastUsedTime"]);
 }
Exemple #7
0
        public DicomServer(ILogger logger, PSDatabase db, string tildePathReplace = null)
        {
            this._logger           = logger;
            this._db               = db;
            this._tildePathReplace = tildePathReplace;

            this._listener = new DICOMListener(this._logger, false);

            this._listener.StoreRequest       += new DICOMListener.StoreRequestHandler(listener_StoreRequest);
            this._listener.AssociationRequest += new DICOMListener.BasicConnectionHandler(listener_AssociationRequest);
            this._listener.FindRequest        += new DICOMListener.QRRequestHandler(listener_FindRequest);
            this._listener.GetRequest         += new DICOMListener.QRRequestHandler(listener_GetRequest);
            this._listener.MoveRequest        += new DICOMListener.QRRequestHandler(listener_MoveRequest);
            this._listener.EntityLookup       += new DICOMListener.EntityLookupHandler(listener_EntityLookup);
        }
Exemple #8
0
        public static PSDatabase GetDb()
        {
            lock (_lockObj)
            {
                if (_db != null)
                {
                    return(_db);
                }

                var serverSettings = (NameValueCollection)ConfigurationManager.GetSection("serverSettings");
                if (serverSettings == null)
                {
                    throw new Exception("serverSettings field missing -- ensure your WebUser.config is setup properly");
                }

                var dbSettings = new DatabaseSettings();

                if (!Enum.TryParse(serverSettings["DatabaseType"], out dbSettings.DBType))
                {
                    throw new ArgumentException("Unknown DatabaseType: " + serverSettings["DatabaseType"]);
                }

                dbSettings.SQLitePath = serverSettings["DatabaseSqlitePath"] ?? "";
                if (dbSettings.SQLitePath.StartsWith(@"~/"))
                {
                    dbSettings.SQLitePath = HttpContext.Current.Server.MapPath(dbSettings.SQLitePath);
                }

                if (dbSettings.DBType != PSDatabase.DBType.SQLite)
                {
                    dbSettings.Hostname = serverSettings["DatabaseServer"];
                    dbSettings.Username = serverSettings["DatabaseUsername"];
                    dbSettings.DBName   = serverSettings["DatabaseName"];
                }

                dbSettings.Password = serverSettings["DatabasePassword"] ?? "";

                var db = new PSDatabase(GetLogger(), HttpContext.Current.Server.MapPath(@"~/"));
                db.UseSettings(dbSettings);

                // If we get this far without an exception then we connected
                _db = db;
                return(_db);
            }
        }