概述

LEAD Medical Storage Server可以配置为,使用特定的数据库模式来存储患者检验数据和实例信息。同时,也可以将LEAD Medical Storage Server配置为,使用具有不同架构的数据库来存储此信息。本博客中的主题便是描述了实现上述目标的体系结构和必要步骤。在本教程中,您将学会创建一个示例SQL数据库并将其连接到LEAD医疗存储服务器。

“自定义数据库”系列教程介绍

在本系列文章中,任何定义为允许数据库与新模式交互的类都以“My”开头。这包括覆盖现有类的新类和类。

在内部,LEAD医用存储服务器使用System.Data.DataSet类作为应用程序和数据库之间的接口。从数据库读取的任何数据都读入System.Data.DataSet。同样,写入数据库的任何数据首先存储在System.Data.DataSet对象中,然后写入数据库。

本博客分为11个主题。前几个主题描述了现有组件如何在默认模式下工作,如何修改默认行为以与其他数据库一起工作,以及如何通过修改特定行为以使用教程示例数据库。后面的主题是实际教程:它仅列出将存储服务器连接到教程数据库的具体步骤。最后一个主题介绍如何恢复LEAD医疗存储服务器以使用原有的LEADTOOLS数据库。

深入了解数据访问层如何工作并不需要实现教程中定义的自定义数据库。实施本教程后,建议阅读系列其他文章以了解如何映射由LEADTOOLS数据访问层使用的模式。

Data Access Layer 数据访问层

Leadtools.Medical.Storage.Data Access Layer组件包括允许用户存储,查询和修改DICOM组合实例的类。

IStorageDataAccessAgent接口的存储数据访问代理。 IStorageDataAccessAgent具有以下成员:

public interface IStorageDataAccessAgent

{

DataSet QueryPatients( MatchingParameterCollection matchingEntitiesCollection )
;

DataSet QueryStudies ( MatchingParameterCollection matchingEntitiesCollection )
;

DataSet QuerySeries ( MatchingParameterCollection matchingEntitiesCollection ) ;

DataSet QueryCompositeInstances ( MatchingParameterCollection
matchingEntitiesCollection ) ;

int MaxQueryResults {get; set;}

bool QueryCompositeInstancesAsync ( MatchingParameterCollection
matchingEntitiesCollection, QueryPageInfo queryPageInfo) ;

void CancelQueryCompositeInstancesAsync(QueryCompositeInstancesArgs args);

event
EventHandler\<QueryCompositeInstancesArgs\>QueryCompositeInstancesStarting;

event EventHandler
\<QueryCompositeInstancesArgs\>QueryCompositeInstancesCompleted;

int FindPatientsCount ( MatchingParameterCollection matchingEntitiesCollection )
;

int FindStudiesCount ( MatchingParameterCollection matchingEntitiesCollection )
;

int FindSeriesCount ( MatchingParameterCollection matchingEntitiesCollection ) ;

int FindCompositeInstancesCount ( MatchingParameterCollection
matchingEntitiesCollection ) ;

bool IsPatientsExists ( string patientID ) ;

bool IsStudyExists ( string studyInstanceUID ) ;

bool IsSeriesExists ( string seriesInstanceUID ) ;

bool IsCompositeInstancesExists ( string sopInstanceUID ) ;

void UpdateCompositeInstance ( CompositeInstanceDataSet compositeInstanceDataSet
) ;

void StoreDicom ( DicomDataSet dataSet,

string referencedFileName,

string retrieveAe,

ReferencedImages[] images,

bool updateExistentPatient,

bool updateExistentStudy,

bool updateExistentSeries,

bool updateExistentInstances ) ;

int DeletePatient ( MatchingParameterCollection matchingEntitiesCollection ) ;

int DeleteStudy ( MatchingParameterCollection matchingEntitiesCollection ) ;

int DeleteSeries ( MatchingParameterCollection matchingEntitiesCollection ) ;

int DeleteInstance ( MatchingParameterCollection matchingEntitiesCollection ) ;

}

将示例数据库连接到LEAD存储服务器教程中,您可创建并实现IStorageDataAccessAgent接口的MyStorageSqlDbDataAccessAgent。 由于本教程将使用SQL Server 2008作为数据库引擎,我们的MyStorageSqlDbDataAccessAgent类将直接从现有的StorageSqlDbDataAccessAgent类派生(它实现IStorageDataAccessAgent),并且仅准备覆盖SQL查询的方法。 如果您不想使用基于SQL的数据库引擎,则您的存储数据访问代理直接实现IStorageDataAccessAgent成员即可。

了解更多

这是本系列的第一篇文章,本文介绍了Data Access Layer 数据访问层的基本概念,我们将在《LEAD医疗存储服务器自定义数据库系列教程 – 数据库》系列的第二篇文章中,着重介绍LEAD医用存储服务器数据库的基本概念。

系列文章