Update Master Formularium dan Corporate formularium
This commit is contained in:
@@ -7,10 +7,11 @@ use App\Models\Benefit;
|
||||
use App\Models\Corporate;
|
||||
use App\Models\Drug;
|
||||
use App\Models\Formularium;
|
||||
use App\Models\CorporateFormularium;
|
||||
use App\Models\Plan;
|
||||
use Box\Spout\Writer\Common\Creator\WriterEntityFactory;
|
||||
|
||||
class CorporateService
|
||||
class FormulariumService
|
||||
{
|
||||
protected function validateFormulariumRow($row)
|
||||
{
|
||||
@@ -45,4 +46,75 @@ class CorporateService
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
public function handleFormuariumTemplateRow($row, $id)
|
||||
{
|
||||
try {
|
||||
$formularium = Formularium::updateOrCreate(
|
||||
[
|
||||
'code' => $row['code'],
|
||||
'formularium_template_id' => $id
|
||||
],
|
||||
[
|
||||
'code' => $row['code'],
|
||||
'name' => $row['name'],
|
||||
'description' => $row['description'],
|
||||
'manufacturer' => $row['manufacturer'],
|
||||
'category_name' => $row['category_name'],
|
||||
'kategori_obat' => $row['kategori_obat'],
|
||||
'uom' => $row['uom'],
|
||||
'composition' => $row['composition'],
|
||||
'general_indication' => $row['general_indication'],
|
||||
'atc_code' => $row['atc_code'],
|
||||
'class' => $row['class'],
|
||||
'bpom_registration' => $row['bpom_registration'],
|
||||
'classifications' => $row['classifications'],
|
||||
'cat_for' => $row['cat_for'],
|
||||
'formularium_template_id' => $id,
|
||||
]);
|
||||
|
||||
return $formularium;
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
public function handleFormuariumCorporateRow($row, $id)
|
||||
{
|
||||
try {
|
||||
$formularium = CorporateFormularium::updateOrCreate(
|
||||
[
|
||||
'formularium_id' => $row['formularium_id'],
|
||||
'corporate_id' => $id
|
||||
],
|
||||
[
|
||||
'formularium_id' => $row['formularium_id'],
|
||||
'corporate_id' => $id,
|
||||
'active' => $row['active']
|
||||
]);
|
||||
|
||||
return $formularium;
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
public $listing_doc_headers = [
|
||||
"Internal Code",
|
||||
"Name",
|
||||
"Description",
|
||||
"Manufacturer",
|
||||
"Category Name",
|
||||
"Kategori Obat",
|
||||
"UOM",
|
||||
"Composition",
|
||||
"General Indication",
|
||||
"ATC Code",
|
||||
"Class",
|
||||
"BPOM Registration",
|
||||
"Classifications",
|
||||
"Cat For (O = obat, VS = Vitamin Suplemen, H=herbal, M=makanan, etc) ",
|
||||
];
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user