瀏覽代碼

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

yeshijie 7 年之前
父節點
當前提交
ed78affa2e

+ 76 - 74
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/adapter/PresModeAdapter.java

@ -114,85 +114,87 @@ public class PresModeAdapter {
            Iterator iterator = returnData.iterator();
            while (iterator.hasNext()){
                JSONArray modeArray = (JSONArray) iterator.next();
                JSONObject mode = (JSONObject) modeArray.get(0);
                JSONObject p  = new JSONObject();
                p.put("code",mode.getInteger("RECIPE_NO")+"");
                p.put("createTime",mode.getString("APPLY_TIME"));
                for(int i=0;i<modeArray.size();i++){
                    JSONObject mode = (JSONObject) modeArray.get(i);
                    JSONObject p  = new JSONObject();
                    p.put("code",mode.getInteger("RECIPE_NO")+"");
                    p.put("createTime",mode.getString("APPLY_TIME"));
                Doctor doctor =  zyDictService.getDoctByJw(mode.getString("APPLY_OPERATOR"),mode.getString("HEALTH_ORG_CODE"));
                // "APPLY_OPERATOR_NAME": 开单医生姓名","HEALTH_ORG_CODE": "开单机构编码",
                if(doctor!=null){
                    p.put("doctor",doctor.getCode());
                    p.put("doctorName",doctor.getName());
                    p.put("hospitalName",doctor.getHospitalName());
                    p.put("hospital",doctor.getHospital());
                }else{
                    p.put("doctor",mode.getString("APPLY_OPERATOR"));
                    p.put("doctorName",mode.getString("APPLY_OPERATOR_NAME"));
                    p.put("hospitalName",mode.getString("HEALTH_ORG_CODE"));
                    p.put("hospital",mode.getString("HEALTH_ORG_CODE"));
                }
                    Doctor doctor =  zyDictService.getDoctByJw(mode.getString("APPLY_OPERATOR"),mode.getString("HEALTH_ORG_CODE"));
                    // "APPLY_OPERATOR_NAME": 开单医生姓名","HEALTH_ORG_CODE": "开单机构编码",
                    if(doctor!=null){
                        p.put("doctor",doctor.getCode());
                        p.put("doctorName",doctor.getName());
                        p.put("hospitalName",doctor.getHospitalName());
                        p.put("hospital",doctor.getHospital());
                    }else{
                        p.put("doctor",mode.getString("APPLY_OPERATOR"));
                        p.put("doctorName",mode.getString("APPLY_OPERATOR_NAME"));
                        p.put("hospitalName",mode.getString("HEALTH_ORG_CODE"));
                        p.put("hospital",mode.getString("HEALTH_ORG_CODE"));
                    }
                PrescriptionDiagnosis diagnosis = new PrescriptionDiagnosis();
//                String diagnoseCode = mode.getString("DIAGNOSE_CODE");
//                String diagnoseName = mode.getString("DIAGNOSE_NAME");
                String diagnoseCode = "E10.100";
                String diagnoseName = "1型糖尿病性酮症";
                diagnosis.setCode(diagnoseCode);//诊断代码
                diagnosis.setName(diagnoseName);//诊断名称
                String icd10 = icd10DictServcie.getHealthProblemsByIcd10Code(diagnoseCode);
                if(!StringUtils.isEmpty(icd10)){
                    JSONObject icd = JSONObject.parseObject(icd10);
                    diagnosis.setHealthProblemName(icd.getString("value"));//诊断名称
                    diagnosis.setHealthProblem(icd.getString("key"));//诊断代码
                }else{
                    diagnosis.setHealthProblemName(diagnoseName);//诊断名称
                    diagnosis.setHealthProblem(diagnoseCode);//诊断代码
                }
                JSONArray jsonArrayDt = new JSONArray();
                jsonArrayDt.add(diagnosis);
                p.put("prescriptionDt",jsonArrayDt);
                    PrescriptionDiagnosis diagnosis = new PrescriptionDiagnosis();
                    String diagnoseCode = mode.getString("DIAGNOSE_CODE");
                    String diagnoseName = mode.getString("DIAGNOSE_NAME");
//                    String diagnoseCode = "E10.100";
//                    String diagnoseName = "1型糖尿病性酮症";
                    diagnosis.setCode(diagnoseCode);//诊断代码
                    diagnosis.setName(diagnoseName);//诊断名称
                    String icd10 = icd10DictServcie.getHealthProblemsByIcd10Code(diagnoseCode);
                    if(!StringUtils.isEmpty(icd10)){
                        JSONObject icd = JSONObject.parseObject(icd10);
                        diagnosis.setHealthProblemName(icd.getString("value"));//诊断名称
                        diagnosis.setHealthProblem(icd.getString("key"));//诊断代码
                    }else{
                        diagnosis.setHealthProblemName(diagnoseName);//诊断名称
                        diagnosis.setHealthProblem(diagnoseCode);//诊断代码
                    }
                    JSONArray jsonArrayDt = new JSONArray();
                    jsonArrayDt.add(diagnosis);
                    p.put("prescriptionDt",jsonArrayDt);
                JSONArray infos = mode.getJSONArray("RECIPE_DETAIL");
                Iterator infoIt = infos.iterator();
                List<PrescriptionInfo> prescriptionInfos = new ArrayList<>();
                while (infoIt.hasNext()){
                    JSONObject info = (JSONObject) infoIt.next();
                    PrescriptionInfo prescriptionInfo = new PrescriptionInfo();
                    prescriptionInfo.setRemark(info.getString("REMARK"));
                    prescriptionInfo.setBindFlag(info.getString("BIND_FLAG"));
                    prescriptionInfo.setDirection("口服");//药品用法
                    prescriptionInfo.setDrugCode(info.getString("ITEM_CODE"));//药品code
                    prescriptionInfo.setDrugName(info.getString("ITEM_NAME"));//药品名称
                    prescriptionInfo.setDrugRate(info.getString("FREQUENCY"));//吃药频率 FREQUENCY
                    prescriptionInfo.setDrugRateName(info.getString("FREQUENCY_NAME"));
                    prescriptionInfo.setDrugFormat(info.getString("ITEM_SPEC"));//药品规格
                    prescriptionInfo.setPrice(info.getInteger("ITEM_PRICE"));//药品单价
                    prescriptionInfo.setNum(info.getInteger("ITEM_QUANTITY"));//药品数目
                    prescriptionInfo.setJwSubCode("");//智业子处方号
                    prescriptionInfo.setDrugNumUnit(info.getString("ITEM_UNIT"));//数量单位编码
                    prescriptionInfo.setDrugNumUnitName(info.getString("ITEM_UNIT_NAME"));//数量单位名称
                    prescriptionInfo.setCost(1);//金额
                    prescriptionInfo.setCharge(0);//自付
                    prescriptionInfo.setBindFlag("0");//成组标志, 0.非成组,1.成组
                    prescriptionInfo.setDayCount(info.getInteger("DAY_COUNT"));//用药天数
                    prescriptionInfo.setDrugUsage(info.getString("USAGE"));//用药方法编码
                    prescriptionInfo.setUsageName(info.getString("USAGE_NAME"));//用药方法名称
                    prescriptionInfo.setPhysicDose(info.getString("PHYSIC_DOSE"));//用药剂量
                    prescriptionInfo.setPhysicDoseUnit(info.getString("PHYSIC_DOSE_UNIT"));//剂量单位编码
                    prescriptionInfo.setPhysicDoseUnitName(info.getString("PHYSIC_DOSE_UNIT_NAME"));//剂量单位名称
                    prescriptionInfo.setPhysicAmount(info.getString("PHYSIC_AMOUNT"));//用药总量
                    prescriptionInfo.setPhysicAmountUnit(info.getString("PHYSIC_AMOUNT_UNIT"));//总量单位编码
                    prescriptionInfo.setPhysicAmountUnitName(info.getString("PHYSIC_AMOUNT_UNIT_NAME"));//总量单位名称
                    prescriptionInfo.setPhysicInjectPlace("");//注射地点编码
                    prescriptionInfo.setPhysicInjectPlaceName("");//注射地点名称
                    prescriptionInfo.setPhysicSkinTest(info.getString("PHYSIC_SKIN_TEST"));//皮试类型名称
                    prescriptionInfo.setPhysicSkinTestName(info.getString("PHYSIC_SKIN_TEST_NAME"));//皮试类型名称
                    prescriptionInfos.add(prescriptionInfo);
                    JSONArray infos = mode.getJSONArray("RECIPE_DETAIL");
                    Iterator infoIt = infos.iterator();
                    List<PrescriptionInfo> prescriptionInfos = new ArrayList<>();
                    while (infoIt.hasNext()){
                        JSONObject info = (JSONObject) infoIt.next();
                        PrescriptionInfo prescriptionInfo = new PrescriptionInfo();
                        prescriptionInfo.setRemark(info.getString("REMARK"));
                        prescriptionInfo.setBindFlag(info.getString("BIND_FLAG"));
                        prescriptionInfo.setDirection("口服");//药品用法
                        prescriptionInfo.setDrugCode(info.getString("ITEM_CODE"));//药品code
                        prescriptionInfo.setDrugName(info.getString("ITEM_NAME"));//药品名称
                        prescriptionInfo.setDrugRate(info.getString("FREQUENCY"));//吃药频率 FREQUENCY
                        prescriptionInfo.setDrugRateName(info.getString("FREQUENCY_NAME"));
                        prescriptionInfo.setDrugFormat(info.getString("ITEM_SPEC"));//药品规格
                        prescriptionInfo.setPrice(info.getInteger("ITEM_PRICE"));//药品单价
                        prescriptionInfo.setNum(info.getInteger("ITEM_QUANTITY"));//药品数目
                        prescriptionInfo.setJwSubCode("");//智业子处方号
                        prescriptionInfo.setDrugNumUnit(info.getString("ITEM_UNIT"));//数量单位编码
                        prescriptionInfo.setDrugNumUnitName(info.getString("ITEM_UNIT_NAME"));//数量单位名称
                        prescriptionInfo.setCost(1);//金额
                        prescriptionInfo.setCharge(0);//自付
                        prescriptionInfo.setBindFlag("0");//成组标志, 0.非成组,1.成组
                        prescriptionInfo.setDayCount(info.getInteger("DAY_COUNT"));//用药天数
                        prescriptionInfo.setDrugUsage(info.getString("USAGE"));//用药方法编码
                        prescriptionInfo.setUsageName(info.getString("USAGE_NAME"));//用药方法名称
                        prescriptionInfo.setPhysicDose(info.getString("PHYSIC_DOSE"));//用药剂量
                        prescriptionInfo.setPhysicDoseUnit(info.getString("PHYSIC_DOSE_UNIT"));//剂量单位编码
                        prescriptionInfo.setPhysicDoseUnitName(info.getString("PHYSIC_DOSE_UNIT_NAME"));//剂量单位名称
                        prescriptionInfo.setPhysicAmount(info.getString("PHYSIC_AMOUNT"));//用药总量
                        prescriptionInfo.setPhysicAmountUnit(info.getString("PHYSIC_AMOUNT_UNIT"));//总量单位编码
                        prescriptionInfo.setPhysicAmountUnitName(info.getString("PHYSIC_AMOUNT_UNIT_NAME"));//总量单位名称
                        prescriptionInfo.setPhysicInjectPlace("");//注射地点编码
                        prescriptionInfo.setPhysicInjectPlaceName("");//注射地点名称
                        prescriptionInfo.setPhysicSkinTest(info.getString("PHYSIC_SKIN_TEST"));//皮试类型名称
                        prescriptionInfo.setPhysicSkinTestName(info.getString("PHYSIC_SKIN_TEST_NAME"));//皮试类型名称
                        prescriptionInfos.add(prescriptionInfo);
                    }
                    p.put("prescriptionInfo",prescriptionInfos);
                    rs.add(p);
                }
                p.put("prescriptionInfo",prescriptionInfos);
                rs.add(p);
            }
            return rs;
        }

+ 13 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/JwPrescriptionService.java

@ -1,14 +1,17 @@
package com.yihu.wlyy.service.third.jw;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.util.HttpClientUtil;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
 * 基位长处方接口
@ -22,6 +25,8 @@ public class JwPrescriptionService {
    private String jwUrl;
    @Autowired
    private HttpClientUtil httpClientUtil;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    /**
     * 获取字典列表
@ -74,7 +79,14 @@ public class JwPrescriptionService {
        params.add(new BasicNameValuePair("applyTimeEnd", applyTimeEnd));
        String response = httpClientUtil.post(url, params, "UTF-8");
//        String response = httpClientUtil.post(url, params, "UTF-8");
        String sql = "SELECT h.response from wlyy_http_log h WHERE h.id = 806287";
        List<Map<String ,Object>> list = jdbcTemplate.queryForList(sql);
        String response = list.get(0).get("response").toString();
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("status",200);
        jsonObject.put("data",response);
        response = jsonObject.toString();
        return response;
    }