https://github.com/giosil/hl7cda2
An extensible library to manage HL7 CDA2 documents.
https://github.com/giosil/hl7cda2
cda clinical-document-architecture health healthcare hl7 hl7-parser hl7-parsing hl7v3 hl7v3-standards
Last synced: 6 months ago
JSON representation
An extensible library to manage HL7 CDA2 documents.
- Host: GitHub
- URL: https://github.com/giosil/hl7cda2
- Owner: giosil
- License: apache-2.0
- Created: 2020-11-17T14:33:14.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2025-02-14T11:26:55.000Z (8 months ago)
- Last Synced: 2025-03-25T14:01:37.987Z (6 months ago)
- Topics: cda, clinical-document-architecture, health, healthcare, hl7, hl7-parser, hl7-parsing, hl7v3, hl7v3-standards
- Language: Java
- Homepage:
- Size: 365 KB
- Stars: 8
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HL7CDA2
An extensible library to manage HL7 CDA2 documents.
## Examples
### Serialize a Clinical Document
```java
ClinicalDocument cda = buildClinicalDocument();ICDASerializer ser = new CDASerializer_IT();
String xml = ser.toXML(cda);
```### Deserialize a Clinical Document
```java
ICDADeserializer dser = new CDADeserializer();dser.load(xml);
ClinicalDocument cda = dser.getClinicalDocument();
```### Render a Clinical Document
```java
ICDARenderer ren = new CDARenderer_IT();Map opt = new HashMap();
opt.put("style", "body{ color: #202020; margin: 4 8 4 8; }");
opt.put("table", "width: 100%;");
opt.put("th", "background-color: #a8d7f7;");
opt.put("td", "background-color: #cfeafc;");
opt.put("title", "color: #000080;");
opt.put("paragraph", "font-style: italic;");ren.setOptions(opt);
String html = ren.toHTML(cda);
```### Transform a Clinical Document
```java
ICDARenderer ren = new CDARenderer_IT();
String html = ren.transform(xml, "CDAit.xsl");
```### Validate a Clinical Document
```java
ICDAValidator val = new CDAValidator();ValidationResult result = val.validate(xml);
System.out.println(result.isSuccess());
System.out.println(result.getErrors());
System.out.println(result.getFatals());
```### XAdES signature
```java
ICDASigner sig = new CDASignerXAdES();byte[] signed = sig.sign(xml);
System.out.println(new String(signed));
```### CAdES signature
```java
ICDASigner sig = new CDASignerCAdES();byte[] pkcs7 = sig.sign(xml);
```## Build
- `git clone https://github.com/giosil/hl7cda2.git`
- `mvn clean install`
- `mvn dependency:copy-dependencies` - To get libraries in target/dependency folder.
- `mvn cobertura:cobertura` - To run the unit tests and generate a Cobertura report.
- `mvn checkstyle:checkstyle` - To check source code respect the rules defined in checkstyle.xml.## Contributors
* [Giorgio Silvestris](https://github.com/giosil)