PHPackages                             mmerlijn/msg-edifact32 - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. mmerlijn/msg-edifact32

ActiveProject[Utility &amp; Helpers](/categories/utility)

mmerlijn/msg-edifact32
======================

Dutch healthcare read/write edifact3.2 to/from repository

v3.9(2w ago)137MITPHPPHP ^8.3

Since Nov 15Pushed 2w ago1 watchersCompare

[ Source](https://github.com/mmerlijn/edifact32)[ Packagist](https://packagist.org/packages/mmerlijn/msg-edifact32)[ RSS](/packages/mmerlijn-msg-edifact32/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (8)Versions (15)Used By (0)

Edifact32 MEDRPT
================

[](#edifact32-medrpt)

Write Medrpt edifact messages form msg repository

### Requirements

[](#requirements)

`php >=8.1`

### Installation

[](#installation)

` composer require mmerlijn/msg-edifact32`

### Writing messages

[](#writing-messages)

```
// fill the msg repository
$msg = new Msg();
$msg->sender->agbcode = "1234567";
$msg->receiver->agbcode = "7654321";
//...
$msg->id = "abc123"; //unique message id

//Patient data
$msg->patient->addId(new Id(id:"123456782",type:"bsn"));
$msg->patient->setName(new Name(
    own_lastname:"Doe",initials:"J"
));
$msg->patient->setSex("M");
$msg->patient->dob = Carbon::create("2000-10-05");
$msg->patient->setAddress(new Address(
   street: "Long Street",building: "14a",city: "Amsterdam",postcode: "1040AA"
   ));
$msg->patient->addPhone("0612341234");
$msg->patient->setInsurance(new Insurance(
            company_name: "CC Comp",
            policy_nr: "01234123124",
            uzovi: "1234",
        ));

//order data
$msg->order->admit_reason_code = "ABC";
$msg->order->admit_reason_name = "Xohabia";

$msg->order->control ="NEW"; //NEW / CANCEL / CHANGE / RESULT
$msg->order->request_nr = "AB123123123";
$msg->priority = false;
$msg->db_of_request = Carbon::now();
$msg->order->requester->agbcode = "0123456";
$msg->order->requester->setName(new Name(own_lastname: 'Arts',initials:"RP"));;
$msg->order->requester->source = "VEKTIS";

//requests
$msg->order->addRequest(new Request(
    test_code: "BBB", test_name: "Blubber"
));
$msg->order->where = "home"; // home=>L / other / else =>O

//result
$msg->order->addResult(new Result(
    type_of_value:"ST", //optional ST/NM/CE/FT
    test_code: "CCC",
    test_name: "Circular",
    value: "true",
    done: true, //final value
    change:false,
));
$msg->order->dt_of_observation = Carbon::now();
$msg->order->dt_of_analysis = Carbon::now();

//comments
$msg->addComment("Hello World"); //belongs to msg

$msg->order->requests->addComment("Hello Day"); // comment on request

$msg->order->result->addComment("Good morning") // comment on result

//create HL7 instance
$edi32 = new \mmerlijn\msgEdifact32\Edifact32()

//setting the data
$edi32->setMsg($msg);

//
try{
  echo $edi32->write(true); //with or without validation of required fields
}catch(\Exception $e){
   echo $e;
}
```

It is also possible to start with a template and add/overwrite msg data afterwards

### Getting message

[](#getting-message)

```
//init instance
$edi32 = new \mmerlijn\msgEdifact32\Edifact32("UNB+UNOA:1+50...");

//or
$edi32 = new \mmerlijn\msgEdifact32\Edifact32();
$edi32->read("MSH...");

//read data to repository (not tested, not planned for implementation)
$msg = $edi32->getMsg(new Msg());
```

### Result

[](#result)

```
```

###  Health Score

48

—

FairBetter than 93% of packages

Maintenance96

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~72 days

Total

14

Last Release

20d ago

Major Versions

v1.5 → v2.02024-06-17

v2.4 → v3.02026-01-11

PHP version history (3 changes)v1.0PHP ^8.1

v2.0PHP ^8.2

v3.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/84de98c9a1803dbd730aabade43023ab14d7df77a5e71c012ecdd1150b300213?d=identicon)[mmerlijn](/maintainers/mmerlijn)

---

Top Contributors

[![mmerlijn](https://avatars.githubusercontent.com/u/8401393?v=4)](https://github.com/mmerlijn "mmerlijn (14 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/mmerlijn-msg-edifact32/health.svg)

```
[![Health](https://phpackages.com/badges/mmerlijn-msg-edifact32/health.svg)](https://phpackages.com/packages/mmerlijn-msg-edifact32)
```

###  Alternatives

[illuminate/support

The Illuminate Support package.

630113.0M41.3k](/packages/illuminate-support)[spatie/holidays

Calculate public holidays

402860.1k2](/packages/spatie-holidays)[craftcms/feed-me

Import content from XML, RSS, CSV or JSON feeds into entries, categories, Craft Commerce products, and more.

293952.6k33](/packages/craftcms-feed-me)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

54681.3k19](/packages/solspace-craft-freeform)[pimcore/data-importer

Adds a comprehensive import functionality to Pimcore Datahub

46855.5k5](/packages/pimcore-data-importer)[japanese-date/japanese-date

日本の暦、祝日を取り扱うライブラリ

1610.0k](/packages/japanese-date-japanese-date)

PHPackages © 2026

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