Repository Service

IRepositoryService<TModel> in assembly SanteDB.Core.Api version 3.0.1980.0

Summary

Represents a repository service

Description

In the SanteDB Software Architecture the repository service layer is the layer responsible for coordinating business rules, privacy, auditing, and other activities from the messaging or other services in the SanteDB iCDR or dCDR.

Repository services should be the primary method of interacting with the SanteDB server infrastructure, as it indicates a user, application or device process is not intending to modify underlying persistence data directly (as would be the case for a system process), rather it wishes SanteDB to execute all validation and rules as normal.

Operations

Operation
Response/Return
Input/Parameter
Description

Get

TModel

Guid key

Gets the specified model data

Get

TModel

Guid key Guid versionKey

Gets the specified model data

Find

IQueryResultSet<TModel>

Expression<Func<TModel,Boolean>> query

Finds the specified data where the current version matches the query provided

Insert

TModel

TModel data

Inserts the specified model information

Save

TModel

TModel data

Inserts or updates the specified data

Delete

TModel

Guid key

Delete the object according to the current or according to server configuration

Implementations

AmiUpstreamRepository<TModel> - (SanteDB.Client)

HDSI upstream repository

This service implementation is abstract or is a generic definition. It is intended to be implemented or constructed at runtime from other services and cannot be used directly

AmiWrappedUpstreamRepository<TModel,TWrapper> - (SanteDB.Client)

Wrapped upstream repository for AMI which uses the ISecurityEntityWrapper

This service implementation is abstract or is a generic definition. It is intended to be implemented or constructed at runtime from other services and cannot be used directly

HdsiUpstreamRepository<TModel> - (SanteDB.Client)

HDSI upstream repository

This service implementation is abstract or is a generic definition. It is intended to be implemented or constructed at runtime from other services and cannot be used directly

UpstreamAuditRepository - (SanteDB.Client)

An upstream audit repository

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Client.Upstream.Repositories.UpstreamAuditRepository, SanteDB.Client, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

UpstreamRepositoryServiceBase<TModel,TWireFormat,TCollection> - (SanteDB.Client)

A generic implementation that calls the upstream for fetching data

This service implementation is abstract or is a generic definition. It is intended to be implemented or constructed at runtime from other services and cannot be used directly

UpstreamForeignDataManagement - (SanteDB.Client)

Upstream foreign data management classes

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Client.Upstream.Management.UpstreamForeignDataManagement, SanteDB.Client, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

LocalMailMessageService - (SanteDB.Core.Api)

Represents a IMailMessageService which uses database persistence layer to store / retrieve mail messages within the system

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Core.Services.Impl.LocalMailMessageService, SanteDB.Core.Api, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

GenericLocalActRepository<TAct> - (SanteDB.Core.Api)

Represents an act repository service.

This service implementation is abstract or is a generic definition. It is intended to be implemented or constructed at runtime from other services and cannot be used directly

GenericLocalClinicalDataRepository<TModel> - (SanteDB.Core.Api)

Represents generic local clinical data repository

This service implementation is abstract or is a generic definition. It is intended to be implemented or constructed at runtime from other services and cannot be used directly

GenericLocalConceptRepository<TModel> - (SanteDB.Core.Api)

Generic local concept repository with sufficient permissions

This service implementation is abstract or is a generic definition. It is intended to be implemented or constructed at runtime from other services and cannot be used directly

GenericLocalMetadataRepository<TMetadata> - (SanteDB.Core.Api)

Provides generic basis for metadata editing

This service implementation is abstract or is a generic definition. It is intended to be implemented or constructed at runtime from other services and cannot be used directly

Local Repository Service - (SanteDB.Core.Api)

Represents a base class for entity repository services

This service implementation is abstract or is a generic definition. It is intended to be implemented or constructed at runtime from other services and cannot be used directly

GenericLocalRepositoryEx<TModel> - (SanteDB.Core.Api)

Generic nullifiable local repository

This service implementation is abstract or is a generic definition. It is intended to be implemented or constructed at runtime from other services and cannot be used directly

GenericLocalSecurityRepository<TSecurityEntity> - (SanteDB.Core.Api)

Generic local security repository

This service implementation is abstract or is a generic definition. It is intended to be implemented or constructed at runtime from other services and cannot be used directly

Default Audit Repository - (SanteDB.Core.Api)

Represents an audit repository which stores and queries audit data.

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Core.Services.Impl.Repository.LocalAuditRepository, SanteDB.Core.Api, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

LocalBatchRepository - (SanteDB.Core.Api)

Local batch repository service

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Core.Services.Impl.Repository.LocalBatchRepository, SanteDB.Core.Api, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

LocalCarePathwayDefinitionRepositoryService - (SanteDB.Core.Api)

Local care pathway definition

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Core.Services.Impl.Repository.LocalCarePathwayDefinitionRepositoryService, SanteDB.Core.Api, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

LocalConceptRepository - (SanteDB.Core.Api)

Represents a service which is responsible for the maintenance of concepts using local persistence.

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Core.Services.Impl.Repository.LocalConceptRepository, SanteDB.Core.Api, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

LocalContainerRepository - (SanteDB.Core.Api)

Place repository that uses local persistence

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Core.Services.Impl.Repository.LocalContainerRepository, SanteDB.Core.Api, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

LocalEntityRelationshipRepository - (SanteDB.Core.Api)

Represents a local entity relationship repository

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Core.Services.Impl.Repository.LocalEntityRelationshipRepository, SanteDB.Core.Api, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

LocalEntityRepository - (SanteDB.Core.Api)

Local entity repository

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Core.Services.Impl.Repository.LocalEntityRepository, SanteDB.Core.Api, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

LocalExtensionTypeRepository - (SanteDB.Core.Api)

Local extension types

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Core.Services.Impl.Repository.LocalExtensionTypeRepository, SanteDB.Core.Api, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

LocalIdentityDomainRepository - (SanteDB.Core.Api)

Represents a repository service for managing assigning authorities.

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Core.Services.Impl.Repository.LocalIdentityDomainRepository, SanteDB.Core.Api, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

LocalManufacturedMaterialRepository - (SanteDB.Core.Api)

Local material persistence service

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Core.Services.Impl.Repository.LocalManufacturedMaterialRepository, SanteDB.Core.Api, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

LocalMaterialRepository - (SanteDB.Core.Api)

Local material persistence service

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Core.Services.Impl.Repository.LocalMaterialRepository, SanteDB.Core.Api, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

LocalOrganizationRepository - (SanteDB.Core.Api)

Provides operations for managing organizations.

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Core.Services.Impl.Repository.LocalOrganizationRepository, SanteDB.Core.Api, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

LocalPatientRepository - (SanteDB.Core.Api)

Local material persistence service

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Core.Services.Impl.Repository.LocalPatientRepository, SanteDB.Core.Api, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

LocalPlaceRepository - (SanteDB.Core.Api)

Place repository that uses local persistence

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Core.Services.Impl.Repository.LocalPlaceRepository, SanteDB.Core.Api, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

LocalProtocolRepositoryService - (SanteDB.Core.Api)

Default protocol repository services

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Core.Services.Impl.Repository.LocalProtocolRepositoryService, SanteDB.Core.Api, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

LocalProviderRepository - (SanteDB.Core.Api)

Provides operations for managing organizations.

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Core.Services.Impl.Repository.LocalProviderRepository, SanteDB.Core.Api, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

LocalSecurityApplicationRepository - (SanteDB.Core.Api)

Local security application repository

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Core.Services.Impl.Repository.LocalSecurityApplicationRepository, SanteDB.Core.Api, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

LocalSecurityDeviceRepository - (SanteDB.Core.Api)

Local security device repository

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Core.Services.Impl.Repository.LocalSecurityDeviceRepository, SanteDB.Core.Api, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

LocalSecurityPolicyRepository - (SanteDB.Core.Api)

Alter policies

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Core.Services.Impl.Repository.LocalSecurityPolicyRepository, SanteDB.Core.Api, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

LocalSecurityRoleRepositoryService - (SanteDB.Core.Api)

Represents a local security role service

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Core.Services.Impl.Repository.LocalSecurityRoleRepositoryService, SanteDB.Core.Api, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

LocalSecurityUserRepositoryService - (SanteDB.Core.Api)

Security user repository

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Core.Services.Impl.Repository.LocalSecurityUserRepositoryService, SanteDB.Core.Api, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

LocalTemplateDefinitionRepositoryService - (SanteDB.Core.Api)

Represents a local metadata repository service

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Core.Services.Impl.Repository.LocalTemplateDefinitionRepositoryService, SanteDB.Core.Api, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

LocalUserEntityRepository - (SanteDB.Core.Api)

Localuser entity repository

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Core.Services.Impl.Repository.LocalUserEntityRepository, SanteDB.Core.Api, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

AppletForeignDataMapRepository - (SanteDB.Core.Applets)

Applet foreign data map repository

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Core.Applets.Services.Impl.AppletForeignDataMapRepository, SanteDB.Core.Applets, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

AppletSubscriptionRepository - (SanteDB.Core.Applets)

An implementation of the ISubscriptionRepository that loads definitions from applets

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Core.Applets.Services.Impl.AppletSubscriptionRepository, SanteDB.Core.Applets, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

MdmEntityRelationshipPersistenceProvider - (SanteDB.Persistence.MDM)

Relationship persistence provider passed through to underlying types

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Persistence.MDM.Services.Resources.MdmEntityRelationshipPersistenceProvider, SanteDB.Persistence.MDM, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

Example Implementation

/// Example Implementation
using SanteDB.Core.Services;
/// Other usings here
public class MyRepositoryService<TModel> : SanteDB.Core.Services.IRepositoryService<TModel> { 
	public String ServiceName => "My own IRepositoryService`1 service";
	/// <summary>
	/// Gets the specified model data
	/// </summary>
	public TModel Get(Guid key){
		throw new System.NotImplementedException();
	}
	/// <summary>
	/// Gets the specified model data
	/// </summary>
	public TModel Get(Guid key,Guid versionKey){
		throw new System.NotImplementedException();
	}
	/// <summary>
	/// Finds the specified data where the current version matches the query provided
	/// </summary>
	public IQueryResultSet<TModel> Find(Expression<Func<TModel,Boolean>> query){
		throw new System.NotImplementedException();
	}
	/// <summary>
	/// Inserts the specified model information
	/// </summary>
	public TModel Insert(TModel data){
		throw new System.NotImplementedException();
	}
	/// <summary>
	/// Inserts or updates the specified data
	/// </summary>
	public TModel Save(TModel data){
		throw new System.NotImplementedException();
	}
	/// <summary>
	/// Delete the object according to the current  or             according to server configuration
	/// </summary>
	public TModel Delete(Guid key){
		throw new System.NotImplementedException();
	}
}

References

Last updated