فهرست منبع

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

trick9191 7 سال پیش
والد
کامیت
6b35a49bf9

+ 23 - 13
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/label/SignPatientLabelInfoService.java

@ -710,11 +710,12 @@ public class SignPatientLabelInfoService extends BaseService {
                    Calendar today = Calendar.getInstance();
                    Calendar startDate = Calendar.getInstance();
                    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
                    sql = "select count(DISTINCT patient) count" +
                    sql = "select count(DISTINCT t1.patient) count" +
                            " from " +
                            "     wlyy_sign_family " +
                            " where (doctor = ? or doctor_health = ?) and status > 0 " +
                            (teamCode > 0 ? " and admin_team_code = ? " : "");
                            "     wlyy_sign_family t1," +
                            "     wlyy_patient t3 " +
                            " where t1.patient = t3.code AND (t1.doctor = ? or t1.doctor_health = ?) and t1.status > 0 " +
                            (teamCode > 0 ? " and t1.admin_team_code = ? " : "");
                    if (label.getLabelCode().equals("1")) {
                        int week = today.get(Calendar.DAY_OF_WEEK) - 2;
@ -745,12 +746,14 @@ public class SignPatientLabelInfoService extends BaseService {
                        sql = " SELECT " +
                                "     count(DISTINCT t1.patient) count" +
                                " FROM" +
                                "     wlyy_sign_family t1 " +
                                "     wlyy_sign_family t1  " +
                                " left join " +
                                "    (select l.patient,l.label,l.label_type,l.label_name from wlyy_sign_family f left join wlyy_sign_patient_label_info l on f.patient = l.patient where (f.doctor = '" + doctor + "' or f.doctor_health = '" + doctor + "') and f.status > 0 and l.label_type = ? and l.status = 1) t2 " +
                                " on t1.patient = t2.patient " +
                                "     ,wlyy_patient t3 " +
                                " WHERE" +
                                "     t2.patient is null " +
                                "     AND t1.patient = t3.code "+
                                "     AND (t1.doctor = ? or t1.doctor_health = ?)" +
                                "     AND t1.status > 0 " +
                                (teamCode > 0 ? "    AND t1.admin_team_code = ? " : "");
@ -765,9 +768,11 @@ public class SignPatientLabelInfoService extends BaseService {
                                "     count(DISTINCT t1.patient) count" +
                                " FROM" +
                                "     wlyy_sign_family t1, " +
                                "     wlyy_sign_patient_label_info t2 " +
                                "     wlyy_sign_patient_label_info t2, " +
                                "     wlyy_patient t3 " +
                                " WHERE" +
                                "     t1.patient = t2.patient " +
                                "     AND t1.patient = t3.code "+
                                "     AND t2.label = ? " +
                                "     AND t2.label_type = ? " +
                                "     AND t2.status = 1 " +
@ -792,7 +797,7 @@ public class SignPatientLabelInfoService extends BaseService {
                json.put("amount", amount);
                int focusAmount = 0;
                sql += labelType.equals("5") ? " AND LENGTH(TRIM(IFNULL(openid,''))) > 0 " : " AND LENGTH(TRIM(IFNULL(t1.openid,''))) > 0 ";
                sql += labelType.equals("5") ? " AND LENGTH(TRIM(IFNULL(t3.openid,''))) > 0 " : " AND LENGTH(TRIM(IFNULL(t3.openid,''))) > 0 ";
                List<Map<String, Object>> focusCount = jdbcTemplate.queryForList(sql, args);
                if (focusCount != null && focusCount.size() > 0 && focusCount.get(0).containsKey("count")) {
@ -900,10 +905,11 @@ public class SignPatientLabelInfoService extends BaseService {
                    Calendar today = Calendar.getInstance();
                    Calendar startDate = Calendar.getInstance();
                    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
                    sql = "select count(DISTINCT  patient) count" +
                    sql = "select count(DISTINCT  t1.patient) count" +
                            " from " +
                            "     wlyy_sign_family " +
                            " where status > 0 " +
                            "   wlyy_sign_family t1," +
                            "   wlyy_patient t3" +
                            " where t1.patient = t3.code AND status > 0 " +
                            " and admin_team_code = ? ";
                    if (label.getLabelCode().equals("1")) {
@ -935,9 +941,11 @@ public class SignPatientLabelInfoService extends BaseService {
                                "     wlyy_sign_family t1 " +
                                " left join " +
                                "    (select repl.patient,repl.label,repl.label_type,repl.label_name from wlyy_sign_family repf left join wlyy_sign_patient_label_info repl on repf.patient = repl.patient where repf.admin_team_code = ? and repf.status > 0 and repl.label_type = ? and repl.status = 1) t2 " +
                                " on t1.patient = t2.patient " +
                                " on t1.patient = t2.patient ," +
                                " wlyy_patient t3 " +
                                " WHERE" +
                                "     t2.patient is null " +
                                "    AND t1.patient = t3.code" +
                                "     AND t1.status > 0 " +
                                "     AND t1.admin_team_code = ? ";
@ -947,9 +955,11 @@ public class SignPatientLabelInfoService extends BaseService {
                                "     count(DISTINCT t1.patient) count" +
                                " FROM" +
                                "     wlyy_sign_family t1, " +
                                "     wlyy_sign_patient_label_info t2 " +
                                "     wlyy_sign_patient_label_info t2, " +
                                "     wlyy_patient t3 " +
                                " WHERE" +
                                "     t1.patient = t2.patient " +
                                "     AND t1.patient = t3.code " +
                                "     AND t2.label = ? " +
                                "     AND t2.label_type = ? " +
                                "     AND t2.status = 1 " +
@ -969,7 +979,7 @@ public class SignPatientLabelInfoService extends BaseService {
                json.put("amount", amount);
                int focusAmount = 0;
                sql += labelType.equals("5") ? " AND LENGTH(TRIM(IFNULL(openid,''))) > 0 " : " AND LENGTH(TRIM(IFNULL(t1.openid,''))) > 0 ";
                sql += labelType.equals("5") ? " AND LENGTH(TRIM(IFNULL(t3.openid,''))) > 0 " : " AND LENGTH(TRIM(IFNULL(t3.openid,''))) > 0 ";
                List<Map<String, Object>> focusCount = jdbcTemplate.queryForList(sql, args);
                if (focusCount != null && focusCount.size() > 0 && focusCount.get(0).containsKey("count")) {

+ 21 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java

@ -1,13 +1,19 @@
package com.yihu.wlyy.service.app.prescription;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.entity.dict.SystemDict;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionInfo;
import com.yihu.wlyy.repository.dict.SystemDictDao;
import com.yihu.wlyy.repository.prescription.PrescriptionInfoDao;
import com.yihu.wlyy.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by Trick on 2017/7/25.
@ -17,7 +23,8 @@ import java.util.List;
public class PrescriptionInfoService extends BaseService {
    @Autowired
    private PrescriptionInfoDao prescriptionInfoDao;
    @Autowired
    private SystemDictDao systemDictDao;
    /**
     * 获取处方下的详细药品
     * @param prescriptionCode
@ -26,4 +33,17 @@ public class PrescriptionInfoService extends BaseService {
    public List<PrescriptionInfo> getPrescriptionInfo(String prescriptionCode) {
        return prescriptionInfoDao.findByPrescriptionCode(prescriptionCode);
    }
    public JSONObject getPrescriptionFilter(){
        JSONObject rs = new JSONObject();
        List<SystemDict> states = systemDictDao.findByDictName("PRESCRIPTION_STATE");
        rs.put("state",states);
        List<Map<String,Object>> diseases = new ArrayList<>();
        Map<String,Object> dis = new HashMap<>();
        dis.put("1","糖尿病");
        //dis.put("","")
        return null;
    }
}

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

@ -969,6 +969,7 @@ public class FamilyContractService extends BaseService {
            patient.setPassword(MD5.GetMD5Code(password + salt));
            patient.setStatus(1);
            patient.setDisease(0);
            patient.setPhoto("../../../images/p-female.png");
        }
        // 保存用户信息

+ 17 - 6
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionInfoController.java

@ -6,12 +6,8 @@ import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.quartz.impl.calendar.BaseCalendar;
import org.springframework.beans.factory.annotation.Autowired;
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.RestController;
import org.springframework.web.bind.annotation.*;
/**
 * Created by Trick on 2017/7/25.
@ -19,7 +15,7 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping(value = "/doctor/prescriptionInfo")
@Api("医生端-长处方接口")
public class PrescriptionInfoController extends BaseController {
public class PrescriptionInfoController extends BaseController{
    @Autowired
    private PrescriptionInfoService prescriptionInfoService;
@ -47,4 +43,19 @@ public class PrescriptionInfoController extends BaseController {
            return error(-1, "失败");
        }
    }
    @RequestMapping(value = "/getPrescriptionFilter")
    @ResponseBody
    @ApiOperation(value = "获取过滤规则信息")
    public String getPrescriptionFilter(){
        try {
            return write(200, "查询成功!", "data", "");
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
}

+ 16 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionInfoController.java

@ -54,5 +54,21 @@ public class PatientPrescriptionInfoController extends BaseController {
            return error(-1, "查询失败!");
        }
    }
    @RequestMapping(value = "/getContinuedPrescription")
    @ResponseBody
    @ApiOperation(value = "获取续方详细信息")
    public String getContinuedPrescription(@RequestParam(required = true)@ApiParam(name="code",value="续方CODE")String code){
        try {
            return write(200, "查询成功!", "data", "");
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
}