|
@ -2,6 +2,7 @@ package com.yihu.wlyy.adapter;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yihu.wlyy.entity.patient.prescription.Prescription;
|
|
|
import com.yihu.wlyy.entity.patient.prescription.PrescriptionInfo;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.stereotype.Component;
|
|
@ -86,13 +87,67 @@ public class PresModeAdapter {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
// info.put("drugCode",info.getString("ITEM_CODE"));
|
|
|
// info.put("drugName",info.getString("ITEM_NAME"));
|
|
|
// info.put("subjectClass",info.getString("SUBJECT_CLASS"));
|
|
|
// info.put("drugFormat",info.getString("ITEM_SPEC"));
|
|
|
// info.put("price",info.getString("ITEM_PRICE"));
|
|
|
// info.put("drugCode",info.getString("ITEM_QUANTITY"));
|
|
|
// info.put("drugCode",info.getString("ITEM_CODE"));
|
|
|
// info.put("drugCode",info.getString("ITEM_CODE"));
|
|
|
// info.put("drugCode",info.getString("ITEM_CODE"));
|
|
|
public JSONArray ModeToPrescription(String json)throws Exception{
|
|
|
// JSONObject oldJson = JSONObject.parseObject(json);
|
|
|
// String dataStr = oldJson.getString("data");
|
|
|
// JSONObject data = JSONObject.parseObject(dataStr);
|
|
|
// JSONArray returnData = data.getJSONArray("returnData");
|
|
|
// String code = data.getString("CODE");
|
|
|
// if(StringUtils.isNotBlank(code)&&"1".equals(code)){
|
|
|
// JSONArray rs = new JSONArray();
|
|
|
// Iterator iterator = returnData.iterator();
|
|
|
// while (iterator.hasNext()){
|
|
|
// JSONArray modeArray = (JSONArray) iterator.next();
|
|
|
// JSONObject mode = (JSONObject) modeArray.get(0);
|
|
|
// Prescription p = new Prescription();
|
|
|
// p.setCode(mode.getInteger("RECIPE_NO")+"");
|
|
|
// p.setCreateTime(mode.getDate("APPLY_TIME"));
|
|
|
//
|
|
|
//// m.put("code",mode.getInteger("RECIPE_NO"));
|
|
|
//// m.put("templateName",mode.getString("TEMPLATE_NAME"));
|
|
|
// JSONArray infos = mode.getJSONArray("TEMPLATE_DETAIL");
|
|
|
// Iterator infoIt = infos.iterator();
|
|
|
// JSONArray is = new JSONArray();
|
|
|
// 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"));//皮试类型名称
|
|
|
// is.add(prescriptionInfo);
|
|
|
// }
|
|
|
// m.put("prescriptionInfo",is);
|
|
|
// rs.add(m);
|
|
|
// }
|
|
|
// return rs;
|
|
|
// }
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
}
|