|
|
@ -0,0 +1,73 @@ |
|
|
|
package a8k.service.appdevicectrl; |
|
|
|
|
|
|
|
import a8k.controler.extapi.pagecontrol.ExtApiTabConfig; |
|
|
|
import a8k.controler.extapi.utils.EnginnerPageActionParam; |
|
|
|
import a8k.controler.extapi.utils.ExtApiFn; |
|
|
|
import a8k.controler.extapi.utils.ExtApiTab; |
|
|
|
import a8k.hardware.type.a8kcanprotocol.A8kEcode; |
|
|
|
import a8k.service.appstate.AppA8kGStateService; |
|
|
|
import a8k.service.appstate.type.EmergencyPosRunState; |
|
|
|
import a8k.service.bak_appbase.progress.EmergencySampleState; |
|
|
|
import a8k.type.exception.AppException; |
|
|
|
import a8k.type.type.BloodType; |
|
|
|
import jakarta.annotation.Resource; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
@ExtApiTab(cfg = ExtApiTabConfig.AppEmergencySamplePosStateMgrService) |
|
|
|
@Component |
|
|
|
public class AppEmergencySamplePosStateMgrService { |
|
|
|
|
|
|
|
@Resource |
|
|
|
AppA8kGStateService gstate; |
|
|
|
|
|
|
|
/* |
|
|
|
* 状态变化 |
|
|
|
* |
|
|
|
* 初始时: |
|
|
|
* getEmergencyPosRunState() -> state = IDLE |
|
|
|
* |
|
|
|
* 提交样本配置后 |
|
|
|
* getEmergencySampleSetting() -> state = PENDING |
|
|
|
* |
|
|
|
* 提交样本配置,且机器开始处理急诊样本时候 |
|
|
|
* getEmergencyPosRunState() -> state = PROCESSING |
|
|
|
* |
|
|
|
* 机器处理完急诊样本后 |
|
|
|
* getEmergencyPosRunState() -> state = FINISHED |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 提交紧急样本设置 |
|
|
|
* @param userid 用户ID |
|
|
|
* @param barcodeid 样本条码 |
|
|
|
* @param bloodType 血型 |
|
|
|
* @param projIndexList |
|
|
|
* |
|
|
|
* 提交后就默认样本已经放置好了,所以需要前台提醒用户需要先暂停设备,放好样本 |
|
|
|
*/ |
|
|
|
@ExtApiFn(name = "提交紧急样本设置", group = "紧急样本设置") |
|
|
|
public void commitEmergencySampleSetting(String userid, String barcodeid, BloodType bloodType,// |
|
|
|
@EnginnerPageActionParam(name = "逗号分割项目列表(例子1,2,3)") String projIndexList) throws AppException { |
|
|
|
EmergencyPosRunState state = gstate.getEmergencyPosRunState(); |
|
|
|
if (state.state.equals(EmergencySampleState.IDLE) || state.state.equals(EmergencySampleState.FINISHED)) { |
|
|
|
state.userid = userid; |
|
|
|
state.bloodType = bloodType; |
|
|
|
state.barcodeid = barcodeid; |
|
|
|
state.projIndex.clear(); |
|
|
|
for (String index : projIndexList.split(",")) { |
|
|
|
state.projIndex.add(Integer.parseInt(index)); |
|
|
|
} |
|
|
|
state.state = EmergencySampleState.PENDING; |
|
|
|
} else { |
|
|
|
throw new AppException(A8kEcode.EmergencySampleIsProcessing.index); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ExtApiFn(name = "获取急诊样本位状态", group = "急诊样本位状态") |
|
|
|
public EmergencyPosRunState getEmergencyPosRunState() { |
|
|
|
return gstate.getEmergencyPosRunState(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |