浏览代码

Merge branch 'dev' of yeshijie/patient-co-management into dev

chenweida 8 年之前
父节点
当前提交
220b9932b5

+ 1 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prenatalInspector/PrenatalInspectorPreCardService.java

@ -189,6 +189,7 @@ public class PrenatalInspectorPreCardService extends BaseService {
     * 2、当居民已有经医生确认过的下一次产检时间,则距离下一次产检前1天,发出产检就诊提醒,提醒居民就诊。点击该消息,进入预约记录页面
     */
    public void sendPrenatalInspectorRemind(){
        System.out.println("产检计划---running");
        List<PrenatalInspectorPlan> planList = prenatalInspectorPlanDao.findWxTipList();
        for (PrenatalInspectorPlan plan:planList){
            try {

+ 6 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/archives/PatientArchivesController.java

@ -88,7 +88,8 @@ public class PatientArchivesController extends WeixinBaseController {
                                @ApiParam(name="serial",value="该类别顺序号,默认填1",defaultValue = "1")
                                @RequestParam(value="serial",required = true) String serial) {
        try {
            String result = patientRecordService.getHealthData(getUID(), event, catalog, serial);
            String result = patientRecordService.getHealthData(getRepUID(), event, catalog, serial);
//            String result = patientRecordService.getHealthData(getUID(), event, catalog, serial);
            return write(200, "获取健康档案详情成功!", "data", result);
        } catch (Exception e) {
@ -168,7 +169,8 @@ public class PatientArchivesController extends WeixinBaseController {
                                    @RequestParam(value="lastTime",required = false) String lastTime)
    {
        try {
            List<Map<String,String>> result = patientRecordService.getExamAndLabReport(getUID(), page, pageSize,lastTime);
            List<Map<String,String>> result = patientRecordService.getExamAndLabReport(getRepUID(), page, pageSize,lastTime);
//            List<Map<String,String>> result = patientRecordService.getExamAndLabReport(getUID(), page, pageSize,lastTime);
            return write(200, "获取检查检验报告成功!", "data", result);
        } catch (Exception e) {
@ -196,7 +198,8 @@ public class PatientArchivesController extends WeixinBaseController {
                          @ApiParam(name = "pageSize", value = "每页记录数", defaultValue = "")
                          @RequestParam(value = "pageSize", required = false) Integer pageSize) {
        try{
            Patient p = patientService.findByCode(getUID());
            Patient p = patientService.findByCode(getRepUID());
//            Patient p = patientService.findByCode(getUID());
            if(p != null){
                JSONArray re = jwArchivesService.getEhrSickMedicalList(p.getIdcard(),pageIndex,pageSize);
                return write(200,"查询成功","list",re);

+ 19 - 15
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/ConsultPublicController.java

@ -1,9 +1,13 @@
package com.yihu.wlyy.web.patient.consult;
import java.util.Date;
import com.yihu.wlyy.entity.consult.ConsultPublic;
import com.yihu.wlyy.entity.consult.ConsultPublicReply;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.service.app.account.PatientInfoService;
import com.yihu.wlyy.service.app.consult.ConsultPublicService;
import com.yihu.wlyy.util.CommonUtil;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.web.WeixinBaseController;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
@ -13,16 +17,10 @@ import org.springframework.data.domain.Page;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.yihu.wlyy.entity.consult.ConsultPublic;
import com.yihu.wlyy.entity.consult.ConsultPublicReply;
import com.yihu.wlyy.service.app.consult.ConsultPublicService;
import com.yihu.wlyy.util.CommonUtil;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.web.WeixinBaseController;
import java.util.Date;
/**
 * 患者端:图文咨询/公共咨询/病友圈控制类
@ -77,8 +75,10 @@ public class ConsultPublicController extends WeixinBaseController {
			}
			cp.setImages(images);
			// 设置患者标识
			cp.setPatient(getUID());
			Patient patient=patientInfoService.findByCode(getUID());
			cp.setPatient(getRepUID());
//			cp.setPatient(getUID());
//			Patient patient=patientInfoService.findByCode(getUID());
			Patient patient=patientInfoService.findByCode(getRepUID());
			cp.setSex(patient.getSex());
			// 设置问题标题
			cp.setTitle(question);
@ -113,7 +113,8 @@ public class ConsultPublicController extends WeixinBaseController {
	public String list(long id, int pagesize, @RequestParam(required = false) String disease) {
		try {
			JSONArray list = new JSONArray();
			Page<ConsultPublic> datas = consultPublicService.findPublicQuestionByPatient(getUID(), disease, id, pagesize);
			Page<ConsultPublic> datas = consultPublicService.findPublicQuestionByPatient(getRepUID(), disease, id, pagesize);
//			Page<ConsultPublic> datas = consultPublicService.findPublicQuestionByPatient(getUID(), disease, id, pagesize);
			if (datas != null) {
				for (ConsultPublic cp : datas) {
					if (cp == null) {
@ -180,8 +181,10 @@ public class ConsultPublicController extends WeixinBaseController {
				images = CommonUtil.copyTempImage(images);
			}
			reply.setImages(images);
			reply.setPatient(getUID());
			Patient patient=patientInfoService.findByCode(getUID());
//			reply.setPatient(getUID());
//			Patient patient=patientInfoService.findByCode(getUID());
			reply.setPatient(getRepUID());
			Patient patient=patientInfoService.findByCode(getRepUID());
			reply.setSex(patient.getSex());
			ConsultPublicReply temp = consultPublicService.addPatientReply(reply);
			if (temp == null) {
@ -232,7 +235,8 @@ public class ConsultPublicController extends WeixinBaseController {
			}
			if (id <= 0) {
				ConsultPublic temp = consultPublicService.findByConsult(consult);
				if (temp != null && StringUtils.equals(temp.getPatient(), getUID())) {
//				if (temp != null && StringUtils.equals(temp.getPatient(), getUID())) {
				if (temp != null && StringUtils.equals(temp.getPatient(), getRepUID())) {
					// 自己的帖子,清空未读数量
					consultPublicService.clearUnread(consult);
				}

+ 19 - 9
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/PatientHealthController.java

@ -63,7 +63,8 @@ public class PatientHealthController extends BaseController {
    public String getRecentData() {
        try {
            List list = new ArrayList();
            String patient = getUID();
            String patient = getRepUID();
//            String patient = getUID();
//            健康指标类型(1血糖,2血压,3体重,4腰围)
            Map map = healthIndexService.findDataByPatient(patient, 1);
            Map map1 = healthIndexService.findDataByPatient(patient, 2);
@ -242,7 +243,8 @@ public class PatientHealthController extends BaseController {
    @ApiOperation("患者最近填写的健康指标")
    public String recent() {
        try {
            JSONArray array = healthIndexService.findRecentByPatient(getUID());
            JSONArray array = healthIndexService.findRecentByPatient(getRepUID());
//            JSONArray array = healthIndexService.findRecentByPatient(getUID());
            if (array != null) {
                return write(200, "查询成功", "list", array);
            } else {
@ -261,7 +263,8 @@ public class PatientHealthController extends BaseController {
    public String last() {
        try {
            Map<String, Object> map = new HashMap<>();
            String patient = getUID();
            String patient = getRepUID();
//            String patient = getUID();
            DevicePatientHealthIndex xt = healthIndexService.findLastByPatien(patient, 1);
            if (xt != null) {
                map.put("xt", xt);
@ -381,9 +384,12 @@ public class PatientHealthController extends BaseController {
    public String addPatientHealthIndex(@ApiParam(name = "data", value = "指标数据", defaultValue = "{\"gi\":\"5.5\",\"gi_type\":\"1\"}")
                                        @RequestParam(value = "data", required = true) String data,
                                        @ApiParam(name = "type", value = "指标类型", defaultValue = "1")
                                        @RequestParam(value = "type", required = true) String type) {
                                        @RequestParam(value = "type", required = true) String type,
                                        @ApiParam(name = "patient", value = "居民code", defaultValue = "1")
                                        @RequestParam(value = "patient", required = true) String patient) {
        try {
            DevicePatientHealthIndex obj = healthIndexService.addPatientHealthIndex(data, type, getUID(), null);
//            DevicePatientHealthIndex obj = healthIndexService.addPatientHealthIndex(data, type, getUID(), null);
            DevicePatientHealthIndex obj = healthIndexService.addPatientHealthIndex(data, type, patient, null);
            //血糖和血压需要校验
            if (type.equals("1") || type.equals("2")) {
                healthIndexService.verifyHealthIndex(obj.getId());
@ -423,7 +429,8 @@ public class PatientHealthController extends BaseController {
                                               @ApiParam(name = "end", value = "结束时间", defaultValue = "2017-06-02 00:00:00")
                                               @RequestParam(value = "end", required = true) String end) {
        try {
            List<DevicePatientHealthIndex> list = healthIndexService.findChartByPatient(getUID(), type, gi_type, begin, end);
            List<DevicePatientHealthIndex> list = healthIndexService.findChartByPatient(getRepUID(), type, gi_type, begin, end);
//            List<DevicePatientHealthIndex> list = healthIndexService.findChartByPatient(getUID(), type, gi_type, begin, end);
            if (list == null) {
                return success("查询成功!");
@ -472,10 +479,12 @@ public class PatientHealthController extends BaseController {
        try {
            JSONArray jsonArray = new JSONArray();
            if (type == 1) {
                List<Object> list = healthIndexService.findIndexByPatient2(getUID(), type, start, end, page, pagesize);
                List<Object> list = healthIndexService.findIndexByPatient2(getRepUID(), type, start, end, page, pagesize);
//                List<Object> list = healthIndexService.findIndexByPatient2(getUID(), type, start, end, page, pagesize);
                jsonArray = new JSONArray(list);
            } else {
                List<DevicePatientHealthIndex> list = healthIndexService.findIndexByPatient(getUID(), type, start, end, page, pagesize);
                List<DevicePatientHealthIndex> list = healthIndexService.findIndexByPatient(getRepUID(), type, start, end, page, pagesize);
//                List<DevicePatientHealthIndex> list = healthIndexService.findIndexByPatient(getUID(), type, start, end, page, pagesize);
                if (list != null) {
                    for (DevicePatientHealthIndex model : list) {
                        JSONObject modelJson = new JSONObject();
@ -518,7 +527,8 @@ public class PatientHealthController extends BaseController {
        try {
            JSONArray standardArray = new JSONArray();
            JSONArray userArray = new JSONArray();
            Iterable<PatientHealthStandard> iterable = healthIndexService.findStandardByPatient(getUID());
            Iterable<PatientHealthStandard> iterable = healthIndexService.findStandardByPatient(getRepUID());
//            Iterable<PatientHealthStandard> iterable = healthIndexService.findStandardByPatient(getUID());
            Iterator<PatientHealthStandard> iterator = null;
            if (iterable != null) {
                iterator = iterable.iterator();

+ 28 - 22
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/PatientHealthRecordController.java

@ -1,8 +1,17 @@
package com.yihu.wlyy.web.patient.health;
import java.util.Date;
import java.util.List;
import com.yihu.wlyy.entity.dict.Medicines;
import com.yihu.wlyy.entity.education.Sports;
import com.yihu.wlyy.entity.education.SportsType;
import com.yihu.wlyy.entity.patient.PatientHealthRecordDiet;
import com.yihu.wlyy.entity.patient.PatientHealthRecordMedication;
import com.yihu.wlyy.entity.patient.PatientHealthRecordSports;
import com.yihu.wlyy.service.app.health.PatientHealthRecordService;
import com.yihu.wlyy.service.app.medicines.MedicinesService;
import com.yihu.wlyy.service.app.sports.SportsService;
import com.yihu.wlyy.util.CommonUtil;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.web.WeixinBaseController;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
@ -16,18 +25,8 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.yihu.wlyy.entity.dict.Medicines;
import com.yihu.wlyy.entity.patient.PatientHealthRecordDiet;
import com.yihu.wlyy.entity.patient.PatientHealthRecordMedication;
import com.yihu.wlyy.entity.patient.PatientHealthRecordSports;
import com.yihu.wlyy.entity.education.Sports;
import com.yihu.wlyy.entity.education.SportsType;
import com.yihu.wlyy.service.app.health.PatientHealthRecordService;
import com.yihu.wlyy.service.app.medicines.MedicinesService;
import com.yihu.wlyy.service.app.sports.SportsService;
import com.yihu.wlyy.util.CommonUtil;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.web.WeixinBaseController;
import java.util.Date;
import java.util.List;
/**
 * 健康记录控制类
@ -177,7 +176,8 @@ public class PatientHealthRecordController extends WeixinBaseController {
			PatientHealthRecordSports record = new PatientHealthRecordSports();
			record.setDel("1");
			record.setCzrq(new Date());
			record.setPatient(getUID());
			record.setPatient(getRepUID());
//			record.setPatient(getUID());
			record.setRecordDate(DateUtil.strToDateShort(record_date));
			record.setSortDate(DateUtil.strToDateAppendNowTime(record_date, DateUtil.YYYY_MM_DD_HH_MM_SS));
			record.setSportsTime(sportsTime);
@ -206,7 +206,8 @@ public class PatientHealthRecordController extends WeixinBaseController {
			PatientHealthRecordMedication record = new PatientHealthRecordMedication();
			record.setDel("1");
			record.setCzrq(new Date());
			record.setPatient(getUID());
			record.setPatient(getRepUID());
//			record.setPatient(getUID());
			record.setRecordDate(DateUtil.strToDateShort(record_date));
			record.setSortDate(DateUtil.strToDateAppendNowTime(record_date, DateUtil.YYYY_MM_DD_HH_MM_SS));
			record.setMedicines(medicines);
@ -236,7 +237,8 @@ public class PatientHealthRecordController extends WeixinBaseController {
			PatientHealthRecordDiet record = new PatientHealthRecordDiet();
			record.setDel("1");
			record.setCzrq(new Date());
			record.setPatient(getUID());
			record.setPatient(getRepUID());
//			record.setPatient(getUID());
			record.setRecordDate(DateUtil.strToDateShort(record_date));
			record.setSortDate(DateUtil.strToDateAppendNowTime(record_date, DateUtil.YYYY_MM_DD_HH_MM_SS));
			record.setContent(content);
@ -267,7 +269,8 @@ public class PatientHealthRecordController extends WeixinBaseController {
	@ResponseBody
	public String recent() {
		try {
			JSONObject json = patientHealthRecordService.findRecentByPatient(getUID());
//			JSONObject json = patientHealthRecordService.findRecentByPatient(getUID());
			JSONObject json = patientHealthRecordService.findRecentByPatient(getRepUID());
			if (json != null) {
				return write(200, "查询成功", "data", json);
			} else {
@ -288,7 +291,8 @@ public class PatientHealthRecordController extends WeixinBaseController {
	@ResponseBody
	public String sports(String start,String end,int page, int pagesize) {
		try {
			Page<PatientHealthRecordSports> data = patientHealthRecordService.findSportsByPatientPage(getUID(), start,end,page, pagesize);
			Page<PatientHealthRecordSports> data = patientHealthRecordService.findSportsByPatientPage(getRepUID(), start,end,page, pagesize);
//			Page<PatientHealthRecordSports> data = patientHealthRecordService.findSportsByPatientPage(getUID(), start,end,page, pagesize);
			if (data != null) {
				JSONArray array = new JSONArray();
				for (PatientHealthRecordSports record : data) {
@ -329,7 +333,8 @@ public class PatientHealthRecordController extends WeixinBaseController {
	@ResponseBody
	public String medication(String start,String end,int page, int pagesize) {
		try {
			Page<PatientHealthRecordMedication> data = patientHealthRecordService.findMedicalByPatientPage(getUID(), start, end, page, pagesize);
			Page<PatientHealthRecordMedication> data = patientHealthRecordService.findMedicalByPatientPage(getRepUID(), start, end, page, pagesize);
//			Page<PatientHealthRecordMedication> data = patientHealthRecordService.findMedicalByPatientPage(getUID(), start, end, page, pagesize);
			if (data != null) {
				JSONArray array = new JSONArray();
				for (PatientHealthRecordMedication record : data) {
@ -366,7 +371,8 @@ public class PatientHealthRecordController extends WeixinBaseController {
	@ResponseBody
	public String diet(String start,String end,int page,int pagesize) {
		try {
			Page<PatientHealthRecordDiet> data = patientHealthRecordService.findDietByPatientPage(getUID(),start,end,page, pagesize);
			Page<PatientHealthRecordDiet> data = patientHealthRecordService.findDietByPatientPage(getRepUID(),start,end,page, pagesize);
//			Page<PatientHealthRecordDiet> data = patientHealthRecordService.findDietByPatientPage(getUID(),start,end,page, pagesize);
			if (data != null) {
				JSONArray array = new JSONArray();
				for (PatientHealthRecordDiet record : data) {