Barcode Generator Provider

IBarcodeProviderService in assembly SanteDB.Core.Api version 2.1.151.0

Summary

Represents a barcode generator (QR, CODE39, etc.) which generates visual pointers to provided data

Description

The barcode generator provider is responsible for accepting one or more EntityIdentifier or ActIdentifier instances from an object, and generating a secure barcode which points at the provided resource. Additionally, the barcode provider provides SanteDB with the tooling to generate barcodes from raw data. These barcodes should be returned as an appropriate stream (containing PNG, PDF, or other data) which can be served to the other SanteDB components such as BI reports, or the REST API

This interface is the basis for the Visual Resource Pointer API

Operations

OperationResponse/ReturnInput/ParameterDescription

Generate

Stream

IEnumerable<IdentifierBase<TEntity>> identifers

Generate a barcode from the specified identifier

Generate

Stream

String rawData

Generate the barcode from raw data

Implementations

QR Code Barcode Generator - (SanteDB.DisconnectedClient.UI)

Barcode generator service that generates a QR code

Description

This service is an implementation of the IBarcodeProviderService which generates two dimensional barcodes with the ZXing library. This service uses the IResourcePointerService to generate digitally signed Visual Resource Pointer payloads which are represented as a QR code.

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.DisconnectedClient.UI.Services.QrBarcodeGenerator, SanteDB.DisconnectedClient.UI, Version=2.1.151.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

Example Implementation

/// Example Implementation
using SanteDB.Core.Services;
/// Other usings here
public class MyBarcodeProviderService : SanteDB.Core.Services.IBarcodeProviderService { 
	public String ServiceName => "My own IBarcodeProviderService service";
	/// <summary>
	/// Generate a barcode from the specified identifier
	/// </summary>
	public Stream Generate<TEntity>(IEnumerable<IdentifierBase<TEntity>> identifers){
		throw new System.NotImplementedException();
	}
	/// <summary>
	/// Generate the barcode from raw data
	/// </summary>
	public Stream Generate(String rawData){
		throw new System.NotImplementedException();
	}
}

References

Last updated