|
@ -3616,159 +3616,121 @@ public class EntranceService {
|
|
|
return ConvertUtil.convertListEnvelop(resp);
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public YlzMedicalRelationDO getSettleInfo(String cardno,String idcard,String outpatientId) throws Exception {
|
|
|
public List<YlzMedicalRelationDO> getSettleList(String cardno,String idcard,String outpatientId) throws Exception {
|
|
|
List<YlzMedicalRelationDO> relationDOList = new ArrayList<>();
|
|
|
WlyyOutpatientDO outpatientDO = outpatientDao.findById(outpatientId);
|
|
|
net.sf.json.JSONObject object1 = qutpatientBalance(outpatientDO.getCardNo(), false);
|
|
|
Double cardFee = object1.getDouble("ZHYE");
|
|
|
/* Double cardFee = 0.0;*/
|
|
|
net.sf.json.JSONArray result = BS10108(cardno,idcard,"1",null,null,null,outpatientDO.getRegisterNo(),false);
|
|
|
if (result!=null&&result.size()!=0){
|
|
|
net.sf.json.JSONObject object = result.getJSONObject(0);
|
|
|
net.sf.json.JSONObject jsonObject = object.getJSONObject("retInfo");
|
|
|
if (jsonObject.getString("retCode").equalsIgnoreCase("00")){
|
|
|
net.sf.json.JSONObject msgInfoJson = object.getJSONObject("msgInfo");
|
|
|
if (msgInfoJson!=null){
|
|
|
net.sf.json.JSONObject resultJSON = msgInfoJson.getJSONObject("receipt");
|
|
|
if (resultJSON!=null){
|
|
|
YlzMedicalRelationDO ylzMedicalRelationDO = ylzMedicailRelationDao.findByLog_no(resultJSON.getString("xtgzh0"));
|
|
|
List<WlyyPrescriptionDO> prescriptionDOList = prescriptionDao.findByRealOrderAndStatusList(resultJSON.getString("xtgzh0"));
|
|
|
String diseaseCode = "";
|
|
|
if (prescriptionDOList!=null&&prescriptionDOList.size()!=0){
|
|
|
diseaseCode= prescriptionDOList.get(0).getDiseaseCode();
|
|
|
}
|
|
|
|
|
|
List<YlzMedicalIcdDO> icdDOList = new ArrayList<>();
|
|
|
List<YlzMedicalMxDO> mxDOList = new ArrayList<>();
|
|
|
if (ylzMedicalRelationDO==null){
|
|
|
ylzMedicalRelationDO = new YlzMedicalRelationDO();
|
|
|
ylzMedicalRelationDO.setLogNo(resultJSON.getString("xtgzh0"));
|
|
|
ylzMedicalRelationDO.setOrgCode("3502000303");
|
|
|
ylzMedicalRelationDO.setRegionCode("350200");
|
|
|
ylzMedicalRelationDO.setIdcard(outpatientDO.getIdcard());
|
|
|
ylzMedicalRelationDO.setName(resultJSON.getString("xming0"));
|
|
|
ylzMedicalRelationDO.setCertType("01");
|
|
|
ylzMedicalRelationDO.setMedicalMode("10");
|
|
|
if (StringUtils.isNoneBlank(outpatientDO.getDiseaseCode())){
|
|
|
ylzMedicalRelationDO.setMedicalType("13");
|
|
|
}else {
|
|
|
ylzMedicalRelationDO.setMedicalType("11");
|
|
|
}
|
|
|
ylzMedicalRelationDO.setCardNo(cardno);
|
|
|
ylzMedicalRelationDO.setHisSerial(outpatientDO.getRegisterNo());
|
|
|
ylzMedicalRelationDO.setHisSettleNo(resultJSON.getString("xtgzh0"));
|
|
|
ylzMedicalRelationDO.setDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalRelationDO.setDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalRelationDO.setHisDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalRelationDO.setHisDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalRelationDO.setEmergencySign("0");
|
|
|
ylzMedicalRelationDO.setTraumaSign("0");
|
|
|
ylzMedicalRelationDO.setDate(outpatientDO.getRegisterDate());
|
|
|
ylzMedicalRelationDO.setItemCount(resultJSON.getString("cfxms0"));
|
|
|
ylzMedicalRelationDO.setTotalAmount(resultJSON.getString("bcfyze"));
|
|
|
ylzMedicalRelationDO.setPreCharges(resultJSON.getString("bcfyze"));
|
|
|
ylzMedicalRelationDO.setBcwkje(resultJSON.getString("bcwkje"));
|
|
|
ylzMedicalRelationDO.setPersonAccount("0");
|
|
|
ylzMedicalRelationDO.setDataSource("53");
|
|
|
ylzMedicalRelationDO.setBalance(cardFee+"");
|
|
|
ylzMedicalRelationDO.setDiseaseCode(diseaseCode);
|
|
|
ylzMedicalRelationDO.setPreCount(resultJSON.getString("cfxms0"));
|
|
|
BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(outpatientDO.getDoctor());
|
|
|
if (baseDoctorDO!=null){
|
|
|
String jobTitle = baseDoctorDO.getJobTitleCode();
|
|
|
Object obj = com.alibaba.fastjson.JSON.parse(object.getString("msgInfo"));
|
|
|
if (obj instanceof JSONObject){
|
|
|
net.sf.json.JSONObject msgInfoJson = object.getJSONObject("msgInfo");
|
|
|
if (msgInfoJson!=null){
|
|
|
net.sf.json.JSONObject resultJSON = msgInfoJson.getJSONObject("receipt");
|
|
|
if (resultJSON!=null){
|
|
|
YlzMedicalRelationDO ylzMedicalRelationDO = ylzMedicailRelationDao.findByLog_no(resultJSON.getString("xtgzh0"));
|
|
|
List<WlyyPrescriptionDO> prescriptionDOList = prescriptionDao.findByRealOrderAndStatusList(resultJSON.getString("xtgzh0"));
|
|
|
String diseaseCode = "";
|
|
|
if (prescriptionDOList!=null&&prescriptionDOList.size()!=0){
|
|
|
diseaseCode= prescriptionDOList.get(0).getDiseaseCode();
|
|
|
}
|
|
|
ylzMedicalRelationDO.setDoctorLevel("02");
|
|
|
ylzMedicalRelationDO.setDel(1);
|
|
|
ylzMedicalRelationDO.setStatus(0);
|
|
|
ylzMedicalRelationDO.setState(0);
|
|
|
ylzMedicalRelationDO.setRelationCode(outpatientDO.getId());
|
|
|
ylzMedicalRelationDO.setCreateTime(new Date());
|
|
|
ylzMedicalRelationDO.setMedicalPrice("0");
|
|
|
if (outpatientDO.getMedicalState()==null){
|
|
|
ylzMedicalRelationDO.setMedicalState(0);
|
|
|
ylzMedicalRelationDO.setPersonCash(resultJSON.getString("bcfyze"));
|
|
|
}else {
|
|
|
if (outpatientDO.getMedicalState().equalsIgnoreCase("0")){
|
|
|
|
|
|
List<YlzMedicalIcdDO> icdDOList = new ArrayList<>();
|
|
|
List<YlzMedicalMxDO> mxDOList = new ArrayList<>();
|
|
|
if (ylzMedicalRelationDO==null){
|
|
|
ylzMedicalRelationDO = new YlzMedicalRelationDO();
|
|
|
ylzMedicalRelationDO.setLogNo(resultJSON.getString("xtgzh0"));
|
|
|
ylzMedicalRelationDO.setOrgCode("3502000303");
|
|
|
ylzMedicalRelationDO.setRegionCode("350200");
|
|
|
ylzMedicalRelationDO.setIdcard(outpatientDO.getIdcard());
|
|
|
ylzMedicalRelationDO.setName(resultJSON.getString("xming0"));
|
|
|
ylzMedicalRelationDO.setCertType("01");
|
|
|
ylzMedicalRelationDO.setMedicalMode("10");
|
|
|
if (StringUtils.isNoneBlank(outpatientDO.getDiseaseCode())){
|
|
|
ylzMedicalRelationDO.setMedicalType("13");
|
|
|
}else {
|
|
|
ylzMedicalRelationDO.setMedicalType("11");
|
|
|
}
|
|
|
ylzMedicalRelationDO.setCardNo(cardno);
|
|
|
ylzMedicalRelationDO.setHisSerial(outpatientDO.getRegisterNo());
|
|
|
ylzMedicalRelationDO.setHisSettleNo(resultJSON.getString("xtgzh0"));
|
|
|
ylzMedicalRelationDO.setDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalRelationDO.setDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalRelationDO.setHisDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalRelationDO.setHisDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalRelationDO.setEmergencySign("0");
|
|
|
ylzMedicalRelationDO.setTraumaSign("0");
|
|
|
ylzMedicalRelationDO.setDate(outpatientDO.getRegisterDate());
|
|
|
ylzMedicalRelationDO.setItemCount(resultJSON.getString("cfxms0"));
|
|
|
ylzMedicalRelationDO.setTotalAmount(resultJSON.getString("bcfyze"));
|
|
|
ylzMedicalRelationDO.setPreCharges(resultJSON.getString("bcfyze"));
|
|
|
ylzMedicalRelationDO.setBcwkje(resultJSON.getString("bcwkje"));
|
|
|
ylzMedicalRelationDO.setPersonAccount("0");
|
|
|
ylzMedicalRelationDO.setDataSource("53");
|
|
|
ylzMedicalRelationDO.setBalance(cardFee+"");
|
|
|
ylzMedicalRelationDO.setDiseaseCode(diseaseCode);
|
|
|
ylzMedicalRelationDO.setPreCount(resultJSON.getString("cfxms0"));
|
|
|
BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(outpatientDO.getDoctor());
|
|
|
if (baseDoctorDO!=null){
|
|
|
String jobTitle = baseDoctorDO.getJobTitleCode();
|
|
|
}
|
|
|
ylzMedicalRelationDO.setDoctorLevel("02");
|
|
|
ylzMedicalRelationDO.setDel(1);
|
|
|
ylzMedicalRelationDO.setStatus(0);
|
|
|
ylzMedicalRelationDO.setState(0);
|
|
|
ylzMedicalRelationDO.setRelationCode(outpatientDO.getId());
|
|
|
ylzMedicalRelationDO.setCreateTime(new Date());
|
|
|
ylzMedicalRelationDO.setMedicalPrice("0");
|
|
|
if (outpatientDO.getMedicalState()==null){
|
|
|
ylzMedicalRelationDO.setMedicalState(0);
|
|
|
ylzMedicalRelationDO.setPersonCash(resultJSON.getString("bcfyze"));
|
|
|
}else {
|
|
|
if (outpatientDO.getMedicalState().equalsIgnoreCase("0")){
|
|
|
ylzMedicalRelationDO.setPersonCash(resultJSON.getString("bcfyze"));
|
|
|
}
|
|
|
ylzMedicalRelationDO.setMedicalState(Integer.parseInt(outpatientDO.getMedicalState()));
|
|
|
}
|
|
|
ylzMedicalRelationDO.setMedicalState(Integer.parseInt(outpatientDO.getMedicalState()));
|
|
|
}
|
|
|
ylzMedicalRelationDO = ylzMedicailRelationDao.save(ylzMedicalRelationDO);
|
|
|
if (resultJSON.get("zdlists")!=null){
|
|
|
Object json = new JSONTokener(resultJSON.getString("zdlists")).nextValue();
|
|
|
if(json instanceof net.sf.json.JSONObject){
|
|
|
net.sf.json.JSONObject icdJSON = (net.sf.json.JSONObject)json;
|
|
|
net.sf.json.JSONObject icdJson = icdJSON.getJSONObject("zdlist");
|
|
|
YlzMedicalIcdDO ylzMedicalIcdDO = new YlzMedicalIcdDO();
|
|
|
ylzMedicalIcdDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalIcdDO.setDel(1);
|
|
|
ylzMedicalIcdDO.setCreateTime(new Date());
|
|
|
ylzMedicalIcdDO.setDiseaseType(icdJson.getString("zdlx"));
|
|
|
ylzMedicalIcdDO.setDiseaseCodeIcd10(icdJson.getString("zdbm"));
|
|
|
ylzMedicalIcdDO.setDiseaseNameIcd10(icdJson.getString("zdmc"));
|
|
|
ylzMedicalIcdDO.setDiseaseOrder(icdJson.getString("zdxh"));
|
|
|
ylzMedicalIcdDO = ylzMedicailIcdDao.save(ylzMedicalIcdDO);
|
|
|
icdDOList.add(ylzMedicalIcdDO);
|
|
|
} else if (json instanceof JSONArray) {
|
|
|
JSONArray icdArray = (JSONArray)json;
|
|
|
for (int k=0;k<icdArray.size();k++) {
|
|
|
net.sf.json.JSONObject icdObject = icdArray.getJSONObject(k);
|
|
|
ylzMedicalRelationDO = ylzMedicailRelationDao.save(ylzMedicalRelationDO);
|
|
|
if (resultJSON.get("zdlists")!=null){
|
|
|
Object json = new JSONTokener(resultJSON.getString("zdlists")).nextValue();
|
|
|
if(json instanceof net.sf.json.JSONObject){
|
|
|
net.sf.json.JSONObject icdJSON = (net.sf.json.JSONObject)json;
|
|
|
net.sf.json.JSONObject icdJson = icdJSON.getJSONObject("zdlist");
|
|
|
YlzMedicalIcdDO ylzMedicalIcdDO = new YlzMedicalIcdDO();
|
|
|
ylzMedicalIcdDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalIcdDO.setDel(1);
|
|
|
ylzMedicalIcdDO.setCreateTime(new Date());
|
|
|
ylzMedicalIcdDO.setDiseaseType(icdObject.getString("zdlx"));
|
|
|
ylzMedicalIcdDO.setDiseaseCodeIcd10(icdObject.getString("zdbm"));
|
|
|
ylzMedicalIcdDO.setDiseaseNameIcd10(icdObject.getString("zdmc"));
|
|
|
ylzMedicalIcdDO.setDiseaseOrder(icdObject.getString("zdxh"));
|
|
|
ylzMedicalIcdDO.setDiseaseType(icdJson.getString("zdlx"));
|
|
|
ylzMedicalIcdDO.setDiseaseCodeIcd10(icdJson.getString("zdbm"));
|
|
|
ylzMedicalIcdDO.setDiseaseNameIcd10(icdJson.getString("zdmc"));
|
|
|
ylzMedicalIcdDO.setDiseaseOrder(icdJson.getString("zdxh"));
|
|
|
ylzMedicalIcdDO = ylzMedicailIcdDao.save(ylzMedicalIcdDO);
|
|
|
icdDOList.add(ylzMedicalIcdDO);
|
|
|
} else if (json instanceof JSONArray) {
|
|
|
JSONArray icdArray = (JSONArray)json;
|
|
|
for (int k=0;k<icdArray.size();k++) {
|
|
|
net.sf.json.JSONObject icdObject = icdArray.getJSONObject(k);
|
|
|
YlzMedicalIcdDO ylzMedicalIcdDO = new YlzMedicalIcdDO();
|
|
|
ylzMedicalIcdDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalIcdDO.setDel(1);
|
|
|
ylzMedicalIcdDO.setCreateTime(new Date());
|
|
|
ylzMedicalIcdDO.setDiseaseType(icdObject.getString("zdlx"));
|
|
|
ylzMedicalIcdDO.setDiseaseCodeIcd10(icdObject.getString("zdbm"));
|
|
|
ylzMedicalIcdDO.setDiseaseNameIcd10(icdObject.getString("zdmc"));
|
|
|
ylzMedicalIcdDO.setDiseaseOrder(icdObject.getString("zdxh"));
|
|
|
ylzMedicalIcdDO = ylzMedicailIcdDao.save(ylzMedicalIcdDO);
|
|
|
icdDOList.add(ylzMedicalIcdDO);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
Object json = new JSONTokener(resultJSON.getString("mxlists")).nextValue();
|
|
|
if(json instanceof net.sf.json.JSONObject){
|
|
|
net.sf.json.JSONObject mxListJSON = (net.sf.json.JSONObject)json;
|
|
|
net.sf.json.JSONObject mxObject = mxListJSON.getJSONObject("mxlist");
|
|
|
YlzMedicalMxDO ylzMedicalMxDO = new YlzMedicalMxDO();
|
|
|
ylzMedicalMxDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalMxDO.setDel(1);
|
|
|
ylzMedicalMxDO.setPrescriptionCode(resultJSON.getString("xtgzh0"));
|
|
|
ylzMedicalMxDO.setHisDetailSn(outpatientDO.getRegisterNo());
|
|
|
ylzMedicalMxDO.setItemCode(mxObject.getString("xmbh00"));
|
|
|
ylzMedicalMxDO.setItemName(mxObject.getString("xmmc00"));
|
|
|
ylzMedicalMxDO.setInvoiceType("01");
|
|
|
ylzMedicalMxDO.setSpecificationType(mxObject.getString("xmgg00"));
|
|
|
ylzMedicalMxDO.setDosageForm(mxObject.getString("jx0000"));
|
|
|
ylzMedicalMxDO.setChargeUnit(mxObject.getString("xmdw00"));
|
|
|
ylzMedicalMxDO.setPrice(mxObject.getString("xmdj00"));
|
|
|
ylzMedicalMxDO.setAmount(mxObject.getString("xmsl00"));
|
|
|
ylzMedicalMxDO.setTotalMoney(mxObject.getString("xmje00"));
|
|
|
ylzMedicalMxDO.setSingleDose(mxObject.getString("ypyl00"));
|
|
|
ylzMedicalMxDO.setUseFrequency(mxObject.getString("yppl00"));
|
|
|
ylzMedicalMxDO.setMedicalWay(mxObject.getString("gytj00"));
|
|
|
ylzMedicalMxDO.setPrescriptionDate(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setMedicationDays(mxObject.getString("ylts00"));
|
|
|
ylzMedicalMxDO.setDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalMxDO.setDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalMxDO.setHisDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalMxDO.setHisDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalMxDO.setMedicalPerName(resultJSON.getString("ysxm00"));
|
|
|
ylzMedicalMxDO.setMedicalPerId(baseDoctorDO.getAtddrNo());
|
|
|
ylzMedicalMxDO.setLimitType(mxObject.getString("sfybxm"));
|
|
|
ylzMedicalMxDO.setActgDate(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setHisItemName(mxObject.getString("xmmc00"));
|
|
|
ylzMedicalMxDO.setHisItemCode(mxObject.getString("xmbh00"));
|
|
|
ylzMedicalMxDO.setClerkDays(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setPeopleType(null);
|
|
|
ylzMedicalMxDO = ylzMedicailMxDao.save(ylzMedicalMxDO);
|
|
|
mxDOList.add(ylzMedicalMxDO);
|
|
|
|
|
|
}else if (json instanceof JSONArray){
|
|
|
JSONArray mxArray = (JSONArray)json;
|
|
|
for (int k=0;k<mxArray.size();k++){
|
|
|
net.sf.json.JSONObject mxObject = mxArray.getJSONObject(k);
|
|
|
Object json = new JSONTokener(resultJSON.getString("mxlists")).nextValue();
|
|
|
if(json instanceof net.sf.json.JSONObject){
|
|
|
net.sf.json.JSONObject mxListJSON = (net.sf.json.JSONObject)json;
|
|
|
net.sf.json.JSONObject mxObject = mxListJSON.getJSONObject("mxlist");
|
|
|
YlzMedicalMxDO ylzMedicalMxDO = new YlzMedicalMxDO();
|
|
|
ylzMedicalMxDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalMxDO.setDel(1);
|
|
@ -3802,106 +3764,743 @@ public class EntranceService {
|
|
|
ylzMedicalMxDO.setPeopleType(null);
|
|
|
ylzMedicalMxDO = ylzMedicailMxDao.save(ylzMedicalMxDO);
|
|
|
mxDOList.add(ylzMedicalMxDO);
|
|
|
|
|
|
}else if (json instanceof JSONArray){
|
|
|
JSONArray mxArray = (JSONArray)json;
|
|
|
for (int k=0;k<mxArray.size();k++){
|
|
|
net.sf.json.JSONObject mxObject = mxArray.getJSONObject(k);
|
|
|
YlzMedicalMxDO ylzMedicalMxDO = new YlzMedicalMxDO();
|
|
|
ylzMedicalMxDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalMxDO.setDel(1);
|
|
|
ylzMedicalMxDO.setPrescriptionCode(resultJSON.getString("xtgzh0"));
|
|
|
ylzMedicalMxDO.setHisDetailSn(outpatientDO.getRegisterNo());
|
|
|
ylzMedicalMxDO.setItemCode(mxObject.getString("xmbh00"));
|
|
|
ylzMedicalMxDO.setItemName(mxObject.getString("xmmc00"));
|
|
|
ylzMedicalMxDO.setInvoiceType("01");
|
|
|
ylzMedicalMxDO.setSpecificationType(mxObject.getString("xmgg00"));
|
|
|
ylzMedicalMxDO.setDosageForm(mxObject.getString("jx0000"));
|
|
|
ylzMedicalMxDO.setChargeUnit(mxObject.getString("xmdw00"));
|
|
|
ylzMedicalMxDO.setPrice(mxObject.getString("xmdj00"));
|
|
|
ylzMedicalMxDO.setAmount(mxObject.getString("xmsl00"));
|
|
|
ylzMedicalMxDO.setTotalMoney(mxObject.getString("xmje00"));
|
|
|
ylzMedicalMxDO.setSingleDose(mxObject.getString("ypyl00"));
|
|
|
ylzMedicalMxDO.setUseFrequency(mxObject.getString("yppl00"));
|
|
|
ylzMedicalMxDO.setMedicalWay(mxObject.getString("gytj00"));
|
|
|
ylzMedicalMxDO.setPrescriptionDate(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setMedicationDays(mxObject.getString("ylts00"));
|
|
|
ylzMedicalMxDO.setDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalMxDO.setDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalMxDO.setHisDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalMxDO.setHisDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalMxDO.setMedicalPerName(resultJSON.getString("ysxm00"));
|
|
|
ylzMedicalMxDO.setMedicalPerId(baseDoctorDO.getAtddrNo());
|
|
|
ylzMedicalMxDO.setLimitType(mxObject.getString("sfybxm"));
|
|
|
ylzMedicalMxDO.setActgDate(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setHisItemName(mxObject.getString("xmmc00"));
|
|
|
ylzMedicalMxDO.setHisItemCode(mxObject.getString("xmbh00"));
|
|
|
ylzMedicalMxDO.setClerkDays(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setPeopleType(null);
|
|
|
ylzMedicalMxDO = ylzMedicailMxDao.save(ylzMedicalMxDO);
|
|
|
mxDOList.add(ylzMedicalMxDO);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}else {
|
|
|
ylzMedicalRelationDO.setOrgCode("3502000303");
|
|
|
ylzMedicalRelationDO.setRegionCode("350200");
|
|
|
ylzMedicalRelationDO.setDiseaseCode(diseaseCode);
|
|
|
ylzMedicalRelationDO.setIdcard(outpatientDO.getIdcard());
|
|
|
ylzMedicalRelationDO.setName(resultJSON.getString("xming0"));
|
|
|
ylzMedicalRelationDO.setCertType("01");
|
|
|
ylzMedicalRelationDO.setMedicalMode("10");
|
|
|
if (StringUtils.isNoneBlank(outpatientDO.getDiseaseCode())){
|
|
|
ylzMedicalRelationDO.setMedicalType("13");
|
|
|
}else {
|
|
|
ylzMedicalRelationDO.setMedicalType("11");
|
|
|
}
|
|
|
ylzMedicalRelationDO.setHisSerial(outpatientDO.getRegisterNo());
|
|
|
ylzMedicalRelationDO.setHisSettleNo(resultJSON.getString("xtgzh0"));
|
|
|
ylzMedicalRelationDO.setDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalRelationDO.setDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalRelationDO.setHisDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalRelationDO.setHisDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalRelationDO.setEmergencySign("0");
|
|
|
ylzMedicalRelationDO.setTraumaSign("0");
|
|
|
ylzMedicalRelationDO.setCardNo(cardno);
|
|
|
ylzMedicalRelationDO.setDate(outpatientDO.getRegisterDate());
|
|
|
ylzMedicalRelationDO.setItemCount(resultJSON.getString("cfxms0"));
|
|
|
ylzMedicalRelationDO.setTotalAmount(resultJSON.getString("bcfyze"));
|
|
|
ylzMedicalRelationDO.setPreCharges(resultJSON.getString("bcfyze"));
|
|
|
ylzMedicalRelationDO.setBcwkje(resultJSON.getString("bcwkje"));
|
|
|
ylzMedicalRelationDO.setDataSource("53");
|
|
|
ylzMedicalRelationDO.setPreCount(resultJSON.getString("cfxms0"));
|
|
|
ylzMedicalRelationDO.setBalance(cardFee+"");
|
|
|
ylzMedicalRelationDO.setMedicalPrice("0");
|
|
|
BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(outpatientDO.getDoctor());
|
|
|
if (baseDoctorDO!=null){
|
|
|
String jobTitle = baseDoctorDO.getJobTitleCode();
|
|
|
}
|
|
|
if (outpatientDO.getMedicalState()==null){
|
|
|
ylzMedicalRelationDO.setMedicalState(0);
|
|
|
ylzMedicalRelationDO.setPersonCash(resultJSON.getString("bcfyze"));
|
|
|
}else {
|
|
|
if (outpatientDO.getMedicalState().equalsIgnoreCase("0")){
|
|
|
ylzMedicalRelationDO.setOrgCode("3502000303");
|
|
|
ylzMedicalRelationDO.setRegionCode("350200");
|
|
|
ylzMedicalRelationDO.setDiseaseCode(diseaseCode);
|
|
|
ylzMedicalRelationDO.setIdcard(outpatientDO.getIdcard());
|
|
|
ylzMedicalRelationDO.setName(resultJSON.getString("xming0"));
|
|
|
ylzMedicalRelationDO.setCertType("01");
|
|
|
ylzMedicalRelationDO.setMedicalMode("10");
|
|
|
if (StringUtils.isNoneBlank(outpatientDO.getDiseaseCode())){
|
|
|
ylzMedicalRelationDO.setMedicalType("13");
|
|
|
}else {
|
|
|
ylzMedicalRelationDO.setMedicalType("11");
|
|
|
}
|
|
|
ylzMedicalRelationDO.setHisSerial(outpatientDO.getRegisterNo());
|
|
|
ylzMedicalRelationDO.setHisSettleNo(resultJSON.getString("xtgzh0"));
|
|
|
ylzMedicalRelationDO.setDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalRelationDO.setDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalRelationDO.setHisDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalRelationDO.setHisDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalRelationDO.setEmergencySign("0");
|
|
|
ylzMedicalRelationDO.setTraumaSign("0");
|
|
|
ylzMedicalRelationDO.setCardNo(cardno);
|
|
|
ylzMedicalRelationDO.setDate(outpatientDO.getRegisterDate());
|
|
|
ylzMedicalRelationDO.setItemCount(resultJSON.getString("cfxms0"));
|
|
|
ylzMedicalRelationDO.setTotalAmount(resultJSON.getString("bcfyze"));
|
|
|
ylzMedicalRelationDO.setPreCharges(resultJSON.getString("bcfyze"));
|
|
|
ylzMedicalRelationDO.setBcwkje(resultJSON.getString("bcwkje"));
|
|
|
ylzMedicalRelationDO.setDataSource("53");
|
|
|
ylzMedicalRelationDO.setPreCount(resultJSON.getString("cfxms0"));
|
|
|
ylzMedicalRelationDO.setBalance(cardFee+"");
|
|
|
ylzMedicalRelationDO.setMedicalPrice("0");
|
|
|
BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(outpatientDO.getDoctor());
|
|
|
if (baseDoctorDO!=null){
|
|
|
String jobTitle = baseDoctorDO.getJobTitleCode();
|
|
|
}
|
|
|
if (outpatientDO.getMedicalState()==null){
|
|
|
ylzMedicalRelationDO.setMedicalState(0);
|
|
|
ylzMedicalRelationDO.setPersonCash(resultJSON.getString("bcfyze"));
|
|
|
}else {
|
|
|
if (outpatientDO.getMedicalState().equalsIgnoreCase("0")){
|
|
|
ylzMedicalRelationDO.setPersonCash(resultJSON.getString("bcfyze"));
|
|
|
}
|
|
|
ylzMedicalRelationDO.setMedicalState(Integer.parseInt(outpatientDO.getMedicalState()));
|
|
|
}
|
|
|
ylzMedicalRelationDO.setMedicalState(Integer.parseInt(outpatientDO.getMedicalState()));
|
|
|
}
|
|
|
ylzMedicalRelationDO.setDoctorLevel("02");
|
|
|
ylzMedicalRelationDO.setDel(1);
|
|
|
ylzMedicalRelationDO.setRelationCode(outpatientDO.getId());
|
|
|
ylzMedicalRelationDO.setCreateTime(new Date());
|
|
|
ylzMedicalRelationDO.setStatus(0);
|
|
|
ylzMedicalRelationDO = ylzMedicailRelationDao.save(ylzMedicalRelationDO);
|
|
|
ylzMedicailIcdDao.deleteByMedicalId(ylzMedicalRelationDO.getId());
|
|
|
/*YlzMedicalIcdDO ylzMedicalIcdDO = new YlzMedicalIcdDO();
|
|
|
ylzMedicalIcdDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalIcdDO.setDel(1);
|
|
|
ylzMedicalIcdDO.setCreateTime(new Date());
|
|
|
ylzMedicalIcdDO.setDiseaseType("01");
|
|
|
ylzMedicalIcdDO.setDiseaseCodeIcd10(resultJSON.getString("bqzdbm"));
|
|
|
ylzMedicalIcdDO.setDiseaseNameIcd10(resultJSON.getString("bqzdms"));
|
|
|
ylzMedicalIcdDO.setDiseaseOrder("01");
|
|
|
ylzMedicalIcdDO = ylzMedicailIcdDao.save(ylzMedicalIcdDO);
|
|
|
icdDOList.add(ylzMedicalIcdDO);*/
|
|
|
if (resultJSON.get("zdlists")!=null){
|
|
|
Object json = new JSONTokener(resultJSON.getString("zdlists")).nextValue();
|
|
|
if(json instanceof net.sf.json.JSONObject){
|
|
|
net.sf.json.JSONObject icdJSON = (net.sf.json.JSONObject)json;
|
|
|
net.sf.json.JSONObject icdJson = icdJSON.getJSONObject("zdlist");
|
|
|
YlzMedicalIcdDO ylzMedicalIcdDO = new YlzMedicalIcdDO();
|
|
|
ylzMedicalIcdDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalIcdDO.setDel(1);
|
|
|
ylzMedicalIcdDO.setCreateTime(new Date());
|
|
|
ylzMedicalIcdDO.setDiseaseType(icdJson.getString("zdlx"));
|
|
|
ylzMedicalIcdDO.setDiseaseCodeIcd10(icdJson.getString("zdbm"));
|
|
|
ylzMedicalIcdDO.setDiseaseNameIcd10(icdJson.getString("zdmc"));
|
|
|
ylzMedicalIcdDO.setDiseaseOrder(icdJson.getString("zdxh"));
|
|
|
ylzMedicalIcdDO = ylzMedicailIcdDao.save(ylzMedicalIcdDO);
|
|
|
icdDOList.add(ylzMedicalIcdDO);
|
|
|
} else if (json instanceof JSONArray) {
|
|
|
JSONArray icdArray = (JSONArray)json;
|
|
|
for (int k=0;k<icdArray.size();k++) {
|
|
|
net.sf.json.JSONObject icdObject = icdArray.getJSONObject(k);
|
|
|
ylzMedicalRelationDO.setDoctorLevel("02");
|
|
|
ylzMedicalRelationDO.setDel(1);
|
|
|
ylzMedicalRelationDO.setRelationCode(outpatientDO.getId());
|
|
|
ylzMedicalRelationDO.setCreateTime(new Date());
|
|
|
ylzMedicalRelationDO.setStatus(0);
|
|
|
ylzMedicalRelationDO = ylzMedicailRelationDao.save(ylzMedicalRelationDO);
|
|
|
ylzMedicailIcdDao.deleteByMedicalId(ylzMedicalRelationDO.getId());
|
|
|
if (resultJSON.get("zdlists")!=null){
|
|
|
Object json = new JSONTokener(resultJSON.getString("zdlists")).nextValue();
|
|
|
if(json instanceof net.sf.json.JSONObject){
|
|
|
net.sf.json.JSONObject icdJSON = (net.sf.json.JSONObject)json;
|
|
|
net.sf.json.JSONObject icdJson = icdJSON.getJSONObject("zdlist");
|
|
|
YlzMedicalIcdDO ylzMedicalIcdDO = new YlzMedicalIcdDO();
|
|
|
ylzMedicalIcdDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalIcdDO.setDel(1);
|
|
|
ylzMedicalIcdDO.setCreateTime(new Date());
|
|
|
ylzMedicalIcdDO.setDiseaseType(icdObject.getString("zdlx"));
|
|
|
ylzMedicalIcdDO.setDiseaseCodeIcd10(icdObject.getString("zdbm"));
|
|
|
ylzMedicalIcdDO.setDiseaseNameIcd10(icdObject.getString("zdmc"));
|
|
|
ylzMedicalIcdDO.setDiseaseOrder(icdObject.getString("zdxh"));
|
|
|
ylzMedicalIcdDO.setDiseaseType(icdJson.getString("zdlx"));
|
|
|
ylzMedicalIcdDO.setDiseaseCodeIcd10(icdJson.getString("zdbm"));
|
|
|
ylzMedicalIcdDO.setDiseaseNameIcd10(icdJson.getString("zdmc"));
|
|
|
ylzMedicalIcdDO.setDiseaseOrder(icdJson.getString("zdxh"));
|
|
|
ylzMedicalIcdDO = ylzMedicailIcdDao.save(ylzMedicalIcdDO);
|
|
|
icdDOList.add(ylzMedicalIcdDO);
|
|
|
} else if (json instanceof JSONArray) {
|
|
|
JSONArray icdArray = (JSONArray)json;
|
|
|
for (int k=0;k<icdArray.size();k++) {
|
|
|
net.sf.json.JSONObject icdObject = icdArray.getJSONObject(k);
|
|
|
YlzMedicalIcdDO ylzMedicalIcdDO = new YlzMedicalIcdDO();
|
|
|
ylzMedicalIcdDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalIcdDO.setDel(1);
|
|
|
ylzMedicalIcdDO.setCreateTime(new Date());
|
|
|
ylzMedicalIcdDO.setDiseaseType(icdObject.getString("zdlx"));
|
|
|
ylzMedicalIcdDO.setDiseaseCodeIcd10(icdObject.getString("zdbm"));
|
|
|
ylzMedicalIcdDO.setDiseaseNameIcd10(icdObject.getString("zdmc"));
|
|
|
ylzMedicalIcdDO.setDiseaseOrder(icdObject.getString("zdxh"));
|
|
|
ylzMedicalIcdDO = ylzMedicailIcdDao.save(ylzMedicalIcdDO);
|
|
|
icdDOList.add(ylzMedicalIcdDO);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
ylzMedicailMxDao.deleteByMedicalId(ylzMedicalRelationDO.getId());
|
|
|
Object json = new JSONTokener(resultJSON.getString("mxlists")).nextValue();
|
|
|
if(json instanceof net.sf.json.JSONObject){
|
|
|
net.sf.json.JSONObject mxListJSON = (net.sf.json.JSONObject)json;
|
|
|
net.sf.json.JSONObject mxObject = mxListJSON.getJSONObject("mxlist");
|
|
|
YlzMedicalMxDO ylzMedicalMxDO = new YlzMedicalMxDO();
|
|
|
ylzMedicalMxDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalMxDO.setDel(1);
|
|
|
ylzMedicalMxDO.setPrescriptionCode(resultJSON.getString("xtgzh0"));
|
|
|
ylzMedicalMxDO.setHisDetailSn(outpatientDO.getRegisterNo());
|
|
|
ylzMedicalMxDO.setItemCode(mxObject.getString("xmbh00"));
|
|
|
ylzMedicalMxDO.setItemName(mxObject.getString("xmmc00"));
|
|
|
ylzMedicalMxDO.setInvoiceType("01");
|
|
|
ylzMedicalMxDO.setSpecificationType(mxObject.getString("xmgg00"));
|
|
|
ylzMedicalMxDO.setDosageForm(mxObject.getString("jx0000"));
|
|
|
ylzMedicalMxDO.setChargeUnit(mxObject.getString("xmdw00"));
|
|
|
ylzMedicalMxDO.setPrice(mxObject.getString("xmdj00"));
|
|
|
ylzMedicalMxDO.setAmount(mxObject.getString("xmsl00"));
|
|
|
ylzMedicalMxDO.setTotalMoney(mxObject.getString("xmje00"));
|
|
|
ylzMedicalMxDO.setSingleDose(mxObject.getString("ypyl00"));
|
|
|
ylzMedicalMxDO.setUseFrequency(mxObject.getString("yppl00"));
|
|
|
ylzMedicalMxDO.setMedicalWay(mxObject.getString("gytj00"));
|
|
|
ylzMedicalMxDO.setPrescriptionDate(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setMedicationDays(mxObject.getString("ylts00"));
|
|
|
ylzMedicalMxDO.setDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalMxDO.setDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalMxDO.setHisDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalMxDO.setHisDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalMxDO.setMedicalPerName(resultJSON.getString("ysxm00"));
|
|
|
ylzMedicalMxDO.setMedicalPerId(baseDoctorDO.getAtddrNo());
|
|
|
ylzMedicalMxDO.setLimitType(mxObject.getString("sfybxm"));
|
|
|
ylzMedicalMxDO.setActgDate(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setHisItemName(mxObject.getString("xmmc00"));
|
|
|
ylzMedicalMxDO.setHisItemCode(mxObject.getString("xmbh00"));
|
|
|
ylzMedicalMxDO.setClerkDays(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setPeopleType(null);
|
|
|
ylzMedicalMxDO = ylzMedicailMxDao.save(ylzMedicalMxDO);
|
|
|
mxDOList.add(ylzMedicalMxDO);
|
|
|
|
|
|
}else if (json instanceof JSONArray){
|
|
|
JSONArray mxArray = (JSONArray)json;
|
|
|
for (int k=0;k<mxArray.size();k++){
|
|
|
net.sf.json.JSONObject mxObject = mxArray.getJSONObject(k);
|
|
|
YlzMedicalMxDO ylzMedicalMxDO = new YlzMedicalMxDO();
|
|
|
ylzMedicalMxDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalMxDO.setDel(1);
|
|
|
ylzMedicalMxDO.setPrescriptionCode(resultJSON.getString("xtgzh0"));
|
|
|
ylzMedicalMxDO.setHisDetailSn(outpatientDO.getRegisterNo());
|
|
|
ylzMedicalMxDO.setItemCode(mxObject.getString("xmbh00"));
|
|
|
ylzMedicalMxDO.setItemName(mxObject.getString("xmmc00"));
|
|
|
ylzMedicalMxDO.setInvoiceType("01");
|
|
|
ylzMedicalMxDO.setSpecificationType(mxObject.getString("xmgg00"));
|
|
|
ylzMedicalMxDO.setDosageForm(mxObject.getString("jx0000"));
|
|
|
ylzMedicalMxDO.setChargeUnit(mxObject.getString("xmdw00"));
|
|
|
ylzMedicalMxDO.setPrice(mxObject.getString("xmdj00"));
|
|
|
ylzMedicalMxDO.setAmount(mxObject.getString("xmsl00"));
|
|
|
ylzMedicalMxDO.setTotalMoney(mxObject.getString("xmje00"));
|
|
|
ylzMedicalMxDO.setSingleDose(mxObject.getString("ypyl00"));
|
|
|
ylzMedicalMxDO.setUseFrequency(mxObject.getString("yppl00"));
|
|
|
ylzMedicalMxDO.setMedicalWay(mxObject.getString("gytj00"));
|
|
|
ylzMedicalMxDO.setPrescriptionDate(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setMedicationDays(mxObject.getString("ylts00"));
|
|
|
ylzMedicalMxDO.setDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalMxDO.setDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalMxDO.setHisDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalMxDO.setHisDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalMxDO.setMedicalPerName(resultJSON.getString("ysxm00"));
|
|
|
ylzMedicalMxDO.setMedicalPerId(baseDoctorDO.getAtddrNo());
|
|
|
if (mxObject.getString("xmbh00").equalsIgnoreCase("XA11GAW043A001010202251")){
|
|
|
ylzMedicalMxDO.setLimitType("N");
|
|
|
}else {
|
|
|
ylzMedicalMxDO.setLimitType(mxObject.getString("sfybxm"));
|
|
|
}
|
|
|
|
|
|
ylzMedicalMxDO.setActgDate(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setHisItemName(mxObject.getString("xmmc00"));
|
|
|
ylzMedicalMxDO.setHisItemCode(mxObject.getString("xmbh00"));
|
|
|
ylzMedicalMxDO.setClerkDays(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setPeopleType(null);
|
|
|
ylzMedicalMxDO = ylzMedicailMxDao.save(ylzMedicalMxDO);
|
|
|
mxDOList.add(ylzMedicalMxDO);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
ylzMedicailMxDao.deleteByMedicalId(ylzMedicalRelationDO.getId());
|
|
|
Object json = new JSONTokener(resultJSON.getString("mxlists")).nextValue();
|
|
|
ylzMedicalRelationDO.setYlzMedicalIcdDOList(icdDOList);
|
|
|
ylzMedicalRelationDO.setYlzMedicalMxDOList(mxDOList);
|
|
|
relationDOList.add(ylzMedicalRelationDO);
|
|
|
}
|
|
|
}
|
|
|
}else if (obj instanceof com.alibaba.fastjson.JSONArray){
|
|
|
JSONArray msgInfoJson = object.getJSONArray("msgInfo");
|
|
|
if (msgInfoJson!=null){
|
|
|
for (int i=0;i<msgInfoJson.size();i++){
|
|
|
net.sf.json.JSONObject resultJSON = msgInfoJson.getJSONObject(i);
|
|
|
if (resultJSON!=null){
|
|
|
YlzMedicalRelationDO ylzMedicalRelationDO = ylzMedicailRelationDao.findByLog_no(resultJSON.getString("xtgzh0"));
|
|
|
List<WlyyPrescriptionDO> prescriptionDOList = prescriptionDao.findByRealOrderAndStatusList(resultJSON.getString("xtgzh0"));
|
|
|
String diseaseCode = "";
|
|
|
if (prescriptionDOList!=null&&prescriptionDOList.size()!=0){
|
|
|
diseaseCode= prescriptionDOList.get(0).getDiseaseCode();
|
|
|
}
|
|
|
|
|
|
List<YlzMedicalIcdDO> icdDOList = new ArrayList<>();
|
|
|
List<YlzMedicalMxDO> mxDOList = new ArrayList<>();
|
|
|
if (ylzMedicalRelationDO==null){
|
|
|
ylzMedicalRelationDO = new YlzMedicalRelationDO();
|
|
|
ylzMedicalRelationDO.setLogNo(resultJSON.getString("xtgzh0"));
|
|
|
ylzMedicalRelationDO.setOrgCode("3502000303");
|
|
|
ylzMedicalRelationDO.setRegionCode("350200");
|
|
|
ylzMedicalRelationDO.setIdcard(outpatientDO.getIdcard());
|
|
|
ylzMedicalRelationDO.setName(resultJSON.getString("xming0"));
|
|
|
ylzMedicalRelationDO.setCertType("01");
|
|
|
ylzMedicalRelationDO.setMedicalMode("10");
|
|
|
if (StringUtils.isNoneBlank(outpatientDO.getDiseaseCode())){
|
|
|
ylzMedicalRelationDO.setMedicalType("13");
|
|
|
}else {
|
|
|
ylzMedicalRelationDO.setMedicalType("11");
|
|
|
}
|
|
|
ylzMedicalRelationDO.setCardNo(cardno);
|
|
|
ylzMedicalRelationDO.setHisSerial(outpatientDO.getRegisterNo());
|
|
|
ylzMedicalRelationDO.setHisSettleNo(resultJSON.getString("xtgzh0"));
|
|
|
ylzMedicalRelationDO.setDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalRelationDO.setDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalRelationDO.setHisDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalRelationDO.setHisDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalRelationDO.setEmergencySign("0");
|
|
|
ylzMedicalRelationDO.setTraumaSign("0");
|
|
|
ylzMedicalRelationDO.setDate(outpatientDO.getRegisterDate());
|
|
|
ylzMedicalRelationDO.setItemCount(resultJSON.getString("cfxms0"));
|
|
|
ylzMedicalRelationDO.setTotalAmount(resultJSON.getString("bcfyze"));
|
|
|
ylzMedicalRelationDO.setPreCharges(resultJSON.getString("bcfyze"));
|
|
|
ylzMedicalRelationDO.setBcwkje(resultJSON.getString("bcwkje"));
|
|
|
ylzMedicalRelationDO.setPersonAccount("0");
|
|
|
ylzMedicalRelationDO.setDataSource("53");
|
|
|
ylzMedicalRelationDO.setBalance(cardFee+"");
|
|
|
ylzMedicalRelationDO.setDiseaseCode(diseaseCode);
|
|
|
ylzMedicalRelationDO.setPreCount(resultJSON.getString("cfxms0"));
|
|
|
BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(outpatientDO.getDoctor());
|
|
|
if (baseDoctorDO!=null){
|
|
|
String jobTitle = baseDoctorDO.getJobTitleCode();
|
|
|
}
|
|
|
ylzMedicalRelationDO.setDoctorLevel("02");
|
|
|
ylzMedicalRelationDO.setDel(1);
|
|
|
ylzMedicalRelationDO.setStatus(0);
|
|
|
ylzMedicalRelationDO.setState(0);
|
|
|
ylzMedicalRelationDO.setRelationCode(outpatientDO.getId());
|
|
|
ylzMedicalRelationDO.setCreateTime(new Date());
|
|
|
ylzMedicalRelationDO.setMedicalPrice("0");
|
|
|
if (outpatientDO.getMedicalState()==null){
|
|
|
ylzMedicalRelationDO.setMedicalState(0);
|
|
|
ylzMedicalRelationDO.setPersonCash(resultJSON.getString("bcfyze"));
|
|
|
}else {
|
|
|
if (outpatientDO.getMedicalState().equalsIgnoreCase("0")){
|
|
|
ylzMedicalRelationDO.setPersonCash(resultJSON.getString("bcfyze"));
|
|
|
}
|
|
|
ylzMedicalRelationDO.setMedicalState(Integer.parseInt(outpatientDO.getMedicalState()));
|
|
|
}
|
|
|
ylzMedicalRelationDO = ylzMedicailRelationDao.save(ylzMedicalRelationDO);
|
|
|
if (resultJSON.get("zdlists")!=null){
|
|
|
Object json = new JSONTokener(resultJSON.getString("zdlists")).nextValue();
|
|
|
if(json instanceof net.sf.json.JSONObject){
|
|
|
net.sf.json.JSONObject icdJSON = (net.sf.json.JSONObject)json;
|
|
|
net.sf.json.JSONObject icdJson = icdJSON.getJSONObject("zdlist");
|
|
|
YlzMedicalIcdDO ylzMedicalIcdDO = new YlzMedicalIcdDO();
|
|
|
ylzMedicalIcdDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalIcdDO.setDel(1);
|
|
|
ylzMedicalIcdDO.setCreateTime(new Date());
|
|
|
ylzMedicalIcdDO.setDiseaseType(icdJson.getString("zdlx"));
|
|
|
ylzMedicalIcdDO.setDiseaseCodeIcd10(icdJson.getString("zdbm"));
|
|
|
ylzMedicalIcdDO.setDiseaseNameIcd10(icdJson.getString("zdmc"));
|
|
|
ylzMedicalIcdDO.setDiseaseOrder(icdJson.getString("zdxh"));
|
|
|
ylzMedicalIcdDO = ylzMedicailIcdDao.save(ylzMedicalIcdDO);
|
|
|
icdDOList.add(ylzMedicalIcdDO);
|
|
|
} else if (json instanceof JSONArray) {
|
|
|
JSONArray icdArray = (JSONArray)json;
|
|
|
for (int k=0;k<icdArray.size();k++) {
|
|
|
net.sf.json.JSONObject icdObject = icdArray.getJSONObject(k);
|
|
|
YlzMedicalIcdDO ylzMedicalIcdDO = new YlzMedicalIcdDO();
|
|
|
ylzMedicalIcdDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalIcdDO.setDel(1);
|
|
|
ylzMedicalIcdDO.setCreateTime(new Date());
|
|
|
ylzMedicalIcdDO.setDiseaseType(icdObject.getString("zdlx"));
|
|
|
ylzMedicalIcdDO.setDiseaseCodeIcd10(icdObject.getString("zdbm"));
|
|
|
ylzMedicalIcdDO.setDiseaseNameIcd10(icdObject.getString("zdmc"));
|
|
|
ylzMedicalIcdDO.setDiseaseOrder(icdObject.getString("zdxh"));
|
|
|
ylzMedicalIcdDO = ylzMedicailIcdDao.save(ylzMedicalIcdDO);
|
|
|
icdDOList.add(ylzMedicalIcdDO);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
Object json = new JSONTokener(resultJSON.getString("mxlists")).nextValue();
|
|
|
if(json instanceof net.sf.json.JSONObject){
|
|
|
net.sf.json.JSONObject mxListJSON = (net.sf.json.JSONObject)json;
|
|
|
net.sf.json.JSONObject mxObject = mxListJSON.getJSONObject("mxlist");
|
|
|
YlzMedicalMxDO ylzMedicalMxDO = new YlzMedicalMxDO();
|
|
|
ylzMedicalMxDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalMxDO.setDel(1);
|
|
|
ylzMedicalMxDO.setPrescriptionCode(resultJSON.getString("xtgzh0"));
|
|
|
ylzMedicalMxDO.setHisDetailSn(outpatientDO.getRegisterNo());
|
|
|
ylzMedicalMxDO.setItemCode(mxObject.getString("xmbh00"));
|
|
|
ylzMedicalMxDO.setItemName(mxObject.getString("xmmc00"));
|
|
|
ylzMedicalMxDO.setInvoiceType("01");
|
|
|
ylzMedicalMxDO.setSpecificationType(mxObject.getString("xmgg00"));
|
|
|
ylzMedicalMxDO.setDosageForm(mxObject.getString("jx0000"));
|
|
|
ylzMedicalMxDO.setChargeUnit(mxObject.getString("xmdw00"));
|
|
|
ylzMedicalMxDO.setPrice(mxObject.getString("xmdj00"));
|
|
|
ylzMedicalMxDO.setAmount(mxObject.getString("xmsl00"));
|
|
|
ylzMedicalMxDO.setTotalMoney(mxObject.getString("xmje00"));
|
|
|
ylzMedicalMxDO.setSingleDose(mxObject.getString("ypyl00"));
|
|
|
ylzMedicalMxDO.setUseFrequency(mxObject.getString("yppl00"));
|
|
|
ylzMedicalMxDO.setMedicalWay(mxObject.getString("gytj00"));
|
|
|
ylzMedicalMxDO.setPrescriptionDate(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setMedicationDays(mxObject.getString("ylts00"));
|
|
|
ylzMedicalMxDO.setDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalMxDO.setDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalMxDO.setHisDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalMxDO.setHisDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalMxDO.setMedicalPerName(resultJSON.getString("ysxm00"));
|
|
|
ylzMedicalMxDO.setMedicalPerId(baseDoctorDO.getAtddrNo());
|
|
|
ylzMedicalMxDO.setLimitType(mxObject.getString("sfybxm"));
|
|
|
ylzMedicalMxDO.setActgDate(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setHisItemName(mxObject.getString("xmmc00"));
|
|
|
ylzMedicalMxDO.setHisItemCode(mxObject.getString("xmbh00"));
|
|
|
ylzMedicalMxDO.setClerkDays(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setPeopleType(null);
|
|
|
ylzMedicalMxDO = ylzMedicailMxDao.save(ylzMedicalMxDO);
|
|
|
mxDOList.add(ylzMedicalMxDO);
|
|
|
|
|
|
}else if (json instanceof JSONArray){
|
|
|
JSONArray mxArray = (JSONArray)json;
|
|
|
for (int k=0;k<mxArray.size();k++){
|
|
|
net.sf.json.JSONObject mxObject = mxArray.getJSONObject(k);
|
|
|
YlzMedicalMxDO ylzMedicalMxDO = new YlzMedicalMxDO();
|
|
|
ylzMedicalMxDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalMxDO.setDel(1);
|
|
|
ylzMedicalMxDO.setPrescriptionCode(resultJSON.getString("xtgzh0"));
|
|
|
ylzMedicalMxDO.setHisDetailSn(outpatientDO.getRegisterNo());
|
|
|
ylzMedicalMxDO.setItemCode(mxObject.getString("xmbh00"));
|
|
|
ylzMedicalMxDO.setItemName(mxObject.getString("xmmc00"));
|
|
|
ylzMedicalMxDO.setInvoiceType("01");
|
|
|
ylzMedicalMxDO.setSpecificationType(mxObject.getString("xmgg00"));
|
|
|
ylzMedicalMxDO.setDosageForm(mxObject.getString("jx0000"));
|
|
|
ylzMedicalMxDO.setChargeUnit(mxObject.getString("xmdw00"));
|
|
|
ylzMedicalMxDO.setPrice(mxObject.getString("xmdj00"));
|
|
|
ylzMedicalMxDO.setAmount(mxObject.getString("xmsl00"));
|
|
|
ylzMedicalMxDO.setTotalMoney(mxObject.getString("xmje00"));
|
|
|
ylzMedicalMxDO.setSingleDose(mxObject.getString("ypyl00"));
|
|
|
ylzMedicalMxDO.setUseFrequency(mxObject.getString("yppl00"));
|
|
|
ylzMedicalMxDO.setMedicalWay(mxObject.getString("gytj00"));
|
|
|
ylzMedicalMxDO.setPrescriptionDate(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setMedicationDays(mxObject.getString("ylts00"));
|
|
|
ylzMedicalMxDO.setDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalMxDO.setDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalMxDO.setHisDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalMxDO.setHisDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalMxDO.setMedicalPerName(resultJSON.getString("ysxm00"));
|
|
|
ylzMedicalMxDO.setMedicalPerId(baseDoctorDO.getAtddrNo());
|
|
|
ylzMedicalMxDO.setLimitType(mxObject.getString("sfybxm"));
|
|
|
ylzMedicalMxDO.setActgDate(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setHisItemName(mxObject.getString("xmmc00"));
|
|
|
ylzMedicalMxDO.setHisItemCode(mxObject.getString("xmbh00"));
|
|
|
ylzMedicalMxDO.setClerkDays(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setPeopleType(null);
|
|
|
ylzMedicalMxDO = ylzMedicailMxDao.save(ylzMedicalMxDO);
|
|
|
mxDOList.add(ylzMedicalMxDO);
|
|
|
}
|
|
|
}
|
|
|
}else {
|
|
|
ylzMedicalRelationDO.setOrgCode("3502000303");
|
|
|
ylzMedicalRelationDO.setRegionCode("350200");
|
|
|
ylzMedicalRelationDO.setDiseaseCode(diseaseCode);
|
|
|
ylzMedicalRelationDO.setIdcard(outpatientDO.getIdcard());
|
|
|
ylzMedicalRelationDO.setName(resultJSON.getString("xming0"));
|
|
|
ylzMedicalRelationDO.setCertType("01");
|
|
|
ylzMedicalRelationDO.setMedicalMode("10");
|
|
|
if (StringUtils.isNoneBlank(outpatientDO.getDiseaseCode())){
|
|
|
ylzMedicalRelationDO.setMedicalType("13");
|
|
|
}else {
|
|
|
ylzMedicalRelationDO.setMedicalType("11");
|
|
|
}
|
|
|
ylzMedicalRelationDO.setHisSerial(outpatientDO.getRegisterNo());
|
|
|
ylzMedicalRelationDO.setHisSettleNo(resultJSON.getString("xtgzh0"));
|
|
|
ylzMedicalRelationDO.setDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalRelationDO.setDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalRelationDO.setHisDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalRelationDO.setHisDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalRelationDO.setEmergencySign("0");
|
|
|
ylzMedicalRelationDO.setTraumaSign("0");
|
|
|
ylzMedicalRelationDO.setCardNo(cardno);
|
|
|
ylzMedicalRelationDO.setDate(outpatientDO.getRegisterDate());
|
|
|
ylzMedicalRelationDO.setItemCount(resultJSON.getString("cfxms0"));
|
|
|
ylzMedicalRelationDO.setTotalAmount(resultJSON.getString("bcfyze"));
|
|
|
ylzMedicalRelationDO.setPreCharges(resultJSON.getString("bcfyze"));
|
|
|
ylzMedicalRelationDO.setBcwkje(resultJSON.getString("bcwkje"));
|
|
|
ylzMedicalRelationDO.setDataSource("53");
|
|
|
ylzMedicalRelationDO.setPreCount(resultJSON.getString("cfxms0"));
|
|
|
ylzMedicalRelationDO.setBalance(cardFee+"");
|
|
|
ylzMedicalRelationDO.setMedicalPrice("0");
|
|
|
BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(outpatientDO.getDoctor());
|
|
|
if (baseDoctorDO!=null){
|
|
|
String jobTitle = baseDoctorDO.getJobTitleCode();
|
|
|
}
|
|
|
if (outpatientDO.getMedicalState()==null){
|
|
|
ylzMedicalRelationDO.setMedicalState(0);
|
|
|
ylzMedicalRelationDO.setPersonCash(resultJSON.getString("bcfyze"));
|
|
|
}else {
|
|
|
if (outpatientDO.getMedicalState().equalsIgnoreCase("0")){
|
|
|
ylzMedicalRelationDO.setPersonCash(resultJSON.getString("bcfyze"));
|
|
|
}
|
|
|
ylzMedicalRelationDO.setMedicalState(Integer.parseInt(outpatientDO.getMedicalState()));
|
|
|
}
|
|
|
ylzMedicalRelationDO.setDoctorLevel("02");
|
|
|
ylzMedicalRelationDO.setDel(1);
|
|
|
ylzMedicalRelationDO.setRelationCode(outpatientDO.getId());
|
|
|
ylzMedicalRelationDO.setCreateTime(new Date());
|
|
|
ylzMedicalRelationDO.setStatus(0);
|
|
|
ylzMedicalRelationDO = ylzMedicailRelationDao.save(ylzMedicalRelationDO);
|
|
|
ylzMedicailIcdDao.deleteByMedicalId(ylzMedicalRelationDO.getId());
|
|
|
if (resultJSON.get("zdlists")!=null){
|
|
|
Object json = new JSONTokener(resultJSON.getString("zdlists")).nextValue();
|
|
|
if(json instanceof net.sf.json.JSONObject){
|
|
|
net.sf.json.JSONObject icdJSON = (net.sf.json.JSONObject)json;
|
|
|
net.sf.json.JSONObject icdJson = icdJSON.getJSONObject("zdlist");
|
|
|
YlzMedicalIcdDO ylzMedicalIcdDO = new YlzMedicalIcdDO();
|
|
|
ylzMedicalIcdDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalIcdDO.setDel(1);
|
|
|
ylzMedicalIcdDO.setCreateTime(new Date());
|
|
|
ylzMedicalIcdDO.setDiseaseType(icdJson.getString("zdlx"));
|
|
|
ylzMedicalIcdDO.setDiseaseCodeIcd10(icdJson.getString("zdbm"));
|
|
|
ylzMedicalIcdDO.setDiseaseNameIcd10(icdJson.getString("zdmc"));
|
|
|
ylzMedicalIcdDO.setDiseaseOrder(icdJson.getString("zdxh"));
|
|
|
ylzMedicalIcdDO = ylzMedicailIcdDao.save(ylzMedicalIcdDO);
|
|
|
icdDOList.add(ylzMedicalIcdDO);
|
|
|
} else if (json instanceof JSONArray) {
|
|
|
JSONArray icdArray = (JSONArray)json;
|
|
|
for (int k=0;k<icdArray.size();k++) {
|
|
|
net.sf.json.JSONObject icdObject = icdArray.getJSONObject(k);
|
|
|
YlzMedicalIcdDO ylzMedicalIcdDO = new YlzMedicalIcdDO();
|
|
|
ylzMedicalIcdDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalIcdDO.setDel(1);
|
|
|
ylzMedicalIcdDO.setCreateTime(new Date());
|
|
|
ylzMedicalIcdDO.setDiseaseType(icdObject.getString("zdlx"));
|
|
|
ylzMedicalIcdDO.setDiseaseCodeIcd10(icdObject.getString("zdbm"));
|
|
|
ylzMedicalIcdDO.setDiseaseNameIcd10(icdObject.getString("zdmc"));
|
|
|
ylzMedicalIcdDO.setDiseaseOrder(icdObject.getString("zdxh"));
|
|
|
ylzMedicalIcdDO = ylzMedicailIcdDao.save(ylzMedicalIcdDO);
|
|
|
icdDOList.add(ylzMedicalIcdDO);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
ylzMedicailMxDao.deleteByMedicalId(ylzMedicalRelationDO.getId());
|
|
|
Object json = new JSONTokener(resultJSON.getString("mxlists")).nextValue();
|
|
|
if(json instanceof net.sf.json.JSONObject){
|
|
|
net.sf.json.JSONObject mxListJSON = (net.sf.json.JSONObject)json;
|
|
|
net.sf.json.JSONObject mxObject = mxListJSON.getJSONObject("mxlist");
|
|
|
YlzMedicalMxDO ylzMedicalMxDO = new YlzMedicalMxDO();
|
|
|
ylzMedicalMxDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalMxDO.setDel(1);
|
|
|
ylzMedicalMxDO.setPrescriptionCode(resultJSON.getString("xtgzh0"));
|
|
|
ylzMedicalMxDO.setHisDetailSn(outpatientDO.getRegisterNo());
|
|
|
ylzMedicalMxDO.setItemCode(mxObject.getString("xmbh00"));
|
|
|
ylzMedicalMxDO.setItemName(mxObject.getString("xmmc00"));
|
|
|
ylzMedicalMxDO.setInvoiceType("01");
|
|
|
ylzMedicalMxDO.setSpecificationType(mxObject.getString("xmgg00"));
|
|
|
ylzMedicalMxDO.setDosageForm(mxObject.getString("jx0000"));
|
|
|
ylzMedicalMxDO.setChargeUnit(mxObject.getString("xmdw00"));
|
|
|
ylzMedicalMxDO.setPrice(mxObject.getString("xmdj00"));
|
|
|
ylzMedicalMxDO.setAmount(mxObject.getString("xmsl00"));
|
|
|
ylzMedicalMxDO.setTotalMoney(mxObject.getString("xmje00"));
|
|
|
ylzMedicalMxDO.setSingleDose(mxObject.getString("ypyl00"));
|
|
|
ylzMedicalMxDO.setUseFrequency(mxObject.getString("yppl00"));
|
|
|
ylzMedicalMxDO.setMedicalWay(mxObject.getString("gytj00"));
|
|
|
ylzMedicalMxDO.setPrescriptionDate(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setMedicationDays(mxObject.getString("ylts00"));
|
|
|
ylzMedicalMxDO.setDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalMxDO.setDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalMxDO.setHisDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalMxDO.setHisDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalMxDO.setMedicalPerName(resultJSON.getString("ysxm00"));
|
|
|
ylzMedicalMxDO.setMedicalPerId(baseDoctorDO.getAtddrNo());
|
|
|
ylzMedicalMxDO.setLimitType(mxObject.getString("sfybxm"));
|
|
|
ylzMedicalMxDO.setActgDate(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setHisItemName(mxObject.getString("xmmc00"));
|
|
|
ylzMedicalMxDO.setHisItemCode(mxObject.getString("xmbh00"));
|
|
|
ylzMedicalMxDO.setClerkDays(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setPeopleType(null);
|
|
|
ylzMedicalMxDO = ylzMedicailMxDao.save(ylzMedicalMxDO);
|
|
|
mxDOList.add(ylzMedicalMxDO);
|
|
|
|
|
|
}else if (json instanceof JSONArray){
|
|
|
JSONArray mxArray = (JSONArray)json;
|
|
|
for (int k=0;k<mxArray.size();k++){
|
|
|
net.sf.json.JSONObject mxObject = mxArray.getJSONObject(k);
|
|
|
YlzMedicalMxDO ylzMedicalMxDO = new YlzMedicalMxDO();
|
|
|
ylzMedicalMxDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalMxDO.setDel(1);
|
|
|
ylzMedicalMxDO.setPrescriptionCode(resultJSON.getString("xtgzh0"));
|
|
|
ylzMedicalMxDO.setHisDetailSn(outpatientDO.getRegisterNo());
|
|
|
ylzMedicalMxDO.setItemCode(mxObject.getString("xmbh00"));
|
|
|
ylzMedicalMxDO.setItemName(mxObject.getString("xmmc00"));
|
|
|
ylzMedicalMxDO.setInvoiceType("01");
|
|
|
ylzMedicalMxDO.setSpecificationType(mxObject.getString("xmgg00"));
|
|
|
ylzMedicalMxDO.setDosageForm(mxObject.getString("jx0000"));
|
|
|
ylzMedicalMxDO.setChargeUnit(mxObject.getString("xmdw00"));
|
|
|
ylzMedicalMxDO.setPrice(mxObject.getString("xmdj00"));
|
|
|
ylzMedicalMxDO.setAmount(mxObject.getString("xmsl00"));
|
|
|
ylzMedicalMxDO.setTotalMoney(mxObject.getString("xmje00"));
|
|
|
ylzMedicalMxDO.setSingleDose(mxObject.getString("ypyl00"));
|
|
|
ylzMedicalMxDO.setUseFrequency(mxObject.getString("yppl00"));
|
|
|
ylzMedicalMxDO.setMedicalWay(mxObject.getString("gytj00"));
|
|
|
ylzMedicalMxDO.setPrescriptionDate(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setMedicationDays(mxObject.getString("ylts00"));
|
|
|
ylzMedicalMxDO.setDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalMxDO.setDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalMxDO.setHisDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalMxDO.setHisDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalMxDO.setMedicalPerName(resultJSON.getString("ysxm00"));
|
|
|
ylzMedicalMxDO.setMedicalPerId(baseDoctorDO.getAtddrNo());
|
|
|
if (mxObject.getString("xmbh00").equalsIgnoreCase("XA11GAW043A001010202251")){
|
|
|
ylzMedicalMxDO.setLimitType("N");
|
|
|
}else {
|
|
|
ylzMedicalMxDO.setLimitType(mxObject.getString("sfybxm"));
|
|
|
}
|
|
|
|
|
|
ylzMedicalMxDO.setActgDate(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setHisItemName(mxObject.getString("xmmc00"));
|
|
|
ylzMedicalMxDO.setHisItemCode(mxObject.getString("xmbh00"));
|
|
|
ylzMedicalMxDO.setClerkDays(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setPeopleType(null);
|
|
|
ylzMedicalMxDO = ylzMedicailMxDao.save(ylzMedicalMxDO);
|
|
|
mxDOList.add(ylzMedicalMxDO);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
ylzMedicalRelationDO.setYlzMedicalIcdDOList(icdDOList);
|
|
|
ylzMedicalRelationDO.setYlzMedicalMxDOList(mxDOList);
|
|
|
relationDOList.add(ylzMedicalRelationDO);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return relationDOList;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public YlzMedicalRelationDO getSettleInfo(String cardno,String idcard,String outpatientId,String realOrder) throws Exception {
|
|
|
WlyyOutpatientDO outpatientDO = outpatientDao.findById(outpatientId);
|
|
|
net.sf.json.JSONObject object1 = qutpatientBalance(outpatientDO.getCardNo(), false);
|
|
|
Double cardFee = object1.getDouble("ZHYE");
|
|
|
/* Double cardFee = 0.0;*/
|
|
|
net.sf.json.JSONArray result = BS10108(cardno,idcard,"1",null,null,null,outpatientDO.getRegisterNo(),false);
|
|
|
if (result!=null&&result.size()!=0){
|
|
|
net.sf.json.JSONObject object = result.getJSONObject(0);
|
|
|
net.sf.json.JSONObject jsonObject = object.getJSONObject("retInfo");
|
|
|
if (jsonObject.getString("retCode").equalsIgnoreCase("00")){
|
|
|
Object obj = com.alibaba.fastjson.JSON.parse(object.getString("msgInfo"));
|
|
|
net.sf.json.JSONObject msgInfoJson = new net.sf.json.JSONObject();
|
|
|
net.sf.json.JSONObject resultJSON = new net.sf.json.JSONObject();
|
|
|
if (obj instanceof JSONObject){
|
|
|
msgInfoJson = object.getJSONObject("msgInfo");
|
|
|
resultJSON = msgInfoJson.getJSONObject("receipt");
|
|
|
}else if (obj instanceof com.alibaba.fastjson.JSONArray){
|
|
|
JSONArray array = object.getJSONArray("msgInfo");
|
|
|
for (int i=0;i<array.size();i++){
|
|
|
net.sf.json.JSONObject msgObj = array.getJSONObject(i);
|
|
|
if (msgObj.getString("xtgzh0").equalsIgnoreCase(realOrder)){
|
|
|
resultJSON = msgObj;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
System.out.println("1111111111111111111111"+resultJSON);
|
|
|
if (resultJSON!=null){
|
|
|
YlzMedicalRelationDO ylzMedicalRelationDO = ylzMedicailRelationDao.findByLog_no(resultJSON.getString("xtgzh0"));
|
|
|
List<WlyyPrescriptionDO> prescriptionDOList = prescriptionDao.findByRealOrderAndStatusList(resultJSON.getString("xtgzh0"));
|
|
|
String diseaseCode = "";
|
|
|
if (prescriptionDOList!=null&&prescriptionDOList.size()!=0){
|
|
|
diseaseCode= prescriptionDOList.get(0).getDiseaseCode();
|
|
|
}
|
|
|
List<YlzMedicalIcdDO> icdDOList = new ArrayList<>();
|
|
|
List<YlzMedicalMxDO> mxDOList = new ArrayList<>();
|
|
|
if (ylzMedicalRelationDO==null){
|
|
|
ylzMedicalRelationDO = new YlzMedicalRelationDO();
|
|
|
ylzMedicalRelationDO.setLogNo(resultJSON.getString("xtgzh0"));
|
|
|
ylzMedicalRelationDO.setOrgCode("3502000303");
|
|
|
ylzMedicalRelationDO.setRegionCode("350200");
|
|
|
ylzMedicalRelationDO.setIdcard(outpatientDO.getIdcard());
|
|
|
ylzMedicalRelationDO.setName(resultJSON.getString("xming0"));
|
|
|
ylzMedicalRelationDO.setCertType("01");
|
|
|
ylzMedicalRelationDO.setMedicalMode("10");
|
|
|
if (StringUtils.isNoneBlank(outpatientDO.getDiseaseCode())){
|
|
|
ylzMedicalRelationDO.setMedicalType("13");
|
|
|
}else {
|
|
|
ylzMedicalRelationDO.setMedicalType("11");
|
|
|
}
|
|
|
ylzMedicalRelationDO.setCardNo(cardno);
|
|
|
ylzMedicalRelationDO.setHisSerial(outpatientDO.getRegisterNo());
|
|
|
ylzMedicalRelationDO.setHisSettleNo(resultJSON.getString("xtgzh0"));
|
|
|
ylzMedicalRelationDO.setDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalRelationDO.setDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalRelationDO.setHisDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalRelationDO.setHisDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalRelationDO.setEmergencySign("0");
|
|
|
ylzMedicalRelationDO.setTraumaSign("0");
|
|
|
ylzMedicalRelationDO.setDate(outpatientDO.getRegisterDate());
|
|
|
ylzMedicalRelationDO.setItemCount(resultJSON.getString("cfxms0"));
|
|
|
ylzMedicalRelationDO.setTotalAmount(resultJSON.getString("bcfyze"));
|
|
|
ylzMedicalRelationDO.setPreCharges(resultJSON.getString("bcfyze"));
|
|
|
ylzMedicalRelationDO.setBcwkje(resultJSON.getString("bcwkje"));
|
|
|
ylzMedicalRelationDO.setPersonAccount("0");
|
|
|
ylzMedicalRelationDO.setDataSource("53");
|
|
|
ylzMedicalRelationDO.setBalance(cardFee+"");
|
|
|
ylzMedicalRelationDO.setDiseaseCode(diseaseCode);
|
|
|
ylzMedicalRelationDO.setPreCount(resultJSON.getString("cfxms0"));
|
|
|
BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(outpatientDO.getDoctor());
|
|
|
if (baseDoctorDO!=null){
|
|
|
String jobTitle = baseDoctorDO.getJobTitleCode();
|
|
|
}
|
|
|
ylzMedicalRelationDO.setDoctorLevel("02");
|
|
|
ylzMedicalRelationDO.setDel(1);
|
|
|
ylzMedicalRelationDO.setStatus(0);
|
|
|
ylzMedicalRelationDO.setState(0);
|
|
|
ylzMedicalRelationDO.setRelationCode(outpatientDO.getId());
|
|
|
ylzMedicalRelationDO.setCreateTime(new Date());
|
|
|
ylzMedicalRelationDO.setMedicalPrice("0");
|
|
|
if (outpatientDO.getMedicalState()==null){
|
|
|
ylzMedicalRelationDO.setMedicalState(0);
|
|
|
ylzMedicalRelationDO.setPersonCash(resultJSON.getString("bcfyze"));
|
|
|
}else {
|
|
|
if (outpatientDO.getMedicalState().equalsIgnoreCase("0")){
|
|
|
ylzMedicalRelationDO.setPersonCash(resultJSON.getString("bcfyze"));
|
|
|
}
|
|
|
ylzMedicalRelationDO.setMedicalState(Integer.parseInt(outpatientDO.getMedicalState()));
|
|
|
}
|
|
|
ylzMedicalRelationDO = ylzMedicailRelationDao.save(ylzMedicalRelationDO);
|
|
|
if (resultJSON.get("zdlists")!=null){
|
|
|
Object json = new JSONTokener(resultJSON.getString("zdlists")).nextValue();
|
|
|
if(json instanceof net.sf.json.JSONObject){
|
|
|
net.sf.json.JSONObject mxListJSON = (net.sf.json.JSONObject)json;
|
|
|
net.sf.json.JSONObject mxObject = mxListJSON.getJSONObject("mxlist");
|
|
|
net.sf.json.JSONObject icdJSON = (net.sf.json.JSONObject)json;
|
|
|
net.sf.json.JSONObject icdJson = icdJSON.getJSONObject("zdlist");
|
|
|
YlzMedicalIcdDO ylzMedicalIcdDO = new YlzMedicalIcdDO();
|
|
|
ylzMedicalIcdDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalIcdDO.setDel(1);
|
|
|
ylzMedicalIcdDO.setCreateTime(new Date());
|
|
|
ylzMedicalIcdDO.setDiseaseType(icdJson.getString("zdlx"));
|
|
|
ylzMedicalIcdDO.setDiseaseCodeIcd10(icdJson.getString("zdbm"));
|
|
|
ylzMedicalIcdDO.setDiseaseNameIcd10(icdJson.getString("zdmc"));
|
|
|
ylzMedicalIcdDO.setDiseaseOrder(icdJson.getString("zdxh"));
|
|
|
ylzMedicalIcdDO = ylzMedicailIcdDao.save(ylzMedicalIcdDO);
|
|
|
icdDOList.add(ylzMedicalIcdDO);
|
|
|
} else if (json instanceof JSONArray) {
|
|
|
JSONArray icdArray = (JSONArray)json;
|
|
|
for (int k=0;k<icdArray.size();k++) {
|
|
|
net.sf.json.JSONObject icdObject = icdArray.getJSONObject(k);
|
|
|
YlzMedicalIcdDO ylzMedicalIcdDO = new YlzMedicalIcdDO();
|
|
|
ylzMedicalIcdDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalIcdDO.setDel(1);
|
|
|
ylzMedicalIcdDO.setCreateTime(new Date());
|
|
|
ylzMedicalIcdDO.setDiseaseType(icdObject.getString("zdlx"));
|
|
|
ylzMedicalIcdDO.setDiseaseCodeIcd10(icdObject.getString("zdbm"));
|
|
|
ylzMedicalIcdDO.setDiseaseNameIcd10(icdObject.getString("zdmc"));
|
|
|
ylzMedicalIcdDO.setDiseaseOrder(icdObject.getString("zdxh"));
|
|
|
ylzMedicalIcdDO = ylzMedicailIcdDao.save(ylzMedicalIcdDO);
|
|
|
icdDOList.add(ylzMedicalIcdDO);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
Object json = new JSONTokener(resultJSON.getString("mxlists")).nextValue();
|
|
|
if(json instanceof net.sf.json.JSONObject){
|
|
|
net.sf.json.JSONObject mxListJSON = (net.sf.json.JSONObject)json;
|
|
|
net.sf.json.JSONObject mxObject = mxListJSON.getJSONObject("mxlist");
|
|
|
YlzMedicalMxDO ylzMedicalMxDO = new YlzMedicalMxDO();
|
|
|
ylzMedicalMxDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalMxDO.setDel(1);
|
|
|
ylzMedicalMxDO.setPrescriptionCode(resultJSON.getString("xtgzh0"));
|
|
|
ylzMedicalMxDO.setHisDetailSn(outpatientDO.getRegisterNo());
|
|
|
ylzMedicalMxDO.setItemCode(mxObject.getString("xmbh00"));
|
|
|
ylzMedicalMxDO.setItemName(mxObject.getString("xmmc00"));
|
|
|
ylzMedicalMxDO.setInvoiceType("01");
|
|
|
ylzMedicalMxDO.setSpecificationType(mxObject.getString("xmgg00"));
|
|
|
ylzMedicalMxDO.setDosageForm(mxObject.getString("jx0000"));
|
|
|
ylzMedicalMxDO.setChargeUnit(mxObject.getString("xmdw00"));
|
|
|
ylzMedicalMxDO.setPrice(mxObject.getString("xmdj00"));
|
|
|
ylzMedicalMxDO.setAmount(mxObject.getString("xmsl00"));
|
|
|
ylzMedicalMxDO.setTotalMoney(mxObject.getString("xmje00"));
|
|
|
ylzMedicalMxDO.setSingleDose(mxObject.getString("ypyl00"));
|
|
|
ylzMedicalMxDO.setUseFrequency(mxObject.getString("yppl00"));
|
|
|
ylzMedicalMxDO.setMedicalWay(mxObject.getString("gytj00"));
|
|
|
ylzMedicalMxDO.setPrescriptionDate(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setMedicationDays(mxObject.getString("ylts00"));
|
|
|
ylzMedicalMxDO.setDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalMxDO.setDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalMxDO.setHisDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalMxDO.setHisDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalMxDO.setMedicalPerName(resultJSON.getString("ysxm00"));
|
|
|
ylzMedicalMxDO.setMedicalPerId(baseDoctorDO.getAtddrNo());
|
|
|
ylzMedicalMxDO.setLimitType(mxObject.getString("sfybxm"));
|
|
|
ylzMedicalMxDO.setActgDate(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setHisItemName(mxObject.getString("xmmc00"));
|
|
|
ylzMedicalMxDO.setHisItemCode(mxObject.getString("xmbh00"));
|
|
|
ylzMedicalMxDO.setClerkDays(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setPeopleType(null);
|
|
|
ylzMedicalMxDO = ylzMedicailMxDao.save(ylzMedicalMxDO);
|
|
|
mxDOList.add(ylzMedicalMxDO);
|
|
|
|
|
|
}else if (json instanceof JSONArray){
|
|
|
JSONArray mxArray = (JSONArray)json;
|
|
|
for (int k=0;k<mxArray.size();k++){
|
|
|
net.sf.json.JSONObject mxObject = mxArray.getJSONObject(k);
|
|
|
YlzMedicalMxDO ylzMedicalMxDO = new YlzMedicalMxDO();
|
|
|
ylzMedicalMxDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalMxDO.setDel(1);
|
|
@ -3935,59 +4534,189 @@ public class EntranceService {
|
|
|
ylzMedicalMxDO.setPeopleType(null);
|
|
|
ylzMedicalMxDO = ylzMedicailMxDao.save(ylzMedicalMxDO);
|
|
|
mxDOList.add(ylzMedicalMxDO);
|
|
|
|
|
|
}else if (json instanceof JSONArray){
|
|
|
JSONArray mxArray = (JSONArray)json;
|
|
|
for (int k=0;k<mxArray.size();k++){
|
|
|
net.sf.json.JSONObject mxObject = mxArray.getJSONObject(k);
|
|
|
YlzMedicalMxDO ylzMedicalMxDO = new YlzMedicalMxDO();
|
|
|
ylzMedicalMxDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalMxDO.setDel(1);
|
|
|
ylzMedicalMxDO.setPrescriptionCode(resultJSON.getString("xtgzh0"));
|
|
|
ylzMedicalMxDO.setHisDetailSn(outpatientDO.getRegisterNo());
|
|
|
ylzMedicalMxDO.setItemCode(mxObject.getString("xmbh00"));
|
|
|
ylzMedicalMxDO.setItemName(mxObject.getString("xmmc00"));
|
|
|
ylzMedicalMxDO.setInvoiceType("01");
|
|
|
ylzMedicalMxDO.setSpecificationType(mxObject.getString("xmgg00"));
|
|
|
ylzMedicalMxDO.setDosageForm(mxObject.getString("jx0000"));
|
|
|
ylzMedicalMxDO.setChargeUnit(mxObject.getString("xmdw00"));
|
|
|
ylzMedicalMxDO.setPrice(mxObject.getString("xmdj00"));
|
|
|
ylzMedicalMxDO.setAmount(mxObject.getString("xmsl00"));
|
|
|
ylzMedicalMxDO.setTotalMoney(mxObject.getString("xmje00"));
|
|
|
ylzMedicalMxDO.setSingleDose(mxObject.getString("ypyl00"));
|
|
|
ylzMedicalMxDO.setUseFrequency(mxObject.getString("yppl00"));
|
|
|
ylzMedicalMxDO.setMedicalWay(mxObject.getString("gytj00"));
|
|
|
ylzMedicalMxDO.setPrescriptionDate(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setMedicationDays(mxObject.getString("ylts00"));
|
|
|
ylzMedicalMxDO.setDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalMxDO.setDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalMxDO.setHisDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalMxDO.setHisDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalMxDO.setMedicalPerName(resultJSON.getString("ysxm00"));
|
|
|
ylzMedicalMxDO.setMedicalPerId(baseDoctorDO.getAtddrNo());
|
|
|
if (mxObject.getString("xmbh00").equalsIgnoreCase("XA11GAW043A001010202251")){
|
|
|
ylzMedicalMxDO.setLimitType("N");
|
|
|
}else {
|
|
|
ylzMedicalMxDO.setLimitType(mxObject.getString("sfybxm"));
|
|
|
}
|
|
|
|
|
|
ylzMedicalMxDO.setActgDate(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setHisItemName(mxObject.getString("xmmc00"));
|
|
|
ylzMedicalMxDO.setHisItemCode(mxObject.getString("xmbh00"));
|
|
|
ylzMedicalMxDO.setClerkDays(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setPeopleType(null);
|
|
|
ylzMedicalMxDO = ylzMedicailMxDao.save(ylzMedicalMxDO);
|
|
|
mxDOList.add(ylzMedicalMxDO);
|
|
|
}
|
|
|
}
|
|
|
}else {
|
|
|
ylzMedicalRelationDO.setOrgCode("3502000303");
|
|
|
ylzMedicalRelationDO.setRegionCode("350200");
|
|
|
ylzMedicalRelationDO.setDiseaseCode(diseaseCode);
|
|
|
ylzMedicalRelationDO.setIdcard(outpatientDO.getIdcard());
|
|
|
ylzMedicalRelationDO.setName(resultJSON.getString("xming0"));
|
|
|
ylzMedicalRelationDO.setCertType("01");
|
|
|
ylzMedicalRelationDO.setMedicalMode("10");
|
|
|
if (StringUtils.isNoneBlank(outpatientDO.getDiseaseCode())){
|
|
|
ylzMedicalRelationDO.setMedicalType("13");
|
|
|
}else {
|
|
|
ylzMedicalRelationDO.setMedicalType("11");
|
|
|
}
|
|
|
ylzMedicalRelationDO.setHisSerial(outpatientDO.getRegisterNo());
|
|
|
ylzMedicalRelationDO.setHisSettleNo(resultJSON.getString("xtgzh0"));
|
|
|
ylzMedicalRelationDO.setDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalRelationDO.setDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalRelationDO.setHisDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalRelationDO.setHisDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalRelationDO.setEmergencySign("0");
|
|
|
ylzMedicalRelationDO.setTraumaSign("0");
|
|
|
ylzMedicalRelationDO.setCardNo(cardno);
|
|
|
ylzMedicalRelationDO.setDate(outpatientDO.getRegisterDate());
|
|
|
ylzMedicalRelationDO.setItemCount(resultJSON.getString("cfxms0"));
|
|
|
ylzMedicalRelationDO.setTotalAmount(resultJSON.getString("bcfyze"));
|
|
|
ylzMedicalRelationDO.setPreCharges(resultJSON.getString("bcfyze"));
|
|
|
ylzMedicalRelationDO.setBcwkje(resultJSON.getString("bcwkje"));
|
|
|
ylzMedicalRelationDO.setDataSource("53");
|
|
|
ylzMedicalRelationDO.setPreCount(resultJSON.getString("cfxms0"));
|
|
|
ylzMedicalRelationDO.setBalance(cardFee+"");
|
|
|
ylzMedicalRelationDO.setMedicalPrice("0");
|
|
|
BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(outpatientDO.getDoctor());
|
|
|
if (baseDoctorDO!=null){
|
|
|
String jobTitle = baseDoctorDO.getJobTitleCode();
|
|
|
}
|
|
|
if (outpatientDO.getMedicalState()==null){
|
|
|
ylzMedicalRelationDO.setMedicalState(0);
|
|
|
ylzMedicalRelationDO.setPersonCash(resultJSON.getString("bcfyze"));
|
|
|
}else {
|
|
|
if (outpatientDO.getMedicalState().equalsIgnoreCase("0")){
|
|
|
ylzMedicalRelationDO.setPersonCash(resultJSON.getString("bcfyze"));
|
|
|
}
|
|
|
ylzMedicalRelationDO.setMedicalState(Integer.parseInt(outpatientDO.getMedicalState()));
|
|
|
}
|
|
|
ylzMedicalRelationDO.setDoctorLevel("02");
|
|
|
ylzMedicalRelationDO.setDel(1);
|
|
|
ylzMedicalRelationDO.setRelationCode(outpatientDO.getId());
|
|
|
ylzMedicalRelationDO.setCreateTime(new Date());
|
|
|
ylzMedicalRelationDO.setStatus(0);
|
|
|
ylzMedicalRelationDO = ylzMedicailRelationDao.save(ylzMedicalRelationDO);
|
|
|
ylzMedicailIcdDao.deleteByMedicalId(ylzMedicalRelationDO.getId());
|
|
|
/*YlzMedicalIcdDO ylzMedicalIcdDO = new YlzMedicalIcdDO();
|
|
|
ylzMedicalIcdDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalIcdDO.setDel(1);
|
|
|
ylzMedicalIcdDO.setCreateTime(new Date());
|
|
|
ylzMedicalIcdDO.setDiseaseType("01");
|
|
|
ylzMedicalIcdDO.setDiseaseCodeIcd10(resultJSON.getString("bqzdbm"));
|
|
|
ylzMedicalIcdDO.setDiseaseNameIcd10(resultJSON.getString("bqzdms"));
|
|
|
ylzMedicalIcdDO.setDiseaseOrder("01");
|
|
|
ylzMedicalIcdDO = ylzMedicailIcdDao.save(ylzMedicalIcdDO);
|
|
|
icdDOList.add(ylzMedicalIcdDO);*/
|
|
|
if (resultJSON.get("zdlists")!=null){
|
|
|
Object json = new JSONTokener(resultJSON.getString("zdlists")).nextValue();
|
|
|
if(json instanceof net.sf.json.JSONObject){
|
|
|
net.sf.json.JSONObject icdJSON = (net.sf.json.JSONObject)json;
|
|
|
net.sf.json.JSONObject icdJson = icdJSON.getJSONObject("zdlist");
|
|
|
YlzMedicalIcdDO ylzMedicalIcdDO = new YlzMedicalIcdDO();
|
|
|
ylzMedicalIcdDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalIcdDO.setDel(1);
|
|
|
ylzMedicalIcdDO.setCreateTime(new Date());
|
|
|
ylzMedicalIcdDO.setDiseaseType(icdJson.getString("zdlx"));
|
|
|
ylzMedicalIcdDO.setDiseaseCodeIcd10(icdJson.getString("zdbm"));
|
|
|
ylzMedicalIcdDO.setDiseaseNameIcd10(icdJson.getString("zdmc"));
|
|
|
ylzMedicalIcdDO.setDiseaseOrder(icdJson.getString("zdxh"));
|
|
|
ylzMedicalIcdDO = ylzMedicailIcdDao.save(ylzMedicalIcdDO);
|
|
|
icdDOList.add(ylzMedicalIcdDO);
|
|
|
} else if (json instanceof JSONArray) {
|
|
|
JSONArray icdArray = (JSONArray)json;
|
|
|
for (int k=0;k<icdArray.size();k++) {
|
|
|
net.sf.json.JSONObject icdObject = icdArray.getJSONObject(k);
|
|
|
YlzMedicalIcdDO ylzMedicalIcdDO = new YlzMedicalIcdDO();
|
|
|
ylzMedicalIcdDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalIcdDO.setDel(1);
|
|
|
ylzMedicalIcdDO.setCreateTime(new Date());
|
|
|
ylzMedicalIcdDO.setDiseaseType(icdObject.getString("zdlx"));
|
|
|
ylzMedicalIcdDO.setDiseaseCodeIcd10(icdObject.getString("zdbm"));
|
|
|
ylzMedicalIcdDO.setDiseaseNameIcd10(icdObject.getString("zdmc"));
|
|
|
ylzMedicalIcdDO.setDiseaseOrder(icdObject.getString("zdxh"));
|
|
|
ylzMedicalIcdDO = ylzMedicailIcdDao.save(ylzMedicalIcdDO);
|
|
|
icdDOList.add(ylzMedicalIcdDO);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
ylzMedicailMxDao.deleteByMedicalId(ylzMedicalRelationDO.getId());
|
|
|
Object json = new JSONTokener(resultJSON.getString("mxlists")).nextValue();
|
|
|
if(json instanceof net.sf.json.JSONObject){
|
|
|
net.sf.json.JSONObject mxListJSON = (net.sf.json.JSONObject)json;
|
|
|
net.sf.json.JSONObject mxObject = mxListJSON.getJSONObject("mxlist");
|
|
|
YlzMedicalMxDO ylzMedicalMxDO = new YlzMedicalMxDO();
|
|
|
ylzMedicalMxDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalMxDO.setDel(1);
|
|
|
ylzMedicalMxDO.setPrescriptionCode(resultJSON.getString("xtgzh0"));
|
|
|
ylzMedicalMxDO.setHisDetailSn(outpatientDO.getRegisterNo());
|
|
|
ylzMedicalMxDO.setItemCode(mxObject.getString("xmbh00"));
|
|
|
ylzMedicalMxDO.setItemName(mxObject.getString("xmmc00"));
|
|
|
ylzMedicalMxDO.setInvoiceType("01");
|
|
|
ylzMedicalMxDO.setSpecificationType(mxObject.getString("xmgg00"));
|
|
|
ylzMedicalMxDO.setDosageForm(mxObject.getString("jx0000"));
|
|
|
ylzMedicalMxDO.setChargeUnit(mxObject.getString("xmdw00"));
|
|
|
ylzMedicalMxDO.setPrice(mxObject.getString("xmdj00"));
|
|
|
ylzMedicalMxDO.setAmount(mxObject.getString("xmsl00"));
|
|
|
ylzMedicalMxDO.setTotalMoney(mxObject.getString("xmje00"));
|
|
|
ylzMedicalMxDO.setSingleDose(mxObject.getString("ypyl00"));
|
|
|
ylzMedicalMxDO.setUseFrequency(mxObject.getString("yppl00"));
|
|
|
ylzMedicalMxDO.setMedicalWay(mxObject.getString("gytj00"));
|
|
|
ylzMedicalMxDO.setPrescriptionDate(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setMedicationDays(mxObject.getString("ylts00"));
|
|
|
ylzMedicalMxDO.setDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalMxDO.setDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalMxDO.setHisDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalMxDO.setHisDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalMxDO.setMedicalPerName(resultJSON.getString("ysxm00"));
|
|
|
ylzMedicalMxDO.setMedicalPerId(baseDoctorDO.getAtddrNo());
|
|
|
ylzMedicalMxDO.setLimitType(mxObject.getString("sfybxm"));
|
|
|
ylzMedicalMxDO.setActgDate(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setHisItemName(mxObject.getString("xmmc00"));
|
|
|
ylzMedicalMxDO.setHisItemCode(mxObject.getString("xmbh00"));
|
|
|
ylzMedicalMxDO.setClerkDays(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setPeopleType(null);
|
|
|
ylzMedicalMxDO = ylzMedicailMxDao.save(ylzMedicalMxDO);
|
|
|
mxDOList.add(ylzMedicalMxDO);
|
|
|
|
|
|
}else if (json instanceof JSONArray){
|
|
|
JSONArray mxArray = (JSONArray)json;
|
|
|
for (int k=0;k<mxArray.size();k++){
|
|
|
net.sf.json.JSONObject mxObject = mxArray.getJSONObject(k);
|
|
|
YlzMedicalMxDO ylzMedicalMxDO = new YlzMedicalMxDO();
|
|
|
ylzMedicalMxDO.setMedicalId(ylzMedicalRelationDO.getId());
|
|
|
ylzMedicalMxDO.setDel(1);
|
|
|
ylzMedicalMxDO.setPrescriptionCode(resultJSON.getString("xtgzh0"));
|
|
|
ylzMedicalMxDO.setHisDetailSn(outpatientDO.getRegisterNo());
|
|
|
ylzMedicalMxDO.setItemCode(mxObject.getString("xmbh00"));
|
|
|
ylzMedicalMxDO.setItemName(mxObject.getString("xmmc00"));
|
|
|
ylzMedicalMxDO.setInvoiceType("01");
|
|
|
ylzMedicalMxDO.setSpecificationType(mxObject.getString("xmgg00"));
|
|
|
ylzMedicalMxDO.setDosageForm(mxObject.getString("jx0000"));
|
|
|
ylzMedicalMxDO.setChargeUnit(mxObject.getString("xmdw00"));
|
|
|
ylzMedicalMxDO.setPrice(mxObject.getString("xmdj00"));
|
|
|
ylzMedicalMxDO.setAmount(mxObject.getString("xmsl00"));
|
|
|
ylzMedicalMxDO.setTotalMoney(mxObject.getString("xmje00"));
|
|
|
ylzMedicalMxDO.setSingleDose(mxObject.getString("ypyl00"));
|
|
|
ylzMedicalMxDO.setUseFrequency(mxObject.getString("yppl00"));
|
|
|
ylzMedicalMxDO.setMedicalWay(mxObject.getString("gytj00"));
|
|
|
ylzMedicalMxDO.setPrescriptionDate(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setMedicationDays(mxObject.getString("ylts00"));
|
|
|
ylzMedicalMxDO.setDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalMxDO.setDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalMxDO.setHisDeptCode(resultJSON.getString("ksbm00"));
|
|
|
ylzMedicalMxDO.setHisDeptName(resultJSON.getString("ghksmc"));
|
|
|
ylzMedicalMxDO.setMedicalPerName(resultJSON.getString("ysxm00"));
|
|
|
ylzMedicalMxDO.setMedicalPerId(baseDoctorDO.getAtddrNo());
|
|
|
if (mxObject.getString("xmbh00").equalsIgnoreCase("XA11GAW043A001010202251")){
|
|
|
ylzMedicalMxDO.setLimitType("N");
|
|
|
}else {
|
|
|
ylzMedicalMxDO.setLimitType(mxObject.getString("sfybxm"));
|
|
|
}
|
|
|
|
|
|
ylzMedicalMxDO.setActgDate(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setHisItemName(mxObject.getString("xmmc00"));
|
|
|
ylzMedicalMxDO.setHisItemCode(mxObject.getString("xmbh00"));
|
|
|
ylzMedicalMxDO.setClerkDays(DateUtil.strToYmdDateLong(mxObject.getString("xmrq00")+" "+mxObject.getString("xmsj00")));
|
|
|
ylzMedicalMxDO.setPeopleType(null);
|
|
|
ylzMedicalMxDO = ylzMedicailMxDao.save(ylzMedicalMxDO);
|
|
|
mxDOList.add(ylzMedicalMxDO);
|
|
|
}
|
|
|
}
|
|
|
ylzMedicalRelationDO.setYlzMedicalIcdDOList(icdDOList);
|
|
|
ylzMedicalRelationDO.setYlzMedicalMxDOList(mxDOList);
|
|
|
return ylzMedicalRelationDO;
|
|
|
}else {
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
ylzMedicalRelationDO.setYlzMedicalIcdDOList(icdDOList);
|
|
|
ylzMedicalRelationDO.setYlzMedicalMxDOList(mxDOList);
|
|
|
return ylzMedicalRelationDO;
|
|
|
}else {
|
|
|
return null;
|
|
|
}
|