ED Class
Encapsulated data is used to transport larger portions of text, binary and XML data within an instance.

Inheritance Hierarchy

OnlineSystem Object
  MARC.Everest.DataTypes HXIT
    MARC.Everest.DataTypes ANY
      MARC.Everest.DataTypes ED

Namespace: MARC.Everest.DataTypes
Assembly: MARC.Everest.Phone (in MARC.Everest.Phone.dll) Version: (1.5.0)



public class ED : ANY, IEncapsulatedData, IEquatable<ED>


The ED data type can be used to encapsulate any binary data within an HL7v3 instance. The ED data type within Everest will be formatted appropriately for whatever particular ITS is used (for example: Binary data in XML would be formatted as Base64)

The key to the ED data type representation on the wire is the [P:Representation] property. This property is set automatically based on the method in which data within the ED is set. For example, if you set the content of the ED as a string, then the Representation property is automatically set to "Text" (which is represented in RAW format in XML). However, if you set the contents of the ED to a byte array, then the representation is set to Base64

The ED datatype provides many mechanisms of populating data within an instace. For example, one could use the byte array property of Data, however for convenience, using the string property Value may work better if you are populating your ED to a string.


Loading a PDF into an ED

ED datatype

// Using constructor
ED t = new ED(File.ReadAllBytes(@"test.pdf"),"application/pdf");
t.Language = "en-US";
t.MediaType = "text/plain";
t.Reference = "http://www.google.com";

Compressing an ED

// The ED data type provides an easy mechanism to automatically compute checksums for the  
// data contained within. Computing an integrity check is simple. All the developer needs to do, 
// is set the IntegrityCheckAlgorithm property, and set the integrity check to the result of the  
// ComputeHash function. If an integrity check algorithm is specified, and no integrity check is  
// assigned, it will be automatically generated when the “IntegrityCheck” value is retrieved.
ED test = new ED(File.ReadAllBytes("C:\\output.pdf"), "text/xml"); 
Console.WriteLine("Original: {0}", test.Data.Length); 

// Setup compression 
test.Compression = EncapsulatedDataCompression.GZ; 
test.Data = test.Compress(); 
Console.WriteLine("Compressed: {0}", test.Data.Length); 

// Setup integrity check 
test.IntegrityCheckAlgorithm = EncapsulatedDataIntegrityAlgorithm.SHA256; 
test.IntegrityCheck = test.ComputeIntegrityCheck(); 

// Validate  
if (!test.ValidateIntegrityCheck()) 
Console.WriteLine("Integrity check doesn't match!"); 
    test.Data = test.UnCompress(); 
    Console.WriteLine("UnCompressed: {0}", test.Data.Length); 

Version Information

Everest Compact Framework

Supported in: 1.2 Compact

Everest Framework

Supported in: 1.2, 1.0

See Also