From 79cac8d2d5baf83483c888780b1a1574d8bac909 Mon Sep 17 00:00:00 2001 From: ivanwilliammd Date: Tue, 12 Nov 2024 19:08:56 +0700 Subject: [PATCH] hotfix Organization JSON --- src/FHIR/Organization.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/FHIR/Organization.php b/src/FHIR/Organization.php index 1f5931d..6c44b98 100644 --- a/src/FHIR/Organization.php +++ b/src/FHIR/Organization.php @@ -140,6 +140,18 @@ public function addAddress($address_line = null, $postal_code = null, $city_name public function json() { + // Add Organization type + if (!array_key_exists('type', $this->organization)) { + $this->organization['type'][] = [ + 'coding' => [ + [ + 'system' => 'http://terminology.hl7.org/CodeSystem/organization-type', + 'code' => 'dept', + 'display' => 'Hospital Department', + ], + ], + ]; + } // Identifier is required if (!array_key_exists('identifier', $this->organization)) {