|
@ -1,24 +1,30 @@
|
|
package com.yihu.mm.controller.medicine;
|
|
package com.yihu.mm.controller.medicine;
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.databind.JavaType;
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.yihu.mm.controller.BaseController;
|
|
import com.yihu.mm.controller.BaseController;
|
|
import com.yihu.mm.entity.patient.ExamReport;
|
|
import com.yihu.mm.entity.patient.ExamReport;
|
|
import com.yihu.mm.entity.patient.PatientExam;
|
|
import com.yihu.mm.entity.patient.PatientExam;
|
|
|
|
import com.yihu.mm.entity.patient.Report;
|
|
|
|
import com.yihu.mm.entity.patient.ReportDetail;
|
|
import com.yihu.mm.entity.questionnaire.MedicineAnswerLog;
|
|
import com.yihu.mm.entity.questionnaire.MedicineAnswerLog;
|
|
import com.yihu.mm.service.*;
|
|
import com.yihu.mm.service.*;
|
|
|
|
import com.yihu.mm.util.JSONUtil;
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
import com.yihu.wlyy.entity.patient.Patient;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiParam;
|
|
import io.swagger.annotations.ApiParam;
|
|
import org.json.JSONObject;
|
|
import org.json.JSONObject;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping(value = "/medicine/physicalExamination")
|
|
@RequestMapping(value = "/medicine/physicalExamination")
|
|
@ -134,13 +140,24 @@ public class PhysicalExaminationController extends BaseController {
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "四诊资料采集")
|
|
@ApiOperation(value = "四诊资料采集")
|
|
@RequestMapping(value = "/dillphoneimgdata",produces="application/json;charset=UTF-8")
|
|
|
|
|
|
@RequestMapping(value = "/dillphoneimgdata", method = RequestMethod.POST,produces="application/json;charset=UTF-8")
|
|
@ResponseBody
|
|
@ResponseBody
|
|
public String dillphoneimgdata(@ApiParam(name = "at_id", value = "文件id", required = true)@RequestParam(required = true, name = "at_id") String at_id,
|
|
|
|
@ApiParam(name = "answer", value = "问题答案,文件名称", required = true)@RequestParam(required = true, name = "answer") String answer,
|
|
|
|
|
|
public String dillphoneimgdata(@RequestParam MultipartFile file,
|
|
@ApiParam(name = "type", value = "1.脸型 2.舌像 3.声音", required = true)@RequestParam(required = true, name = "type") String type,
|
|
@ApiParam(name = "type", value = "1.脸型 2.舌像 3.声音", required = true)@RequestParam(required = true, name = "type") String type,
|
|
@ApiParam(name = "ct_id", value = "咨询编号", required = true)@RequestParam(required = true, name = "ct_id") String ct_id){
|
|
@ApiParam(name = "ct_id", value = "咨询编号", required = true)@RequestParam(required = true, name = "ct_id") String ct_id){
|
|
String result = physicalExaminationService.dillphoneimgdata(at_id, answer, type, ct_id);
|
|
|
|
|
|
String uploadAttachment = physicalExaminationService.uploadAttachment(file);
|
|
|
|
String at_id = null;
|
|
|
|
String at_realname=null;
|
|
|
|
JSONObject uploadResult = new JSONObject(uploadAttachment);
|
|
|
|
String status = uploadResult.get("status").toString();
|
|
|
|
if("200".equals(status)){
|
|
|
|
JSONObject recordset = uploadResult.getJSONObject("recordset");
|
|
|
|
at_id = recordset.get("at_id").toString();
|
|
|
|
at_realname = (String) recordset.get("at_realname");
|
|
|
|
}else{
|
|
|
|
return write(500,"提交失败","exception",uploadResult.get("status").toString());
|
|
|
|
}
|
|
|
|
String result = physicalExaminationService.dillphoneimgdata(at_id, at_realname, type, ct_id);
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
@ -150,11 +167,26 @@ public class PhysicalExaminationController extends BaseController {
|
|
public String showDetail(@ApiParam(name = "patientCode", value = "居民code", required = false)@RequestParam(required = true, name = "patientCode") String patientCode,
|
|
public String showDetail(@ApiParam(name = "patientCode", value = "居民code", required = false)@RequestParam(required = true, name = "patientCode") String patientCode,
|
|
@ApiParam(name = "ct_id", value = "咨询编号", required = false)@RequestParam(required = false, name = "ct_id") String ct_id){
|
|
@ApiParam(name = "ct_id", value = "咨询编号", required = false)@RequestParam(required = false, name = "ct_id") String ct_id){
|
|
ExamReport examReport = examReportService.showDetail(patientCode, ct_id);
|
|
ExamReport examReport = examReportService.showDetail(patientCode, ct_id);
|
|
|
|
|
|
|
|
Map<String,Object> respon = new HashMap<String,Object>();
|
|
if(null!=examReport){
|
|
if(null!=examReport){
|
|
|
|
|
|
|
|
String report = examReport.getReport();
|
|
|
|
String reportDetail = examReport.getReportDetail();
|
|
|
|
|
|
|
|
List<Report> reports = null;
|
|
|
|
ReportDetail reportDetail1 = null;
|
|
|
|
ObjectMapper objm = new ObjectMapper();
|
|
|
|
JavaType javaType = objm.getTypeFactory().constructParametricType(List.class, Report.class);
|
|
|
|
try {
|
|
|
|
reports=(List<Report>)objm.readValue(report,javaType);
|
|
|
|
reportDetail1 = (ReportDetail) JSONUtil.JSONToObj(reportDetail, ReportDetail.class);
|
|
|
|
} catch (Exception e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
respon.put("report",reports);
|
|
|
|
respon.put("reportDetail",reportDetail1);
|
|
|
|
return write(200,"查询成功","recordset",respon);
|
|
}
|
|
}
|
|
return write(200,"查询成功","recordset",examReport);
|
|
|
|
|
|
return write(-200,"未查询到数据");
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|