陈昶聿
3 天以前 a2101aa52a00ae103a26a950b54f985f46769239
smartor/src/main/java/com/smartor/service/impl/PatSpecificArchiveGenerateServiceImpl.java
@@ -166,12 +166,14 @@
                if (SpecificArchiveConstants.DEPT_CATEGORY_GYNECOLOGY.equals(deptCategory)) {
                    PatMaternityArchiveDetail detail =
                            buildMaternityDetail(patMedOuthosp, targetArchive, config, campusid);
                    patMaternityArchiveService.insertOrUpdateMaternityArchive(detail);
                    // 接诊完成自动建档:只建草稿,等人工保存档案后再生成随访计划
                    patMaternityArchiveService.insertOrUpdateMaternityArchive(detail, false);
                    generatedCount++;
                } else if (SpecificArchiveConstants.DEPT_CATEGORY_PEDIATRICS.equals(deptCategory)) {
                    PatChildArchiveDetail detail =
                            buildChildDetail(patMedOuthosp, targetArchive, config, campusid);
                    patChildArchiveService.insertOrUpdateChildArchive(detail);
                    // 接诊完成自动建档:只建草稿,等人工保存档案后再生成随访计划
                    patChildArchiveService.insertOrUpdateChildArchive(detail, false);
                    generatedCount++;
                } else {
                    log.warn("生成专科档案跳过:未知部门分类,configId={},deptCategory={}",
@@ -329,10 +331,12 @@
                Long archiveId;
                if (SpecificArchiveConstants.DEPT_CATEGORY_GYNECOLOGY.equals(deptCategory)) {
                    PatMaternityArchiveDetail detail = buildInhospMaternityDetail(context, config);
                    archiveId = (long) patMaternityArchiveService.insertOrUpdateMaternityArchive(detail);
                    // 住院随访完成自动建档:只建草稿,等人工保存档案后再生成随访计划
                    archiveId = (long) patMaternityArchiveService.insertOrUpdateMaternityArchive(detail, false);
                } else if (SpecificArchiveConstants.DEPT_CATEGORY_PEDIATRICS.equals(deptCategory)) {
                    PatChildArchiveDetail detail = buildInhospChildDetail(context, config);
                    archiveId = (long) patChildArchiveService.insertOrUpdateChildArchive(detail);
                    // 住院随访完成自动建档:只建草稿,等人工保存档案后再生成随访计划
                    archiveId = (long) patChildArchiveService.insertOrUpdateChildArchive(detail, false);
                } else {
                    log.warn("住院随访生成专科档案跳过:未知部门分类,configId={},deptCategory={}",
                            config.getId(), deptCategory);
@@ -489,6 +493,7 @@
        PatMaternityArchiveDetail detail = new PatMaternityArchiveDetail();
        detail.setArchiveType(config.getArchiveType());
        detail.setFollowupPeriod(config.getFollowupPeriod());
        detail.setPlannedFollowTime(patMedOuthosp.getFudate());
        detail.setSourceType(SpecificArchiveConstants.SOURCE_TYPE_OUTHOSP);
        detail.setSourceBizId(patMedOuthosp.getId());
        detail.setSourceBizNo(patMedOuthosp.getOuthospno());
@@ -504,6 +509,7 @@
        PatChildArchiveDetail detail = new PatChildArchiveDetail();
        detail.setArchiveType(config.getArchiveType());
        detail.setFollowupPeriod(config.getFollowupPeriod());
        detail.setPlannedFollowTime(patMedOuthosp.getFudate());
        detail.setSourceType(SpecificArchiveConstants.SOURCE_TYPE_OUTHOSP);
        detail.setSourceBizId(patMedOuthosp.getId());
        detail.setSourceBizNo(patMedOuthosp.getOuthospno());
@@ -527,6 +533,7 @@
        PatMaternityArchiveDetail detail = new PatMaternityArchiveDetail();
        detail.setArchiveType(config.getArchiveType());
        detail.setFollowupPeriod(config.getFollowupPeriod());
        detail.setPlannedFollowTime(context.inhosp == null ? null : context.inhosp.getFudate());
        detail.setSourceType(SpecificArchiveConstants.SOURCE_TYPE_INHOSP_FOLLOWUP);
        detail.setSourceBizId(inInhospid(context));
        detail.setSourceBizNo(inInhospno(context));
@@ -574,6 +581,7 @@
        PatChildArchiveDetail detail = new PatChildArchiveDetail();
        detail.setArchiveType(config.getArchiveType());
        detail.setFollowupPeriod(config.getFollowupPeriod());
        detail.setPlannedFollowTime(context.inhosp == null ? null : context.inhosp.getFudate());
        detail.setSourceType(SpecificArchiveConstants.SOURCE_TYPE_INHOSP_FOLLOWUP);
        detail.setSourceBizId(inInhospid(context));
        detail.setSourceBizNo(inInhospno(context));