Quantcast
Channel: HL7 SDK - Open Source CDA R2 Implementation for .NET and COM
Viewing all articles
Browse latest Browse all 148

New Post: hl7 sdk and imbedded base 64 pdf

$
0
0
It's easy if you work with CDA. Please note that the library does not implement all the HL7 v3 standards and is intended to work with CDA only.
Here is an example:


static String EncodeFile(String path)
    {
        var byteArray = File.ReadAllBytes(path);
        var base64EncodedByteArray = Convert.ToBase64String(byteArray);
        return base64EncodedByteArray;
    }

    static void Main(string[] args)
    {
        var cd = new ClinicalDocument();
        // ...
        // populating patient info, authors etc skipped
        // ...
        var ed = new ED();
        ed.Text = EncodeFile(@"C:\Temp\OrderResult.pdf");
        ed.Representation = BinaryDataEncoding.B64;
        ed.MediaType = "application/pdf";
        cd.Component.AsNonXMLBody.Text = ed;
        Console.WriteLine(cd.Xml);
        Console.ReadLine();
    }
```

Viewing all articles
Browse latest Browse all 148

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>