|
@ -129,7 +129,7 @@ public class PresModeAdapter {
|
|
|
}else{
|
|
|
p.put("doctor",mode.getString("APPLY_OPERATOR"));
|
|
|
p.put("doctorName",mode.getString("APPLY_OPERATOR_NAME"));
|
|
|
//p.setHospitalName(doctor.getHospitalName());
|
|
|
p.put("hospitalName",mode.getString("HEALTH_ORG_CODE"));
|
|
|
p.put("hospital",mode.getString("HEALTH_ORG_CODE"));
|
|
|
}
|
|
|
|
|
@ -199,4 +199,98 @@ public class PresModeAdapter {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 处方详情转换
|
|
|
* @param json
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONObject modelToSinglePrescription(String json){
|
|
|
JSONObject oldJson = JSONObject.parseObject(json);
|
|
|
JSONObject data = oldJson.getJSONObject("data");
|
|
|
JSONArray returnData = data.getJSONArray("returnData");
|
|
|
String code = data.getString("CODE");
|
|
|
if(StringUtils.isNotBlank(code)&&"1".equals(code)){
|
|
|
JSONArray modeArray = returnData.getJSONArray(0);
|
|
|
JSONObject mode = (JSONObject) modeArray.get(0);
|
|
|
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"));
|
|
|
}
|
|
|
|
|
|
JSONObject diagnosis = new JSONObject();
|
|
|
// String diagnoseCode = mode.getString("DIAGNOSE_CODE");
|
|
|
// String diagnoseName = mode.getString("DIAGNOSE_NAME");
|
|
|
String diagnoseCode = "E10.100";
|
|
|
String diagnoseName = "1型糖尿病性酮症";
|
|
|
diagnosis.put("code",diagnoseCode);//诊断代码
|
|
|
diagnosis.put("name",diagnoseName);//诊断名称
|
|
|
String icd10 = icd10DictServcie.getHealthProblemsByIcd10Code(diagnoseCode);
|
|
|
if(!StringUtils.isEmpty(icd10)){
|
|
|
JSONObject icd = JSONObject.parseObject(icd10);
|
|
|
diagnosis.put("healthProblemName",icd.getString("value"));//诊断名称
|
|
|
diagnosis.put("healthProblem",icd.getString("key"));//诊断代码
|
|
|
}else{
|
|
|
diagnosis.put("healthProblemName",diagnoseName);//诊断名称
|
|
|
diagnosis.put("healthProblem",diagnoseCode);//诊断代码
|
|
|
}
|
|
|
JSONArray jsonArrayDt = new JSONArray();
|
|
|
jsonArrayDt.add(diagnosis);
|
|
|
p.put("prescriptionDt",jsonArrayDt);
|
|
|
|
|
|
JSONArray infos = mode.getJSONArray("RECIPE_DETAIL");
|
|
|
Iterator infoIt = infos.iterator();
|
|
|
JSONArray prescriptionInfos = new JSONArray();
|
|
|
while (infoIt.hasNext()){
|
|
|
JSONObject info = (JSONObject) infoIt.next();
|
|
|
JSONObject prescriptionInfo = new JSONObject();
|
|
|
prescriptionInfo.put("Remark",info.getString("REMARK"));
|
|
|
prescriptionInfo.put("BindFlag",info.getString("BIND_FLAG"));
|
|
|
prescriptionInfo.put("direction",info.getString("USAGE_NAME"));//药品用法
|
|
|
prescriptionInfo.put("drugCode",info.getString("ITEM_CODE"));//药品code
|
|
|
prescriptionInfo.put("drugName",info.getString("ITEM_NAME"));//药品名称
|
|
|
prescriptionInfo.put("drugRate",info.getString("FREQUENCY"));//吃药频率 FREQUENCY
|
|
|
prescriptionInfo.put("drugRateName",info.getString("FREQUENCY_NAME"));
|
|
|
prescriptionInfo.put("drugFormat",info.getString("ITEM_SPEC"));//药品规格
|
|
|
prescriptionInfo.put("price",info.getInteger("ITEM_PRICE"));//药品单价
|
|
|
prescriptionInfo.put("num",info.getInteger("ITEM_QUANTITY"));//药品数目
|
|
|
prescriptionInfo.put("jwSubCode","");//智业子处方号
|
|
|
prescriptionInfo.put("drugNumUnit",info.getString("ITEM_UNIT"));//数量单位编码
|
|
|
prescriptionInfo.put("drugNumUnitName",info.getString("ITEM_UNIT_NAME"));//数量单位名称
|
|
|
prescriptionInfo.put("cost",1);//金额
|
|
|
prescriptionInfo.put("charge",0);//自付
|
|
|
prescriptionInfo.put("bindFlag","0");//成组标志, 0.非成组,1.成组
|
|
|
prescriptionInfo.put("dayCount",info.getInteger("DAY_COUNT"));//用药天数
|
|
|
prescriptionInfo.put("drugUsage",info.getString("USAGE"));//用药方法编码
|
|
|
prescriptionInfo.put("usageName",info.getString("USAGE_NAME"));//用药方法名称
|
|
|
prescriptionInfo.put("physicDose",info.getString("PHYSIC_DOSE"));//用药剂量
|
|
|
prescriptionInfo.put("physicDoseUnit",info.getString("PHYSIC_DOSE_UNIT"));//剂量单位编码
|
|
|
prescriptionInfo.put("physicDoseUnitName",info.getString("PHYSIC_DOSE_UNIT_NAME"));//剂量单位名称
|
|
|
prescriptionInfo.put("physicAmount",info.getString("PHYSIC_AMOUNT"));//用药总量
|
|
|
prescriptionInfo.put("physicAmountUnit",info.getString("PHYSIC_AMOUNT_UNIT"));//总量单位编码
|
|
|
prescriptionInfo.put("physicAmountUnitName",info.getString("PHYSIC_AMOUNT_UNIT_NAME"));//总量单位名称
|
|
|
prescriptionInfo.put("physicInjectPlace","");//注射地点编码
|
|
|
prescriptionInfo.put("physicInjectPlaceName","");//注射地点名称
|
|
|
prescriptionInfo.put("physicSkinTest",info.getString("PHYSIC_SKIN_TEST"));//皮试类型名称
|
|
|
prescriptionInfo.put("physicSkinTestName",info.getString("PHYSIC_SKIN_TEST_NAME"));//皮试类型名称
|
|
|
prescriptionInfos.add(prescriptionInfo);
|
|
|
}
|
|
|
p.put("prescriptionInfo",prescriptionInfos);
|
|
|
return p;
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
}
|