门诊挂号-部分
This commit is contained in:
@@ -89,6 +89,12 @@ public class HealthcareServiceDto {
|
||||
private Integer appointmentRequiredFlag;
|
||||
private String appointmentRequiredFlag_enumText;
|
||||
|
||||
/**
|
||||
* 费用定价ID
|
||||
*/
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long definitionId;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
|
||||
@@ -17,8 +17,14 @@ import com.core.common.core.domain.R;
|
||||
import com.core.common.utils.AgeCalculatorUtil;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.openhis.administration.domain.Encounter;
|
||||
import com.openhis.administration.domain.EncounterLocation;
|
||||
import com.openhis.administration.domain.EncounterParticipant;
|
||||
import com.openhis.administration.domain.Patient;
|
||||
import com.openhis.administration.mapper.PatientMapper;
|
||||
import com.openhis.administration.service.IEncounterLocationService;
|
||||
import com.openhis.administration.service.IEncounterParticipantService;
|
||||
import com.openhis.administration.service.IEncounterService;
|
||||
import com.openhis.clinical.domain.ConditionDefinition;
|
||||
import com.openhis.clinical.mapper.ConditionDefinitionMapper;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
@@ -59,6 +65,15 @@ public class IOutpatientRegistrationAppServiceImpl implements IOutpatientRegistr
|
||||
@Resource
|
||||
HealthcareServiceBizMapper healthcareServiceBizMapper;
|
||||
|
||||
@Resource
|
||||
IEncounterService iEncounterService;
|
||||
|
||||
@Resource
|
||||
IEncounterLocationService iEncounterLocationService;
|
||||
|
||||
@Resource
|
||||
IEncounterParticipantService iEncounterParticipantService;
|
||||
|
||||
/**
|
||||
* 门诊挂号 - 查询患者信息
|
||||
*
|
||||
@@ -71,7 +86,7 @@ public class IOutpatientRegistrationAppServiceImpl implements IOutpatientRegistr
|
||||
public Page<PatientMetadata> getPatientMetadataBySearchKey(String searchKey, Integer pageNo, Integer pageSize) {
|
||||
// 构建查询条件
|
||||
QueryWrapper<Patient> queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey,
|
||||
new HashSet<>(Arrays.asList("id_card","name", "py_str", "wb_str")), null);
|
||||
new HashSet<>(Arrays.asList("id_card", "name", "py_str", "wb_str")), null);
|
||||
// 设置排序
|
||||
queryWrapper.orderByDesc("update_time");
|
||||
// 患者信息
|
||||
@@ -194,6 +209,40 @@ public class IOutpatientRegistrationAppServiceImpl implements IOutpatientRegistr
|
||||
*/
|
||||
@Override
|
||||
public R<?> saveRegister(OutpatientRegistrationAddParam outpatientRegistrationAddParam) {
|
||||
// 就诊管理-表单数据
|
||||
EncounterFormData encounterFormData = outpatientRegistrationAddParam.getEncounterFormData();
|
||||
// 就诊位置管理-表单数据
|
||||
EncounterLocationFormData encounterLocationFormData =
|
||||
outpatientRegistrationAddParam.getEncounterLocationFormData();
|
||||
// 就诊参数者管理-表单数据
|
||||
EncounterParticipantFormData encounterParticipantFormData =
|
||||
outpatientRegistrationAddParam.getEncounterParticipantFormData();
|
||||
|
||||
// 患者ID
|
||||
Long patientId = encounterFormData.getPatientId();
|
||||
// 服务项目ID
|
||||
Long serviceTypeId = encounterFormData.getServiceTypeId();
|
||||
// 校验是否重复挂号
|
||||
Integer num = outpatientRegistrationAppMapper.getNumByPatientIdAndOrganizationId(patientId, serviceTypeId);
|
||||
if (num > 0) {
|
||||
return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
}
|
||||
|
||||
// 保存就诊信息
|
||||
Encounter encounter = new Encounter();
|
||||
BeanUtils.copyProperties(encounterFormData, encounter);
|
||||
// 就诊ID
|
||||
Long encounterId = iEncounterService.saveEncounter(encounter);
|
||||
// 保存就诊位置信息
|
||||
encounterLocationFormData.setEncounterId(encounterId);
|
||||
EncounterLocation encounterLocation = new EncounterLocation();
|
||||
BeanUtils.copyProperties(encounterLocationFormData, encounterLocation);
|
||||
iEncounterLocationService.saveEncounterLocation(encounterLocation);
|
||||
// 保存就诊参数者信息
|
||||
encounterParticipantFormData.setEncounterId(encounterId);
|
||||
EncounterParticipant encounterParticipant = new EncounterParticipant();
|
||||
BeanUtils.copyProperties(encounterParticipantFormData, encounterParticipant);
|
||||
iEncounterParticipantService.saveEncounterParticipant(encounterParticipant);
|
||||
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"挂号"}));
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@ import com.openhis.web.outpatientservice.dto.OutpatientRegistrationInitDto;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 门诊挂号 controller
|
||||
*/
|
||||
@@ -128,7 +130,7 @@ public class OutpatientRegistrationController {
|
||||
* @return 结果
|
||||
*/
|
||||
@PostMapping(value = "/save")
|
||||
public R<?> saveRegister(@RequestBody OutpatientRegistrationAddParam outpatientRegistrationAddParam) {
|
||||
public R<?> saveRegister(@Valid @RequestBody OutpatientRegistrationAddParam outpatientRegistrationAddParam) {
|
||||
return iOutpatientRegistrationAppService.saveRegister(outpatientRegistrationAddParam);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 就诊诊断 表单数据
|
||||
|
||||
@@ -8,6 +8,7 @@ import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 就诊 表单数据
|
||||
|
||||
@@ -9,6 +9,7 @@ import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 就诊位置 表单数据
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.openhis.web.outpatientservice.dto;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
@@ -15,10 +15,10 @@ public class OutpatientRegistrationAddParam {
|
||||
*/
|
||||
private EncounterFormData encounterFormData;
|
||||
|
||||
/**
|
||||
* 就诊诊断管理-表单数据
|
||||
*/
|
||||
private EncounterDiagnosisFormData encounterDiagnosisFormData;
|
||||
// /**
|
||||
// * 就诊诊断管理-表单数据
|
||||
// */
|
||||
// private EncounterDiagnosisFormData encounterDiagnosisFormData;
|
||||
|
||||
/**
|
||||
* 就诊位置管理-表单数据
|
||||
@@ -30,4 +30,12 @@ public class OutpatientRegistrationAddParam {
|
||||
*/
|
||||
private EncounterParticipantFormData encounterParticipantFormData;
|
||||
|
||||
/**
|
||||
* 就诊账户管理-表单数据
|
||||
*/
|
||||
|
||||
/**
|
||||
* 费用项管理-表单数据
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
@@ -14,9 +14,17 @@ import com.openhis.web.outpatientservice.dto.PractitionerMetadata;
|
||||
*/
|
||||
@Repository
|
||||
public interface OutpatientRegistrationAppMapper {
|
||||
|
||||
/**
|
||||
* 查询医生
|
||||
*/
|
||||
IPage<PractitionerMetadata> getPractitionerMetadataPage(@Param("page") Page<PractitionerMetadata> page,
|
||||
@Param("locationId") Long locationId, @Param("RoleCode") String RoleCode,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<PractitionerMetadata> queryWrapper);
|
||||
|
||||
/**
|
||||
* 根据病人id和科室id查询当日挂号次数
|
||||
*/
|
||||
Integer getNumByPatientIdAndOrganizationId(@Param("patientId") Long patientId,
|
||||
@Param("serviceTypeId") Long serviceTypeId);
|
||||
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
T3.extra_details,
|
||||
T3.contact,
|
||||
T3.appointment_required_flag,
|
||||
T3.definition_id,
|
||||
T3.charge_name,
|
||||
T3.price
|
||||
FROM
|
||||
@@ -37,6 +38,7 @@
|
||||
T1.extra_details,
|
||||
T1.contact,
|
||||
T1.appointment_required_flag,
|
||||
T2.id AS definition_id,
|
||||
T2.charge_name,
|
||||
T2.price
|
||||
FROM
|
||||
|
||||
@@ -12,8 +12,7 @@
|
||||
T3.py_str,
|
||||
T3.wb_str
|
||||
FROM (
|
||||
SELECT
|
||||
T1.tenant_id,
|
||||
SELECT T1.tenant_id,
|
||||
T1.ID,
|
||||
T1.NAME,
|
||||
T1.gender_enum,
|
||||
@@ -30,4 +29,14 @@
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="getNumByPatientIdAndOrganizationId" resultType="Integer">
|
||||
SELECT COUNT
|
||||
(1)
|
||||
FROM adm_encounter
|
||||
WHERE delete_flag = '0'
|
||||
AND patient_id = #{patientId}
|
||||
AND service_type_id = #{serviceTypeId}
|
||||
AND create_time > CURRENT_DATE
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -58,4 +58,6 @@ public class PromptMsgConstant {
|
||||
String M00010 = "apl.common.M00010";
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -11,4 +11,11 @@ import com.openhis.administration.domain.EncounterLocation;
|
||||
*/
|
||||
public interface IEncounterLocationService extends IService<EncounterLocation> {
|
||||
|
||||
/**
|
||||
* 保存就诊位置信息
|
||||
*
|
||||
* @param encounterLocation 就诊位置信息
|
||||
*/
|
||||
void saveEncounterLocation(EncounterLocation encounterLocation);
|
||||
|
||||
}
|
||||
@@ -11,4 +11,11 @@ import com.openhis.administration.domain.EncounterParticipant;
|
||||
*/
|
||||
public interface IEncounterParticipantService extends IService<EncounterParticipant> {
|
||||
|
||||
/**
|
||||
* 保存就诊参与者
|
||||
*
|
||||
* @param encounterParticipant 就诊参与者信息
|
||||
*/
|
||||
void saveEncounterParticipant(EncounterParticipant encounterParticipant);
|
||||
|
||||
}
|
||||
@@ -10,5 +10,12 @@ import com.openhis.administration.domain.Encounter;
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface IEncounterService extends IService<Encounter> {
|
||||
/**
|
||||
* 保存就诊信息
|
||||
*
|
||||
* @param encounter 就诊信息
|
||||
* @return 保存后的信息
|
||||
*/
|
||||
Long saveEncounter(Encounter encounter);
|
||||
|
||||
}
|
||||
@@ -14,6 +14,17 @@ import com.openhis.administration.service.IEncounterLocationService;
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class EncounterLocationServiceImpl extends ServiceImpl<EncounterLocationMapper, EncounterLocation> implements IEncounterLocationService {
|
||||
public class EncounterLocationServiceImpl extends ServiceImpl<EncounterLocationMapper, EncounterLocation>
|
||||
implements IEncounterLocationService {
|
||||
|
||||
/**
|
||||
* 保存就诊位置信息
|
||||
*
|
||||
* @param encounterLocation 就诊位置信息
|
||||
*/
|
||||
@Override
|
||||
public void saveEncounterLocation(EncounterLocation encounterLocation) {
|
||||
baseMapper.insert(encounterLocation);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,6 +14,17 @@ import com.openhis.administration.service.IEncounterParticipantService;
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class EncounterParticipantServiceImpl extends ServiceImpl<EncounterParticipantMapper, EncounterParticipant> implements IEncounterParticipantService {
|
||||
public class EncounterParticipantServiceImpl extends ServiceImpl<EncounterParticipantMapper, EncounterParticipant>
|
||||
implements IEncounterParticipantService {
|
||||
|
||||
/**
|
||||
* 保存就诊参与者
|
||||
*
|
||||
* @param encounterParticipant 就诊参与者信息
|
||||
*/
|
||||
@Override
|
||||
public void saveEncounterParticipant(EncounterParticipant encounterParticipant) {
|
||||
baseMapper.insert(encounterParticipant);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,4 +16,19 @@ import com.openhis.administration.service.IEncounterService;
|
||||
@Service
|
||||
public class EncounterServiceImpl extends ServiceImpl<EncounterMapper, Encounter> implements IEncounterService {
|
||||
|
||||
/**
|
||||
* 保存就诊信息
|
||||
*
|
||||
* @param encounter 就诊信息
|
||||
* @return 保存后的信息
|
||||
*/
|
||||
@Override
|
||||
public Long saveEncounter(Encounter encounter) {
|
||||
// 生产就诊编码
|
||||
|
||||
// 生产就诊序号
|
||||
baseMapper.insert(encounter);
|
||||
return encounter.getId();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -43,4 +43,4 @@ apl.common.M00006=操作失败,该数据已被他人删除,请刷新后重试
|
||||
apl.common.M00007=操作失败,该数据已被他人更改,请刷新后重试
|
||||
apl.common.M00008=请勿重复提交
|
||||
apl.common.M00009=查询成功
|
||||
apl.common.M00010=操作失败,请联系管理员
|
||||
apl.common.M00010=操作失败,请联系管理员
|
||||
|
||||
Reference in New Issue
Block a user