- Add opd_coding_queue + opd_snomed_suggestions migrations - Add ProcessSnomedCoding spark command (cron: snomed:process-coding) Extracts clinical phrases, matches local SNOMED FULLTEXT, saves suggestions - Add AbdmCodingPanel controller: index/review/confirm/reject/correct/mark_fhir_ready/tip_check - Add coding_panel + coding_panel_review views (Bootstrap 5, AJAX actions) - Inject queue trigger in opd_prescription_save (fail-open, ON DUPLICATE KEY) - Add consult form tip badge: polls tip_check 4s after save, shows review link - Add AbdmCodingPanel routes behind abdm permission filter - Various ABDM gateway, FHIR, ABHA, SNOMED library updates
47 lines
1.4 KiB
PHP
47 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Database\Migrations;
|
|
|
|
use CodeIgniter\Database\Migration;
|
|
|
|
class AddSnomedToInvestigation extends Migration
|
|
{
|
|
public function up()
|
|
{
|
|
if (! $this->db->tableExists('investigation')) {
|
|
return;
|
|
}
|
|
|
|
$fields = $this->db->getFieldNames('investigation');
|
|
$add = [];
|
|
|
|
if (! in_array('snomed_concept_id', $fields, true)) {
|
|
$add['snomed_concept_id'] = ['type' => 'VARCHAR', 'constraint' => 30, 'null' => true, 'default' => null];
|
|
}
|
|
if (! in_array('snomed_term', $fields, true)) {
|
|
$add['snomed_term'] = ['type' => 'VARCHAR', 'constraint' => 500, 'null' => true, 'default' => null];
|
|
}
|
|
if (! in_array('loinc_code', $fields, true)) {
|
|
$add['loinc_code'] = ['type' => 'VARCHAR', 'constraint' => 20, 'null' => true, 'default' => null];
|
|
}
|
|
|
|
if (! empty($add)) {
|
|
$this->forge->addColumn('investigation', $add);
|
|
}
|
|
}
|
|
|
|
public function down()
|
|
{
|
|
if (! $this->db->tableExists('investigation')) {
|
|
return;
|
|
}
|
|
|
|
$fields = $this->db->getFieldNames('investigation');
|
|
foreach (['snomed_concept_id', 'snomed_term', 'loinc_code'] as $col) {
|
|
if (in_array($col, $fields, true)) {
|
|
$this->forge->dropColumn('investigation', $col);
|
|
}
|
|
}
|
|
}
|
|
}
|