|
@ -1,11 +1,31 @@
|
|
package com.yihu.jw.hospital.endpoint.archives;
|
|
package com.yihu.jw.hospital.endpoint.archives;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.yihu.jw.contant.CommonContant;
|
|
|
|
import com.yihu.jw.entity.base.inpatient.BaseInpatientRegistrationDO;
|
|
|
|
import com.yihu.jw.entity.base.patient.PatientPreDiagnosisInfoDO;
|
|
|
|
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
|
|
|
|
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionInfoDO;
|
|
|
|
import com.yihu.jw.entity.hospital.survey.WlyySurveyRecordDO;
|
|
import com.yihu.jw.patient.service.PatientPreDiagnosisInfoService;
|
|
import com.yihu.jw.patient.service.PatientPreDiagnosisInfoService;
|
|
|
|
import com.yihu.jw.restmodel.web.Envelop;
|
|
|
|
import com.yihu.jw.restmodel.web.ListEnvelop;
|
|
|
|
import com.yihu.jw.restmodel.web.ObjEnvelop;
|
|
|
|
import com.yihu.jw.restmodel.web.PageEnvelop;
|
|
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
|
|
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
|
|
|
|
import com.yihu.jw.util.excel.ExportUtl;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
|
import jxl.write.WritableSheet;
|
|
|
|
import jxl.write.WritableWorkbook;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.OutputStream;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Created by yeshijie on 2024/12/20.
|
|
* Created by yeshijie on 2024/12/20.
|
|
@ -17,6 +37,178 @@ public class PreDiagnosisInfoEndpoint extends EnvelopRestEndpoint {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private PatientPreDiagnosisInfoService patientPreDiagnosisInfoService;
|
|
private PatientPreDiagnosisInfoService patientPreDiagnosisInfoService;
|
|
|
|
@Autowired
|
|
|
|
private ExportUtl exportUtl;
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping(value = "savePreDiagnosisInfo")
|
|
|
|
@ApiOperation(value = "保存档案数据")
|
|
|
|
public ObjEnvelop savePreDiagnosisInfo (
|
|
|
|
@ApiParam(name = "json", value = "档案json")
|
|
|
|
@RequestParam(value = "json", required = true) String json) {
|
|
|
|
try {
|
|
|
|
PatientPreDiagnosisInfoDO patientPreDiagnosisInfoDO= toEntity(json, PatientPreDiagnosisInfoDO.class);
|
|
|
|
return ObjEnvelop.getSuccess("获取成功",patientPreDiagnosisInfoService.savePreDiagnosisInfo(patientPreDiagnosisInfoDO));
|
|
|
|
}catch (Exception e){
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
return ObjEnvelop.getError(CommonContant.Message.SAVE_SUCCESS);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "findByPage")
|
|
|
|
@ApiOperation(value = "诊前信息分页")
|
|
|
|
public Envelop findByPage(@ApiParam(name = "name", value = "姓名", required = false)
|
|
|
|
@RequestParam(value = "name", required = false)String name,
|
|
|
|
@ApiParam(name = "mobile", value = "手机号", required = false)
|
|
|
|
@RequestParam(value = "mobile", required = false)String mobile,
|
|
|
|
@ApiParam(name = "idcard", value = "身份证", required = false)
|
|
|
|
@RequestParam(value = "idcard", required = false)String idcard,
|
|
|
|
@ApiParam(name = "chargeType", value = "自费或者医保", required = false)
|
|
|
|
@RequestParam(value = "chargeType", required = false)String chargeType,
|
|
|
|
@ApiParam(name = "fromSource", value = "来源(读卡器或者扫码枪)", required = false)
|
|
|
|
@RequestParam(value = "fromSource", required = false)String fromSource,
|
|
|
|
@ApiParam(name = "systolicPressureStart", value = "收缩压开始", required = false)
|
|
|
|
@RequestParam(value = "systolicPressureStart", required = false)String systolicPressureStart,
|
|
|
|
@ApiParam(name = "diastolicPressureStart", value = "舒张压", required = false)
|
|
|
|
@RequestParam(value = "diastolicPressureStart", required = false)String diastolicPressureStart,
|
|
|
|
@ApiParam(name = "systolicPressureEnd", value = "收缩压结束", required = false)
|
|
|
|
@RequestParam(value = "systolicPressureEnd", required = false)String systolicPressureEnd,
|
|
|
|
@ApiParam(name = "diastolicPressureEnd", value = "舒张压结束", required = false)
|
|
|
|
@RequestParam(value = "diastolicPressureEnd", required = false)String diastolicPressureEnd,
|
|
|
|
@ApiParam(name = "startTime", value = "开始时间", required = false)
|
|
|
|
@RequestParam(value = "startTime", required = false)String startTime,
|
|
|
|
@ApiParam(name = "endTime", value = "结束时间", required = false)
|
|
|
|
@RequestParam(value = "endTime", required = false)String endTime,
|
|
|
|
@ApiParam(name = "page", value = "第几页,从1开始", required = true, defaultValue = "1")
|
|
|
|
@RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
|
|
|
|
@ApiParam(name = "size", value = "每页分页大小", required = true, defaultValue = "10")
|
|
|
|
@RequestParam(value = "size", required = true,defaultValue = "10")Integer size){
|
|
|
|
try {
|
|
|
|
PageEnvelop pageEnvelop = patientPreDiagnosisInfoService.findByPage(name,mobile,idcard,chargeType,fromSource,systolicPressureStart
|
|
|
|
,diastolicPressureStart,systolicPressureEnd,diastolicPressureEnd,startTime,endTime,page,size);
|
|
|
|
return pageEnvelop;
|
|
|
|
}catch (Exception e){
|
|
|
|
return failedException2(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@GetMapping(value = "open/exportExcel/exportPatientPreDisagnosisInfoRecord")
|
|
|
|
@ApiOperation(value = " 导出诊前信息")
|
|
|
|
public ListEnvelop exportPatientPreDisagnosisInfoRecord(
|
|
|
|
@ApiParam(name = "name", value = "姓名", required = false)
|
|
|
|
@RequestParam(value = "name", required = false)String name,
|
|
|
|
@ApiParam(name = "mobile", value = "手机号", required = false)
|
|
|
|
@RequestParam(value = "mobile", required = false)String mobile,
|
|
|
|
@ApiParam(name = "idcard", value = "身份证", required = false)
|
|
|
|
@RequestParam(value = "idcard", required = false)String idcard,
|
|
|
|
@ApiParam(name = "chargeType", value = "自费或者医保", required = false)
|
|
|
|
@RequestParam(value = "chargeType", required = false)String chargeType,
|
|
|
|
@ApiParam(name = "fromSource", value = "来源(读卡器或者扫码枪)", required = false)
|
|
|
|
@RequestParam(value = "fromSource", required = false)String fromSource,
|
|
|
|
@ApiParam(name = "systolicPressureStart", value = "收缩压开始", required = false)
|
|
|
|
@RequestParam(value = "systolicPressureStart", required = false)String systolicPressureStart,
|
|
|
|
@ApiParam(name = "diastolicPressureStart", value = "舒张压", required = false)
|
|
|
|
@RequestParam(value = "diastolicPressureStart", required = false)String diastolicPressureStart,
|
|
|
|
@ApiParam(name = "systolicPressureEnd", value = "收缩压结束", required = false)
|
|
|
|
@RequestParam(value = "systolicPressureEnd", required = false)String systolicPressureEnd,
|
|
|
|
@ApiParam(name = "diastolicPressureEnd", value = "舒张压结束", required = false)
|
|
|
|
@RequestParam(value = "diastolicPressureEnd", required = false)String diastolicPressureEnd,
|
|
|
|
@ApiParam(name = "startTime", value = "开始时间", required = false)
|
|
|
|
@RequestParam(value = "startTime", required = false)String startTime,
|
|
|
|
@ApiParam(name = "endTime", value = "结束时间", required = false)
|
|
|
|
@RequestParam(value = "endTime", required = false)String endTime,
|
|
|
|
HttpServletResponse response) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
PageEnvelop pageEnvelop = patientPreDiagnosisInfoService.findByPage(name,mobile,idcard,chargeType,fromSource,systolicPressureStart
|
|
|
|
,diastolicPressureStart,systolicPressureEnd,diastolicPressureEnd,startTime,endTime,1,1000000000);
|
|
|
|
response.setContentType("octets/stream");
|
|
|
|
response.setHeader("Content-Disposition", "attachment; filename=" + new String("surveyRecordExcel.xls"));
|
|
|
|
OutputStream os = response.getOutputStream();
|
|
|
|
pushTotalExcel(os, pageEnvelop.getDetailModelList());
|
|
|
|
return success(pageEnvelop.getDetailModelList());
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
return failedListEnvelopException(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void pushTotalExcel(OutputStream os, List<PatientPreDiagnosisInfoDO> list) throws Exception {
|
|
|
|
WritableWorkbook wwb = jxl.Workbook.createWorkbook(os);
|
|
|
|
try {
|
|
|
|
WritableSheet ws;
|
|
|
|
ws = wwb.createSheet("sheet", 1);
|
|
|
|
|
|
|
|
String[] header = {"就诊卡号", "病人姓名", "联系电话", "证件号码", "性别","年龄", "出生日期", "费别","患者授权","血压值(收缩/舒张)","操作人","操作时间"};
|
|
|
|
int k = 0;
|
|
|
|
for (String h : header) {
|
|
|
|
exportUtl.addCell(ws, 0, k, h);//表名,行,列,header
|
|
|
|
k++;
|
|
|
|
}
|
|
|
|
|
|
|
|
int i = 1;
|
|
|
|
for (PatientPreDiagnosisInfoDO m : list) {
|
|
|
|
exportUtl.addCell(ws, i, 0, m.getCardNo());
|
|
|
|
exportUtl.addCell(ws, i, 1, m.getName());
|
|
|
|
exportUtl.addCell(ws, i, 2, m.getMobile());
|
|
|
|
exportUtl.addCell(ws, i, 3, m.getIdcard());
|
|
|
|
exportUtl.addCell(ws, i, 4, m.getSex().equalsIgnoreCase("1")?"男":m.getSex().equalsIgnoreCase("2")?"女":"未知");
|
|
|
|
exportUtl.addCell(ws, i, 5, m.getAge());
|
|
|
|
exportUtl.addCell(ws, i, 6, m.getBirthday());
|
|
|
|
exportUtl.addCell(ws, i, 7, m.getChargeTypeName());
|
|
|
|
exportUtl.addCell(ws, i, 8, m.getFromSourceName());
|
|
|
|
exportUtl.addCell(ws, i, 9, (m.getSystolicPressure()+"/"+m.getDiastolicPressure()));
|
|
|
|
exportUtl.addCell(ws, i, 10, m.getDoctorName());
|
|
|
|
exportUtl.addCell(ws, i, 11, m.getCreateTime());
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
wwb.write();
|
|
|
|
wwb.close();
|
|
|
|
} catch (IOException e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
if (wwb != null) wwb.close();
|
|
|
|
throw e;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "findHealthIndexPage")
|
|
|
|
@ApiOperation(value = "关联平台测量数据")
|
|
|
|
public Envelop findHealthIndexPage(
|
|
|
|
@ApiParam(name = "deviceSn", value = "设备sn码", required = false)
|
|
|
|
@RequestParam(value = "deviceSn", required = false)String deviceSn,
|
|
|
|
@ApiParam(name = "dept", value = "科室", required = false)
|
|
|
|
@RequestParam(value = "dept", required = false)String dept,
|
|
|
|
@ApiParam(name = "startTime", value = "开始时间", required = false)
|
|
|
|
@RequestParam(value = "startTime", required = false)String startTime,
|
|
|
|
@ApiParam(name = "endTime", value = "结束时间", required = false)
|
|
|
|
@RequestParam(value = "endTime", required = false)String endTime,
|
|
|
|
@ApiParam(name = "page", value = "第几页,从1开始", required = true, defaultValue = "1")
|
|
|
|
@RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
|
|
|
|
@ApiParam(name = "size", value = "每页分页大小", required = true, defaultValue = "10")
|
|
|
|
@RequestParam(value = "size", required = true,defaultValue = "10")Integer size){
|
|
|
|
try {
|
|
|
|
PageEnvelop pageEnvelop = patientPreDiagnosisInfoService.findHealthIndexPage(deviceSn,dept,startTime,endTime,page,size);
|
|
|
|
return pageEnvelop;
|
|
|
|
}catch (Exception e){
|
|
|
|
return failedException2(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "getPatientInfo")
|
|
|
|
@ApiOperation(value = "根据身份证获取用户信息")
|
|
|
|
public ObjEnvelop getPatientInfo (
|
|
|
|
@ApiParam(name = "idCard", value = "身份证")
|
|
|
|
@RequestParam(value = "idCard", required = true) String idCard) {
|
|
|
|
try {
|
|
|
|
return ObjEnvelop.getSuccess("获取成功",patientPreDiagnosisInfoService.getPatientInfo(idCard));
|
|
|
|
}catch (Exception e){
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
return ObjEnvelop.getError(CommonContant.Message.SAVE_SUCCESS);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|