feat(dialysis+workflow): 透析会话 BPMN 工作流集成
- dialysis_record 新增 workflow_instance_id 列,关联工作流实例 - 种子 dialysis_session BPMN 流程定义:透前评估→上机确认→透中监测→透后评估→医生审核 - 事件驱动编排器:dialysis.record.created → 自动启动 BPMN 工作流 - 工作流启动后自动回写 instance_id 到透析记录 - 编排器在 erp-server 层实现(遵循星型依赖架构)
This commit is contained in:
@@ -113,6 +113,7 @@ mod m20260504_000110_alter_critical_alerts_version_i32;
|
||||
mod m20260505_000111_create_care_plan;
|
||||
mod m20260505_000112_create_shift_management;
|
||||
mod m20260505_000113_create_ble_gateways;
|
||||
mod m20260505_000114_dialysis_record_add_workflow_instance;
|
||||
|
||||
pub struct Migrator;
|
||||
|
||||
@@ -233,6 +234,7 @@ impl MigratorTrait for Migrator {
|
||||
Box::new(m20260505_000111_create_care_plan::Migration),
|
||||
Box::new(m20260505_000112_create_shift_management::Migration),
|
||||
Box::new(m20260505_000113_create_ble_gateways::Migration),
|
||||
Box::new(m20260505_000114_dialysis_record_add_workflow_instance::Migration),
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
use sea_orm_migration::prelude::*;
|
||||
|
||||
#[derive(DeriveMigrationName)]
|
||||
pub struct Migration;
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl MigrationTrait for Migration {
|
||||
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
||||
manager
|
||||
.alter_table(
|
||||
Table::alter()
|
||||
.table(Alias::new("dialysis_record"))
|
||||
.add_column(
|
||||
ColumnDef::new(Alias::new("workflow_instance_id"))
|
||||
.uuid()
|
||||
.null(),
|
||||
)
|
||||
.to_owned(),
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
||||
manager
|
||||
.alter_table(
|
||||
Table::alter()
|
||||
.table(Alias::new("dialysis_record"))
|
||||
.drop_column(Alias::new("workflow_instance_id"))
|
||||
.to_owned(),
|
||||
)
|
||||
.await
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user