mmerlijn/msg-repo

Dutch healthcare read/write edifact to/from repository

Installs: 1 145

Dependents: 4

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:project

pkg:composer/mmerlijn/msg-repo

v3.2.5 2025-12-10 14:39 UTC

README

Repository to store healthcare data V3

installation

composer require mmerlijn/msg-repo

Order helpers

$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

Repo to array

$msg->toArray();

Compact array (empty values are removed)

$msg->toArray(true);

Form array to repo

$msg = new Msg(...$array);
//or
$msg = (new Msg)->fromArray($array);

Repository tree

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" => ""
      "organisation" => 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" => ""
      "organisation" => 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" => ""
      "organisation" => array:6 [
        "name" => ""
        "department" => ""
        "short" => ""
        "agbcode" => null
        "source" => null
        "phone" => ""
      ]
      "application" => ""
      "device" => ""
      "facility" => ""
      "location" => ""
    ]
    "organisation" => 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" => ""
    "organisation" => 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" => ""
    "organisation" => 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"
]