PHPackages                             nikitakls/cda - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. nikitakls/cda

ActiveLibrary[File &amp; Storage](/categories/file-storage)

nikitakls/cda
=============

A package to create cda files for n3health

v0.3(1y ago)1100MITPHP

Since Jun 24Pushed 1y agoCompare

[ Source](https://github.com/nikitakls/cda)[ Packagist](https://packagist.org/packages/nikitakls/cda)[ RSS](/packages/nikitakls-cda/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

CDA
===

[](#cda)

Create HL7-CDA (tm) documents in PHP.

This library has some Australian CDA Extensions enabled.
This library is a work in progress and does not currently provide full CDA coverage.

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b720fc8d42de1a41b513ebc3364768cb488dae6324ef8606d3e15d4814db9131/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7068702d6865616c74682f6364612f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/php-health/cda/?branch=master)

Usage
-----

[](#usage)

To see how to use the library check out the tests folder. [ClinicalDocument\_test](tests/ClinicalDocument_test.php) and [NCTIS\_test](tests/NCTIS_test.php)are good starting points.

### Manage references

[](#manage-references)

Each `ClinicalDocument` has its own `ReferenceManager`, which help to manage references across documents.

`ReferenceType` may be added on some elements to create a reference :

```
$doc = new ClinicalDocument();

$refManager = $doc->getReferenceManager();

// create an element 'element' which may have a reference

$element->setReference($refManager->getReferenceType('my_reference'));
// will create blabla

// add the reference in a text

$text->setText($refManager->getReferenceElement('my_reference'));
// will create

```

Run tests
---------

[](#run-tests)

1. Run composer to load phpunit and build autoload :

```
composer install

```

2. Run tests

```
you might see the the file phpunit-debug in the tests, the file sets up command line debugging for intellij:
export XDEBUG_CONFIG="idekey=phpstorm-xdebug";
phpunit $@

tests are structured so you can run the tests per group.  look for the @group docblock in each test file.

```

Version History
---------------

[](#version-history)

### Version 1.0.0

[](#version-100)

This version has undergone significant refactoring and has had many more tags implemented. There has been some customisation to the Australian context. The [NCTIS\_test](tests/NCTIS_test.php) implements the code examples for an event summary CDA document.

In this version there is now a lot better checking of tag attributes such as moodCodes, classCodes, TypeCodes. These acceptable codes are enumerated in their Interfaces. Check out [ClassCodeInterface](lib/Interfaces/ClassCodeInterface.php)for an example. The possible attributes for each tag are derived from the schema documents and set using the setAcceptable&lt; Attribute &gt;Codes methods.

PHP Traits have been used extensively to improve the code-styling/readability and to reduce unnecessary code duplication.

Note that while every effort was made to maintain compatibility with the previous version some changes were required, and some breaking changes were made.

### Version 0.1.0

[](#version-010)

First release

###  Health Score

26

—

LowBetter than 40% of packages

Maintenance47

Moderate activity, may be stable

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity29

Early-stage or recently created project

 Bus Factor1

Top contributor holds 70.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~11 days

Total

3

Last Release

396d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2038333?v=4)[Nikita](/maintainers/nikitakls)[@nikitakls](https://github.com/nikitakls)

---

Top Contributors

[![julienfastre](https://avatars.githubusercontent.com/u/345600?v=4)](https://github.com/julienfastre "julienfastre (26 commits)")[![nikitakls](https://avatars.githubusercontent.com/u/2038333?v=4)](https://github.com/nikitakls "nikitakls (7 commits)")[![leneaniki](https://avatars.githubusercontent.com/u/169373997?v=4)](https://github.com/leneaniki "leneaniki (4 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nikitakls-cda/health.svg)

```
[![Health](https://phpackages.com/badges/nikitakls-cda/health.svg)](https://phpackages.com/packages/nikitakls-cda)
```

###  Alternatives

[dmhendricks/file-icon-vectors

A collection of file type icons in SVG format.

37880.0k11](/packages/dmhendricks-file-icon-vectors)[barracudanetworks/archivestream-php

A library for dynamically streaming dynamic tar or zip files without the need to have the complete file stored on the server.

77196.8k1](/packages/barracudanetworks-archivestream-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
