generated from spatie/package-skeleton-php
-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
46218ef
commit 6230b12
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
namespace Satusehat\Integration\FHIR; | ||
|
||
use Satusehat\Integration\Exception\FHIR\FHIRException; | ||
use Satusehat\Integration\OAuth2Client; | ||
|
||
class Medication extends OAuth2Client | ||
{ | ||
public array $medication = [ | ||
'resourceType' => 'Medication', | ||
]; | ||
|
||
public function addIdentifier($identifier) | ||
{ | ||
$identifier['system'] = 'http://sys-ids.kemkes.go.id/medication/'.$this->organization_id; | ||
$identifier['value'] = $identifier; | ||
$identifier['use'] = 'official'; | ||
|
||
$this->medication['identifier'][] = $identifier; | ||
} | ||
|
||
public function setCode($code = null, $display = null) | ||
{ | ||
$coding['system'] = 'http://sys-ids.kemkes.go.id/kfa'; | ||
$coding['code'] = $code; | ||
|
||
if ($display) { | ||
$coding['display'] = $display; | ||
} | ||
|
||
$this->medication['code']['coding'][] = $coding; | ||
} | ||
|
||
public function setStatus($status = 'active') | ||
{ | ||
$this->medication['status'] = $status; | ||
} | ||
|
||
public function setManufacturer($manufacturer = null) | ||
{ | ||
$this->medication['manufacturer']['reference'] = 'Organization/'.($manufacturer ? $manufacturer : $this->organization_id); | ||
} | ||
|
||
public function setForm($form = null) | ||
{ | ||
$this->medication['form']['coding'][] = [ | ||
'system' => 'http://terminology.hl7.org/CodeSystem/medication-form-codes', | ||
'code' => $form, | ||
]; | ||
} | ||
} |