Browse Source

卫计委发送文章接口文档补充

liuwenbin 7 years ago
parent
commit
d0af3f776a

+ 8 - 0
patient-co/patient-co-statistics-es/pom.xml

@ -441,6 +441,14 @@
            <artifactId>elasticsearch-sql</artifactId>
            <version>2.4.1.0</version>
        </dependency>
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>common-entity</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu</groupId>
            <artifactId>common-entity</artifactId>
        </dependency>
    </dependencies>
    <build>

+ 15 - 4
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/util/ElasticsearchUtil.java

@ -2,10 +2,14 @@ package com.yihu.wlyy.statistics.util;
import com.alibaba.druid.sql.ast.SQLExpr;
import com.alibaba.druid.sql.ast.expr.SQLQueryExpr;
import com.alibaba.druid.sql.parser.ParserException;
import com.alibaba.druid.sql.parser.SQLExprParser;
import com.alibaba.druid.sql.parser.Token;
import com.yihu.wlyy.statistics.etl.save.es.ElasticFactory;
import com.yihu.wlyy.statistics.vo.SaveModel;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.search.SearchHit;
import org.nlpcn.es4sql.domain.Select;
import org.nlpcn.es4sql.jdbc.ObjectResult;
import org.nlpcn.es4sql.jdbc.ObjectResultsExtractor;
@ -254,7 +258,7 @@ public class ElasticsearchUtil {
        StringBuffer groupBy = new StringBuffer();
        //根据 childAreaLevel   group by
        if (SaveModel.teamLevel.equals(childAreaLevel)) {
            sql.append("select team,teamName,result1,result2 from wlyy_quota_test where  '");
            sql.append("select team,teamName,result1,result2 from wlyy_quota_test where  ");
        } else if (SaveModel.OrgLevel.equals(childAreaLevel)) {
            sql.append("select hospital,hospitalName,sum(result1) result1,sum(result2) result2 from wlyy_quota_test where  ");
            groupBy.append(" group by hospital,hospitalName");
@ -305,7 +309,9 @@ public class ElasticsearchUtil {
            SQLExprParser parser = new ElasticSqlExprParser(sql);
            SQLExpr expr = parser.expr();
            SQLQueryExpr queryExpr = (SQLQueryExpr) expr;
//            if (parser.getLexer().token() != Token.EOF) {
//                throw new ParserException("illegal sql expr : " + sql);
//            }
            Select select = null;
            select = new SqlParser().parseSelect(queryExpr);
@ -319,11 +325,13 @@ public class ElasticsearchUtil {
                requestBuilder = action.explain();
            } else {
                //封装成自己的Select对象
                queryAction = new DefaultQueryAction(elasticFactory.getTransportClient(), select);
                Client client = elasticFactory.getTransportClient();
                queryAction = new DefaultQueryAction(client, select);
                requestBuilder = queryAction.explain();
            }
            SearchResponse response = (SearchResponse) requestBuilder.get();
            ObjectResult temp = new ObjectResultsExtractor(true, true, true).extractResults(response.getAggregations(), true);
//            ObjectResult temp = new ObjectResultsExtractor(true, true, true).extractResults(response.getAggregations(), true);
            ObjectResult temp = new ObjectResultsExtractor(true, true, true).extractResults(response.getHits(), true);
            List<String> heads = temp.getHeaders();
            temp.getLines().stream().forEach(one -> {
                try {
@ -331,6 +339,9 @@ public class ElasticsearchUtil {
                    for (int i = 0; i < one.size(); i++) {
                        String key = null;
                        Object value = one.get(i);
                        if(heads.get(i).startsWith("_")){
                            continue;
                        }
                        if (heads.get(i).contains("date_histogram")) {
                            key = "setQuotaDate";
                            value=DateUtil.strToDate(String.valueOf(value),"yyyy-MM-dd HH:mm:ss");

BIN
patient-co/patient-co-statistics/doc/业务文档/统计指标流程.docx


+ 4 - 2
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/redis/RedisThread.java

@ -95,8 +95,10 @@ public class RedisThread implements Runnable {
            }else if("wechat".equals(title)){
                String data = json.getString("value");
                pushMsgTask.getQueue().put(new org.json.JSONObject(data));
            }else{
            }else if("adjustPrescription".equals(title)){
                //线下调整处方完成
                String prescriptionCode = json.getString("prescription");
                prescriptionService.setPrescriptionInfo(prescriptionCode);
            }
        }catch (Exception e){
            logger.error("redis_error...",e);

+ 31 - 1
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionService.java

@ -6,6 +6,7 @@ import com.yihu.wlyy.entity.message.Message;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionExpressage;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionInfo;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionLog;
import com.yihu.wlyy.repository.doctor.DoctorTeamDao;
import com.yihu.wlyy.repository.message.MessageDao;
@ -18,16 +19,19 @@ import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.third.jw.JwPrescriptionService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.MessageType;
import net.sf.json.JSONArray;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
 * Created by chenweida on 2017/7/27.
@ -56,7 +60,8 @@ public class PrescriptionService extends BaseService {
    private JwPrescriptionService jwPrescriptionService;
    @Autowired
    private PrescriptionDiagnosisDao prescriptionDiagnosisDao;
    @Autowired
    private StringRedisTemplate redisTemplate;
    @Autowired
    private DoctorTeamDao doctorTeamDao;
    @Autowired
@ -97,6 +102,31 @@ public class PrescriptionService extends BaseService {
        }
    }
    /**
     * 设置处方redis药品信息
     * @param prescriptionCode
     * @return
     */
    public boolean setPrescriptionInfo(String prescriptionCode){
        try {
            if(!StringUtils.isEmpty(prescriptionCode))
            {
                //判断该续方的药品信息redis是否存在
                String key = "prescription:"+prescriptionCode+":drugInfo";
                List<PrescriptionInfo> list = prescriptionInfoDao.findByPrescriptionCode(prescriptionCode);
                if(list!=null&&list.size()>0){
                    String re = JSONArray.fromObject(list).toString();
                    redisTemplate.opsForValue().set(key,re,180, TimeUnit.DAYS);
                }
            }
        }
        catch (Exception ex) {
            ex.printStackTrace();
            return false;
        }
        return true;
    }
    /**
     * 配药完成
     * @param code

BIN
patient-co/patient-co-wlyy/doc/接口文档/对外接口文档/集美健康教育/集美对外测试服务器信息.docx


+ 30 - 30
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PatientHealthGuidanceDao.java

@ -1,6 +1,6 @@
/*******************************************************************************
 * Copyright (c) 2005, 2014 springside.github.io
 *
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package com.yihu.wlyy.repository.patient;
@ -18,43 +18,43 @@ import com.yihu.wlyy.entity.patient.PatientHealthGuidance;
public interface PatientHealthGuidanceDao extends PagingAndSortingRepository<PatientHealthGuidance, Long>, JpaSpecificationExecutor<PatientHealthGuidance> {
	@Query("select b.name, b.photo, a.id, a.content, a.createTime,b.level,a.readStatus from PatientHealthGuidance a, Doctor b where a.patient = ?1 and a.doctor = b.code and a.del = '1' order by a.id desc")
	Page<Object> findByPatient(String patient, Pageable pageRequest);
    @Query("select b.name, b.photo, a.id, a.content, a.createTime,b.level,a.readStatus from PatientHealthGuidance a, Doctor b where a.patient = ?1 and a.doctor = b.code and a.del = '1' order by a.id desc")
    Page<Object> findByPatient(String patient, Pageable pageRequest);
	@Query("select b.name, b.photo, a.id, a.content, a.createTime,b.level,a.readStatus from PatientHealthGuidance a, Doctor b where a.patient = ?1 and a.doctor = b.code and a.id < ?2 and a.del = '1' order by a.id desc")
	Page<Object> findByPatient(String patient, long id, Pageable pageRequest);
	
	@Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.patient = b.code and a.del = '1' order by a.id desc")
	Page<Object> findByDoctor(String doctor, Pageable pageRequest);
	
	@Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.id < ?2 and a.patient = b.code and a.del = '1' order by a.id desc")
	Page<Object> findByDoctor(String doctor, long id, Pageable pageRequest);
    @Query("select b.name, b.photo, a.id, a.content, a.createTime,b.level,a.readStatus from PatientHealthGuidance a, Doctor b where a.patient = ?1 and a.doctor = b.code and a.id < ?2 and a.del = '1' order by a.id desc")
    Page<Object> findByPatient(String patient, long id, Pageable pageRequest);
	@Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.patient = ?2 and a.patient = b.code and a.del = '1' order by a.id desc")
	Page<Object> findByDoctor(String doctor, String patient, Pageable pageRequest);
    @Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.patient = b.code and a.del = '1' order by a.id desc")
    Page<Object> findByDoctor(String doctor, Pageable pageRequest);
	@Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.patient = ?2 and a.patient = b.code and a.id < ?3 and a.del = '1' order by a.id desc")
	Page<Object> findByDoctor(String doctor, String patient, long id, Pageable pageRequest);
    @Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.id < ?2 and a.patient = b.code and a.del = '1' order by a.id desc")
    Page<Object> findByDoctor(String doctor, long id, Pageable pageRequest);
	@Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.czrq between ?2 and ?3 and a.patient = b.code and a.del = '1' order by a.id desc")
	Page<Object> findByDoctor(String doctor, Date begin, Date end, Pageable pageRequest);
    @Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.patient = ?2 and a.patient = b.code and a.del = '1' order by a.id desc")
    Page<Object> findByDoctor(String doctor, String patient, Pageable pageRequest);
	@Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.czrq between ?2 and ?3 and a.id < ?4 and a.patient = b.code and a.del = '1' order by a.id desc")
	Page<Object> findByDoctor(String doctor, Date begin, Date end, long id, Pageable pageRequest);
    @Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.patient = ?2 and a.patient = b.code and a.id < ?3 and a.del = '1' order by a.id desc")
    Page<Object> findByDoctor(String doctor, String patient, long id, Pageable pageRequest);
	@Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.patient = ?2 and a.czrq between ?3 and ?4 and a.patient = b.code and a.del = '1' order by a.id desc")
	Page<Object> findByDoctor(String doctor, String patient, Date begin, Date end, Pageable pageRequest);
    @Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.czrq between ?2 and ?3 and a.patient = b.code and a.del = '1' order by a.id desc")
    Page<Object> findByDoctor(String doctor, Date begin, Date end, Pageable pageRequest);
	@Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.patient = ?2 and a.czrq between ?3 and ?4 and a.id < ?5 and a.patient = b.code and a.del = '1' order by a.id desc")
	Page<Object> findByDoctor(String doctor, String patient, Date begin, Date end, long id, Pageable pageRequest);
    @Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.czrq between ?2 and ?3 and a.id < ?4 and a.patient = b.code and a.del = '1' order by a.id desc")
    Page<Object> findByDoctor(String doctor, Date begin, Date end, long id, Pageable pageRequest);
	//查找昨天的健康指导
	@Query("SELECT a FROM PatientHealthGuidance a WHERE unix_timestamp(a.czrq)>=unix_timestamp(?1) and unix_timestamp(a.czrq)<unix_timestamp(?2) ")
	List<PatientHealthGuidance> findByCzrqyYesterday(String yesterday,String now );
    @Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.patient = ?2 and a.czrq between ?3 and ?4 and a.patient = b.code and a.del = '1' order by a.id desc")
    Page<Object> findByDoctor(String doctor, String patient, Date begin, Date end, Pageable pageRequest);
	@Query("SELECT count(a) from PatientHealthGuidance a WHERE  a.patient=?2 and a.doctor=?1 ")
	Integer findbydoctorAndPatient(String doctor, String patientCode);
    @Query("select b.name, b.photo, a.id, a.content, a.czrq from PatientHealthGuidance a, Patient b where a.doctor = ?1 and a.patient = ?2 and a.czrq between ?3 and ?4 and a.id < ?5 and a.patient = b.code and a.del = '1' order by a.id desc")
    Page<Object> findByDoctor(String doctor, String patient, Date begin, Date end, long id, Pageable pageRequest);
	@Query("select b.name, b.photo, a.id, substring(a.content, 1, 50) as content, a.createTime,b.level,b.code,a.adminTeamCode from PatientHealthGuidance a, Doctor b where a.doctor = b.code and a.patient = ?1 and a.adminTeamCode = ?2 and a.del = '1'")
	Page<Object> findByPatientAndTeamCode(String patient, Long teamCode, Pageable pageable);
    //查找昨天的健康指导
    @Query("SELECT a FROM PatientHealthGuidance a WHERE unix_timestamp(a.czrq)>=unix_timestamp(?1) and unix_timestamp(a.czrq)<unix_timestamp(?2) ")
    List<PatientHealthGuidance> findByCzrqyYesterday(String yesterday, String now);
    @Query("SELECT count(a) from PatientHealthGuidance a WHERE  a.patient=?2 and a.doctor=?1 ")
    Integer findbydoctorAndPatient(String doctor, String patientCode);
    @Query("select b.name, b.photo, a.id, substring(a.content, 1, 50) as content, a.createTime,b.level,b.code,a.adminTeamCode from PatientHealthGuidance a, Doctor b where a.doctor = b.code and a.patient = ?1 and a.adminTeamCode = ?2 and a.del = '1'")
    Page<Object> findByPatientAndTeamCode(String patient, Long teamCode, Pageable pageable);
}

+ 88 - 84
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionService.java

@ -231,97 +231,101 @@ public class PrescriptionService extends BaseService {
            if(200 == status && 1 == code){
                JSONArray zyCfinfoListReturnData = zyCfinfo.getJSONArray("returnData");
                JSONArray zyCfinfoList = zyCfinfoListReturnData.getJSONArray(0);
                JSONArray cfInfo = new JSONArray();
                for (int i = 0; i < zyCfinfoList.size(); i++) {
                    JSONObject zyCfinfoObj = zyCfinfoList.getJSONObject(i);
                    //支付明细
                    JSONArray zySettleDetailList = zyCfinfoList.getJSONObject(i).getJSONArray("SETTLE_DETAIL");
                    //根据挂号号获取处方明细
                    Prescription prescription = prescriptionDao.findByVisitNoAndRecipeNo(zyCfinfoObj.getString("VISIT_NO"),recipeNo);
                    List<PrescriptionDiagnosis> pds = prescriptionDiagnosisDao.findByPrescriptionCode(prescription.getCode());
                    //诊断明细        {"zdms00":"诊断或症状描述","zdbh00":"诊断或症状编码"}
                    if (!pds.isEmpty()){
                        JSONArray zdInfo = new JSONArray();
                        for (PrescriptionDiagnosis pd : pds) {
                            JSONObject j1 = new JSONObject();
                            j1.put("zdms00",pd.getName());//诊断或症状描述"1型糖尿病性酮症"
                            j1.put("zdbh00",pd.getCode());//诊断或症状编码"E10.100"
                            zdInfo.add(j1);
                
                if(zyCfinfoListReturnData.size()!=0 && !zyCfinfoListReturnData.isEmpty()){
    
                    JSONArray zyCfinfoList = zyCfinfoListReturnData.getJSONArray(0);
                    JSONArray cfInfo = new JSONArray();
                    for (int i = 0; i < zyCfinfoList.size(); i++) {
        
                        JSONObject zyCfinfoObj = zyCfinfoList.getJSONObject(i);
                        //支付明细
                        JSONArray zySettleDetailList = zyCfinfoList.getJSONObject(i).getJSONArray("SETTLE_DETAIL");
                        //根据挂号号获取处方明细
                        Prescription prescription = prescriptionDao.findByVisitNoAndRecipeNo(zyCfinfoObj.getString("VISIT_NO"),recipeNo);
        
                        List<PrescriptionDiagnosis> pds = prescriptionDiagnosisDao.findByPrescriptionCode(prescription.getCode());
                        //诊断明细        {"zdms00":"诊断或症状描述","zdbh00":"诊断或症状编码"}
                        if (!pds.isEmpty()){
                            JSONArray zdInfo = new JSONArray();
                            for (PrescriptionDiagnosis pd : pds) {
                                JSONObject j1 = new JSONObject();
                                j1.put("zdms00",pd.getName());//诊断或症状描述"1型糖尿病性酮症"
                                j1.put("zdbh00",pd.getCode());//诊断或症状编码"E10.100"
                                zdInfo.add(j1);
                            }
                            json.put("zdlist",zdInfo);
                        }
                        json.put("zdlist",zdInfo);
                    }
                    //收费明细       {"xmgg00":"项目规格","cfhao0":"处方号","sfybxm":"是否医保项目","dcyydw":"单次用药单位","xmje00":"项目金额","xmbh00":"项目编号",
                    // "ysxm00":"医生姓名","yppl00":"药品频率","gytj00":"给药途径","ypts00":"药品天数","xmdj00":"项目单价","qyzl00":"取药总量","ylts00":"药量天数",
                    // "sptxbm":"商品条形编码","xmmc00":"项目名称","fpxmbh":"发票项目编号","xmsl00":"项目数量","ypyl00":"药品用量","qyzldw":"取药单位","xmdw00":"项目单位",
                    // "jx0000":"剂型"}
                    Integer cfxms0 = 0;
                    for (int j= 0; j < zySettleDetailList.size(); j++) {
                        JSONObject zySettleDetailObj = zySettleDetailList.getJSONObject(j);
        
        
                        //收费明细       {"xmgg00":"项目规格","cfhao0":"处方号","sfybxm":"是否医保项目","dcyydw":"单次用药单位","xmje00":"项目金额","xmbh00":"项目编号",
                        // "ysxm00":"医生姓名","yppl00":"药品频率","gytj00":"给药途径","ypts00":"药品天数","xmdj00":"项目单价","qyzl00":"取药总量","ylts00":"药量天数",
                        // "sptxbm":"商品条形编码","xmmc00":"项目名称","fpxmbh":"发票项目编号","xmsl00":"项目数量","ypyl00":"药品用量","qyzldw":"取药单位","xmdw00":"项目单位",
                        // "jx0000":"剂型"}
        
                        Integer cfxms0 = 0;
                        for (int j= 0; j < zySettleDetailList.size(); j++) {
                            JSONObject zySettleDetailObj = zySettleDetailList.getJSONObject(j);
//                        String RECIPE_NO = zySettleDetailObj.getString("RECIPE_NO");
//                        if(recipeNo.equals(RECIPE_NO)){//过滤其他处方号
                        cfxms0++;
                        JSONObject j2 = new JSONObject();
                        j2.put("xmbh00",zySettleDetailObj.getString("INSUR_ITEM_CODE"));//项目编号
                        j2.put("xmmc00",zySettleDetailObj.getString("INSUR_ITEM_NAME"));//项目名称
                        j2.put("fpxmbh",zySettleDetailObj.getString("INSUR_INVOICE_TYPE_CODE"));//发票项目编号
                        j2.put("sfybxm",zySettleDetailObj.getString("INSUR_FLAG"));//是否医保项目
                        Double _price = Double.parseDouble(zySettleDetailObj.getString("INSUR_ITEM_PRICE"));
                        DecimalFormat df = new DecimalFormat("######0.00");
                        _price = _price*100;
                        j2.put("xmdj00",df.format(_price));//项目单价
                        j2.put("xmdw00",zySettleDetailObj.getString("INSUR_ITEM_UNIT_NAME"));//项目单位
                        j2.put("xmgg00",zySettleDetailObj.getString("INSUR_ITEM_SPEC"));//项目规格(医保)
                        j2.put("xmsl00",zySettleDetailObj.getString("ITEM_QUANTITY"));//项目数量
                        Double _cost = Double.parseDouble(zySettleDetailObj.getString("COST"));
                        Integer infocost = CommonUtil.doubleToInt(_cost);
                        j2.put("xmje00",String.valueOf(infocost));//项目金额
                        j2.put("ysxm00",zySettleDetailObj.getString("APPLY_OPERATOR_NAME"));//医生姓名
                        j2.put("sptxbm","");//商品条形编码
                        j2.put("yppl00",zySettleDetailObj.getString("FREQUENCY"));//药品频率
                        j2.put("ypyl00",zySettleDetailObj.getString("PHYSIC_DOSE"));//药品用量
                        j2.put("cfhao0",zySettleDetailObj.getString("RECIPE_NO"));//处方号
                        j2.put("jx0000",zySettleDetailObj.getString("PHYSIC_FORM"));//剂型
                        j2.put("dcyydw",zySettleDetailObj.getString("PHYSIC_DOSE_UNIT"));//单次用药单位
                        j2.put("qyzl00",zySettleDetailObj.getString("PHYSIC_AMOUNT"));//取药总量
                        j2.put("qyzldw",zySettleDetailObj.getString("PHYSIC_AMOUNT_UNIT"));//取药单位
                        j2.put("gytj00",zySettleDetailObj.getString("PHYSIC_USAGE"));//给药途径
                        j2.put("ypts00",zySettleDetailObj.getString("DAY_COUNT"));//药品天数
                        cfInfo.add(j2);
                            cfxms0++;
                            JSONObject j2 = new JSONObject();
                            j2.put("xmbh00",zySettleDetailObj.getString("INSUR_ITEM_CODE"));//项目编号
                            j2.put("xmmc00",zySettleDetailObj.getString("INSUR_ITEM_NAME"));//项目名称
                            j2.put("fpxmbh",zySettleDetailObj.getString("INSUR_INVOICE_TYPE_CODE"));//发票项目编号
                            j2.put("sfybxm",zySettleDetailObj.getString("INSUR_FLAG"));//是否医保项目
            
                            Double _price = Double.parseDouble(zySettleDetailObj.getString("INSUR_ITEM_PRICE"));
                            DecimalFormat df = new DecimalFormat("######0.00");
                            _price = _price*100;
                            j2.put("xmdj00",df.format(_price));//项目单价
            
                            j2.put("xmdw00",zySettleDetailObj.getString("INSUR_ITEM_UNIT_NAME"));//项目单位
                            j2.put("xmgg00",zySettleDetailObj.getString("INSUR_ITEM_SPEC"));//项目规格(医保)
                            j2.put("xmsl00",zySettleDetailObj.getString("ITEM_QUANTITY"));//项目数量
            
                            Double _cost = Double.parseDouble(zySettleDetailObj.getString("COST"));
                            Integer infocost = CommonUtil.doubleToInt(_cost);
                            j2.put("xmje00",String.valueOf(infocost));//项目金额
            
                            j2.put("ysxm00",zySettleDetailObj.getString("APPLY_OPERATOR_NAME"));//医生姓名
                            j2.put("sptxbm","");//商品条形编码
                            j2.put("yppl00",zySettleDetailObj.getString("FREQUENCY"));//药品频率
                            j2.put("ypyl00",zySettleDetailObj.getString("PHYSIC_DOSE"));//药品用量
                            j2.put("cfhao0",zySettleDetailObj.getString("RECIPE_NO"));//处方号
                            j2.put("jx0000",zySettleDetailObj.getString("PHYSIC_FORM"));//剂型
                            j2.put("dcyydw",zySettleDetailObj.getString("PHYSIC_DOSE_UNIT"));//单次用药单位
                            j2.put("qyzl00",zySettleDetailObj.getString("PHYSIC_AMOUNT"));//取药总量
                            j2.put("qyzldw",zySettleDetailObj.getString("PHYSIC_AMOUNT_UNIT"));//取药单位
                            j2.put("gytj00",zySettleDetailObj.getString("PHYSIC_USAGE"));//给药途径
                            j2.put("ypts00",zySettleDetailObj.getString("DAY_COUNT"));//药品天数
                            cfInfo.add(j2);
//                        }
                        }
        
                        //处方主信息     {"yyksbm":"医生科室编号","bcsfcs":"本次收费次数","yszjhm":"医生证件号码","ysxm00":"医生姓名","mzlb00":"门诊类别","sfydgh":"是否药店挂号",
                        // "bcghcs":"本次挂号次数","ghksmc":"挂号科室名称","cfxms0":"明细上传数量","mzlsh0":"医保挂号流水号 如果为空,将自动医保挂号并收费","ghfy00":"挂号费用",
                        // "yszjdj":"医师诊金级别","bqbm00":"病情编码","sfygwd":"是否医改网点"}
                        JSONObject jsonObject = new JSONObject();
                        jsonObject.put("yyksbm",zyCfinfoObj.getString("VISIT_DEPT"));//医生科室编号
                        jsonObject.put("bcsfcs","1");//本次收费次数
                        jsonObject.put("yszjhm",zyCfinfoObj.getString("VISIT_IDENTITY_CARD_NO"));//医生证件号码
                        jsonObject.put("ysxm00",prescription.getDoctorName());//医生姓名
                        jsonObject.put("mzlb00",zyCfinfoObj.getString("INSUR_DISP_REGISTER_TYPE"));//门诊类别---普通门诊默认为101
                        jsonObject.put("sfydgh","N");//是否药店挂号,默认为N,不是药店挂号
                        jsonObject.put("bcghcs","1");//本次挂号次数
                        jsonObject.put("ghksmc",prescription.getDeptName());//挂号科室名称
                        jsonObject.put("mzlsh0","");//医保挂号流水号
                        jsonObject.put("ghfy00","0");//挂号费用
                        jsonObject.put("bqbm00","");//病情编码---可为空,不传递
                        jsonObject.put("sfygwd","N");//是否医改网点--默认为否
                        jsonObject.put("yszjdj",zyCfinfoObj.getString("INSUR_DOCTOR_RANK"));//医师诊金级别
                        jsonObject.put("cfxms0",""+cfxms0);//明细上传数量
                        json.put("recipeContent",jsonObject);
                    }
                    //处方主信息     {"yyksbm":"医生科室编号","bcsfcs":"本次收费次数","yszjhm":"医生证件号码","ysxm00":"医生姓名","mzlb00":"门诊类别","sfydgh":"是否药店挂号",
                    // "bcghcs":"本次挂号次数","ghksmc":"挂号科室名称","cfxms0":"明细上传数量","mzlsh0":"医保挂号流水号 如果为空,将自动医保挂号并收费","ghfy00":"挂号费用",
                    // "yszjdj":"医师诊金级别","bqbm00":"病情编码","sfygwd":"是否医改网点"}
                    JSONObject jsonObject = new JSONObject();
                    jsonObject.put("yyksbm",zyCfinfoObj.getString("VISIT_DEPT"));//医生科室编号
                    jsonObject.put("bcsfcs","1");//本次收费次数
                    jsonObject.put("yszjhm",zyCfinfoObj.getString("VISIT_IDENTITY_CARD_NO"));//医生证件号码
                    jsonObject.put("ysxm00",prescription.getDoctorName());//医生姓名
                    jsonObject.put("mzlb00",zyCfinfoObj.getString("INSUR_DISP_REGISTER_TYPE"));//门诊类别---普通门诊默认为101
                    jsonObject.put("sfydgh","N");//是否药店挂号,默认为N,不是药店挂号
                    jsonObject.put("bcghcs","1");//本次挂号次数
                    jsonObject.put("ghksmc",prescription.getDeptName());//挂号科室名称
                    jsonObject.put("mzlsh0","");//医保挂号流水号
                    jsonObject.put("ghfy00","0");//挂号费用
                    jsonObject.put("bqbm00","");//病情编码---可为空,不传递
                    jsonObject.put("sfygwd","N");//是否医改网点--默认为否
                    jsonObject.put("yszjdj",zyCfinfoObj.getString("INSUR_DOCTOR_RANK"));//医师诊金级别
                    jsonObject.put("cfxms0",""+cfxms0);//明细上传数量
                    json.put("recipeContent",jsonObject);
                    json.put("mxlist",cfInfo);
                }
                json.put("mxlist",cfInfo);
            }else{
                String errormessage = jwobj.getString("MESSAGE");
                throw new Exception(errormessage);

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/StatisticsController.java

@ -82,8 +82,8 @@ public class StatisticsController extends BaseController {
            if (index != null) {
                for (String idx : indexes) {
//                    result.put("index_" + idx, statisticsESService.getDateIncrementDetail(startDate, endDate, interval, area, level, idx, level2_type));
                    result.put("index_" + idx, statisticsService.getDateIncrementDetail(startDate, endDate, interval, area, Integer.parseInt(level), idx, level2_type));
                    result.put("index_" + idx, statisticsESService.getDateIncrementDetail(startDate, endDate, interval, area, level, idx, level2_type));
//                    result.put("index_" + idx, statisticsService.getDateIncrementDetail(startDate, endDate, interval, area, Integer.parseInt(level), idx, level2_type));
                }
            }

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/doctor/GcEduArticleController.java

@ -40,7 +40,7 @@ import javax.jms.TextMessage;
import java.util.*;
/**
 * Created by chenweida on 2017/8/30.
 * Created by chenweida on 2017/8/30...
 */
@Controller
@RequestMapping(value = "/wlyygc/doctor/edu/article", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/doctor/GcLableController.java

@ -61,7 +61,7 @@ public class GcLableController extends BaseController {
    @ApiOperation("根据分组类型查找标签已经标签下的患者数目")
    public ResultListModel<List<PatientLabelModel>> labelsWithNum(
            @ApiParam(name = "labelType", value = "1:服务类型(卫计委分组) 2:健康情况 3:疾病类型 4:团队标签(自定义标签)", required = true) @RequestParam(value = "labelType", required = true) String labelType,
            @ApiParam(name = "teamCode", value = "医生所属的团队ID", required = true) @RequestParam(value = "teamCode", required = true) Long teamCode
            @ApiParam(name = "teamCode", value = "医生所属的团队ID", required = false) @RequestParam(value = "teamCode", required = false) Long teamCode
    ) {
        try {
            JSONArray result = null;

+ 0 - 35
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/service/GcEduArticleService.java

@ -60,41 +60,6 @@ public class GcEduArticleService {
        StringBuffer sb = new StringBuffer();//sql
        //1 服务类型  2 健康情况 3 疾病类型 4 自定义标签
        if (!org.springframework.util.StringUtils.isEmpty(labelType)) {
//            switch (labelType) {
//                case "1": {
//                    sb.append(" SELECT " +
//                            "  w.patient " +
//                            "FROM " +
//                            "  wlyy_sign_family w " +
//                            " WHERE " +
//                            "  w.`status` > 0 " +
//                            " AND w.code in ( select sign_code from  " +
//                            "  wlyy_sign_family_server where server_type=? ) ");
//                    params.add(labelCode);
//
//                    if (teamId != null && teamId > 0) {
//                        sb.append(" and w.admin_team_code=? ");
//                        params.add(teamId);
//                    }
//                    break;
//                }
//                case "2":
//                case "3":
//                case "4": {
//                    sb.append("SELECT w.patient FROM wlyy_sign_family w " +
//                            "WHERE " +
//                            "  w.patient in (SELECT  l.patient FROM  wlyy_sign_patient_label_info l WHERE l.label_type = ? AND l.label = ? and l.status=1) " +
//                            "AND w.`status` > 0");
//                    params.add(labelType);
//                    params.add(labelCode);
//                    if (teamId != null && teamId > 0) {
//                        sb.append(" and w.admin_team_code=? ");
//                        params.add(teamId);
//                    }
//                    break;
//                }
//            }
            switch (labelType) {
                case "1":{
                    sb.append(" select w.patient FROM wlyy_sign_family w  left join wlyy_sign_family_server s on w.code=s.sign_code " +