diff --git a/src/FHIR/Organization.php b/src/FHIR/Organization.php index 2e99c36..6c44b98 100644 --- a/src/FHIR/Organization.php +++ b/src/FHIR/Organization.php @@ -141,15 +141,17 @@ public function addAddress($address_line = null, $postal_code = null, $city_name public function json() { // Add Organization type - $this->organization['type'][] = [ - 'coding' => [ - [ - 'system' => 'http://terminology.hl7.org/CodeSystem/organization-type', - 'code' => 'dept', - 'display' => 'Hospital Department', + 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)) {