feat(patient): implement record number pattern management
- Add RecordNumberSettingsController for managing patient record number patterns. - Create RecordNumberPattern entity to represent the pattern configuration. - Implement RecordNumberPatternRepository for database interactions. - Develop RecordNumberGenerator service for generating and validating record numbers. - Add tests for record number generation, backfilling, and API interactions. - Ensure proper access control for viewing and updating patterns based on user roles.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* یکتایی شمارهٔ پرونده در هر محیط.
|
||||
*
|
||||
* پیش از اجرا روی دادهٔ واقعی بررسی شد که شمارهٔ تکراری وجود ندارد. چند `NULL` در
|
||||
* unique index مجاز است، پس پروندههای بیشماره (که تا پیش از این قابلیت اکثریتاند)
|
||||
* مانع نمیشوند.
|
||||
*/
|
||||
final class Version20260804082400 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Unique patient record number per tenant';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('CREATE UNIQUE INDEX uniq_patient_record_number ON patient_records (entity_type, entity_id, record_number)');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('DROP INDEX uniq_patient_record_number ON patient_records');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user