Compare commits

18 Commits

Author SHA1 Message Date
Auora
ce76b2f98d 增加门诊病历的标题:门诊初诊病历/门诊复诊病历,当患者是初时-》门诊初诊病历,当患者为复诊时-》门诊复诊病历。
标题下面增加:就诊卡号、姓名、性别、年龄以及就诊日期(默认创建病历的当前时间)和就诊科室(患者当前开单科室),系统自动获取患者的档案信息。
2025-10-24 11:56:44 +08:00
8fbca1a898 Merge remote-tracking branch 'origin/develop' into develop 2025-10-24 11:27:32 +08:00
d548215123 就诊卡号查询患者信息 优化查询框布局 2025-10-24 11:26:56 +08:00
953d17dc8c 增加就诊和复诊的选定按钮和判断逻辑 2025-10-24 11:24:33 +08:00
叶锦涛
b71a21ea5c Merge remote-tracking branch 'origin/develop' into develop 2025-10-23 16:04:48 +08:00
叶锦涛
0a20b5e34e 拉宽诊断类型的方框 2025-10-23 16:02:55 +08:00
388425084e 增加就诊和复诊的选定按钮和判断逻辑 2025-10-23 16:01:34 +08:00
51ee8d1b43 医保码:将医保码修改成诊断代码。
在诊断名称后增加两个字段诊断医生和诊断时间,诊断医生为默认开立诊断的医生,诊断时间为默认开立诊断的当前时间。
2025-10-23 15:43:47 +08:00
Auora
d29d56e712 去掉patientList组件中多余的“岁” 2025-10-23 14:47:32 +08:00
Auora
9084ddaa98 1增加就诊卡号字段显示。
2卡号:当病历号/姓名字段通过条件检索到患者信息选择时卡号字段也要进行赋值。
2025-10-23 14:42:01 +08:00
叶锦涛
be6d5c1ccc 增加单位岁 增加项目编码字段 2025-10-23 10:52:34 +08:00
1bba9e598a 解决死亡时间格式不一致问题 2025-10-22 16:56:05 +08:00
d58a5e8ab3 通过卡号查询患者信息 2025-10-22 16:49:09 +08:00
e6ffb7101f 2 2025-10-22 16:26:55 +08:00
Auora
48b2188cf9 当输入患者的姓名和身份号码两个字段的值已经存在时,提醒挂号工作人员该患者档案已经存在 2025-10-22 15:15:11 +08:00
Auora
8bc5d45976 去掉年龄的“岁”字 2025-10-22 13:52:16 +08:00
04f6e7e960 Merge branch 'develop' of https://gitea.gentronhealth.com/wangjunping/his into develop 2025-10-22 11:52:42 +08:00
8fb58bdab8 就诊卡号:限制成必填选项。 2025-10-22 11:50:37 +08:00
26 changed files with 355 additions and 79 deletions

View File

@@ -119,6 +119,12 @@ public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistra
// 初复诊 // 初复诊
e.setFirstEnum_enumText(patientIdList.contains(e.getId()) ? EncounterType.FOLLOW_UP.getInfo() e.setFirstEnum_enumText(patientIdList.contains(e.getId()) ? EncounterType.FOLLOW_UP.getInfo()
: EncounterType.INITIAL.getInfo()); : EncounterType.INITIAL.getInfo());
// 患者标识
PatientIdentifier patientIdentifier = patientIdentifierService
.getOne(new LambdaQueryWrapper<PatientIdentifier>().eq(PatientIdentifier::getPatientId, e.getId()));
if (patientIdentifier != null) {
e.setIdentifierNo(patientIdentifier.getIdentifierNo());
}
}); });
return patientMetadataPage; return patientMetadataPage;

View File

@@ -56,4 +56,8 @@ public class PatientMetadata {
*/ */
private String firstEnum_enumText; private String firstEnum_enumText;
/**
* 就诊卡号
*/
private String identifierNo;
} }

View File

@@ -40,6 +40,11 @@ public class PatientInfoDto {
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
private Long orgId; private Long orgId;
/**
* 科室名称
*/
private String organizationName;
/** /**
* 患者姓名 * 患者姓名
*/ */

View File

@@ -53,4 +53,13 @@ public interface IPatientInformationService {
*/ */
R<?> addPatient(PatientInformationDto patientInformationDto); R<?> addPatient(PatientInformationDto patientInformationDto);
/**
* 检查患者是否存在
*
* @param name 患者姓名
* @param idCardNo 身份证号
* @return 是否存在
*/
boolean checkPatientExists(String name, String idCardNo);
} }

View File

@@ -257,4 +257,14 @@ public class PatientInformationServiceImpl implements IPatientInformationService
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00003, new Object[] {"病人信息"})); : R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00003, new Object[] {"病人信息"}));
} }
@Override
public boolean checkPatientExists(String name, String idCardNo) {
QueryWrapper<Patient> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("name", name)
.eq("id_card", idCardNo)
.eq("delete_flag", "0");
return patientService.count(queryWrapper) > 0;
}
} }

View File

@@ -78,4 +78,16 @@ public class PatientInformationController {
.ok(patientInformationService.getPatientInfo(patientInfoSearchParam, searchKey, pageNo, pageSize, request)); .ok(patientInformationService.getPatientInfo(patientInfoSearchParam, searchKey, pageNo, pageSize, request));
} }
/**
* 检查患者是否存在
*
* @param name 患者姓名
* @param idCardNo 身份证号
* @return 是否存在
*/
@GetMapping("/check-exists")
public R<?> checkPatientExists(@RequestParam String name, @RequestParam String idCardNo) {
return R.ok(patientInformationService.checkPatientExists(name, idCardNo));
}
} }

View File

@@ -68,7 +68,7 @@ public class PatientInformationDto {
/** /**
* 死亡时间 * 死亡时间
*/ */
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy/MM/dd HH:mm:ss", timezone = "GMT+8")
private Date deceasedDate; private Date deceasedDate;
/** /**

View File

@@ -296,6 +296,7 @@ public class IChargeBillServiceImpl implements IChargeBillService {
ChargeItemDefinition chargeItemDefinition = iChargeItemDefinitionService.getById(definitionId); ChargeItemDefinition chargeItemDefinition = iChargeItemDefinitionService.getById(definitionId);
YbMedChrgItmType medChrgItmType = YbMedChrgItmType medChrgItmType =
YbMedChrgItmType.getByCode(Integer.parseInt(chargeItemDefinition.getYbType())); YbMedChrgItmType.getByCode(Integer.parseInt(chargeItemDefinition.getYbType()));

View File

@@ -19,6 +19,7 @@
T10.type_code, T10.type_code,
T10.contract_name, T10.contract_name,
T10.org_id, T10.org_id,
T10.organization_name,
T10.register_time, T10.register_time,
T10.reception_time, T10.reception_time,
T10.practitioner_user_id, T10.practitioner_user_id,

View File

@@ -44,6 +44,9 @@ import TreeSelect from '@/components/TreeSelect'
// 字典标签组件 // 字典标签组件
import DictTag from '@/components/DictTag' import DictTag from '@/components/DictTag'
// 导入请求工具
import request from './utils/request'
import { ElDialog, ElMessage } from 'element-plus'; import { ElDialog, ElMessage } from 'element-plus';
import {registerComponents} from './template'; import {registerComponents} from './template';
@@ -64,6 +67,9 @@ app.config.globalProperties.handleTree = handleTree
app.config.globalProperties.addDateRange = addDateRange app.config.globalProperties.addDateRange = addDateRange
app.config.globalProperties.selectDictLabel = selectDictLabel app.config.globalProperties.selectDictLabel = selectDictLabel
app.config.globalProperties.selectDictLabels = selectDictLabels app.config.globalProperties.selectDictLabels = selectDictLabels
// 全局挂载请求实例
app.config.globalProperties.$http = request
// 全局组件挂载 // 全局组件挂载
app.component('DictTag', DictTag) app.component('DictTag', DictTag)
app.component('Pagination', Pagination) app.component('Pagination', Pagination)

View File

@@ -48,6 +48,11 @@
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8">
<el-form-item label="项目编码" prop="busNo">
<el-input v-model="form.busNo" placeholder="请输入项目编码" />
</el-form-item>
</el-col>
</el-row> </el-row>
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="8"> <el-col :span="8">
@@ -356,7 +361,7 @@ const diagnosisTreatmentList = ref([]);
const data = reactive({ const data = reactive({
form: {}, form: {},
rules: { rules: {
// busNo: [{ required: true, message: "编码不能为空", trigger: "blur" }], busNo: [{ required: true, message: "编码不能为空", trigger: "blur" }],
name: [{ required: true, message: '名称不能为空', trigger: 'blur' }], name: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
// statusEnum: [{ required: true, message: "状态不能为空", trigger: "blur" }], // statusEnum: [{ required: true, message: "状态不能为空", trigger: "blur" }],
categoryCode: [{ required: true, message: '诊疗目录不能为空', trigger: 'blur' }], categoryCode: [{ required: true, message: '诊疗目录不能为空', trigger: 'blur' }],
@@ -450,6 +455,7 @@ function setValue(row) {
form.value = { form.value = {
name: formatValue(row.medicalServiceName), //医疗服务项目名称 name: formatValue(row.medicalServiceName), //医疗服务项目名称
ybNo: formatValue(row.medicalCatalogCode), // 医保编码 ybNo: formatValue(row.medicalCatalogCode), // 医保编码
busNo: formatValue(row.medicalCatalogCode), // 项目编码使用医保编码
categoryCode: props.currentCategoryEnum, categoryCode: props.currentCategoryEnum,
// chrgitmLv: formatValue( // chrgitmLv: formatValue(
// row.insuranceClass == '甲' ? '1' : row.insuranceClass == '乙' ? '2' : '3' // row.insuranceClass == '甲' ? '1' : row.insuranceClass == '乙' ? '2' : '3'

View File

@@ -124,7 +124,9 @@
:disabled="isViewMode" :disabled="isViewMode"
@input="handleAgeInput" @input="handleAgeInput"
placeholder="请输入年龄" placeholder="请输入年龄"
/> >
<template #suffix></template>
</el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@@ -300,6 +302,36 @@ const title = ref('新增患者');
const visible = ref(false); const visible = ref(false);
const emits = defineEmits(['submit']); // 声明自定义事件 const emits = defineEmits(['submit']); // 声明自定义事件
const validateUniquePatient = (rule, value, callback) => {
const { name, idCard } = form.value;
// 确保姓名和身份证都已填写且身份证为18位
if (!name || !idCard || idCard.length !== 18) {
return callback(); // 不满足条件,不校验
}
// 使用 axios 直接请求,避免依赖 proxy.$http
import('@/utils/request').then(({ default: request }) => {
request({
url: '/patient-manage/information/check-exists',
method: 'get',
params: {
name: name,
idCardNo: idCard
}
}).then(res => {
if (res.code === 200 && res.data === true) {
callback(new Error('该患者档案已存在!'));
} else {
callback();
}
}).catch(error => {
console.error('校验患者是否存在失败:', error);
callback(); // 出错时不阻塞表单
});
});
};
// 身份证号码校验函数 // 身份证号码校验函数
const validateIdCard = (rule, value, callback) => { const validateIdCard = (rule, value, callback) => {
@@ -338,13 +370,17 @@ const data = reactive({
age: undefined, age: undefined,
}, },
rules: { rules: {
name: [{ required: true, message: '姓名不能为空', trigger: 'change' }], name: [{ required: true, message: '姓名不能为空', trigger: 'change' },
{ validator: validateUniquePatient, trigger: 'blur' }
],
genderEnum: [{ required: true, message: '请选择性别', trigger: 'change' }], genderEnum: [{ required: true, message: '请选择性别', trigger: 'change' }],
age: [{ required: true, message: '年龄不能为空', trigger: 'change' }], age: [{ required: true, message: '年龄不能为空', trigger: 'change' }],
phone: [{ required: true, message: '联系方式不能为空', trigger: 'change' }], phone: [{ required: true, message: '联系方式不能为空', trigger: 'change' }],
identifierNo: [{ required: true, message: '就诊卡号不能为空', trigger: 'change' }],
idCard: [ idCard: [
{ required: true, message: '证件号码不能为空', trigger: 'change' }, { required: true, message: '证件号码不能为空', trigger: 'change' },
{ validator: validateIdCard, trigger: 'blur' } { validator: validateIdCard, trigger: 'blur' },
{ validator: validateUniquePatient, trigger: 'blur' }
], ],
birthDate: [{ required: false, message: '请选择出生日期', trigger: 'change' }], birthDate: [{ required: false, message: '请选择出生日期', trigger: 'change' }],
}, },
@@ -378,7 +414,7 @@ function handleBirthDateChange() {
age--; age--;
} }
form.value.age = age + '岁'; form.value.age = age;
} }
} }
@@ -389,7 +425,7 @@ function handleAgeInput() {
if (ageMatch) { if (ageMatch) {
const age = parseInt(ageMatch[0]); const age = parseInt(ageMatch[0]);
// 移除非数字字符,保留数字和可能的单位 // 移除非数字字符,保留数字和可能的单位
form.value.age = age + '岁'; form.value.age = age ;
// 计算出生日期 // 计算出生日期
const today = new Date(); const today = new Date();
@@ -428,7 +464,7 @@ watch(
age--; age--;
} }
form.value.age = age + '岁'; form.value.age = age ;
} }
} }
); );

View File

@@ -49,9 +49,12 @@
label="年龄" label="年龄"
align="center" align="center"
key="age" key="age"
prop="age"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> >
<template #default="scope">
{{ scope.row.age ? `${scope.row.age}` : '-' }}
</template>
</el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total > 0" v-show="total > 0"

View File

@@ -7,10 +7,15 @@
@cell-click="clickRow" @cell-click="clickRow"
> >
<el-table-column label="姓名" align="center" prop="name" /> <el-table-column label="姓名" align="center" prop="name" />
<el-table-column label="就诊卡号" align="center" prop="identifierNo" />
<el-table-column label="性别" align="center" prop="genderEnum_enumText" /> <el-table-column label="性别" align="center" prop="genderEnum_enumText" />
<el-table-column label="证件号" align="center" prop="idCard" /> <el-table-column label="证件号" align="center" prop="idCard" />
<el-table-column label="联系电话" align="center" prop="phone" /> <el-table-column label="联系电话" align="center" prop="phone" />
<el-table-column label="年龄" align="center" prop="age" /> <el-table-column label="年龄" align="center">
<template #default="scope">
{{ scope.row.age ? `${scope.row.age}` : '-' }}
</template>
</el-table-column>
</el-table> </el-table>
</div> </div>
</template> </template>

View File

@@ -7,7 +7,7 @@
<el-form :model="form" :rules="rules" ref="outpatientRegistrationRef" label-width="110px"> <el-form :model="form" :rules="rules" ref="outpatientRegistrationRef" label-width="110px">
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="5"> <el-col :span="5">
<el-form-item label="病历号/姓名:" prop="searchKey"> <el-form-item label="患者身份信息:" prop="searchKey">
<el-popover <el-popover
:popper-style="{ padding: '0' }" :popper-style="{ padding: '0' }"
placement="bottom-start" placement="bottom-start"
@@ -22,7 +22,7 @@
@blur="handleBlur" @blur="handleBlur"
@input="handleSearchPatient" @input="handleSearchPatient"
v-model="form.searchKey" v-model="form.searchKey"
placeholder="请输入姓名/拼音/身份证" placeholder="请输入姓名/身份证/就诊卡号"
/> />
</template> </template>
</el-popover> </el-popover>
@@ -88,8 +88,8 @@
</el-row> </el-row>
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="5"> <el-col :span="5">
<el-form-item label="卡号:" prop="card"> <el-form-item label="就诊卡号:" prop="card">
<el-input v-model="form.card" placeholder="" :disabled="true" /> <el-input v-model="form.identifierNo" placeholder="" :disabled="true" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
@@ -439,7 +439,11 @@
prop="patientName" prop="patientName"
width="120" width="120"
/> />
<el-table-column label="年龄" align="center" key="age" prop="age" width="120" /> <el-table-column label="年龄" align="center" key="age" prop="age" width="120">
<template #default="scope">
{{ scope.row.age ? `${scope.row.age}` : '-' }}
</template>
</el-table-column>
<el-table-column <el-table-column
label="患者性别" label="患者性别"
align="center" align="center"
@@ -1235,6 +1239,7 @@ function selsectPatient(row) {
form.value.phone = row.phone; form.value.phone = row.phone;
form.value.firstEnum_enumText = row.firstEnum_enumText; form.value.firstEnum_enumText = row.firstEnum_enumText;
form.value.age = row.age; form.value.age = row.age;
form.value.identifierNo = row.identifierNo;
} }
// 设置新增参数 // 设置新增参数

View File

@@ -162,10 +162,17 @@ function removeDiagnosis(row, index) {
} }
function save() { function save() {
// 为每个诊断项添加诊断医生和诊断时间
const diagnosisChildList = tcmDiagonsisSaveList.value.map(item => ({
...item,
diagnosisDoctor: props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || '',
diagnosisTime: new Date().toLocaleString('zh-CN')
}));
saveTcmDiagnosis({ saveTcmDiagnosis({
patientId: props.patientInfo.patientId, patientId: props.patientInfo.patientId,
encounterId: props.patientInfo.encounterId, encounterId: props.patientInfo.encounterId,
diagnosisChildList: tcmDiagonsisSaveList.value, diagnosisChildList: diagnosisChildList,
}).then((res) => { }).then((res) => {
if (res.code == 200) { if (res.code == 200) {
emit('close'); emit('close');

View File

@@ -76,7 +76,7 @@
<el-form :model="form" :rules="rules" ref="formRef"> <el-form :model="form" :rules="rules" ref="formRef">
<el-table ref="diagnosisTableRef" :data="form.diagnosisList" height="650"> <el-table ref="diagnosisTableRef" :data="form.diagnosisList" height="650">
<el-table-column label="序号" type="index" width="50" /> <el-table-column label="序号" type="index" width="50" />
<el-table-column label="诊断排序" align="center" prop="diagSrtNo" width="180"> <el-table-column label="诊断排序" align="center" prop="diagSrtNo" width="120">
<template #default="scope"> <template #default="scope">
<el-form-item <el-form-item
:prop="`diagnosisList.${scope.$index}.diagSrtNo`" :prop="`diagnosisList.${scope.$index}.diagSrtNo`"
@@ -135,9 +135,13 @@
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="医保码" align="center" prop="ybNo" width="180" />
<el-table-column label="诊断类型" align="center" prop="maindiseFlag"> <el-table-column label="诊断医生" align="center" prop="diagnosisDoctor" width="120" />
<el-table-column label="诊断时间" align="center" prop="diagnosisTime" width="150" />
<el-table-column label="诊断代码" align="center" prop="ybNo" width="180" />
<el-table-column label="诊断类型" align="center" prop="maindiseFlag" width="120">
<template #default="scope"> <template #default="scope">
<div style="display:flex;flex-direction:column;align-items:center;gap:5px;">
<el-checkbox <el-checkbox
label="主诊断" label="主诊断"
:trueLabel="1" :trueLabel="1"
@@ -150,7 +154,7 @@
<el-select <el-select
v-model="scope.row.verificationStatusEnum" v-model="scope.row.verificationStatusEnum"
placeholder=" " placeholder=" "
style="width: 40%; padding-bottom: 5px; padding-left: 10px" style="width: 100%; padding-bottom: 5px; padding-left: 10px"
size="small" size="small"
> >
<el-option <el-option
@@ -160,6 +164,7 @@
:value="item.value" :value="item.value"
/> />
</el-select> </el-select>
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="130"> <el-table-column label="操作" align="center" width="130">
@@ -192,6 +197,7 @@
<script setup> <script setup>
import { getCurrentInstance } from 'vue'; import { getCurrentInstance } from 'vue';
import useUserStore from '@/store/modules/user';
import { import {
getConditionDefinitionInfo, getConditionDefinitionInfo,
saveDiagnosis, saveDiagnosis,
@@ -228,6 +234,7 @@ const props = defineProps({
}); });
const emits = defineEmits(['diagnosisSave']); const emits = defineEmits(['diagnosisSave']);
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const userStore = useUserStore();
const { med_type } = proxy.useDict('med_type'); const { med_type } = proxy.useDict('med_type');
const rules = ref({ const rules = ref({
name: [{ required: true, message: '请选择诊断', trigger: 'change' }], name: [{ required: true, message: '请选择诊断', trigger: 'change' }],
@@ -244,27 +251,45 @@ watch(
); );
function getDetail(encounterId) { function getDetail(encounterId) {
if (!encounterId) {
console.warn('未提供有效的就诊ID无法获取病历详情');
return;
}
getEmrDetail(encounterId).then((res) => { getEmrDetail(encounterId).then((res) => {
allowAdd.value = res.data ? true : false; allowAdd.value = res.data ? true : false;
}); });
} }
function getList() { function getList() {
if (!props.patientInfo || !props.patientInfo.encounterId) {
console.warn('患者就诊信息不完整,无法获取诊断数据');
return;
}
getEncounterDiagnosis(props.patientInfo.encounterId).then((res) => { getEncounterDiagnosis(props.patientInfo.encounterId).then((res) => {
if (res.code == 200) { if (res.code == 200) {
form.value.diagnosisList = res.data; // 为每个诊断项添加默认的诊断医生和时间(如果不存在)
form.value.diagnosisList = res.data.map(item => ({
...item,
diagnosisDoctor: item.diagnosisDoctor || props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
diagnosisTime: item.diagnosisTime || new Date().toLocaleString('zh-CN')
}));
emits('diagnosisSave', false); emits('diagnosisSave', false);
console.log(form.value.diagnosisList); console.log(form.value.diagnosisList);
} }
}); });
getTcmDiagnosis({ encounterId: props.patientInfo.encounterId }).then((res) => { getTcmDiagnosis({ encounterId: props.patientInfo.encounterId }).then((res) => {
if (res.code == 200) { if (res.code == 200) {
if (res.data.illness.length > 0) { if (res.data.illness && res.data.illness.length > 0 && res.data.symptom) {
res.data.illness.forEach((item, index) => { res.data.illness.forEach((item, index) => {
form.value.diagnosisList.push({ form.value.diagnosisList.push({
name: item.name + '-' + res.data.symptom[index].name, name: item.name + '-' + (res.data.symptom[index]?.name || ''),
ybNo: item.ybNo, ybNo: item.ybNo,
medTypeCode: item.medTypeCode, medTypeCode: item.medTypeCode,
diagnosisDoctor: props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
diagnosisTime: new Date().toLocaleString('zh-CN')
}); });
}); });
} }
@@ -272,6 +297,7 @@ function getList() {
console.log(form.value.diagnosisList); console.log(form.value.diagnosisList);
} }
}); });
getTree(); getTree();
} }
@@ -285,10 +311,15 @@ function init() {
} }
function handleImport() { function handleImport() {
if (!props.patientInfo || !props.patientInfo.encounterId) {
console.warn('患者就诊信息不完整,无法导入慢性病信息');
return;
}
if (props.patientInfo.contractName != '自费') { if (props.patientInfo.contractName != '自费') {
// 获取患者慢性病信息 // 获取患者慢性病信息
getChronicDisease({ encounterId: props.patientInfo.encounterId }).then((res) => { getChronicDisease({ encounterId: props.patientInfo.encounterId }).then((res) => {
if (res.data.length > 0) { if (res.data && res.data.length > 0) {
res.data.forEach((item, index) => { res.data.forEach((item, index) => {
form.value.diagnosisList.push({ form.value.diagnosisList.push({
...item, ...item,
@@ -299,6 +330,8 @@ function handleImport() {
diagSrtNo: form.value.diagnosisList.length + 1, diagSrtNo: form.value.diagnosisList.length + 1,
iptDiseTypeCode: 2, iptDiseTypeCode: 2,
diagnosisDesc: '', diagnosisDesc: '',
diagnosisDoctor: props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
diagnosisTime: new Date().toLocaleString('zh-CN')
}, },
}); });
}); });
@@ -342,7 +375,8 @@ const filterNode = (value, data) => {
* 获取诊断树列表 * 获取诊断树列表
*/ */
function getTree() { function getTree() {
getConditionDefinitionInfo(props.patientInfo ? props.patientInfo.patientId : '').then((res) => { const patientId = props.patientInfo?.patientId || '';
getConditionDefinitionInfo(patientId).then((res) => {
if (res.code == 200) { if (res.code == 200) {
let list = []; let list = [];
list = res.data.patientHistoryList; list = res.data.patientHistoryList;
@@ -391,6 +425,8 @@ function handleAddDiagnosis() {
diagSrtNo: form.value.diagnosisList.length + 1, diagSrtNo: form.value.diagnosisList.length + 1,
iptDiseTypeCode: 2, iptDiseTypeCode: 2,
diagnosisDesc: '', diagnosisDesc: '',
diagnosisDoctor: props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
diagnosisTime: new Date().toLocaleString('zh-CN')
}); });
if (form.value.diagnosisList.length == 1) { if (form.value.diagnosisList.length == 1) {
form.value.diagnosisList[0].maindiseFlag = 1; form.value.diagnosisList[0].maindiseFlag = 1;
@@ -537,6 +573,8 @@ function handleNodeClick(data) {
medTypeCode: '11', medTypeCode: '11',
diagSrtNo: form.value.diagnosisList.length + 1, diagSrtNo: form.value.diagnosisList.length + 1,
definitionId: data.definitionId, definitionId: data.definitionId,
diagnosisDoctor: props.patientInfo.practitionerName || props.patientInfo.doctorName || props.patientInfo.physicianName || userStore.name,
diagnosisTime: new Date().toLocaleString('zh-CN')
}); });
if (form.value.diagnosisList.length == 1) { if (form.value.diagnosisList.length == 1) {
form.value.diagnosisList[0].maindiseFlag = 1; form.value.diagnosisList[0].maindiseFlag = 1;

View File

@@ -15,7 +15,42 @@
</el-button> --> </el-button> -->
</div> </div>
<div style="max-height: 650px; overflow-y: auto; overflow-x: hidden"> <div style="max-height: 650px; overflow-y: auto; overflow-x: hidden">
<div style="text-align: center; font-size: 18px; font-weight: bold; margin-bottom: 10px;">
{{ visitType === 'FIRST' ? '门诊初诊病历' : '门诊复诊病历' }}
</div>
<el-form ref="emrRef" :model="form" :rules="rules" label-width="80px"> <el-form ref="emrRef" :model="form" :rules="rules" label-width="80px">
<el-row :gutter="4">
<el-col :span="4">
<el-form-item label="就诊卡号" prop="patientId" style="width: 100%">
<el-input placeholder="" v-model="patientInfo.patientId" class="input-with-bottom-border"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="姓名" prop="patientName" style="width: 100%">
<el-input placeholder="" v-model="patientInfo.patientName" class="input-with-bottom-border"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="性别" prop="genderEnum_enumText" style="width: 100%">
<el-input placeholder="" v-model="patientInfo.genderEnum_enumText" class="input-with-bottom-border"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="年龄" prop="age" style="width: 100%">
<el-input placeholder="" v-model="patientInfo.age" class="input-with-bottom-border"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="就诊日期" prop="currentVisitDate" style="width: 100%">
<el-input placeholder="" v-model="currentVisitDate" class="input-with-bottom-border"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="就诊科室" prop="organizationName" style="width: 100%">
<el-input placeholder="" v-model="patientInfo.organizationName" class="input-with-bottom-border"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="6"> <el-col :span="6">
<el-form-item label="身高" prop="height" style="width: 100%"> <el-form-item label="身高" prop="height" style="width: 100%">
@@ -168,6 +203,20 @@ import { saveEmr, getEmrDetail, saveEmrTemplate } from '../api';
import emrTemplate from '../emr/emrtemplate.vue'; import emrTemplate from '../emr/emrtemplate.vue';
import emrhistory from '../emr/emrhistory.vue'; import emrhistory from '../emr/emrhistory.vue';
import { ref, computed } from 'vue';
// 2. 当前就诊日期(默认为当前时间)
const currentVisitDate = computed(() => {
return new Date().toLocaleString('zh-CN', {
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
});
});
const form = ref({}); const form = ref({});
const emrTitle = ref(''); const emrTitle = ref('');
const radio = ref(1); const radio = ref(1);
@@ -184,6 +233,10 @@ const props = defineProps({
type: Object, type: Object,
required: true, required: true,
}, },
visitType: { // ✅ 接收父组件传来的值
type: String,
default: '',
},
}); });
watch( watch(

View File

@@ -200,6 +200,11 @@ const props = defineProps({
}, },
patientInfo: { patientInfo: {
type: Object, type: Object,
default: () => ({}),
},
encounterId: {
type: String,
default: '',
}, },
}); });
const emit = defineEmits(['close']); const emit = defineEmits(['close']);
@@ -284,14 +289,22 @@ function submit() {
...submitForm, ...submitForm,
diagnosisYbNo: diagnosisYbNo, diagnosisYbNo: diagnosisYbNo,
diagnosisDefinitionId: diagnosisDefinitionId, diagnosisDefinitionId: diagnosisDefinitionId,
ambEncounterId: props.patientInfo.encounterId, // 优先使用props.encounterId确保就诊ID正确传递
ambEncounterId: props.encounterId || props.patientInfo.encounterId,
patientId: props.patientInfo.patientId, patientId: props.patientInfo.patientId,
}; };
console.log('提交住院数据:', saveData);
handleHospitalization(saveData).then((res) => { handleHospitalization(saveData).then((res) => {
if (res.code == 200) { if (res.code == 200) {
proxy.$modal.msgSuccess('办理成功'); proxy.$modal.msgSuccess('办理成功');
close(); close();
} else {
console.error('办理失败:', res.msg);
proxy.$modal.msgError(res.msg || '办理失败,请检查数据后重试');
} }
}).catch(error => {
console.error('提交出错:', error);
proxy.$modal.msgError('提交请求失败');
}); });
} }
}); });

View File

@@ -98,7 +98,12 @@
<el-descriptions-item label="医生:" width="150">{{ <el-descriptions-item label="医生:" width="150">{{
userStore.name userStore.name
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="" width="300"> <el-descriptions-item label="" width="350">
<!-- 初诊 / 复诊 按钮 -->
<el-radio v-model="visitType" label="FIRST">初诊</el-radio>
<el-radio v-model="visitType" label="FOLLOW_UP">复诊</el-radio>
<!-- 原有按钮 -->
<el-button type="primary" plain @click.stop="handleFinish(patientInfo.encounterId)"> <el-button type="primary" plain @click.stop="handleFinish(patientInfo.encounterId)">
完诊 完诊
</el-button> </el-button>
@@ -118,11 +123,7 @@
<el-button <el-button
type="primary" type="primary"
plain plain
@click.stop=" @click.stop="openDialog = true"
() => {
openDialog = true;
}
"
> >
办理住院 办理住院
</el-button> </el-button>
@@ -146,6 +147,7 @@
saveStatus = value; saveStatus = value;
} }
" "
:visitType="visitType"
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="诊断" name="diagnosis"> <el-tab-pane label="诊断" name="diagnosis">
@@ -204,6 +206,7 @@ import {
leaveEncounter, leaveEncounter,
completeEncounter, completeEncounter,
getEnPrescriptionInfo, getEnPrescriptionInfo,
getEmrHistoryList
} from './components/api.js'; } from './components/api.js';
import prescriptionlist from './components/prescription/prescriptionlist.vue'; import prescriptionlist from './components/prescription/prescriptionlist.vue';
import RefundListDialog from './components/prescription/refundListDialog.vue'; import RefundListDialog from './components/prescription/refundListDialog.vue';
@@ -260,6 +263,7 @@ const diagnosisRef = ref();
const waitCount = ref(0); const waitCount = ref(0);
const loading = ref(false); const loading = ref(false);
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const visitType = ref('');
const disabled = computed(() => { const disabled = computed(() => {
return Object.keys(patientInfo.value).length === 0; return Object.keys(patientInfo.value).length === 0;
}); });
@@ -282,7 +286,41 @@ function getPatientList() {
}); });
}); });
} }
function setVisitType(type) {
visitType.value = type;
}
function checkPatientHistory(patient) {
// 如果患者没有身份证号,无法判断是否为初诊
if (!patient.idCard) {
// 默认设置为初诊
visitType.value = 'FIRST';
return;
}
// 查询患者历史就诊记录
const params = {
patientId: patient.patientId,
idCard: patient.idCard
};
getEmrHistoryList(params).then(res => {
if (res.code === 200) {
// 如果有历史记录,则为复诊
if (res.data && res.data.total > 0) {
visitType.value = 'FOLLOW_UP';
} else {
// 如果没有历史记录,则为初诊
visitType.value = 'FIRST';
}
} else {
// 请求失败,默认设置为初诊
visitType.value = 'FIRST';
}
}).catch(() => {
// 异常情况,默认设置为初诊
visitType.value = 'FIRST';
});
}
function getWaitPatient() { function getWaitPatient() {
queryParams.value.registerTimeSTime = formatDateStr(new Date(), 'YYYY-MM-DD') + ' 00:00:00'; queryParams.value.registerTimeSTime = formatDateStr(new Date(), 'YYYY-MM-DD') + ' 00:00:00';
queryParams.value.registerTimeETime = formatDateStr(new Date(), 'YYYY-MM-DD') + ' 23:59:59'; queryParams.value.registerTimeETime = formatDateStr(new Date(), 'YYYY-MM-DD') + ' 23:59:59';
@@ -351,6 +389,10 @@ function handleCardClick(item, index) {
patient.active = patient.encounterId === item.encounterId; patient.active = patient.encounterId === item.encounterId;
}); });
patientInfo.value = item; patientInfo.value = item;
// 检查患者历史记录以确定初诊/复诊
checkPatientHistory(item);
activeTab.value = 'emr'; activeTab.value = 'emr';
nextTick(() => { nextTick(() => {
prescriptionRef.value.getListInfo(); prescriptionRef.value.getListInfo();

View File

@@ -27,7 +27,11 @@
<el-table-column type="index" width="54" align="center" label="序号" /> <el-table-column type="index" width="54" align="center" label="序号" />
<el-table-column prop="patientName" align="center" label="申请患者" /> <el-table-column prop="patientName" align="center" label="申请患者" />
<el-table-column prop="genderEnum_enumText" label="性别" align="center" /> <el-table-column prop="genderEnum_enumText" label="性别" align="center" />
<el-table-column prop="age" label="年龄" align="center" /> <el-table-column label="年龄" align="center">
<template #default="scope">
{{ scope.row.age ? `${scope.row.age}` : '-' }}
</template>
</el-table-column>
<el-table-column prop="sourceName" align="center" label="申请来源"> <el-table-column prop="sourceName" align="center" label="申请来源">
<template #default="scope"> <template #default="scope">
{{ scope.row.sourceName || '-' }} {{ scope.row.sourceName || '-' }}

View File

@@ -28,7 +28,11 @@
<el-table-column type="index" width="54" align="center" label="序号" /> <el-table-column type="index" width="54" align="center" label="序号" />
<el-table-column prop="patientName" align="center" label="患者姓名" /> <el-table-column prop="patientName" align="center" label="患者姓名" />
<el-table-column prop="genderEnum_enumText" label="性别" align="center" /> <el-table-column prop="genderEnum_enumText" label="性别" align="center" />
<el-table-column prop="age" label="年龄" align="center" /> <el-table-column label="年龄" align="center">
<template #default="scope">
{{ scope.row.age ? `${scope.row.age}` : '-' }}
</template>
</el-table-column>
<el-table-column prop="requestTime" align="center" label="申请时间" /> <el-table-column prop="requestTime" align="center" label="申请时间" />
<el-table-column prop="sourceName" align="center" label="申请来源" /> <el-table-column prop="sourceName" align="center" label="申请来源" />
<el-table-column prop="wardName" align="center" label="入院病区" /> <el-table-column prop="wardName" align="center" label="入院病区" />

View File

@@ -39,7 +39,9 @@
v-model="form.age" v-model="form.age"
:disabled="isViewMode" :disabled="isViewMode"
@input="(value) => (form.age = value.replace(/[^0-9]/g, ''))" @input="(value) => (form.age = value.replace(/[^0-9]/g, ''))"
/> >
<template #suffix></template>
</el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
@@ -79,7 +81,9 @@
</el-row> </el-row>
<!-- <el-col :span="6"> <!-- <el-col :span="6">
<el-form-item label="年龄" prop="age"> <el-form-item label="年龄" prop="age">
<el-input v-model="form.age" clearable :disabled="isViewMode"/> <el-input v-model="form.age" clearable :disabled="isViewMode">
<template #suffix></template>
</el-input>
</el-form-item> </el-form-item>
</el-col> --> </el-col> -->
<el-row> <el-row>

View File

@@ -183,7 +183,9 @@
v-model="form.age" v-model="form.age"
:disabled="isViewMode" :disabled="isViewMode"
@input="(value) => (form.age = value.replace(/[^0-9]/g, ''))" @input="(value) => (form.age = value.replace(/[^0-9]/g, ''))"
/> >
<template #suffix></template>
</el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">

View File

@@ -3,7 +3,7 @@
jdk17 (必须) jdk17 (必须)
node.js-v16.15 (推荐) node.js-v16.15 (推荐)
PostgreSQL-v16.2 (必须) PostgreSQL-v16.2 (必须)1
redis (常用稳定版本即可) redis (常用稳定版本即可)
需要修改数据库和redis的连接信息,详见: 需要修改数据库和redis的连接信息,详见: