Fix log formatting and outbox message processing

- Corrected ASCII row formatting in logs to ensure proper line breaks.
- Resolved issue causing empty result outbox during HL7 result simulation.
- Ensured messages are correctly processed and translation errors are handled.
This commit is contained in:
mahdahar 2025-12-29 08:23:48 +07:00
parent 622e0bd0de
commit 883f5b3643
2 changed files with 18 additions and 46 deletions

View File

@ -20,6 +20,7 @@ class CreateTestsTable extends Migration {
'VisibleRpt' => ['type' => 'int', 'null' => true], 'VisibleRpt' => ['type' => 'int', 'null' => true],
'CountStat' => ['type' => 'int', 'null' => true], 'CountStat' => ['type' => 'int', 'null' => true],
'CreateDate' => ['type' => 'Datetime', 'null' => true], 'CreateDate' => ['type' => 'Datetime', 'null' => true],
'StartDate' => ['type' => 'Datetime', 'null' => true],
'EndDate' => ['type' => 'Datetime', 'null' => true], 'EndDate' => ['type' => 'Datetime', 'null' => true],
]); ]);
$this->forge->addKey('TestSiteID', true); $this->forge->addKey('TestSiteID', true);
@ -27,7 +28,6 @@ class CreateTestsTable extends Migration {
$this->forge->addField([ $this->forge->addField([
'TestTechID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true], 'TestTechID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
'SiteID' => ['type' => 'INT', 'null' => true],
'TestSiteID' => ['type' => 'INT', 'null' => false], 'TestSiteID' => ['type' => 'INT', 'null' => false],
'DisciplineID' => ['type' => 'int', 'null' => true], 'DisciplineID' => ['type' => 'int', 'null' => true],
'DepartmentID' => ['type' => 'int', 'null' => true], 'DepartmentID' => ['type' => 'int', 'null' => true],
@ -52,7 +52,6 @@ class CreateTestsTable extends Migration {
$this->forge->addField([ $this->forge->addField([
'TestCalID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true], 'TestCalID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
'SiteID' => ['type' => 'INT', 'null' => true],
'TestSiteID' => ['type' => 'INT', 'null' => false], 'TestSiteID' => ['type' => 'INT', 'null' => false],
'DisciplineID' => ['type' => 'INT', 'null' => true], 'DisciplineID' => ['type' => 'INT', 'null' => true],
'DepartmentID' => ['type' => 'INT', 'null' => true], 'DepartmentID' => ['type' => 'INT', 'null' => true],
@ -70,7 +69,6 @@ class CreateTestsTable extends Migration {
$this->forge->addField([ $this->forge->addField([
'TestGrpID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true], 'TestGrpID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
'SiteID' => ['type' => 'INT', 'null' => true],
'TestSiteID' => ['type' => 'INT', 'null' => false], 'TestSiteID' => ['type' => 'INT', 'null' => false],
'Member' => ['type' => 'INT', 'null' => true], 'Member' => ['type' => 'INT', 'null' => true],
'CreateDate' => ['type' => 'Datetime', 'null' => true], 'CreateDate' => ['type' => 'Datetime', 'null' => true],

View File

@ -11,67 +11,43 @@ class CreateRefRangesTable extends Migration {
'RefNumID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true], 'RefNumID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
'SiteID' => ['type' => 'INT', 'null' => true], 'SiteID' => ['type' => 'INT', 'null' => true],
'TestSiteID' => ['type' => 'INT', 'null' => false], 'TestSiteID' => ['type' => 'INT', 'null' => false],
'SpcType' => ['type' => 'varchar', 'constraint'=> 10, 'null' => false], 'SpcType' => ['type' => 'INT', 'null' => true],
'Sex' => ['type' => 'INT', 'null' => true], 'Sex' => ['type' => 'INT', 'null' => true],
'Criteria' => ['type' => 'varchar', 'constraint'=>100, 'null' => true], 'Criteria' => ['type' => 'varchar', 'constraint'=>100, 'null' => true],
'AgeStart' => ['type' => 'INT', 'null' => true], 'AgeStart' => ['type' => 'INT', 'null' => true],
'AgeEnd' => ['type' => 'int', 'null' => true], 'AgeEnd' => ['type' => 'int', 'null' => true],
'CriticalLow' => ['type' => 'int', 'null' => true], 'NumRefType' => ['type' => 'INT', 'null' => true],
'Low' => ['type' => 'int', 'null' => true], 'RangeType' => ['type' => 'INT', 'null' => true],
'High' => ['type' => 'int', 'null' => true], 'LowSign' => ['type' => 'INT', 'null' => true],
'CriticalHigh' => ['type' => 'int', 'null' => true], 'Low' => ['type' => 'INT', 'null' => true],
'HighSign' => ['type' => 'INT', 'null' => true],
'High' => ['type' => 'INT', 'null' => true],
'Display' => ['type' => 'INT', 'null' => true],
'Flag' => ['type' => 'varchar', 'constraint'=>10, 'null' => true],
'Interpretation' => ['type' => 'varchar', 'constraint'=>255, 'null' => true],
'Notes' => ['type' => 'varchar', 'constraint'=>255, 'null' => true],
'CreateDate' => ['type' => 'Datetime', 'null' => true], 'CreateDate' => ['type' => 'Datetime', 'null' => true],
'StartDate' => ['type' => 'Datetime', 'null' => true],
'EndDate' => ['type' => 'Datetime', 'null' => true], 'EndDate' => ['type' => 'Datetime', 'null' => true],
]); ]);
$this->forge->addKey('RefNumID', true); $this->forge->addKey('RefNumID', true);
$this->forge->createTable('refnum'); $this->forge->createTable('refnum');
$this->forge->addField([
'RefTHoldID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
'SiteID' => ['type' => 'INT', 'null' => true],
'TestSiteID' => ['type' => 'INT', 'null' => false],
'SpcType' => ['type' => 'varchar', 'constraint'=> 10, 'null' => false],
'Sex' => ['type' => 'INT', 'null' => true],
'AgeStart' => ['type' => 'INT', 'null' => true],
'AgeEnd' => ['type' => 'int', 'null' => true],
'TholdSign' => ['type' => 'int', 'null' => true],
'TholdValue' => ['type' => 'int', 'null' => true],
'BelowTxt' => ['type' => 'varchar', 'constraint'=> 50, 'null' => true],
'AboveTxt' => ['type' => 'varchar', 'constraint'=> 50, 'null' => true],
'GrayZoneLow' => ['type' => 'int', 'null' => true],
'GrayZoneHigh' => ['type' => 'int', 'null' => true],
'GrayZoneTxt' => ['type' => 'varchar', 'constraint'=> 10, 'null' => true],
'CreateDate' => ['type' => 'Datetime', 'null' => true],
'EndDate' => ['type' => 'Datetime', 'null' => true],
]);
$this->forge->addKey('RefTHoldID', true);
$this->forge->createTable('refthold');
$this->forge->addField([
'RefVSetID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
'SiteID' => ['type' => 'INT', 'null' => true],
'TestSiteID' => ['type' => 'INT', 'null' => false],
'SpcType' => ['type' => 'varchar', 'constraint'=> 10, 'null' => false],
'Sex' => ['type' => 'INT', 'null' => true],
'AgeStart' => ['type' => 'INT', 'null' => true],
'AgeEnd' => ['type' => 'int', 'null' => true],
'RefTxt' => ['type' => 'varchar', 'constraint'=>255, 'null' => true],
'CreateDate' => ['type' => 'Datetime', 'null' => true],
'EndDate' => ['type' => 'Datetime', 'null' => true],
]);
$this->forge->addKey('RefVSetID', true);
$this->forge->createTable('refvset');
$this->forge->addField([ $this->forge->addField([
'RefTxtID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true], 'RefTxtID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
'SiteID' => ['type' => 'INT', 'null' => true], 'SiteID' => ['type' => 'INT', 'null' => true],
'TestSiteID' => ['type' => 'INT', 'null' => false], 'TestSiteID' => ['type' => 'INT', 'null' => false],
'SpcType' => ['type' => 'varchar', 'constraint'=> 10, 'null' => false], 'SpcType' => ['type' => 'varchar', 'constraint'=> 10, 'null' => false],
'Sex' => ['type' => 'INT', 'null' => true], 'Sex' => ['type' => 'INT', 'null' => true],
'Criteria' => ['type' => 'varchar', 'constraint'=>100, 'null' => true],
'AgeStart' => ['type' => 'INT', 'null' => true], 'AgeStart' => ['type' => 'INT', 'null' => true],
'AgeEnd' => ['type' => 'int', 'null' => true], 'AgeEnd' => ['type' => 'int', 'null' => true],
'TxtRefType' => ['type' => 'INT', 'null' => true],
'RefTxt' => ['type' => 'varchar', 'constraint'=>255, 'null' => true], 'RefTxt' => ['type' => 'varchar', 'constraint'=>255, 'null' => true],
'Flag' => ['type' => 'varchar', 'constraint'=>10, 'null' => true],
'Notes' => ['type' => 'varchar', 'constraint'=>255, 'null' => true],
'CreateDate' => ['type' => 'Datetime', 'null' => true], 'CreateDate' => ['type' => 'Datetime', 'null' => true],
'StartDate' => ['type' => 'Datetime', 'null' => true],
'EndDate' => ['type' => 'Datetime', 'null' => true], 'EndDate' => ['type' => 'Datetime', 'null' => true],
]); ]);
$this->forge->addKey('RefTxtID', true); $this->forge->addKey('RefTxtID', true);
@ -80,8 +56,6 @@ class CreateRefRangesTable extends Migration {
public function down() { public function down() {
$this->forge->dropTable('refnum'); $this->forge->dropTable('refnum');
$this->forge->dropTable('refthold');
$this->forge->dropTable('refvset');
$this->forge->dropTable('reftxt'); $this->forge->dropTable('reftxt');
} }
} }