This is a dotNet software library that aims to make the generation of Clinical Document Architecture (CDA) documents easy and encapsulates validation logic to ensure that the result document conforms to the standards outlines by CDA and HL7 v3

This software library contains CDA document Implementation objects (Eg. SharedHealthSummary, EReferral etc); these objects wrap up three distinct models. Each model encapsulates either CDA (Clinical Document Architecture) or SDT (Structured Document Template) logic. 

The three models can be loosely described as two context models and one content model. Each of the models is then wrapped within the CDA document Implementation object

	The three CDA / SDT models are:
	1 - CDA Context
	2 - SDT Context
	3 - SDT Content

The CDA document Implementation objects are designed to wrap each of the above models and to expose methods that help with object instantiation and subsequent hydration.

Where possible, it is desirable to use the CDA document Implementation objects to instantiate child objects associated with each implementation; as this ensures the object you receive conform to the correct interface / implementation, while also ensuring that the resulting CDA document model is valid.

Setup
=====

- To build the distributable package, Visual Studio 2008 must be installed.
- Start up CDA.sln.
- For documentation on the CDA library, refer to Help/Index.html.


Solution
========

The solution consists of three projects:

CDA:
The 'Nehta.VendorLibrary.CDA.Sample' project contains sample code for the CDA library, and is designed as an introduction to CDA and the NEHTA CDA libraries

The 'Nehta.VendorLibrary.CDA' project contains the CDA and SDT (Structured Document Template) models for each of the CDA documents. It also contains a CDA Generator that will convert each model into an valid CDA Document (XMLDocument)

	The library consists of the following distinct classes for use in generating a CDA document:     
	1. composition / factory classes
		- SharedHealthSummary
		- EReferral
		- SpecialistLetter
		- EventSummary
		- EDischargeSummary

	2. CDAGenerator
		- this accepts any of the above CDA document Implementation objects and returns a CDA XML document
		
     
CDA.Sample: Sample code for the CDA library.

Common: The 'Nehta.VendorLibrary.Common' project contains helper libraries common across all NEHTA vendor library components.


Building and using the library
==============================

The solution can be built using 'ctrl-shift-b'. The compiled assembly can then be referenced where ever a CDA document is required to be conStructured or referenced.


CDA Logo usage
============

Each model allows for the inclusion of a logo within the CDA document. To include the logo you need to set the IncludeLogo property on the model and you also need to include a png file with the name "logo.png".
The default NEHTA style sheet will look for this logo in the same directory as the CDA document.


Library Usage
============

Detailed class documentation can be found in "Help/Index.html".

  
Licensing
=========
Copyright 2011 NEHTA

Licensed under the NEHTA Open Source (Apache) License; you may not use this file except in compliance with the License. A copy of the License is in the 'license.txt' file, which should be provided with this work.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
