|
@@ -30,7 +30,8 @@ import java.util.Map;
|
|
|
public class OrderCovidExamService {
|
|
|
private final AppointmentDao dao;
|
|
|
private final MultipleExamTimeLimit timeLimit = new MultipleExamTimeLimit();
|
|
|
- private final SimpleDateFormat timeLimitFormat = new SimpleDateFormat("HHmm");
|
|
|
+ private static Boolean CHECK_MAX_COVID_ANTIGEN = true;
|
|
|
+ private static Integer MAX_COVID_ANTIGEN = 100;
|
|
|
|
|
|
@Value("${hrgApiUrl}")
|
|
|
private String hrgApiUrl;
|
|
@@ -40,6 +41,11 @@ public class OrderCovidExamService {
|
|
|
this.dao = dao;
|
|
|
}
|
|
|
|
|
|
+ public void setCovidAntigenLimit(Boolean needCheck, int maxCount) {
|
|
|
+ CHECK_MAX_COVID_ANTIGEN = needCheck;
|
|
|
+ MAX_COVID_ANTIGEN = maxCount;
|
|
|
+ }
|
|
|
+
|
|
|
public ResultVo<String> hasDoneCovidAssessment(String patientId) {
|
|
|
CovidQuestionnaire covid = dao.validCovidAssessment(patientId);
|
|
|
if (null == covid) {
|
|
@@ -51,6 +57,9 @@ public class OrderCovidExamService {
|
|
|
|
|
|
public ResultVo<String> savePrescription(String patientId, int type) {
|
|
|
if (type == 2) {
|
|
|
+ if (CHECK_MAX_COVID_ANTIGEN && dao.reqCount("004651") >= MAX_COVID_ANTIGEN) {
|
|
|
+ return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "今日新冠抗原检测已售罄,无法继续下单,敬请谅解。");
|
|
|
+ }
|
|
|
int regNoExist = dao.regNoExist(patientId);
|
|
|
if (regNoExist == 0) {
|
|
|
return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "您今日没有有效的挂号信息,无法继续下单,敬请谅解。");
|