PHP code example of mmerlijn / msg-repo
1. Go to this page and download the library: Download mmerlijn/msg-repo library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mmerlijn / msg-repo example snippets
composer
$order->addComment("comment")->addComment("Comment 2");
$order->addRequest($request)->addRequest($otherRequest);
$order->addResult($result);
$patient->setName($name)
->setAddress($address)
->setPhone("0612341234");
$order->getRequestedTestcodes(); //return all requested testcodes as array
$order->filterTestCodes(string|array); //filters requests and results with given test_code
$msg->toArray();
$msg->toArray(true);
$msg = new Msg(...$array);
//or
$msg = (new Msg)->fromArray($array);
array:11 [
"patient" => array:13 [
"sex" => ""
"name" => array:10 [
"initials" => ""
"firstname" => ""
"lastname" => ""
"prefix" => ""
"own_lastname" => ""
"own_prefix" => ""
"name" => ""
"sex" => ""
"salutation" => ""
"full_name" => ""
]
"dob" => null
"bsn" => ""
"address" => array:8 [
"postcode" => ""
"city" => ""
"street" => ""
"building" => ""
"building_nr" => ""
"building_addition" => ""
"country" => "NL"
"postbus" => ""
]
"address2" => null
"phones" => []
"insurance" => array:5 [
"uzovi" => ""
"policy_nr" => ""
"company_name" => ""
"phone" => ""
"address" => array:8 [
"postcode" => ""
"city" => ""
"street" => ""
"building" => ""
"building_nr" => ""
"building_addition" => ""
"country" => "NL"
"postbus" => ""
]
]
"ids" => []
"last_requester" => ""
"email" => null
"gp" => ""
"comments" => []
]
"order" => array:18 [
"control" => "NEW"
"request_nr" => ""
"lab_nr" => ""
"complete" => true
"priority" => null
"start_date" => null
"order_status" => "F"
"where" => ""
"requester" => array:11 [
"agbcode" => ""
"name" => array:10 [
"initials" => ""
"firstname" => ""
"lastname" => ""
"prefix" => ""
"own_lastname" => ""
"own_prefix" => ""
"name" => ""
"sex" => ""
"salutation" => ""
"full_name" => ""
]
"source" => ""
"address" => array:8 [
"postcode" => ""
"city" => ""
"street" => ""
"building" => ""
"building_nr" => ""
"building_addition" => ""
"country" => "NL"
"postbus" => ""
]
"phone" => ""
"type" => ""
"organization" => array:6 [
"name" => ""
"department" => ""
"short" => ""
"agbcode" => null
"source" => null
"phone" => ""
]
"application" => ""
"device" => ""
"facility" => ""
"location" => ""
]
"copy_to" => array:11 [
"agbcode" => ""
"name" => array:10 [
"initials" => ""
"firstname" => ""
"lastname" => ""
"prefix" => ""
"own_lastname" => ""
"own_prefix" => ""
"name" => ""
"sex" => ""
"salutation" => ""
"full_name" => ""
]
"source" => ""
"address" => array:8 [
"postcode" => ""
"city" => ""
"street" => ""
"building" => ""
"building_nr" => ""
"building_addition" => ""
"country" => "NL"
"postbus" => ""
]
"phone" => ""
"type" => ""
"organization" => array:6 [
"name" => ""
"department" => ""
"short" => ""
"agbcode" => null
"source" => null
"phone" => ""
]
"application" => ""
"device" => ""
"facility" => ""
"location" => ""
]
"entered_by" => array:11 [
"agbcode" => ""
"name" => array:10 [
"initials" => ""
"firstname" => ""
"lastname" => ""
"prefix" => ""
"own_lastname" => ""
"own_prefix" => ""
"name" => ""
"sex" => ""
"salutation" => ""
"full_name" => ""
]
"source" => ""
"address" => array:8 [
"postcode" => ""
"city" => ""
"street" => ""
"building" => ""
"building_nr" => ""
"building_addition" => ""
"country" => "NL"
"postbus" => ""
]
"phone" => ""
"type" => ""
"organization" => array:6 [
"name" => ""
"department" => ""
"short" => ""
"agbcode" => null
"source" => null
"phone" => ""
]
"application" => ""
"device" => ""
"facility" => ""
"location" => ""
]
"organization" => array:6 [
"name" => ""
"department" => ""
"short" => ""
"agbcode" => null
"source" => null
"phone" => ""
]
"request_at" => null
"observation_at" => null
"observation_end_at" => null
"analysis_at" => null
"requests" => array:1 [
0 => array:9 [
"test" => array:6 [
"code" => "1234"
"value" => "Testnaam"
"source" => "L"
"a_code" => ""
"a_value" => ""
"a_source" => ""
]
"other_test" => array:6 [
"code" => ""
"value" => ""
"source" => ""
"a_code" => ""
"a_value" => ""
"a_source" => ""
]
"change" => false
"id" => ""
"clinical_info" => ""
"priority" => false
"observations" => array:1 [
0 => array:11 [
"type" => "ST"
"value" => ""
"test" => array:6 [
"code" => "5678"
"value" => "Observatiewaarde"
"source" => ""
"a_code" => ""
"a_value" => ""
"a_source" => ""
]
"units" => ""
"quantity" => ""
"reference_range" => ""
"abnormal_flag" => ""
"comments" => []
"done" => true
"change" => false
"values" => []
]
]
"specimens" => []
"comments" => []
]
]
"admit_reason" => array:6 [
"code" => ""
"value" => ""
"source" => ""
"a_code" => ""
"a_value" => ""
"a_source" => ""
]
]
"sender" => array:11 [
"agbcode" => ""
"name" => array:10 [
"initials" => ""
"firstname" => ""
"lastname" => ""
"prefix" => ""
"own_lastname" => ""
"own_prefix" => ""
"name" => ""
"sex" => ""
"salutation" => ""
"full_name" => ""
]
"source" => ""
"address" => array:8 [
"postcode" => ""
"city" => ""
"street" => ""
"building" => ""
"building_nr" => ""
"building_addition" => ""
"country" => "NL"
"postbus" => ""
]
"phone" => ""
"type" => ""
"organization" => array:6 [
"name" => ""
"department" => ""
"short" => ""
"agbcode" => null
"source" => null
"phone" => ""
]
"application" => ""
"device" => ""
"facility" => ""
"location" => ""
]
"receiver" => array:11 [
"agbcode" => ""
"name" => array:10 [
"initials" => ""
"firstname" => ""
"lastname" => ""
"prefix" => ""
"own_lastname" => ""
"own_prefix" => ""
"name" => ""
"sex" => ""
"salutation" => ""
"full_name" => ""
]
"source" => ""
"address" => array:8 [
"postcode" => ""
"city" => ""
"street" => ""
"building" => ""
"building_nr" => ""
"building_addition" => ""
"country" => "NL"
"postbus" => ""
]
"phone" => ""
"type" => ""
"organization" => array:6 [
"name" => ""
"department" => ""
"short" => ""
"agbcode" => null
"source" => null
"phone" => ""
]
"application" => ""
"device" => ""
"facility" => ""
"location" => ""
]
"datetime" => "2025-12-04 07:31:54"
"msgType" => array:5 [
"type" => ""
"trigger" => ""
"structure" => ""
"version" => ""
"charset" => "8859/1"
]
"id" => ""
"security_id" => ""
"processing_id" => ""
"comments" => []
"default_source" => "L"
]