|
@ -25,7 +25,11 @@ import com.yihu.jw.restmodel.web.PageEnvelop;
|
|
|
import com.yihu.jw.util.date.DateUtil;
|
|
|
import com.yihu.jw.util.encrypt.MD5;
|
|
|
import com.yihu.jw.util.entity.ServiceException;
|
|
|
import com.yihu.jw.util.excel.ExportUtl;
|
|
|
import com.yihu.jw.util.idcard.IdCardUtil;
|
|
|
import jxl.write.WritableSheet;
|
|
|
import jxl.write.WritableWorkbook;
|
|
|
import jxl.write.WriteException;
|
|
|
import org.apache.commons.collections.map.HashedMap;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.json.JSONArray;
|
|
@ -44,6 +48,8 @@ import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import javax.transaction.Transactional;
|
|
|
import java.io.IOException;
|
|
|
import java.io.OutputStream;
|
|
|
import java.text.DateFormat;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
@ -100,16 +106,332 @@ public class FollowUpService {
|
|
|
private BasePatientMedicareCardDao basePatientMedicareCardDao;
|
|
|
@Autowired
|
|
|
private WlyyPatientFamilyMemberDao familyMemberDao;
|
|
|
@Autowired
|
|
|
private ExportUtl exportUtl;
|
|
|
|
|
|
public void exportByFollowupFormType(String businessType, String businessSource, String startDate, String endDate, String patientName,
|
|
|
String followupStatus, String doctorName, String deptCode, String followupFormType, OutputStream os) throws Exception {
|
|
|
WritableWorkbook wwb = jxl.Workbook.createWorkbook(os);
|
|
|
|
|
|
List<Map<String, Object>> followupList = followupList(businessType, businessSource, startDate, endDate, patientName, followupStatus, doctorName, deptCode, followupFormType);
|
|
|
// 根据表单类型分类
|
|
|
Map<String, List<Map<String, Object>>> followupListGroupingByFormType = followupList.stream()
|
|
|
.collect(Collectors.groupingBy(item -> (String) item.get("followupFormType")));
|
|
|
// 处理每种类型的表单
|
|
|
for (Map.Entry<String, List<Map<String, Object>>> followupEntry : followupListGroupingByFormType.entrySet()) {
|
|
|
String followupFormType2 = followupEntry.getKey();
|
|
|
List<Map<String, Object>> followupList2 = followupEntry.getValue();
|
|
|
String ids = followupList2.stream().map(i -> "'" + i.get("id") + "'")
|
|
|
.collect(Collectors.joining(",","(",")"));
|
|
|
|
|
|
Map<Integer, List<Map<String, Object>>> followupList3 = followupList2.stream()
|
|
|
.collect(Collectors.groupingBy(i -> (Integer) i.get("id")));
|
|
|
|
|
|
// 全院通用随访
|
|
|
if("1".equals(followupFormType2)) {
|
|
|
String sql = "select distinct * from wlyy_followup_content c where c.followup_id IN "+ids+" AND c.followup_project='1'";
|
|
|
List<Map<String, Object>> followupContent = jdbcTemplate.queryForList(sql);
|
|
|
|
|
|
try {
|
|
|
WritableSheet ws = wwb.createSheet("全院通用随访", 1);
|
|
|
|
|
|
String[] header = {"随访患者", "随访方式", "随访状态", "随访医生", "随访日期", "随方小结"};
|
|
|
int k = 0;
|
|
|
for (String h : header) {
|
|
|
exportUtl.addCell(ws, 0, k, h);//表名,行,列,header
|
|
|
k++;
|
|
|
}
|
|
|
int i = 1;
|
|
|
for (Map<String, Object> m : followupContent) {
|
|
|
Integer followupId = (Integer) m.get("followup_id");
|
|
|
Map<String, Object> followup = followupList3.get(followupId).get(0);
|
|
|
exportUtl.addCell(ws, i, 0, followup.get("patientName")); // 随访患者
|
|
|
exportUtl.addCell(ws, i, 1, followup.get("followupTypeValue")); // 随访方式
|
|
|
exportUtl.addCell(ws, i, 2, followup.get("statusName")); // 随访状态
|
|
|
exportUtl.addCell(ws, i, 3, followup.get("doctorName")); // 随访医生
|
|
|
exportUtl.addCell(ws, i, 4, followup.get("followupDate")); // 随访日期
|
|
|
exportUtl.addCell(ws, i, 5, m.get("followup_value")); // 随方小结
|
|
|
i++;
|
|
|
}
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
if (wwb != null) wwb.close();
|
|
|
throw e;
|
|
|
}
|
|
|
|
|
|
} else if("2".equals(followupFormType2)) {
|
|
|
String sql = followupOrthopedicsSql + " where f.followup_id IN " + ids;
|
|
|
List<Map<String, Object>> followupOrthopedicsList = jdbcTemplate.queryForList(sql);
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
WritableSheet ws = wwb.createSheet("骨科患者术后随访", 2);
|
|
|
|
|
|
String[] header = {"姓名", "性别", "年龄", "联系电话", "门诊号/住院号", "手术日期", "手术类型","主刀医生","伤口愈合情况","其他内容",
|
|
|
"是否按计划进行康复训练","未按计划训练原因","肢体功能恢复,关节活动度","肢体功能恢复,肌力","辅助器具使用","发热","体温","肢体肿胀/疼痛加重","深静脉血栓症状(如下肢红肿、疼痛)","其他异常",
|
|
|
"睡眠质量","饮食情况","心里状态","需心理干预","下次随访时间","下次随访方式","下次关注重点","随访医生","随访时间"};
|
|
|
int k = 0;
|
|
|
for (String h : header) {
|
|
|
exportUtl.addCell(ws, 0, k, h);//表名,行,列,header
|
|
|
k++;
|
|
|
}
|
|
|
int i = 1;
|
|
|
for(Map<String, Object> m : followupOrthopedicsList) {
|
|
|
Integer followupId = (Integer) m.get("followupId");
|
|
|
Map<String, Object> followup = followupList3.get(followupId).get(0);
|
|
|
int j = 0;
|
|
|
|
|
|
exportUtl.addCell(ws, i, j++, m.get("name"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("sexValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("age"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("mobile"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("visitNo"));
|
|
|
|
|
|
exportUtl.addCell(ws, i, j++, m.get("operationDate"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("operationType"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("chiefDoctorName"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("woundHealingStatusValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("woundHealingStatusOther"));
|
|
|
|
|
|
exportUtl.addCell(ws, i, j++, m.get("planTrainingValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("planTrainingReason"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("joint"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("muscleStrength"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("assistiveDevicesValue"));
|
|
|
|
|
|
exportUtl.addCell(ws, i, j++, m.get("feverValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("bodyTemperature"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("swellingPainValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("deepVeinThrombosisValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("otherAnomalies"));
|
|
|
|
|
|
exportUtl.addCell(ws, i, j++, m.get("sleepStatusValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("dietaryStatusValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("psychologicalStatusValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("psychologicalInterventionValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("nextFollowupTime"));
|
|
|
|
|
|
exportUtl.addCell(ws, i, j++, m.get("nextFollowupWay"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("nextFocus"));
|
|
|
exportUtl.addCell(ws, i, j++, followup.get("doctorName"));
|
|
|
exportUtl.addCell(ws, i, j++, followup.get("followupDate"));
|
|
|
|
|
|
i++;
|
|
|
}
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
if (wwb != null) wwb.close();
|
|
|
throw e;
|
|
|
}
|
|
|
|
|
|
|
|
|
} else if("4".equals(followupFormType2)) {
|
|
|
|
|
|
String sql = baseFollowupHandFootSql + " where f.followup_id IN " + ids;
|
|
|
List<Map<String, Object>> baseFollowupHandFootList = jdbcTemplate.queryForList(sql);
|
|
|
|
|
|
try {
|
|
|
WritableSheet ws = wwb.createSheet("手足外科患者随访", 3);
|
|
|
|
|
|
String[] header = {"姓名", "性别", "年龄", "联系电话", "门诊号/住院号", "手术日期", "手术类型","主刀医生","伤口与血运,伤口愈合情况","末梢血运(手指/足趾)",
|
|
|
"是否手外科","关节活动度","是否足踝外科","肢体肿胀情况","关节功能","步态","是否显微外科手书专项随访","伤口愈合","末梢血运(手指/足趾)",
|
|
|
"是否糖尿病足专项随访","伤口愈合","足部感觉","血糖监测","餐前","餐后","是否按计划进行康复训练","未按计划训练原因","日常生活能力",
|
|
|
"特殊需求","下次随访时间","下次随访方式","下次关注重点","随访医生","随访时间"};
|
|
|
int k = 0;
|
|
|
for (String h : header) {
|
|
|
exportUtl.addCell(ws, 0, k, h);//表名,行,列,header
|
|
|
k++;
|
|
|
}
|
|
|
int i = 1;
|
|
|
for(Map<String, Object> m : baseFollowupHandFootList) {
|
|
|
Integer followupId = (Integer) m.get("followupId");
|
|
|
Map<String, Object> followup = followupList3.get(followupId).get(0);
|
|
|
int j = 0;
|
|
|
|
|
|
exportUtl.addCell(ws, i, j++, m.get("name"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("sexValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("age"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("mobile"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("visitNo"));
|
|
|
|
|
|
exportUtl.addCell(ws, i, j++, m.get("operationDate"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("operationType"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("chiefDoctorName"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("woundHealingStatusValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("peripheralBloodCirculationValue"));
|
|
|
|
|
|
exportUtl.addCell(ws, i, j++, m.get("isHandSurgeryValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("jointRangeValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("isFootSurgeryValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("swellingLimbsValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("swellingLimbsValue"));
|
|
|
|
|
|
exportUtl.addCell(ws, i, j++, m.get("jointGaitValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("isMicrosurgeryValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("woundHealingValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("peripheralBloodCirculation2Value"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("isDiabetesValue"));
|
|
|
|
|
|
exportUtl.addCell(ws, i, j++, m.get("diabetesWoundHealingValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("diabetesFootFeelValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("diabetesBloodSugarValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("diabetesBloodSugarB"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("diabetesBloodSugarA"));
|
|
|
|
|
|
exportUtl.addCell(ws, i, j++, m.get("planTrainingValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("planTrainingReason"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("adlValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("specialNeeds"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("nextFollowupTime"));
|
|
|
|
|
|
exportUtl.addCell(ws, i, j++, m.get("nextFollowupWay"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("nextFocus"));
|
|
|
exportUtl.addCell(ws, i, j++, followup.get("doctorName"));
|
|
|
exportUtl.addCell(ws, i, j++, followup.get("followupDate"));
|
|
|
|
|
|
i++;
|
|
|
}
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
if (wwb != null) wwb.close();
|
|
|
throw e;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} else if("3".equals(followupFormType2)) {
|
|
|
|
|
|
String sql = baseFollowupOncologySql + " where f.followup_id IN " + ids;
|
|
|
List<Map<String, Object>> baseFollowupOncologyList = jdbcTemplate.queryForList(sql);
|
|
|
|
|
|
try {
|
|
|
WritableSheet ws = wwb.createSheet("肿瘤科患者随访", 4);
|
|
|
|
|
|
String[] header = {"姓名", "性别", "年龄", "联系电话", "门诊号/住院号", "诊断", "分期", "治疗阶段", "主管医生", "恶心/呕吐",
|
|
|
"恶心/呕吐频率", "需止吐药调整", "骨髓抑制", "白细胞", "需升白治疗", "黏膜炎", "口腔/肛周疼痛评分", "手足综合征", "皮肤红肿/脱皮", "放射性皮炎",
|
|
|
"放射性肺炎", "咳嗽气促", "吞咽困难", "皮疹", "分级", "需激素治疗", "甲状腺功能异常", "需内分泌科会诊", "疼痛部位", "当前疼痛程度(0-10分)",
|
|
|
"最严重的疼痛程度(0-10分)", "镇痛药物使用", "未使用原因", "体重变化", "近一月下降体重", "进食情况", "体力状况(ECOG评分)", "近期复查项目影像学(CT/MRI)", "近期复查项目肿瘤标志物", "具体升高",
|
|
|
"近期复查项目血常规/生化异常", "异常项", "需处理", "下一步诊疗计划", "情绪状态", "需心理干预", "家庭支持", "具体需求", "经济负担", "需慈善援助/药物减免",
|
|
|
"症状记录", "需教育", "用药依从性", "漏服次数", "漏服原因", "生活方式", "运动量", "下次随访时间", "下次随访方式", "下次关注重点",
|
|
|
"随访医生", "随访时间"};
|
|
|
int k = 0;
|
|
|
for (String h : header) {
|
|
|
exportUtl.addCell(ws, 0, k, h);//表名,行,列,header
|
|
|
k++;
|
|
|
}
|
|
|
int i = 1;
|
|
|
for (Map<String, Object> m : baseFollowupOncologyList) {
|
|
|
Integer followupId = (Integer) m.get("followupId");
|
|
|
Map<String, Object> followup = followupList3.get(followupId).get(0);
|
|
|
int j = 0;
|
|
|
|
|
|
exportUtl.addCell(ws, i, j++, m.get("name"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("sexValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("age"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("mobile"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("visitNo"));
|
|
|
|
|
|
exportUtl.addCell(ws, i, j++, m.get("diagnosis"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("stages"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("treatmentPhaseValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("manageDoctorName"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("nauseaVomitingValue"));
|
|
|
|
|
|
exportUtl.addCell(ws, i, j++, m.get("nauseaVomitingRate"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("antiemeticDrugsValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("myelosuppressionValue")); // 骨髓抑制
|
|
|
exportUtl.addCell(ws, i, j++, m.get("leukocyte")); // 白细胞
|
|
|
exportUtl.addCell(ws, i, j++, m.get("leukogenicActionValue")); // 升白治疗
|
|
|
|
|
|
exportUtl.addCell(ws, i, j++, m.get("mucositisValue")); // 黏膜炎
|
|
|
exportUtl.addCell(ws, i, j++, m.get("oralPainScore"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("handFootSyndromeValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("skinRednessValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("radiodermatitisValue"));
|
|
|
|
|
|
exportUtl.addCell(ws, i, j++, m.get("radiationPneumonitisValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("coughingValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("dysphagiaValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("rashValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("rashGrade"));
|
|
|
|
|
|
exportUtl.addCell(ws, i, j++, m.get("rashHormoneTherapyValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("thyroidDysfunctionValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("thyroidDysfunctionConsultationValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("painArea"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("painLevelValue"));
|
|
|
|
|
|
exportUtl.addCell(ws, i, j++, m.get("painLevel2Value"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("analgesicsUseValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("analgesicsReason"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("weightChangesValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("weightLoss"));
|
|
|
|
|
|
exportUtl.addCell(ws, i, j++, m.get("eatingSituationValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("performanceStatusValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("ctMriValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("tumorMarkersValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("tumorMarkersHigh"));
|
|
|
|
|
|
exportUtl.addCell(ws, i, j++, m.get("bloodRoutineValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("bloodRoutineAbnormal"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("bloodRoutineDealValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("diagnosisTreatmentPlanValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("emotionalStateValue"));
|
|
|
|
|
|
exportUtl.addCell(ws, i, j++, m.get("emotionalStateInterfereValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("familySupportValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("familySupportNeed"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("economicBurdenValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("economicBurdenReduceValue"));
|
|
|
|
|
|
exportUtl.addCell(ws, i, j++, m.get("symptomRecordValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("symptomRecordEduValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("medicationComplianceValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("medicationComplianceTime"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("medicationComplianceReason"));
|
|
|
|
|
|
exportUtl.addCell(ws, i, j++, m.get("lifestyleValue"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("lifestyleSport"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("nextFollowupTime"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("nextFollowupWay"));
|
|
|
exportUtl.addCell(ws, i, j++, m.get("nextFocus"));
|
|
|
|
|
|
exportUtl.addCell(ws, i, j++, followup.get("doctorName"));
|
|
|
exportUtl.addCell(ws, i, j++, followup.get("followupDate"));
|
|
|
|
|
|
i++;
|
|
|
}
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
if (wwb != null) wwb.close();
|
|
|
throw e;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
wwb.write();
|
|
|
wwb.close();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
//随访记录列表
|
|
|
public PageEnvelop followupPage(String businessType, String businessSource, String startDate, String endDate, String patientName,
|
|
|
String keyName,String followupStatus,String doctorName,String dept, Integer page, Integer size){
|
|
|
String keyName,String followupStatus,String doctorName,String dept,
|
|
|
String deptCode,String followupFormType,
|
|
|
Integer page, Integer size){
|
|
|
String sql = "SELECT DISTINCT f.id,f.patient_name patientName,f.patient_code patientCode,p.photo,p.idcard,p.birthday,p.sex,p.mobile, " +
|
|
|
"f.doctor_code doctorCode,f.doctor_name doctorName,pl.disease_name businessTypeName,pl.disease businessType,ip.id itemPlanId, " +
|
|
|
"h.dept_code deptCode,h.dept_name deptName,f.`status`,date_format(f.followup_date, '%Y-%m-%d %H:%i:%s') followupDate,'诊后康复' businessSource," +
|
|
|
"date_format(f.followup_plan_date, '%Y-%m-%d %H:%i:%s') followupPlanDate,date_format(pl.create_time, '%Y-%m-%d %H:%i:%s') turnDownDate," +
|
|
|
"if(i.from_source=2,i.doctor_name,pl.plan_doctor_name) planDoctorName,if(i.from_source=2,i.dept_name,h2.dept_name) turnDownDeptName ";
|
|
|
"if(i.from_source=2,i.doctor_name,pl.plan_doctor_name) planDoctorName,if(i.from_source=2,i.dept_name,h2.dept_name) turnDownDeptName, " +
|
|
|
"f.followup_form_type followupFormType,d.dict_value followupFormTypeValue ";
|
|
|
String countSql = "select count(DISTINCT f.id) ";
|
|
|
String filter = " from wlyy_followup f " +
|
|
|
"LEFT JOIN base_service_item_plan ip on f.id = ip.relation_code and ip.relation_type='6' " +
|
|
@ -118,6 +440,7 @@ public class FollowUpService {
|
|
|
"INNER JOIN base_patient p on p.id = f.patient_code " +
|
|
|
"LEFT JOIN base_doctor_hospital h on f.doctor_code=h.doctor_code and h.del=1 " +
|
|
|
"LEFT JOIN base_doctor_hospital h2 on pl.plan_doctor=h2.doctor_code and h2.del=1 " +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict d ON d.dict_name='followup_form_type' AND d.dict_code=f.followup_form_type " +
|
|
|
"WHERE 1=1 ";
|
|
|
if(StringUtils.isNotBlank(businessType)){
|
|
|
if(businessType.contains(",")){
|
|
@ -153,6 +476,12 @@ public class FollowUpService {
|
|
|
if (StringUtils.isNotBlank(endDate)){
|
|
|
filter += " and f.followup_date<='"+endDate+" 23:59:59' ";
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(deptCode)){
|
|
|
filter += " AND h.dept_code='" + deptCode + "' ";
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(followupFormType)){
|
|
|
filter += " AND followup_form_type = '" + followupFormType + "' ";
|
|
|
}
|
|
|
String orderBy = " order by f.followup_date desc limit "+(page-1)*size+","+size;
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql+filter+orderBy);
|
|
|
for (Map<String, Object> vo : list) {
|
|
@ -186,18 +515,21 @@ public class FollowUpService {
|
|
|
}
|
|
|
|
|
|
public List<Map<String, Object>> followupList(String businessType, String businessSource, String startDate, String endDate, String patientName,
|
|
|
String followupStatus,String doctorName){
|
|
|
String followupStatus,String doctorName,String deptCode,String followupFormType){
|
|
|
String sql = "SELECT DISTINCT f.id,f.patient_name patientName,f.patient_code patientCode,p.idcard,p.birthday,p.sex,p.mobile,p.address, " +
|
|
|
"f.doctor_code doctorCode,f.doctor_name doctorName,pl.disease_name businessTypeName,pl.disease businessType, " +
|
|
|
"h.dept_code deptCode,h.dept_name deptName,f.`status`,if(f.`status`=1,date_format(f.followup_date, '%Y-%m-%d %H:%i:%s'),'') followupDate," +
|
|
|
"'诊后康复' businessSource,date_format(f.followup_plan_date, '%Y-%m-%d %H:%i:%s') followupPlanDate," +
|
|
|
"date_format(pl.create_time, '%Y-%m-%d %H:%i:%s') turnDownDate,pl.plan_doctor_name planDoctorName,h2.dept_name turnDownDeptName ";
|
|
|
"date_format(pl.create_time, '%Y-%m-%d %H:%i:%s') turnDownDate,pl.plan_doctor_name planDoctorName,h2.dept_name turnDownDeptName, " +
|
|
|
"f.followup_form_type followupFormType,d.dict_value followupFormTypeValue, d2.dict_value followupTypeValue ";
|
|
|
String filter = " from wlyy_followup f " +
|
|
|
"INNER JOIN base_service_item_plan ip on f.id = ip.relation_code and ip.relation_type='6' " +
|
|
|
"LEFT JOIN wlyy_patient_rehabilitation_plan pl on pl.id = ip.plan_id " +
|
|
|
"INNER JOIN base_patient p on p.id = f.patient_code " +
|
|
|
"LEFT JOIN base_doctor_hospital h on f.doctor_code=h.doctor_code and h.del=1 " +
|
|
|
"LEFT JOIN base_doctor_hospital h2 on pl.plan_doctor=h2.doctor_code and h2.del=1 " +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict d ON d.dict_name='followup_form_type' AND d.dict_code=f.followup_form_type " +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict d2 ON d2.dict_name='FOLLOWUP_WAY_DICT' AND d2.dict_code=f.followup_type " +
|
|
|
"WHERE 1=1 ";
|
|
|
if(StringUtils.isNotBlank(businessType)){
|
|
|
if(businessType.contains(",")){
|
|
@ -227,6 +559,12 @@ public class FollowUpService {
|
|
|
if (StringUtils.isNotBlank(endDate)){
|
|
|
filter += " and f.followup_date<='"+endDate+" 23:59:59' ";
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(deptCode)){
|
|
|
filter += " AND h.dept_code='" + deptCode + "' ";
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(followupFormType)){
|
|
|
filter += " AND followup_form_type = '" + followupFormType + "' ";
|
|
|
}
|
|
|
String orderBy = " order by f.followup_date desc ";
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql+filter+orderBy);
|
|
|
for (Map<String, Object> vo : list) {
|
|
@ -3844,4 +4182,309 @@ public class FollowUpService {
|
|
|
return symptomName;
|
|
|
}
|
|
|
|
|
|
public String followupOrthopedicsSql = "SELECT\n" +
|
|
|
" f.id,\n" +
|
|
|
" f.patient,\n" +
|
|
|
" f.doctor,\n" +
|
|
|
" f.doctor_name doctorName,\n" +
|
|
|
" f.followup_id followupId,\n" +
|
|
|
" f.name,\n" +
|
|
|
" f.sex,\n" +
|
|
|
" CASE f.sex\n" +
|
|
|
" WHEN '1' THEN '男'\n" +
|
|
|
" WHEN '2' THEN '女'\n" +
|
|
|
" WHEN '3' THEN '未知'\n" +
|
|
|
" ELSE f.sex\n" +
|
|
|
" END AS sexValue,\n" +
|
|
|
" f.age,\n" +
|
|
|
" f.mobile,\n" +
|
|
|
" f.visit_no visitNo,\n" +
|
|
|
" f.operation_date operationDate,\n" +
|
|
|
" f.operation_type operationType,\n" +
|
|
|
" f.chief_doctor chiefDoctor,\n" +
|
|
|
" f.chief_doctor_name chiefDoctorName,\n" +
|
|
|
" f.wound_healing_status woundHealingStatus,\n" +
|
|
|
" dict_wound_healing_status.dict_value woundHealingStatusValue,\n" +
|
|
|
" f.wound_healing_status_other woundHealingStatusOther,\n" +
|
|
|
" f.plan_training planTraining,\n" +
|
|
|
" CASE f.plan_training WHEN '0' THEN '否' WHEN '1' THEN '是' ELSE f.plan_training END AS planTrainingValue,\n" +
|
|
|
" f.plan_training_reason planTrainingReason,\n" +
|
|
|
" f.joint,\n" +
|
|
|
" f.muscle_strength muscleStrength,\n" +
|
|
|
" f.assistive_devices assistiveDevices,\n" +
|
|
|
" dict_assistive_devices.dict_value assistiveDevicesValue,\n" +
|
|
|
" f.fever,\n" +
|
|
|
" CASE f.fever\n" +
|
|
|
" WHEN '0' THEN '无'\n" +
|
|
|
" WHEN '1' THEN '有'\n" +
|
|
|
" ELSE f.fever\n" +
|
|
|
" END AS feverValue,\n" +
|
|
|
" f.body_temperature bodyTemperature,\n" +
|
|
|
" f.swelling_pain swellingPain,\n" +
|
|
|
" CASE f.swelling_pain\n" +
|
|
|
" WHEN '1' THEN '无'\n" +
|
|
|
" WHEN '0' THEN '有'\n" +
|
|
|
" ELSE f.swelling_pain\n" +
|
|
|
" END AS swellingPainValue,\n" +
|
|
|
" f.deep_vein_thrombosis deepVeinThrombosis,\n" +
|
|
|
" dict_deep_vein_thrombosis.dict_value deepVeinThrombosisValue,\n" +
|
|
|
" f.other_anomalies otherAnomalies,\n" +
|
|
|
" f.sleep_status sleepStatus,\n" +
|
|
|
" dict_sleep_status.dict_value sleepStatusValue,\n" +
|
|
|
" f.dietary_status dietaryStatus,\n" +
|
|
|
" dict_dietary_status.dict_value dietaryStatusValue,\n" +
|
|
|
" f.psychological_status psychologicalStatus,\n" +
|
|
|
" dict_psychological_status.dict_value psychologicalStatusValue,\n" +
|
|
|
" f.psychological_intervention psychologicalIntervention,\n" +
|
|
|
" CASE f.psychological_intervention\n" +
|
|
|
" WHEN '1' THEN '是'\n" +
|
|
|
" WHEN '0' THEN '否'\n" +
|
|
|
" ELSE f.psychological_intervention\n" +
|
|
|
" END AS psychologicalInterventionValue,\n" +
|
|
|
" f.next_followup_time nextFollowupTime,\n" +
|
|
|
" f.next_followup_way nextFollowupWay,\n" +
|
|
|
" f.next_focus nextFocus,\n" +
|
|
|
" f.create_time createTime\n" +
|
|
|
"FROM base_followup_orthopedics f\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict dict_wound_healing_status\n" +
|
|
|
" ON dict_wound_healing_status.dict_name = 'wound_healing_status' AND dict_wound_healing_status.dict_code = f.wound_healing_status\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict dict_assistive_devices\n" +
|
|
|
" ON dict_assistive_devices.dict_name = 'assistive_devices' AND dict_assistive_devices.dict_code = f.assistive_devices\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict dict_deep_vein_thrombosis\n" +
|
|
|
" ON dict_deep_vein_thrombosis.dict_name = 'deep_vein_thrombosis' AND dict_deep_vein_thrombosis.dict_code = f.deep_vein_thrombosis\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict dict_sleep_status\n" +
|
|
|
" ON dict_sleep_status.dict_name = 'sleep_status' AND dict_sleep_status.dict_code = f.sleep_status\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict dict_dietary_status\n" +
|
|
|
" ON dict_dietary_status.dict_name = 'dietary_status' AND dict_dietary_status.dict_code = f.dietary_status\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict dict_psychological_status\n" +
|
|
|
" ON dict_psychological_status.dict_name = 'psychological_status' AND dict_psychological_status.dict_code = f.psychological_status ";
|
|
|
|
|
|
|
|
|
public String baseFollowupOncologySql = "SELECT\n" +
|
|
|
" f.id,\n" +
|
|
|
" f.patient,\n" +
|
|
|
" f.doctor,\n" +
|
|
|
" f.doctor_name doctorName,\n" +
|
|
|
" f.followup_id followupId,\n" +
|
|
|
" f.name,\n" +
|
|
|
" f.sex,\n" +
|
|
|
" CASE f.sex WHEN '1' THEN '男' WHEN '2' THEN '女' WHEN '3' THEN '未知' ELSE f.sex END AS sexValue,\n" +
|
|
|
" f.age,\n" +
|
|
|
" f.mobile,\n" +
|
|
|
" f.visit_no visitNo,\n" +
|
|
|
" f.diagnosis,\n" +
|
|
|
" f.stages,\n" +
|
|
|
" f.treatment_phase treatmentPhase,\n" +
|
|
|
" dict_treatment_phase.dict_value treatmentPhaseValue,\n" +
|
|
|
" f.manage_doctor manageDoctor,\n" +
|
|
|
" f.manage_doctor_name manageDoctorName,\n" +
|
|
|
" f.nausea_vomiting nauseaVomiting,\n" +
|
|
|
" CASE f.nausea_vomiting WHEN '1' THEN '有' WHEN '0' THEN '无' ELSE f.nausea_vomiting END AS nauseaVomitingValue,\n" +
|
|
|
" f.nausea_vomiting_rate nauseaVomitingRate,\n" +
|
|
|
" f.antiemetic_drugs antiemeticDrugs,\n" +
|
|
|
" CASE f.antiemetic_drugs WHEN '1' THEN '是' WHEN '0' THEN '否' ELSE f.antiemetic_drugs END AS antiemeticDrugsValue,\n" +
|
|
|
" f.myelosuppression,\n" +
|
|
|
" CASE f.myelosuppression WHEN '1' THEN '有' WHEN '0' THEN '无' ELSE f.myelosuppression END AS myelosuppressionValue,\n" +
|
|
|
" f.leukocyte,\n" +
|
|
|
" f.leukogenic_action leukogenicAction,\n" +
|
|
|
" CASE f.leukogenic_action WHEN '1' THEN '是' WHEN '0' THEN '否' ELSE f.leukogenic_action END AS leukogenicActionValue,\n" +
|
|
|
" f.mucositis,\n" +
|
|
|
" CASE f.mucositis WHEN '1' THEN '有' WHEN '0' THEN '无' ELSE f.mucositis END AS mucositisValue,\n" +
|
|
|
" f.oral_pain_score oralPainScore,\n" +
|
|
|
" f.hand_foot_syndrome handFootSyndrome,\n" +
|
|
|
" dict_hand_foot_syndrome.dict_value handFootSyndromeValue,\n" +
|
|
|
" f.`skin_redness,` skinRedness,\n" +
|
|
|
" dict_skin_redness.dict_value skinRednessValue,\n" +
|
|
|
" f.radiodermatitis,\n" +
|
|
|
" CASE f.radiodermatitis WHEN '1' THEN '有' WHEN '0' THEN '无' ELSE f.radiodermatitis END AS radiodermatitisValue,\n" +
|
|
|
" f.radiation_pneumonitis radiationPneumonitis,\n" +
|
|
|
" CASE f.radiation_pneumonitis WHEN '1' THEN '有' WHEN '0' THEN '无' ELSE f.radiation_pneumonitis END AS radiationPneumonitisValue,\n" +
|
|
|
" f.coughing,\n" +
|
|
|
" dict_coughing.dict_value coughingValue,\n" +
|
|
|
" f.dysphagia,\n" +
|
|
|
" CASE f.dysphagia WHEN '1' THEN '有' WHEN '0' THEN '无' ELSE f.dysphagia END AS dysphagiaValue,\n" +
|
|
|
" f.rash,\n" +
|
|
|
" CASE f.rash WHEN '1' THEN '有' WHEN '0' THEN '无' ELSE f.rash END AS rashValue,\n" +
|
|
|
" f.rash_grade rashGrade,\n" +
|
|
|
" f.rash_hormone_therapy rashHormoneTherapy,\n" +
|
|
|
" CASE f.rash_hormone_therapy WHEN '1' THEN '是' WHEN '0' THEN '否' ELSE f.rash_hormone_therapy END AS rashHormoneTherapyValue,\n" +
|
|
|
" f.thyroid_dysfunction thyroidDysfunction,\n" +
|
|
|
" CASE f.thyroid_dysfunction WHEN '1' THEN '有' WHEN '0' THEN '无' ELSE f.thyroid_dysfunction END AS thyroidDysfunctionValue,\n" +
|
|
|
" f.thyroid_dysfunction_consultation thyroidDysfunctionConsultation,\n" +
|
|
|
" CASE f.thyroid_dysfunction_consultation WHEN '1' THEN '是' WHEN '0' THEN '否' ELSE f.thyroid_dysfunction_consultation END AS thyroidDysfunctionConsultationValue,\n" +
|
|
|
" f.pain_area painArea,\n" +
|
|
|
" f.pain_level painLevel,\n" +
|
|
|
" dict_pain_level.dict_value painLevelValue,\n" +
|
|
|
" f.pain_level2 painLevel2,\n" +
|
|
|
" dict_pain_level2.dict_value painLevel2Value,\n" +
|
|
|
" f.analgesics_use analgesicsUse,\n" +
|
|
|
" dict_analgesics_use.dict_value analgesicsUseValue,\n" +
|
|
|
" f.analgesics_reason analgesicsReason,\n" +
|
|
|
" f.weight_changes weightChanges,\n" +
|
|
|
" dict_weight_changes.dict_value weightChangesValue,\n" +
|
|
|
" f.weight_loss weightLoss,\n" +
|
|
|
" f.eating_situation eatingSituation,\n" +
|
|
|
" dict_eating_situation.dict_value eatingSituationValue,\n" +
|
|
|
" f.performance_status performanceStatus,\n" +
|
|
|
" dict_performance_status.dict_value performanceStatusValue,\n" +
|
|
|
" f.ct_mri ctMri,\n" +
|
|
|
" dict_ct_mri.dict_value ctMriValue,\n" +
|
|
|
" f.tumor_markers tumorMarkers,\n" +
|
|
|
" dict_tumor_markers.dict_value tumorMarkersValue,\n" +
|
|
|
" f.tumor_markers_high tumorMarkersHigh,\n" +
|
|
|
" f.blood_routine bloodRoutine,\n" +
|
|
|
" CASE f.blood_routine WHEN '1' THEN '是' WHEN '0' THEN '否' ELSE f.blood_routine END AS bloodRoutineValue,\n" +
|
|
|
" f.blood_routine_abnormal bloodRoutineAbnormal,\n" +
|
|
|
" f.blood_routine_deal bloodRoutineDeal,\n" +
|
|
|
" CASE f.blood_routine_deal WHEN '1' THEN '是' WHEN '0' THEN '否' ELSE f.blood_routine_deal END AS bloodRoutineDealValue,\n" +
|
|
|
" f.diagnosis_treatment_plan diagnosisTreatmentPlan,\n" +
|
|
|
" dict_diagnosis_treatment_plan.dict_value diagnosisTreatmentPlanValue,\n" +
|
|
|
" f.emotional_state emotionalState,\n" +
|
|
|
" dict_emotional_state.dict_value emotionalStateValue,\n" +
|
|
|
" f.emotional_state_interfere emotionalStateInterfere,\n" +
|
|
|
" CASE f.emotional_state_interfere WHEN '1' THEN '是' WHEN '0' THEN '否' ELSE f.emotional_state_interfere END AS emotionalStateInterfereValue,\n" +
|
|
|
" f.family_support familySupport,\n" +
|
|
|
" dict_family_support.dict_value familySupportValue,\n" +
|
|
|
" f.family_support_need familySupportNeed,\n" +
|
|
|
" f.economic_burden economicBurden,\n" +
|
|
|
" CASE f.economic_burden WHEN '1' THEN '有' WHEN '0' THEN '无' ELSE f.economic_burden END AS economicBurdenValue,\n" +
|
|
|
" f.economic_burden_reduce economicBurdenReduce,\n" +
|
|
|
" CASE f.economic_burden_reduce WHEN '1' THEN '是' WHEN '0' THEN '否' ELSE f.economic_burden_reduce END AS economicBurdenReduceValue,\n" +
|
|
|
" f.symptom_record symptomRecord,\n" +
|
|
|
" dict_symptom_record.dict_value symptomRecordValue,\n" +
|
|
|
" f.symptom_record_edu symptomRecordEdu,\n" +
|
|
|
" CASE f.symptom_record_edu WHEN '1' THEN '是' WHEN '0' THEN '否' ELSE f.symptom_record_edu END AS symptomRecordEduValue,\n" +
|
|
|
" f.medication_compliance medicationCompliance,\n" +
|
|
|
" dict_medication_compliance.dict_value medicationComplianceValue,\n" +
|
|
|
" f.medication_compliance_time medicationComplianceTime,\n" +
|
|
|
" f.medication_compliance_reason medicationComplianceReason,\n" +
|
|
|
" f.lifestyle,\n" +
|
|
|
" dict_lifestyle.dict_value lifestyleValue,\n" +
|
|
|
" f.lifestyle_sport lifestyleSport,\n" +
|
|
|
" f.next_followup_time nextFollowupTime,\n" +
|
|
|
" f.next_followup_way nextFollowupWay,\n" +
|
|
|
" f.next_focus nextFocus,\n" +
|
|
|
" f.create_time createTime\n" +
|
|
|
"FROM base_followup_oncology f\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict dict_treatment_phase ON dict_treatment_phase.dict_name='treatment_phase' AND dict_treatment_phase.dict_code=f.treatment_phase\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict dict_hand_foot_syndrome ON dict_hand_foot_syndrome.dict_name='hand_foot_syndrome' AND dict_hand_foot_syndrome.dict_code=f.hand_foot_syndrome\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict dict_skin_redness ON dict_skin_redness.dict_name='skin_redness' AND dict_skin_redness.dict_code=f.`skin_redness,`\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict dict_coughing ON dict_coughing.dict_name='coughing' AND dict_coughing.dict_code=f.coughing\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict dict_pain_level ON dict_pain_level.dict_name='pain_level' AND dict_pain_level.dict_code=f.pain_level\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict dict_pain_level2 ON dict_pain_level2.dict_name='pain_level' AND dict_pain_level2.dict_code=f.pain_level2\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict dict_analgesics_use ON dict_analgesics_use.dict_name='analgesics_use' AND dict_analgesics_use.dict_code=f.analgesics_use\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict dict_weight_changes ON dict_weight_changes.dict_name='weight_changes' AND dict_weight_changes.dict_code=f.weight_changes\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict dict_eating_situation ON dict_eating_situation.dict_name='eating_situation' AND dict_eating_situation.dict_code=f.eating_situation\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict dict_performance_status ON dict_performance_status.dict_name='performance_status' AND dict_performance_status.dict_code=f.performance_status\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict dict_ct_mri ON dict_ct_mri.dict_name='ct_mri' AND dict_ct_mri.dict_code=f.ct_mri\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict dict_tumor_markers ON dict_tumor_markers.dict_name='tumor_markers' AND dict_tumor_markers.dict_code=f.tumor_markers\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict dict_diagnosis_treatment_plan ON dict_diagnosis_treatment_plan.dict_name='diagnosis_treatment_plan' AND dict_diagnosis_treatment_plan.dict_code=f.diagnosis_treatment_plan\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict dict_emotional_state ON dict_emotional_state.dict_name='emotional_state' AND dict_emotional_state.dict_code=f.emotional_state\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict dict_family_support ON dict_family_support.dict_name='family_support' AND dict_family_support.dict_code=f.family_support\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict dict_symptom_record ON dict_symptom_record.dict_name='symptom_record' AND dict_symptom_record.dict_code=f.symptom_record\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict dict_medication_compliance ON dict_medication_compliance.dict_name='medication_compliance' AND dict_medication_compliance.dict_code=f.medication_compliance\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict dict_lifestyle ON dict_lifestyle.dict_name='lifestyle' AND dict_lifestyle.dict_code=f.lifestyle ";
|
|
|
|
|
|
public String baseFollowupHandFootSql = "SELECT\n" +
|
|
|
" f.id,\n" +
|
|
|
" f.patient,\n" +
|
|
|
" f.doctor,\n" +
|
|
|
" f.doctor_name doctorName,\n" +
|
|
|
" f.followup_id followupId,\n" +
|
|
|
" f.name,\n" +
|
|
|
" f.sex,\n" +
|
|
|
" CASE f.sex\n" +
|
|
|
" WHEN '1' THEN '男'\n" +
|
|
|
" WHEN '2' THEN '女'\n" +
|
|
|
" WHEN '3' THEN '未知'\n" +
|
|
|
" ELSE NULL\n" +
|
|
|
" END AS sexValue,\n" +
|
|
|
" f.age,\n" +
|
|
|
" f.mobile,\n" +
|
|
|
" f.visit_no visitNo,\n" +
|
|
|
" f.operation_date operationDate,\n" +
|
|
|
" f.operation_type operationType,\n" +
|
|
|
" f.chief_doctor chiefDoctor,\n" +
|
|
|
" f.chief_doctor_name chiefDoctorName,\n" +
|
|
|
" f.wound_healing_status woundHealingStatus,\n" +
|
|
|
" d_wound_healing_status.dict_value woundHealingStatusValue,\n" +
|
|
|
" f.peripheral_blood_circulation peripheralBloodCirculation,\n" +
|
|
|
" d_peripheral_blood_circulation.dict_value peripheralBloodCirculationValue,\n" +
|
|
|
" f.is_hand_surgery isHandSurgery,\n" +
|
|
|
" CASE f.is_hand_surgery\n" +
|
|
|
" WHEN '1' THEN '是'\n" +
|
|
|
" WHEN '0' THEN '否'\n" +
|
|
|
" ELSE NULL\n" +
|
|
|
" END AS isHandSurgeryValue,\n" +
|
|
|
" f.joint_range jointRange,\n" +
|
|
|
" d_joint_range.dict_value jointRangeValue,\n" +
|
|
|
" f.is_foot_surgery isFootSurgery,\n" +
|
|
|
" CASE f.is_foot_surgery\n" +
|
|
|
" WHEN '1' THEN '是'\n" +
|
|
|
" WHEN '0' THEN '否'\n" +
|
|
|
" ELSE NULL\n" +
|
|
|
" END AS isFootSurgeryValue,\n" +
|
|
|
" f.swelling_limbs swellingLimbs,\n" +
|
|
|
" d_swelling_limbs.dict_value swellingLimbsValue,\n" +
|
|
|
" f.joint_function jointFunction,\n" +
|
|
|
" d_joint_function.dict_value jointFunctionValue,\n" +
|
|
|
" f.joint_gait jointGait,\n" +
|
|
|
" d_joint_gait.dict_value jointGaitValue,\n" +
|
|
|
" f.is_microsurgery isMicrosurgery,\n" +
|
|
|
" CASE f.is_microsurgery\n" +
|
|
|
" WHEN '1' THEN '是'\n" +
|
|
|
" WHEN '0' THEN '否'\n" +
|
|
|
" ELSE NULL\n" +
|
|
|
" END AS isMicrosurgeryValue,\n" +
|
|
|
" f.wound_healing woundHealing,\n" +
|
|
|
" d_wound_healing.dict_value woundHealingValue,\n" +
|
|
|
" f.peripheral_blood_circulation2 peripheralBloodCirculation2,\n" +
|
|
|
" d_peripheral_blood_circulation2.dict_value peripheralBloodCirculation2Value,\n" +
|
|
|
" f.is_diabetes isDiabetes,\n" +
|
|
|
" CASE f.is_diabetes\n" +
|
|
|
" WHEN '1' THEN '是'\n" +
|
|
|
" WHEN '0' THEN '否'\n" +
|
|
|
" ELSE NULL\n" +
|
|
|
" END AS isDiabetesValue,\n" +
|
|
|
" f.diabetes_wound_healing diabetesWoundHealing,\n" +
|
|
|
" d_diabetes_wound_healing.dict_value diabetesWoundHealingValue,\n" +
|
|
|
" f.diabetes_foot_feel diabetesFootFeel,\n" +
|
|
|
" CASE f.diabetes_foot_feel\n" +
|
|
|
" WHEN '1' THEN '有'\n" +
|
|
|
" WHEN '0' THEN '无'\n" +
|
|
|
" ELSE NULL\n" +
|
|
|
" END AS diabetesFootFeelValue,\n" +
|
|
|
" f.diabetes_blood_sugar diabetesBloodSugar,\n" +
|
|
|
" CASE f.diabetes_blood_sugar\n" +
|
|
|
" WHEN '1' THEN '有'\n" +
|
|
|
" WHEN '0' THEN '无'\n" +
|
|
|
" ELSE NULL\n" +
|
|
|
" END AS diabetesBloodSugarValue,\n" +
|
|
|
" f.diabetes_blood_sugar_b diabetesBloodSugarB,\n" +
|
|
|
" f.diabetes_blood_sugar_a diabetesBloodSugarA,\n" +
|
|
|
" f.plan_training planTraining,\n" +
|
|
|
" CASE f.plan_training\n" +
|
|
|
" WHEN '1' THEN '是'\n" +
|
|
|
" WHEN '0' THEN '否'\n" +
|
|
|
" ELSE NULL\n" +
|
|
|
" END AS planTrainingValue,\n" +
|
|
|
" f.plan_training_reason planTrainingReason,\n" +
|
|
|
" f.adl,\n" +
|
|
|
" d_adl.dict_value adlValue,\n" +
|
|
|
" f.special_needs specialNeeds,\n" +
|
|
|
" f.next_followup_time nextFollowupTime,\n" +
|
|
|
" f.next_followup_way nextFollowupWay,\n" +
|
|
|
" f.next_focus nextFocus,\n" +
|
|
|
" f.create_time createTime\n" +
|
|
|
"FROM base_followup_hand_foot f\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict d_wound_healing_status ON d_wound_healing_status.dict_name = 'wound_healing_status2' AND d_wound_healing_status.dict_code = f.wound_healing_status\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict d_peripheral_blood_circulation ON d_peripheral_blood_circulation.dict_name = 'peripheral_blood_circulation' AND d_peripheral_blood_circulation.dict_code = f.peripheral_blood_circulation\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict d_joint_range ON d_joint_range.dict_name = 'joint_range' AND d_joint_range.dict_code = f.joint_range\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict d_swelling_limbs ON d_swelling_limbs.dict_name = 'swelling_limbs' AND d_swelling_limbs.dict_code = f.swelling_limbs\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict d_joint_function ON d_joint_function.dict_name = 'joint_function' AND d_joint_function.dict_code = f.joint_function\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict d_joint_gait ON d_joint_gait.dict_name = 'joint_gait' AND d_joint_gait.dict_code = f.joint_gait\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict d_wound_healing ON d_wound_healing.dict_name = 'wound_healing_status2' AND d_wound_healing.dict_code = f.wound_healing\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict d_peripheral_blood_circulation2 ON d_peripheral_blood_circulation2.dict_name = 'peripheral_blood_circulation' AND d_peripheral_blood_circulation2.dict_code = f.peripheral_blood_circulation2\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict d_diabetes_wound_healing ON d_diabetes_wound_healing.dict_name = 'wound_healing_status2' AND d_diabetes_wound_healing.dict_code = f.diabetes_wound_healing\n" +
|
|
|
"LEFT JOIN wlyy_hospital_sys_dict d_adl ON d_adl.dict_name = 'adl' AND d_adl.dict_code = f.adl ";
|
|
|
}
|