From 3a5a554e8eb8035eaecd1dbebc4c196296981592 Mon Sep 17 00:00:00 2001 From: ivanwilliammd Date: Mon, 2 Dec 2024 12:45:10 +0000 Subject: [PATCH 01/15] Update CHANGELOG --- CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c3b782..90bfaaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,18 @@ * Added: API KFA * Updated : OAuth parameter changed from base_url to fhir_url +## 3.2.9 - 2024-12-02 + +### What's Changed + +* updated Medication.setId by @ivanwilliammd in https://github.com/ivanwilliammd/satusehat-integration/pull/110 +* updated MedicationRequest.setEncounterId by @ivanwilliammd in https://github.com/ivanwilliammd/satusehat-integration/pull/112 + +- [minor adjustment of ReasonCode](https://github.com/ivanwilliammd/satusehat-integration/commit/e220c01952550576286e4155ef586ea3019c40f6) by @ivanwilliammd +- [prevent double $timingcoding](https://github.com/ivanwilliammd/satusehat-integration/commit/246339fffe3178b12cfb0d4d8569938a91254121) by @ivanwilliammd + +**Full Changelog**: https://github.com/ivanwilliammd/satusehat-integration/compare/3.2.4...3.2.9 + ## 3.2.4 - 2024-12-02 ### What's Changed @@ -303,6 +315,7 @@ class BaseController extends Controller + ``` @@ -444,6 +457,7 @@ class BaseController extends Controller + ``` From 474c81251a8b45b7625cb0eea1c0c0f20ae6d0f5 Mon Sep 17 00:00:00 2001 From: ivanwilliammd Date: Mon, 2 Dec 2024 19:45:39 +0700 Subject: [PATCH 02/15] updated performerId & recorderId typo --- src/FHIR/MedicationRequest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FHIR/MedicationRequest.php b/src/FHIR/MedicationRequest.php index ccc48e9..1ad244a 100644 --- a/src/FHIR/MedicationRequest.php +++ b/src/FHIR/MedicationRequest.php @@ -158,7 +158,7 @@ public function setRequester($requesterId, $name) public function setPerformer($performerId, $name) { - $this->medication_request['performer']['reference'] = 'Practitioner/'.$performer; + $this->medication_request['performer']['reference'] = 'Practitioner/'.$performerId; $this->medication_request['performer']['display'] = $name; } @@ -173,7 +173,7 @@ public function setPerformerType($performer_type) public function setRecorder($recorderId, $name) { - $this->medication_request['recorder']['reference'] = 'Practitioner/'.$recorder; + $this->medication_request['recorder']['reference'] = 'Practitioner/'.$recorderId; $this->medication_request['recorder']['display'] = $name; } From 2f8e74e0b529a399086ce49b1d468b55974f973b Mon Sep 17 00:00:00 2001 From: ivanwilliammd Date: Mon, 2 Dec 2024 20:05:52 +0700 Subject: [PATCH 03/15] updated unitofmeasure for MedicationRequest.addDosageInstruction --- src/FHIR/MedicationRequest.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/FHIR/MedicationRequest.php b/src/FHIR/MedicationRequest.php index 1ad244a..3aec817 100644 --- a/src/FHIR/MedicationRequest.php +++ b/src/FHIR/MedicationRequest.php @@ -240,12 +240,13 @@ public function addDosageInstruction($sequence = 1, $route_code, $timing_code, $ $doseAndRate_type['coding'][] = $doseAndRate_type_coding; $doseAndRate_singular['type'] = $doseAndRate_type; - // If dose_value or dose_unit is not declared, skip + // If dose_value or dose_unit is not declared, skip this assignment + // Normally only used for partial dose, so only UOM supported in here, e.g. 5 mL if (isset($dose_value) && isset($dose_unit)) { $doseAndRate_quantity['value'] = $dose_value; $doseAndRate_quantity['code'] = $dose_unit; - $doseAndRate_quantity['system'] = $this->drug_form[$dose_unit]['system']; - $doseAndRate_quantity['unit'] = $this->drug_form[$dose_unit]['display']; + $doseAndRate_quantity['system'] = 'http://unitsofmeasure.org'; + $doseAndRate_quantity['unit'] = $dose_unit; $doseAndRate_singular['doseQuantity'] = $doseAndRate_quantity; } From 1fe6533166d2ff1f236f75c642e2598059ae6dc4 Mon Sep 17 00:00:00 2001 From: ivanwilliammd Date: Mon, 2 Dec 2024 20:09:18 +0700 Subject: [PATCH 04/15] MedicationRequest.addContained medication json array --- src/FHIR/MedicationRequest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FHIR/MedicationRequest.php b/src/FHIR/MedicationRequest.php index 3aec817..212248d 100644 --- a/src/FHIR/MedicationRequest.php +++ b/src/FHIR/MedicationRequest.php @@ -310,7 +310,7 @@ public function setSubstitution($allowed = true, $reason = 'G') public function addContained(Medication $medication) { - $this->medication_request['contained'][] = $medication; + $this->medication_request['contained'][] = json_decode($medication->json(), true); } public function json() From f0b099376cc6dbe6bd1698089ba2aa91d28af994 Mon Sep 17 00:00:00 2001 From: ivanwilliammd Date: Mon, 2 Dec 2024 20:11:06 +0700 Subject: [PATCH 05/15] added setMedicationREfernce --- src/FHIR/MedicationRequest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FHIR/MedicationRequest.php b/src/FHIR/MedicationRequest.php index 212248d..2647de8 100644 --- a/src/FHIR/MedicationRequest.php +++ b/src/FHIR/MedicationRequest.php @@ -120,10 +120,10 @@ public function addReportedReference($reference) $this->medication_request['reportedReference']['reference'] = $reference; } - public function setMedicationReference($reference) + public function setMedicationReference($reference, $display) { $this->medication_request['medicationReference']['reference'] = $reference; - $this->medication_request['medicationReference']['display'] = $reference; + $this->medication_request['medicationReference']['display'] = $display; } public function setSubject($subjectId, $name) From 664813acca3e00946b3e84bd243f556f11fa2937 Mon Sep 17 00:00:00 2001 From: ivanwilliammd Date: Mon, 2 Dec 2024 20:23:26 +0700 Subject: [PATCH 06/15] updated .html in medication.form.coding.system --- src/FHIR/Medication.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FHIR/Medication.php b/src/FHIR/Medication.php index 168040e..b1999ba 100644 --- a/src/FHIR/Medication.php +++ b/src/FHIR/Medication.php @@ -75,7 +75,7 @@ public function setForm($code = null) } $this->medication['form']['coding'][] = [ - 'system' => 'http://terminology.hl7.org/CodeSystem/medication-form-codes', + 'system' => 'http://terminology.hl7.org/CodeSystem/medication-form-codes.html', 'code' => $code, 'display' => $this->medication_form[$code], ]; From d90f976c1e1d6febfd663c7c15b56537e7847fa1 Mon Sep 17 00:00:00 2001 From: ivanwilliammd Date: Mon, 2 Dec 2024 20:27:42 +0700 Subject: [PATCH 07/15] updated Readme.md and Medication.form.system --- README.md | 1 + src/FHIR/Medication.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 70a37d3..d3c0198 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ - This unofficial SATUSEHAT FHIR PHP Library to help generate SATUSEHAT FHIR-ready JSON, using profile established by [SATUSEHAT Documentation](https://satusehat.kemkes.go.id/platform/docs). - This repository is rapidly developing and need help. Please kindly comment in [Issue](https://github.com/ivanwilliammd/satusehat-integration/issues) section to contribute or Sponsor this project. - Features supported --> see [Wiki](https://github.com/ivanwilliammd/satusehat-integration/wiki/Features) +- Error type from SATUSEHAT --> see [PUBLISHED - Dokumen Kamus Rule Number (Error Code)](https://docs.google.com/spreadsheets/d/1vnYFL2Ho1lICEgWmE2HFwkbEgiRvw1uaYBBW8NvwzjI/edit?gid=927500518#gid=927500518) ## SATUSEHAT dissemination summary - Update (19/9/2024) : Medication is attached to MedicationRequest and MedicationDispense diff --git a/src/FHIR/Medication.php b/src/FHIR/Medication.php index b1999ba..cd2ca24 100644 --- a/src/FHIR/Medication.php +++ b/src/FHIR/Medication.php @@ -75,7 +75,7 @@ public function setForm($code = null) } $this->medication['form']['coding'][] = [ - 'system' => 'http://terminology.hl7.org/CodeSystem/medication-form-codes.html', + 'system' => 'http://terminology.kemkes.go.id/CodeSystem/medication-form', 'code' => $code, 'display' => $this->medication_form[$code], ]; From 2212db1154a1b6977a776c6ae64a6138c55e7042 Mon Sep 17 00:00:00 2001 From: ivanwilliammd Date: Mon, 2 Dec 2024 20:37:31 +0700 Subject: [PATCH 08/15] fixed all medicationRequest error --- src/FHIR/MedicationRequest.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/FHIR/MedicationRequest.php b/src/FHIR/MedicationRequest.php index 2647de8..7bf472c 100644 --- a/src/FHIR/MedicationRequest.php +++ b/src/FHIR/MedicationRequest.php @@ -98,11 +98,12 @@ public function setIntent($intent = 'order') public function addCategory($category = 'outpatient') { - $this->medication_request['category']['coding'][] = [ + $medicationrequest_category['coding'][] = [ 'system' => 'http://terminology.hl7.org/CodeSystem/medicationrequest-category', 'code' => $category, 'display' => $this->medicationrequest_category[$category], ]; + $this->medication_request['category'][] = $medicationrequest_category; } public function setPriority($priority = 'routine') @@ -164,11 +165,12 @@ public function setPerformer($performerId, $name) public function setPerformerType($performer_type) { - $this->medication_request['performerType']['coding'][] = [ - 'system' => 'http://snomed.info/sct', + $medicationrequest_performer_type['coding'][] = [ + 'system' => 'http://terminology.hl7.org/CodeSystem/medicationrequest-performer-type', 'code' => $performer_type, 'display' => $this->performer_role[$performer_type], ]; + $this->medication_request['performerType'][] = $medicationrequest_performer_type; } public function setRecorder($recorderId, $name) @@ -189,16 +191,18 @@ public function addReasonCode($code, $display = null) $display = $display ? $display : $code_check->icd10_en; - $this->medication_request['reasonCode']['coding'][] = [ + $medicationrequest_reasonCode['coding'][] = [ 'system' => 'http://hl7.org/fhir/sid/icd-10', 'code' => strtoupper($code), 'display' => $display, ]; + + $this->medication_request['reasonCode'][] = $medicationrequest_reasonCode; } public function addReasonReference($reference) { - $this->medication_request['reasonReference']['reference'] = 'Condition/'.$reference; + $this->medication_request['reasonReference'][]['reference'] = 'Condition/'.$reference; } public function addBasedOn($reference) @@ -257,7 +261,7 @@ public function addDosageInstruction($sequence = 1, $route_code, $timing_code, $ $route_coding['code'] = $route_code; $route_coding['display'] = $this->route[$route_code]; - $dosage_instruction['route']['coding'] = $route_coding; + $dosage_instruction['route']['coding'][] = $route_coding; $timing_coding['system'] = 'http://terminology.hl7.org/CodeSystem/v3-GTSAbbreviation'; $timing_coding['code'] = $timing_code; From 49d90d531104ba6fa48b9b64089bf30723882f5c Mon Sep 17 00:00:00 2001 From: ivanwilliammd Date: Mon, 2 Dec 2024 20:54:14 +0700 Subject: [PATCH 09/15] updated MedicationRequest & Medication --- src/FHIR/Medication.php | 8 +++- src/FHIR/MedicationRequest.php | 76 +++++++++++++++++++++------------- 2 files changed, 53 insertions(+), 31 deletions(-) diff --git a/src/FHIR/Medication.php b/src/FHIR/Medication.php index cd2ca24..a4e0d94 100644 --- a/src/FHIR/Medication.php +++ b/src/FHIR/Medication.php @@ -116,10 +116,14 @@ public function addIngredient($itemCode = null, $itemDisplay = null, $numerator throw new FHIRException("Item display is required"); } - $ingredient['item']['coding'][] = [ - 'system' => 'http://sys-ids.kemkes.go.id/kfa', + $ingredient['itemCodableConcept'] = [ + 'coding' => [ + [ + 'system' => 'http://sys-ids.kemkes.go.id/kfa', 'code' => $itemCode, 'display' => $itemDisplay, + ], + ], ]; $ingredient['isActive'] = true; diff --git a/src/FHIR/MedicationRequest.php b/src/FHIR/MedicationRequest.php index 7bf472c..e5192ef 100644 --- a/src/FHIR/MedicationRequest.php +++ b/src/FHIR/MedicationRequest.php @@ -98,12 +98,15 @@ public function setIntent($intent = 'order') public function addCategory($category = 'outpatient') { - $medicationrequest_category['coding'][] = [ - 'system' => 'http://terminology.hl7.org/CodeSystem/medicationrequest-category', - 'code' => $category, - 'display' => $this->medicationrequest_category[$category], - ]; - $this->medication_request['category'][] = $medicationrequest_category; + $this->medication_request['category'][] = [ + 'coding' => [ + [ + 'system' => 'http://terminology.hl7.org/CodeSystem/medicationrequest-category', + 'code' => $category, + 'display' => $this->medicationrequest_category[$category], + ], + ], + ];; } public function setPriority($priority = 'routine') @@ -165,12 +168,15 @@ public function setPerformer($performerId, $name) public function setPerformerType($performer_type) { - $medicationrequest_performer_type['coding'][] = [ - 'system' => 'http://terminology.hl7.org/CodeSystem/medicationrequest-performer-type', - 'code' => $performer_type, - 'display' => $this->performer_role[$performer_type], - ]; - $this->medication_request['performerType'][] = $medicationrequest_performer_type; + $this->medication_request['performerType'][] = [ + 'coding' => [ + [ + 'system' => 'http://terminology.hl7.org/CodeSystem/medicationrequest-performer-type', + 'code' => $performer_type, + 'display' => $this->performer_role[$performer_type], + ], + ], + ];; } public function setRecorder($recorderId, $name) @@ -191,18 +197,22 @@ public function addReasonCode($code, $display = null) $display = $display ? $display : $code_check->icd10_en; - $medicationrequest_reasonCode['coding'][] = [ - 'system' => 'http://hl7.org/fhir/sid/icd-10', - 'code' => strtoupper($code), - 'display' => $display, + $this->medication_request['reasonCode'][] = [ + 'coding' => [ + [ + 'system' => 'http://hl7.org/fhir/sid/icd-10', + 'code' => strtoupper($code), + 'display' => $display, + ], + ], ]; - - $this->medication_request['reasonCode'][] = $medicationrequest_reasonCode; } public function addReasonReference($reference) { - $this->medication_request['reasonReference'][]['reference'] = 'Condition/'.$reference; + $this->medication_request['reasonReference'][] = [ + 'reference' => 'Condition/'.$reference, + ]; } public function addBasedOn($reference) @@ -257,17 +267,25 @@ public function addDosageInstruction($sequence = 1, $route_code, $timing_code, $ $dosage_instruction['doseAndRate'][] = $doseAndRate_singular; - $route_coding['system'] = 'http://snomed.info/sct'; - $route_coding['code'] = $route_code; - $route_coding['display'] = $this->route[$route_code]; - - $dosage_instruction['route']['coding'][] = $route_coding; - - $timing_coding['system'] = 'http://terminology.hl7.org/CodeSystem/v3-GTSAbbreviation'; - $timing_coding['code'] = $timing_code; - $timing_coding['display'] = $this->timing[$timing_code]; + $dosage_instruction['route'][] = [ + 'coding' => [ + [ + 'system' => 'http://snomed.info/sct', + 'code' => $route_code, + 'display' => $this->route[$route_code], + ], + ], + ]; - $dosage_instruction['timing']['coding'][] = $timing_coding; + $dosage_instruction['timing']['code'][] = [ + 'coding' => [ + [ + 'system' => 'http://terminology.hl7.org/CodeSystem/v3-GTSAbbreviation', + 'code' => $timing_code, + 'display' => $this->timing[$timing_code], + ], + ], + ];; $this->medication_request['dosageInstruction'][] = $dosage_instruction; } From ef3c58b876efa65938b24022b5fe214118878ce7 Mon Sep 17 00:00:00 2001 From: ivanwilliammd Date: Mon, 2 Dec 2024 20:57:03 +0700 Subject: [PATCH 10/15] fixed codableconcept --- src/FHIR/Medication.php | 46 +++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/src/FHIR/Medication.php b/src/FHIR/Medication.php index a4e0d94..f2cfe45 100644 --- a/src/FHIR/Medication.php +++ b/src/FHIR/Medication.php @@ -47,14 +47,15 @@ public function addIdentifier($medication_id) 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; + $this->medication['code'][] = [ + 'coding' => [ + [ + 'system' => 'http://sys-ids.kemkes.go.id/kfa', + 'code' => $code, + 'display' => $display, + ], + ], + ]; } public function setStatus($status = 'active') @@ -74,11 +75,16 @@ public function setForm($code = null) throw new FHIRException("Medication form code not found"); } - $this->medication['form']['coding'][] = [ - 'system' => 'http://terminology.kemkes.go.id/CodeSystem/medication-form', - 'code' => $code, - 'display' => $this->medication_form[$code], + $this->medication['form'][] = [ + 'coding' => [ + [ + 'system' => 'http://terminology.kemkes.go.id/CodeSystem/medication-form', + 'code' => $code, + 'display' => $this->medication_form[$code], + ], + ], ]; + } public function setAmount($numerator = null, $numerator_unit = null, $denominator = 1, $denominator_unit = null) @@ -120,8 +126,8 @@ public function addIngredient($itemCode = null, $itemDisplay = null, $numerator 'coding' => [ [ 'system' => 'http://sys-ids.kemkes.go.id/kfa', - 'code' => $itemCode, - 'display' => $itemDisplay, + 'code' => $itemCode, + 'display' => $itemDisplay, ], ], ]; @@ -165,10 +171,14 @@ public function setMedicationType($code = 'NC') ); $medicationType['url'] = 'https://fhir.kemkes.go.id/r4/StructureDefinition/MedicationType'; - $medicationType['valueCodeableConcept']['coding'][] = [ - 'system' => 'http://terminology.kemkes.go.id/CodeSystem/medication-type', - 'code' => $code, - 'display' => $medicationTypeOption[$code], + $medicationType['valueCodeableConcept'][] = [ + 'coding' => [ + [ + 'system' => 'http://terminology.kemkes.go.id/CodeSystem/medication-type', + 'code' => $code, + 'display' => $medicationTypeOption[$code], + ], + ], ]; $this->medication['extension'][] = $medicationType; From e69ba62ba2e48ac8924fa01c2c915814b61f6e80 Mon Sep 17 00:00:00 2001 From: ivanwilliammd Date: Mon, 2 Dec 2024 21:00:44 +0700 Subject: [PATCH 11/15] updated medication codableconcept --- src/FHIR/MedicationRequest.php | 39 ++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/src/FHIR/MedicationRequest.php b/src/FHIR/MedicationRequest.php index e5192ef..fa13ac0 100644 --- a/src/FHIR/MedicationRequest.php +++ b/src/FHIR/MedicationRequest.php @@ -82,13 +82,15 @@ public function setStatus($status = 'completed') public function setStatusReason($status_code = null) { - $medicationrequest_status_reason = [ - 'system' => 'http://sys-ids.kemkes.go.id/status-reason', - 'code' => $status_code, - 'display' => $this->medicationrequest_status_reason[$status_code], + $this->medication_request['statusReason'][] = [ + 'coding' => [ + [ + 'system' => 'http://sys-ids.kemkes.go.id/status-reason', + 'code' => $status_code, + 'display' => $this->medicationrequest_status_reason[$status_code], + ], + ], ]; - - $this->medication_request['statusReason']['coding'][] = $medicationrequest_status_reason; } public function setIntent($intent = 'order') @@ -222,10 +224,14 @@ public function addBasedOn($reference) public function setCourseOfTherapyType($course) { - $this->medication_request['courseOfTherapyType']['coding'][] = [ - 'system' => 'http://terminology.hl7.org/CodeSystem/medicationrequest-course-of-therapy', - 'code' => $course, - 'display' => $this->course_of_therapy_type[$course], + $this->medication_request['courseOfTherapyType'][] = [ + 'coding' => [ + [ + 'system' => 'http://terminology.hl7.org/CodeSystem/medicationrequest-course-of-therapy', + 'code' => $course, + 'display' => $this->course_of_therapy_type[$course], + ], + ], ]; } @@ -247,11 +253,16 @@ public function addDosageInstruction($sequence = 1, $route_code, $timing_code, $ $dosage_instruction['patientInstruction'] = $patientInstruction; $dosage_instruction['asNeededBoolean'] = $as_needed; - $doseAndRate_type_coding['system'] = 'http://terminology.hl7.org/CodeSystem/dose-rate-type'; - $doseAndRate_type_coding['code'] = 'ordered'; - $doseAndRate_type_coding['display'] = 'Ordered'; + $doseAndRate_type = [ + 'coding' => [ + [ + 'system' => 'http://terminology.hl7.org/CodeSystem/dose-rate-type', + 'code' => 'ordered', + 'display' => 'Ordered', + ], + ], + ]; - $doseAndRate_type['coding'][] = $doseAndRate_type_coding; $doseAndRate_singular['type'] = $doseAndRate_type; // If dose_value or dose_unit is not declared, skip this assignment From ca3bef460d716a2953bbe97e23c4d389d527d663 Mon Sep 17 00:00:00 2001 From: ivanwilliammd Date: Mon, 2 Dec 2024 21:07:18 +0700 Subject: [PATCH 12/15] adjusted terminology for MedicationRequest.dosageInstruction.route with WHO ATC terminology instead of snomed CT --- src/FHIR/MedicationRequest.php | 2 +- src/Terminology/MedicationTerminology.php | 35 ++++++++++++++++++++++- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/FHIR/MedicationRequest.php b/src/FHIR/MedicationRequest.php index fa13ac0..89945d2 100644 --- a/src/FHIR/MedicationRequest.php +++ b/src/FHIR/MedicationRequest.php @@ -281,7 +281,7 @@ public function addDosageInstruction($sequence = 1, $route_code, $timing_code, $ $dosage_instruction['route'][] = [ 'coding' => [ [ - 'system' => 'http://snomed.info/sct', + 'system' => 'http://www.whocc.no/atc', 'code' => $route_code, 'display' => $this->route[$route_code], ], diff --git a/src/Terminology/MedicationTerminology.php b/src/Terminology/MedicationTerminology.php index 3648ff6..7970415 100644 --- a/src/Terminology/MedicationTerminology.php +++ b/src/Terminology/MedicationTerminology.php @@ -354,7 +354,7 @@ class MedicationTerminology "MO" => "monthly", ); - public array $route = array( + public array $route_snomed = array( 697971008 => "Arteriovenous fistula route", 420254004 => "Body cavity route", 54471007 => "Buccal route", @@ -520,6 +520,39 @@ class MedicationTerminology 16857009 => "Vaginal route", ); + public array $routes = array( + "implant" => "Implant", + "Inhal" => "Inhalation", + "Instill" => "Instillation", + "N" => "Nasal", + "O" => "Oral", + "P" => "Parenteral", + "R" => "Rectal", + "SL" => "Sublingual/Buccal/Oromucosal", + "TD" => "Transdermal", + "V" => "Vaginal", + "Inhal.powder" => "Inhalation Powder", + "Inhal.aerosol" => "Inhalation Aerosol", + "Inhal.solution" => "Inhalation Solution", + "urethral" => "Urethral", + "TD patch" => "Transdermal Patch", + "intravesical" => "Intravesical", + "Instill.solution" => "Instillation Solution", + "lamella" => "Lamella", + "oral aerosol" => "Oral Aerosol", + "s.c. implant" => "S.C. Implant", + "ocular" => "Ocular", + "otic" => "Otic", + "cutaneous" => "Cutaneous", + "inj.subcutaneous" => "Injection Subcutaneous", + "inj.intramuscular" => "Injection Intramuscular", + "inj.intravenous" => "Injection Intravenous", + "inj.intrathecal" => "Injection Intrathecal", + "Chewing Gum" => "Chewing Gum", + "ointment" => "Ointment", + "stomatologic" => "Stomatologic" + ); + public function __construct() { $this->medication_form = $this->medication_form; From 31c4aaf116f32053450d9638dd8b19beceaba429 Mon Sep 17 00:00:00 2001 From: ivanwilliammd Date: Mon, 2 Dec 2024 21:14:33 +0700 Subject: [PATCH 13/15] updated $route typo in MedicationTerminology --- src/Terminology/MedicationTerminology.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Terminology/MedicationTerminology.php b/src/Terminology/MedicationTerminology.php index 7970415..1843be9 100644 --- a/src/Terminology/MedicationTerminology.php +++ b/src/Terminology/MedicationTerminology.php @@ -520,7 +520,7 @@ class MedicationTerminology 16857009 => "Vaginal route", ); - public array $routes = array( + public array $route = array( "implant" => "Implant", "Inhal" => "Inhalation", "Instill" => "Instillation", From 9c8ae4329453623f45f086d6b3fe2006401f7986 Mon Sep 17 00:00:00 2001 From: ivanwilliammd Date: Mon, 2 Dec 2024 21:18:36 +0700 Subject: [PATCH 14/15] fixed valueCodableConcept --- src/FHIR/Medication.php | 6 +++--- src/FHIR/MedicationRequest.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/FHIR/Medication.php b/src/FHIR/Medication.php index f2cfe45..96cb9b7 100644 --- a/src/FHIR/Medication.php +++ b/src/FHIR/Medication.php @@ -47,7 +47,7 @@ public function addIdentifier($medication_id) public function setCode($code = null, $display = null) { - $this->medication['code'][] = [ + $this->medication['code'] = [ 'coding' => [ [ 'system' => 'http://sys-ids.kemkes.go.id/kfa', @@ -75,7 +75,7 @@ public function setForm($code = null) throw new FHIRException("Medication form code not found"); } - $this->medication['form'][] = [ + $this->medication['form'] = [ 'coding' => [ [ 'system' => 'http://terminology.kemkes.go.id/CodeSystem/medication-form', @@ -171,7 +171,7 @@ public function setMedicationType($code = 'NC') ); $medicationType['url'] = 'https://fhir.kemkes.go.id/r4/StructureDefinition/MedicationType'; - $medicationType['valueCodeableConcept'][] = [ + $medicationType['valueCodeableConcept'] = [ 'coding' => [ [ 'system' => 'http://terminology.kemkes.go.id/CodeSystem/medication-type', diff --git a/src/FHIR/MedicationRequest.php b/src/FHIR/MedicationRequest.php index 89945d2..3a8e577 100644 --- a/src/FHIR/MedicationRequest.php +++ b/src/FHIR/MedicationRequest.php @@ -170,7 +170,7 @@ public function setPerformer($performerId, $name) public function setPerformerType($performer_type) { - $this->medication_request['performerType'][] = [ + $this->medication_request['performerType'] = [ 'coding' => [ [ 'system' => 'http://terminology.hl7.org/CodeSystem/medicationrequest-performer-type', @@ -278,7 +278,7 @@ public function addDosageInstruction($sequence = 1, $route_code, $timing_code, $ $dosage_instruction['doseAndRate'][] = $doseAndRate_singular; - $dosage_instruction['route'][] = [ + $dosage_instruction['route'] = [ 'coding' => [ [ 'system' => 'http://www.whocc.no/atc', @@ -288,7 +288,7 @@ public function addDosageInstruction($sequence = 1, $route_code, $timing_code, $ ], ]; - $dosage_instruction['timing']['code'][] = [ + $dosage_instruction['timing']['code'] = [ 'coding' => [ [ 'system' => 'http://terminology.hl7.org/CodeSystem/v3-GTSAbbreviation', From 16d3f18cae62d6a69af82c00ed2a3b1a18a315b4 Mon Sep 17 00:00:00 2001 From: ivanwilliammd Date: Mon, 2 Dec 2024 21:34:53 +0700 Subject: [PATCH 15/15] updated MedicationRequest.put --- src/FHIR/MedicationRequest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FHIR/MedicationRequest.php b/src/FHIR/MedicationRequest.php index 3a8e577..68988a3 100644 --- a/src/FHIR/MedicationRequest.php +++ b/src/FHIR/MedicationRequest.php @@ -376,7 +376,7 @@ public function post() public function put($id) { - $this->medication['id'] = $id; + $this->medication_request['id'] = $id; $payload = $this->json(); [$statusCode, $res] = $this->ss_put('MedicationRequest', $id, $payload);