打开并编译项目My.Medical.Storage.DataAccessLayer项目。默认位置为C: \ LEADTOOLS22 \ \医学教程\ DotNet \ \ My.Medical.Storage.DataAccessLayer例子注意:如果您使用的是早期版本的SQL Server 2008(即SQL Server 2005),则不支持数据类型SqlDbType。日期.在这种情况下,你有两个选择:
开放MyDataSet.Designer.cs的所有实例SqlDbType。日期与SqlDbType。DateTime
按照下面的步骤操作强类型数据集类和XML模式的新实例MyDataSet.Designer.cs。
打开并编译My.Medical.Storage.Configuration项目。默认位置为C: \ LEADTOOLS22 \ \医学教程\ DotNet \ \ My.Medical.Storage.Configuration例子.
编译项目将生成两个程序集:
本教程使用Microsoft SQL Server 2008而且SQL Server Management Studio.您也可以使用SQL精简版,它是在安装Visual Studio时默认安装的。如果您使用SQL精简版,您可以下载SQL Server Management Studio Express(从Microsoft免费下载)。
脚本生成SQL Server 2008教程数据库
使用(主)去/******对象:数据库[MyDicomDb]脚本日期:07/15/2013 13:02:13 ******/创建数据库[MyDicomDb]去ALTER DATABASE [MyDicomDb] SET compatible level = 100去If (1 = fulltextserviceproperty (“IsFullTextInstalled”))开始EXEC [MyDicomDb]。[dbo]。[sp_fulltext_database] @action =“启用”结束去SET ANSI_NULL_DEFAULT OFF [MyDicomDb去SET ANSI_NULLS OFF [MyDicomDb去ALTER DATABASE [MyDicomDb] SET ANSI_PADDING OFF去ALTER DATABASE [MyDicomDb] SET ANSI_WARNINGS OFF去设置数据库的算术中止去设置数据库自动关闭去SET AUTO_CREATE_STATISTICS ON去设置数据库自动收缩关闭去SET AUTO_UPDATE_STATISTICS ON去SET CURSOR_CLOSE_ON_COMMIT OFF去设置数据库的全局默认值去SET CONCAT_NULL_YIELDS_NULL OFF去更改数据库[MyDicomDb]关闭数字中止去ALTER DATABASE [MyDicomDb] SET QUOTED_IDENTIFIER OFF去更改数据库[MyDicomDb]关闭递归触发器去ALTER DATABASE [MyDicomDb] SET DISABLE_BROKER去设置自动更新统计异步关闭去设置数据库DATE_CORRELATION_OPTIMIZATION关闭去取消数据库的可信赖性去设置ALLOW_SNAPSHOT_ISOLATION关闭去修改数据库参数去关闭数据库的只读快照去更改数据库[MyDicomDb]去ALTER DATABASE [MyDicomDb去ALTER DATABASE [MyDicomDb] SET RECOVERY FULL去SET MULTI_USER [MyDicomDb去设置PAGE_VERIFY校验和去ALTER DATABASE [MyDicomDb] SET db_chains OFF去执行系统。sp_db_vardecimal_storage_format N“MyDicomDb”N“上”去使用[MyDicomDb]去/******对象:表[dbo]。[MyPatientTable]脚本日期:07/01/2013 17:44:15 ******/设置ansi_nulls为on去设置quoted_identifier为on去CREATE TABLE [dbo].[MyPatientTable]([PatientId] [int[id (1,1) not null][PatientIdentification] [nvarchar](70) NOT NULL,[PatientName] [nvarchar](max) NOT NULL,[病人生日][日期]NULL,[患者性别][nvarchar](50) NULL,[病人评论][nvarchar](200) NULL,约束[PK_Patient]主键聚集([PatientId] ASC(pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary],CONSTRAINT [uc_patientidentiid] UNIQUE非聚类([PatientIdentification] ASC(pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary])在[主要的]去/******对象:表[dbo]。[MyStudyTable]脚本日期:07/01/2013 17:44:15 ******/设置ansi_nulls为on去设置quoted_identifier为on去CREATE TABLE [dbo].[MyStudyTable]([StudyId] [int[id (1,1) not null][StudyPatientId] [int不是空的,[StudyStudyInstanceUID] [nvarchar](64) NOT NULL,[studydate] [date] NULL[StudyAccessionNumber] [nvarchar](64) NULL,[StudyStudyDescription] [nvarchar](256) NULL,[StudyReferringPhysiciansName] [nvarchar](50) NULL,[StudyStudyId] [nvarchar](16) NULL,约束[PK_Study]主键聚集([StudyId] ASC(pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary],CONSTRAINT [uc_StudyStudyInstanceUID] UNIQUE非聚类([StudyStudyInstanceUID] ASC(pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary])在[主要的]去/******对象:表[dbo]。[MySeriesTable]脚本日期:07/01/2013 17:44:15 ******/设置ansi_nulls为on去设置quoted_identifier为on去CREATE TABLE [dbo].[MySeriesTable]([SeriesId] [int[id (1,1) not null][SeriesStudyId] [int不是空的,[SeriesSeriesInstanceUID] [nvarchar](64) NOT NULL,[seriesbodypartdetected] [nvarchar](16) NULL,[SeriesSeriesNumber] [int空,[SeriesSeriesDescription] [nvarchar](300) NULL,[SeriesSeriesDate] [date] NULL,[SeriesModality] [nvarchar](50) NULL,约束[PK_Series]主键聚集([SeriesId] ASC(pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary],CONSTRAINT [uc_SerieSeriesInstanceUID] UNIQUE非集群(SeriesSeriesInstanceUID ASC,[SeriesStudyId] ASC(pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary])在[主要的]去/******对象:表[dbo]。[MyInstanceTable]脚本日期:07/01/2013 17:44:15 ******/设置ansi_nulls为on去设置quoted_identifier为on去CREATE TABLE [dbo].[MyInstanceTable]([ImageId] [bigint] id (1,1) NOT NULL,[ImageSeriesId] [int不是空的,[SOPInstanceUID] [nvarchar](64) NOT NULL,[ImageImageNumber] [int不是空的,[ImageLastStoreDate] [date] NULL,[ImageFilename] [nvarchar](400) NOT NULL,[ImageUniqueSOPClassUID] [nvarchar](64) NULL,[ImageRows] [bigint] NULL,[ImageColumns] [bigint] NULL,[imagebitsallocate] [bigint] NULL,约束[PK_Image]主键已聚集([ImageId] ASC(pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary],CONSTRAINT [IX_Image_SOPInstanceUID] UNIQUE非集群([SOPInstanceUID] ASC(pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary])在[主要的]去/******对象:ForeignKey [FK_DImage_Series]脚本日期:07/01/2013 17:44:15 ******/修改表[dbo]。[MyInstanceTable] WITH CHECK ADD CONSTRAINT [FK_DImage_Series]外键([ImageSeriesId])引用(dbo)。[MySeriesTable] ([SeriesId])删除级联去修改表[dbo]。[MyInstanceTable]检查约束[FK_DImage_Series]去/******对象:ForeignKey [FK_Series_Study]脚本日期:07/01/2013 17:44:15 ******/修改表[dbo]。[MySeriesTable] WITH CHECK ADD CONSTRAINT [FK_Series_Study]外键([SeriesStudyId])引用(dbo)。[MyStudyTable] ([StudyId])去修改表[dbo]。[MySeriesTable]检查约束[FK_Series_Study]去/******对象:ForeignKey [FK_Study_Patient]脚本日期:07/01/2013 17:44:15 ******/修改表[dbo]。[MyStudyTable] WITH CHECK ADD CONSTRAINT [FK_Study_Patient]外键([StudyPatientId])引用(dbo)。[MyPatientTable] ([PatientId])去修改表[dbo]。[MyStudyTable]检查约束[FK_Study_Patient]去
注意:
对于早期版本的SQL Server(即SQL Server 2005),不支持数据类型SqlDbType。日期.
如果您使用的是SQL Server 2005,则可以使用以下脚本生成数据库,而不是使用数据类型SqlDbType。DateTime.
脚本为SQL Server 2005生成教程数据库
使用(主)去/******对象:数据库[MyDicomDb]脚本日期:08/12/2013 10:39:18 ******/创建数据库[MyDicomDb]去If (1 = fulltextserviceproperty (“IsFullTextInstalled”))开始EXEC [MyDicomDb]。[dbo]。[sp_fulltext_database] @action =“启用”结束去SET ANSI_NULL_DEFAULT OFF [MyDicomDb去SET ANSI_NULLS OFF [MyDicomDb去ALTER DATABASE [MyDicomDb] SET ANSI_PADDING OFF去ALTER DATABASE [MyDicomDb] SET ANSI_WARNINGS OFF去设置数据库的算术中止去设置数据库自动关闭去SET AUTO_CREATE_STATISTICS ON去设置数据库自动收缩关闭去SET AUTO_UPDATE_STATISTICS ON去SET CURSOR_CLOSE_ON_COMMIT OFF去设置数据库的全局默认值去SET CONCAT_NULL_YIELDS_NULL OFF去更改数据库[MyDicomDb]关闭数字中止去ALTER DATABASE [MyDicomDb] SET QUOTED_IDENTIFIER OFF去更改数据库[MyDicomDb]关闭递归触发器去ALTER DATABASE [MyDicomDb] SET DISABLE_BROKER去设置自动更新统计异步关闭去设置数据库DATE_CORRELATION_OPTIMIZATION关闭去取消数据库的可信赖性去设置ALLOW_SNAPSHOT_ISOLATION关闭去修改数据库参数去关闭数据库的只读快照去ALTER DATABASE [MyDicomDb去ALTER DATABASE [MyDicomDb] SET RECOVERY FULL去SET MULTI_USER [MyDicomDb去设置PAGE_VERIFY校验和去ALTER DATABASE [MyDicomDb] SET db_chains OFF去使用[MyDicomDb]去/******对象:表[dbo]。[MyPatientTable]脚本日期:08/12/2013 10:39:19 ******/设置ansi_nulls为on去设置quoted_identifier为on去CREATE TABLE [dbo].[MyPatientTable]([PatientId] [int[id (1,1) not null][PatientIdentification] [nvarchar](70) NOT NULL,[PatientName] [nvarchar](max) NOT NULL,[病人生日][日期时间]NULL,[患者性别][nvarchar](50) NULL,[病人评论][nvarchar](200) NULL,约束[PK_Patient]主键聚集([PatientId] ASC(pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary],CONSTRAINT [uc_patientidentiid] UNIQUE非聚类([PatientIdentification] ASC(pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary])在[主要的]去/******对象:表[dbo]。[MyStudyTable]脚本日期:08/12/2013 10:39:19 ******/设置ansi_nulls为on去设置quoted_identifier为on去CREATE TABLE [dbo].[MyStudyTable]([StudyId] [int[id (1,1) not null][StudyPatientId] [int不是空的,[StudyStudyInstanceUID] [nvarchar](64) NOT NULL,[StudyStudyDate] [datetime] NULL[StudyAccessionNumber] [nvarchar](64) NULL,[StudyStudyDescription] [nvarchar](256) NULL,[StudyReferringPhysiciansName] [nvarchar](50) NULL,[StudyStudyId] [nvarchar](16) NULL,约束[PK_Study]主键聚集([StudyId] ASC(pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary],CONSTRAINT [uc_StudyStudyInstanceUID] UNIQUE非聚类([StudyStudyInstanceUID] ASC(pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary])在[主要的]去/******对象:表[dbo]。[MySeriesTable]脚本日期:08/12/2013 10:39:19 ******/设置ansi_nulls为on去设置quoted_identifier为on去CREATE TABLE [dbo].[MySeriesTable]([SeriesId] [int[id (1,1) not null][SeriesStudyId] [int不是空的,[SeriesSeriesInstanceUID] [nvarchar](64) NOT NULL,[seriesbodypartdetected] [nvarchar](16) NULL,[SeriesSeriesNumber] [int空,[SeriesSeriesDescription] [nvarchar](300) NULL,[SeriesSeriesDate] [datetime] NULL,[SeriesModality] [nvarchar](50) NULL,约束[PK_Series]主键聚集([SeriesId] ASC(pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary],CONSTRAINT [uc_SerieSeriesInstanceUID] UNIQUE非集群(SeriesSeriesInstanceUID ASC,[SeriesStudyId] ASC(pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary])在[主要的]去/******对象:表[dbo]。[MyInstanceTable]脚本日期:08/12/2013 10:39:19 ******/设置ansi_nulls为on去设置quoted_identifier为on去CREATE TABLE [dbo].[MyInstanceTable]([ImageId] [bigint] id (1,1) NOT NULL,[ImageSeriesId] [int不是空的,[SOPInstanceUID] [nvarchar](64) NOT NULL,[ImageImageNumber] [int不是空的,[ImageLastStoreDate] [datetime] NULL,[ImageFilename] [nvarchar](400) NOT NULL,[ImageUniqueSOPClassUID] [nvarchar](64) NULL,[ImageRows] [bigint] NULL,[ImageColumns] [bigint] NULL,[imagebitsallocate] [bigint] NULL,约束[PK_Image]主键已聚集([ImageId] ASC(pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary],CONSTRAINT [IX_Image_SOPInstanceUID] UNIQUE非集群([SOPInstanceUID] ASC(pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary])在[主要的]去/******对象:ForeignKey [FK_Study_Patient]脚本日期:08/12/2013 10:39:19 ******/修改表[dbo]。[MyStudyTable] WITH CHECK ADD CONSTRAINT [FK_Study_Patient]外键([StudyPatientId])引用(dbo)。[MyPatientTable] ([PatientId])去修改表[dbo]。[MyStudyTable]检查约束[FK_Study_Patient]去/******对象:ForeignKey [FK_Series_Study]脚本日期:08/12/2013 10:39:19 ******/修改表[dbo]。[MySeriesTable] WITH CHECK ADD CONSTRAINT [FK_Series_Study]外键([SeriesStudyId])引用(dbo)。[MyStudyTable] ([StudyId])去修改表[dbo]。[MySeriesTable]检查约束[FK_Series_Study]去/******对象:ForeignKey [FK_DImage_Series]脚本日期:08/12/2013 10:39:19 ******/修改表[dbo]。[MyInstanceTable] WITH CHECK ADD CONSTRAINT [FK_DImage_Series]外键([ImageSeriesId])引用(dbo)。[MySeriesTable] ([SeriesId])删除级联去修改表[dbo]。[MyInstanceTable]检查约束[FK_DImage_Series]去
注释掉现有的storageDataAccessConfiguration175进入configSections,并添加一个新的myStorageDataAccessConfiguration175部分。新的部分是突出显示下面是黄色部分。
<!——<节名=“storageDataAccessConfiguration175”类型=“Leadtools.Medical.DataAccessLayer.Configuration。DataAccessSettings Leadtools.Medical。DataAccessLayer, Version=21.0.0.1, Culture=neutral, PublicKeyToken=9cf889f53ea9b907"/>--><节名=“myStorageDataAccessConfiguration175”类型=“Leadtools.Medical.DataAccessLayer.Configuration。DataAccessSettings Leadtools.Medical。DataAccessLayer, Version=21.0.0.1, Culture=neutral, PublicKeyToken=9cf889f53ea9b907"/>
注释掉现有的StorageServer进入storageDataAccessConfiguration175定义,并添加一个新的myStorageDataAccessConfiguration175定义。变化是突出显示下面是黄色部分。
< storageDataAccessConfiguration175 connectionName =“LeadStorageServer21_32”><!——<添加productName =“StorageServer”名=“L21_PACS_SCP32”connectionName =“LeadStorageServer21_32”/>--><添加productName =“工作站”名=“L21_WS_SERVER32”connectionName =“MedicalWorkstation21_32”/>< / storageDataAccessConfiguration175 >< myStorageDataAccessConfiguration175 connectionName =“MyDicomDb”><添加productName =“StorageServer”名=“L21_PACS_SCP32”connectionName =“MyDicomDb”/>< / myStorageDataAccessConfiguration175 >
向
新的连接字符串将显示出来突出显示下面是黄色。旧版本和新版本的区别在于,在旧字符串中,名称和目录称为“LeadStorageServer21_32”,而在新字符串中,它们称为“MyDicomDb”。
< connectionStrings ><添加名称=“LeadStorageServer21_32”connectionString ="数据源=医疗测试;故障转移伙伴=;初始目录=LeadStorageServer21_32;集成安全性=False;用户ID=sa;密码=sa;池化=True"providerName =“System.Data.SqlClient”/><添加名称=“MyDicomDb”connectionString ="数据源=医疗测试;故障转移伙伴=;初始目录=MyDicomDb;集成安全性=False;用户ID=sa;密码=sa;池化=True"providerName =“System.Data.SqlClient”/>< / connectionStrings >
注意:
这里的数据源是“medical-test”。您应该将此更改为指向您的SQLServer,其机器名称后面跟着SQLServer名称,例如:Data Source= " myMachineName\SQLServer "。您可能需要更改SQLServer ID和密码才能成功验证。将更改保存到globalPacs.config,并关闭文件。
C: \ LEADTOOLS22 \ \ \ DotNet \ StorageServerManager医学例子.修改shell.cs
请注意,所有这些更改都已经在shell.cs的发布版本中,包装在指令中
默认位置为C: \ LEADTOOLS22 \ \医疗\ DotNet \例子StorageServerManager \ \ Shell.cs壳.
//教程代码更改使用Leadtools.Medical.Storage.DataAccessLayer.Interface;使用My.Medical.Storage.DataAccessLayer;使用My.Medical.Storage.DataAccessLayer.Entities;//教程代码更改
将以下内容添加到Run ()方法后立即调用createconfigationservices (service);
//教程代码更改DataAccessServiceLocator。登记< IPatientInfo > (新MyPatientInfo ());DataAccessServiceLocator。登记< IStudyInfo > (新MyStudyInfo ());DataAccessServiceLocator。登记< ISeriesInfo > (新MySeriesInfo ());DataAccessServiceLocator。登记< IInstanceInfo > (新MyInstanceInfo ());RegisteredEntities.Items.Add (RegisteredEntities.PatientEntityNametypeof(MyPatient));RegisteredEntities.Items.Add (RegisteredEntities.StudyEntityNametypeof(MyStudy));RegisteredEntities.Items.Add (RegisteredEntities.SeriesEntityNametypeof(MySeries));RegisteredEntities.Items.Add (RegisteredEntities.InstanceEntityNametypeof(MyInstance));//教程代码更改
在RegisterDataAccessLayers ()方法时,更改以下语句以创建的实例MyStorageDataAccessConfigurationView。变化是突出显示黄色:
storageAgent = DataAccessFactory。GetInstance(新增我的StorageDataAccessConfigurationView(配置,DicomDemoSettings188金宝搏beat体育官网Manager。ProductNameStorageServer, null))。CreateDataAccessAgent ();
修改Program.cs
C: \ LEADTOOLS22 \ \医疗\ DotNet \ StorageServerManager \ Program.cs例子.保龄球dbConfigured = GlobalPacsUpdater。IsDbComponentsConfigured 188金宝搏的网址客服(productsToCheck出消息);dbConfigured =真正的;
修改StorageServerContainerPresenter.cs
C: \ LEADTOOLS22 \ \医疗\ DotNet例子\ StorageServerManager \ \ StorageServerContainer \ StorageServerContainerPresenter.cs UI.//教程代码更改使用My.Medical.Storage.DataAccessLayer;使用My.Medical.Storage.DataAccessLayer.Entities;使用Leadtools.Dicom.Common.DataTypes;使用Leadtools.Medical.Winforms.Control;使用Leadtools.Dicom.Common.Extensions;//教程代码更改
在RunView()方法之后,插入MyPrepareSearch()方法。看到分配StorageDatabaseManager。PrepareSearch委托有关委托的解释。
私人无效MyPrepareSearch (MatchingParameterCollection matchingCollection){DicomQueryParams q = __DbManager.GetDicomQueryParams();试一试{MatchingParameterList matchingList =新MatchingParameterList ();MyPatient病人=新MyPatient ();MyStudy study =新MyStudy ();MySeries系列=新MySeries ();matchingList.Add(病人);matchingList.Add(研究);matchingList.Add(系列);matchingCollection.Add (matchingList);研究。StudyAccessionNumber = q.AccessionNumber;病人。patientidentiid = q.PatientId;如果(!字符串.IsNullOrEmpty (q.PatientName.FamilyName))病人。PatientName = q.PatientName.FamilyName.TrimEnd(‘*’) +“*”;如果(!字符串.IsNullOrEmpty (q.PatientName.GivenName))病人。PatientName = q.PatientName.GivenName.TrimEnd‘*’) +“*”;如果(!字符串.IsNullOrEmpty (q.Modalities))系列。SeriesModality = q. modes . replace (”、““\ \”);;如果(!字符串.IsNullOrEmpty (q.SeriesDescription))系列。SeriesSeriesDescription = q.SeriesDescription.TrimEnd(‘*’) +“*”;如果(!字符串.IsNullOrEmpty (q.ReferringPhysiciansName.FamilyName))研究。studyreferringphysicansname = q. referringphysicansname . familyname . trimend (‘*’) +“*”;;如果(!字符串.IsNullOrEmpty (q.ReferringPhysiciansName.GivenName))研究。StudyReferringPhysiciansName = q.ReferringPhysiciansName.GivenName.TrimEnd(‘*’) +“*”;;如果(q.StudyFromChecked || q.StudyToChecked){DateRange studyDateRange =新DateRange ();如果(q.StudyFromChecked){studyDateRange。开始日期= q.StudyFromDate;}如果(q.StudyToChecked){studyDateRange。结束日期= q.StudyToDate;}研究。StudyStudyDate = studyDateRange;}如果(q.StorageDateChecked){MyInstance实例=新MyInstance ();DateRange DateRange =新DateRange ();DateRangeFilter StorageDateRangeFilter = q.StorageDateRange;字符串startDate = StorageDateRangeFilter.DateRangeFrom;字符串endDate = StorageDateRangeFilter.DateRangeTo;如果(StorageDateRangeFilter。选择edDateFilter == DateRangeFilter.RangeFilterType.DateRange){如果(!字符串.IsNullOrEmpty (startDate可以)){dateRange。开始日期= DateTime.Parse(startDate);}如果(!字符串.IsNullOrEmpty (endDate)){dateRange。EndDate = DateTime.Parse(EndDate);}}其他的如果(StorageDateRangeFilter。选择edDateFilter == DateRangeFilter.RangeFilterType.Months){DateTime lastMonthsDate = DateTime. now . subtractmonths (Convert.ToInt32(StorageDateRangeFilter.LastMonths));dateRange。开始日期= lastMonthsDate;dateRange。EndDate =日期时间。现在;}其他的{TimeSpan减去天数=新时间间隔(Convert.ToInt32 (StorageDateRangeFilter.LastDays),DateTime.Now.Hour,DateTime.Now.Minute,DateTime.Now.Second,DateTime.Now.Millisecond);dateRange。开始日期= DateTime.Now.Subtract(subtractionDays);dateRange。EndDate =日期时间。现在;}实例。ImageLastStoreDate = dateRange;matchingList.Add(实例);}研究。studyid = q.StudyId;}抓(例外的例外){扔异常;}最后{//什么都不做;}}
在CreateContainerPages ()方法,将PrepareSearchDelegate
StorageDatabaseManager dbManager =新StorageDatabaseManager ();dbManager。PrepareSearch =新PrepareSearchDelegate (MyPrepareSearch);
在CreateContainerPages ()方法,添加一个调用来获取查询参数
ServerState.Instance.LicenseChanged + =新EventHandler (Instance_LicenseChanged);dbManager.GetDicomQueryParams ();
在configureserverinfocontrol ()方法,修改GetConnectionString调用以使用自定义配置
存储= GetConnectionString(configPacs, configMachine,新我的StorageDataAccessConfigurationView (configPacs PacsProduct。ProductName,零) .DataAccessSettingsSectionName);
构建StorageServerManagerDemo_Original.exe
修改Leadtools.Dicom.Server.exe.config(添加突出显示在黄色)
<?xml version =“1.0”编码=“utf - 8”? >< >配置< configSections ><节名=“leadLogging”类型=“Leadtools.Logging.Configuration。ConfigSectionHandler Leadtools。日志”/><节名=“xmlStorageCatalogSettings”类型=“Leadtools.Medical.Storage.DataAccessLayer。XmlStorageCatalogSettings Leadtools.Medical.Storage.DataAccessLayer”/>< sectionGroup name =“applicationSettings”类型=“System.Configuration。ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"><节名=“Leadtools.Dicom.Service.Properties.Settings”类型=“System.Configuration。ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"requirePermission =“假”/>< / sectionGroup >< / configSections >< leadLogging ><频道><通道名称=“DataAccessLoggingChannel”类型=“Leadtools.Medical.Logging.DataAccessLayer。DataAccessLoggingChannel Leadtools.Medical.Logging.DataAccessLayer”/>> < /渠道< / leadLogging >< xmlStorageCatalogSettings catalogPath =“C: \ LEADTOOLS22 \ Bin \ Dotnet4 \ Win32 \ MyCatalog.xml”/>运行时> << generatePublisherEvidence启用=“假”/>< assemblyBinding xmlns =“urn: schemas-microsoft-com: asm.v1”>< dependentAssembly >< assemblyIdentity name =“System.Data.SqlServerCe”都必须“89845 dcd8080cc91”文化=“中性”/>< bindingRedirect oldVersion =“0.0.0.0-3.5.1.0”新版本=“3.5.1.0”/>< / dependentAssembly >< dependentAssembly >< assemblyIdentity name =“Microsoft.Practices.ObjectBuilder2”都必须“31 bf3856ad364e35”文化=“中性”/>< bindingRedirect oldVersion =“0.0.0.0-2.2.0.0”新版本=“2.2.0.0”/>< / dependentAssembly >< dependentAssembly >< assemblyIdentity name =“Microsoft.Practices.Unity”都必须“31 bf3856ad364e35”文化=“中性”/>< bindingRedirect oldVersion =“0.0.0.0-1.2.0.0”新版本=“1.2.0.0”/>< / dependentAssembly >< / assemblyBinding >运行时> < /< appSettings ><添加关键=“LicenseFile”值=""/><添加关键=“DeveloperKey”值=""/><添加关键=“DataSetSchema”值=“C: \ LEADTOOLS22 \ Bin \ Dotnet4 \ Win32 \ MyDataSet.xsd”/>< / appSettings >> < /配置
修改StorageServerManagerDemo_Original.exe.config(添加突出显示在黄色)
<?xml version =“1.0”? >< >配置< configSections ><节名=“xmlStorageCatalogSettings”类型=“Leadtools.Medical.Storage.DataAccessLayer。XmlStorageCatalogSettings Leadtools.Medical.Storage.DataAccessLayer”/>< / configSections >< xmlStorageCatalogSettings catalogPath =“C: \ LEADTOOLS22 \ Bin \ Dotnet4 \ Win32 \ MyCatalog.xml”/>运行时> << assemblyBinding xmlns =“urn: schemas-microsoft-com: asm.v1”>< dependentAssembly >< assemblyIdentity name =“System.Data.SqlServerCe”都必须“89845 dcd8080cc91”文化=“中性”/>< bindingRedirect oldVersion =“0.0.0.0-3.5.1.0”新版本=“3.5.1.0”/>< / dependentAssembly >< dependentAssembly >< assemblyIdentity name =“Microsoft.Practices.ObjectBuilder2”都必须“31 bf3856ad364e35”文化=“中性”/>< bindingRedirect oldVersion =“0.0.0.0-2.2.0.0”新版本=“2.2.0.0”/>< / dependentAssembly >< dependentAssembly >< assemblyIdentity name =“Microsoft.Practices.Unity”都必须“31 bf3856ad364e35”文化=“中性”/>< bindingRedirect oldVersion =“0.0.0.0-1.2.0.0”新版本=“1.2.0.0”/>< / dependentAssembly >< / assemblyBinding >运行时> < /< appSettings ><添加关键=“DataSetSchema”值=“C: \ LEADTOOLS22 \ Bin \ Dotnet4 \ Win32 \ MyDataSet.xsd”/>< / appSettings >> < /配置
打开查询设置,并设置IOD XML路径为您的MyQueryIOD.xml文件。
脚本创建Forward表
使用[MyDicomDb]去/******对象:表[dbo]。[Forward]脚本日期:09/04/2013 15:55:39 ******/设置ansi_nulls为on去设置quoted_identifier为on去CREATE TABLE [dbo].[Forward]([SOPInstanceUID] [nvarchar](64) NOT NULL,[ForwardDate] [datetime] NULL,[过期时间][日期时间]NULL,约束[PK_Forward]主键已聚集([SOPInstanceUID] ASC(pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary])在[主要的]去修改表[dbo]。[Forward] WITH CHECK ADD CONSTRAINT [FK_Forward_Instance]外键([SOPInstanceUID])引用(dbo)。[MyInstanceTable] ([SOPInstanceUID])在级联更新时删除级联去修改表[dbo]。[Forward]检查约束[FK_Forward_Instance]去
修改Leadtools.Medical.Forward.DataAccessLayer组装
C: \ LEADTOOLS22 \ \ \ DotNet \ Medical.Forward.DataAccessLayer医学例子.将以下内容添加到ForwardDBDataAccessAgent构造函数:
公共ForwardDBDataAccessAgent (字符串connectionString){#如果TUTORIAL_CUSTOM_DATABASE_instanceTableName =@“MyInstanceTable”;_columnNameSOPInstanceUID =@“SOPInstanceUID”;_columnNameReferencedFile =@“ImageFilename”;# endifConnectionString =连接字符串;}
打开属性页面
添加TUTORIAL_CUSTOM_DATABASE从条件编译符号
构建项目以生成新的Leadtools.Medical.Forward.DataAccessLayer.dll组装。
修改GlobalPacs.config
< forwardConfiguration175 >,注释掉现有条目,并使用MyDicomDb作为连接名。变化是突出显示下面是黄色。< forwardConfiguration175 ><!——<添加productName =“StorageServer”名=“L21_PACS_SCP32”connectionName =“LeadStorageServer21_32”/>--><添加productName =“StorageServer”名=“L21_PACS_SCP32”connectionName =“MyDicomDb”/>< / forwardConfiguration175 >
将更改保存到globalPacs.config,并关闭文件