Skip to content

Commit e2514cf

Browse files
Merge pull request #62 from ivanwilliammd/hotfix_organization
Hotfix organization
2 parents e9c57eb + 79cac8d commit e2514cf

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/FHIR/Organization.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,17 @@ public function addAddress($address_line = null, $postal_code = null, $city_name
141141
public function json()
142142
{
143143
// Add Organization type
144-
$this->organization['type'][] = [
145-
'coding' => [
146-
[
147-
'system' => 'http://terminology.hl7.org/CodeSystem/organization-type',
148-
'code' => 'dept',
149-
'display' => 'Hospital Department',
144+
if (!array_key_exists('type', $this->organization)) {
145+
$this->organization['type'][] = [
146+
'coding' => [
147+
[
148+
'system' => 'http://terminology.hl7.org/CodeSystem/organization-type',
149+
'code' => 'dept',
150+
'display' => 'Hospital Department',
151+
],
150152
],
151-
],
152-
];
153+
];
154+
}
153155

154156
// Identifier is required
155157
if (!array_key_exists('identifier', $this->organization)) {

0 commit comments

Comments
 (0)