You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
86 lines
3.0 KiB
86 lines
3.0 KiB
package com.ynxbd.common.action;
|
|
|
|
|
|
import com.ynxbd.common.action.base.BaseAction;
|
|
import com.ynxbd.common.bean.his.HisTreat;
|
|
import com.ynxbd.common.dao.his.HisTreatDao;
|
|
import com.ynxbd.common.helper.common.AesHelper;
|
|
import com.ynxbd.common.result.Result;
|
|
import com.ynxbd.common.result.ResultEnum;
|
|
import com.ynxbd.common.result.ServiceException;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
import org.apache.struts2.convention.annotation.Action;
|
|
import org.apache.struts2.convention.annotation.Namespace;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
@Slf4j
|
|
@Namespace("/treat")
|
|
public class TreatAction extends BaseAction {
|
|
|
|
@Action("getTreatList")
|
|
public Result getTreatList(String patientId, String deptCode) {
|
|
log.info("[就诊记录]查询 patientId={}, deptCode={}", patientId, deptCode);
|
|
if (patientId == null || deptCode == null) {
|
|
return Result.error(ResultEnum.PARAM_IS_DEFECT);
|
|
}
|
|
List<HisTreat> treatList = new HisTreatDao().getTreatList(patientId, deptCode);
|
|
return Result.success(treatList);
|
|
}
|
|
|
|
|
|
@Action("createTreatRecord")
|
|
public Result createTreatRecord(String treatNum) {
|
|
log.info("[就诊记录]创建 treatNum={}", treatNum);
|
|
try {
|
|
if (treatNum == null) {
|
|
return Result.error(ResultEnum.PARAM_IS_DEFECT);
|
|
}
|
|
|
|
HisTreat treat = new HisTreatDao().createTreat(treatNum);
|
|
return Result.success(treat);
|
|
} catch (ServiceException e) {
|
|
return Result.error(e);
|
|
}
|
|
}
|
|
|
|
@Action("getInfoByTreatNum")
|
|
public Result getInfoByTreatNum(String treatNum) {
|
|
try {
|
|
if (treatNum == null) {
|
|
return Result.error(ResultEnum.PARAM_IS_BLANK);
|
|
}
|
|
treatNum = AesHelper.deCode(treatNum);
|
|
if (ObjectUtils.isEmpty(treatNum)) {
|
|
return Result.error(ResultEnum.PARAM_IS_INVALID);
|
|
}
|
|
log.info("[就诊记录]查询信息 treatNum={}", treatNum);
|
|
List<HisTreat> daatList = new HisTreatDao().getInfoByTreatNum(treatNum);
|
|
return Result.success(daatList);
|
|
} catch (ServiceException e) {
|
|
return Result.error(e);
|
|
}
|
|
}
|
|
|
|
@Action("getDoctCaSign")
|
|
public Result getDoctCaSign(String doctCode) {
|
|
try {
|
|
if (ObjectUtils.isEmpty(doctCode)) {
|
|
return Result.error(ResultEnum.PARAM_IS_INVALID);
|
|
}
|
|
log.info("[电子签名]查询 doctCode={}", doctCode);
|
|
String caSign = new HisTreatDao().getDoctCaSign(doctCode);
|
|
Map<String, Object> dataMap = new HashMap<>();
|
|
if (caSign != null) {
|
|
dataMap.put("caSign", AesHelper.enCode(caSign));
|
|
}
|
|
return Result.success(dataMap);
|
|
} catch (ServiceException e) {
|
|
return Result.error(e);
|
|
}
|
|
}
|
|
|
|
}
|
|
|