|
@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yihu.jw.entity.base.patient.BasePatientDO;
|
|
|
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
|
|
|
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
|
|
|
import com.yihu.jw.entity.base.wx.WxTemplateConfigDO;
|
|
|
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
|
|
@ -20,6 +21,7 @@ import com.yihu.jw.hospital.prescription.service.entrance.DsyyEntranceService;
|
|
|
import com.yihu.jw.mysql.query.BaseJpaService;
|
|
|
import com.yihu.jw.order.dao.BusinessOrderDao;
|
|
|
import com.yihu.jw.patient.dao.BasePatientDao;
|
|
|
import com.yihu.jw.patient.dao.BasePatientMedicareCardDao;
|
|
|
import com.yihu.jw.util.date.DateUtil;
|
|
|
import com.yihu.jw.util.http.HttpClientUtil;
|
|
|
import com.yihu.jw.utils.WebserviceUtil;
|
|
@ -45,8 +47,51 @@ public class DsyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
|
|
|
private static Logger logger = LoggerFactory.getLogger(DsyyPrescriptionService.class);
|
|
|
@Autowired
|
|
|
private DsyyEntranceService dsyyEntranceService;
|
|
|
@Autowired
|
|
|
private BasePatientDao patientDao;
|
|
|
@Autowired
|
|
|
private BasePatientMedicareCardDao patientMedicareCardDao;
|
|
|
//=============查询视图========================
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 通过身份证获取卡号
|
|
|
*
|
|
|
*
|
|
|
* @param patient
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public JSONArray findCardNo(String patient) throws Exception {
|
|
|
BasePatientDO patientDO = patientDao.getOne(patient);
|
|
|
if (patientDO==null){
|
|
|
throw new Exception("不存在该患者!");
|
|
|
}
|
|
|
patientMedicareCardDao.deleteByPatientId(patient);
|
|
|
JSONArray array = dsyyEntranceService.findCardNo(patientDO.getIdcard());
|
|
|
for (int i=0;i<array.size();i++){
|
|
|
JSONObject object = array.getJSONObject(i);
|
|
|
String cardType = object.getString("CARD_TYPE");
|
|
|
String cardNo = object.getString("CARD_NO");
|
|
|
String cardTypeName = object.getString("CARD_TYPE_NAME");
|
|
|
PatientMedicareCardDO patientMedicareCardDO = new PatientMedicareCardDO();
|
|
|
patientMedicareCardDO.setCode(cardNo);
|
|
|
patientMedicareCardDO.setParentType("A");
|
|
|
if (cardType.equalsIgnoreCase("D")){
|
|
|
patientMedicareCardDO.setType("A_01");
|
|
|
}else {
|
|
|
patientMedicareCardDO.setType("A_03");
|
|
|
}
|
|
|
patientMedicareCardDO.setPatientCode(patient);
|
|
|
patientMedicareCardDO.setOrgCode("350211A1002");
|
|
|
patientMedicareCardDO.setCityCode("350200");
|
|
|
patientMedicareCardDO.setDel("1");
|
|
|
patientMedicareCardDO.setRemark(cardTypeName);
|
|
|
patientMedicareCardDao.save(patientMedicareCardDO);
|
|
|
}
|
|
|
return array;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取诊断
|
|
|
*
|
|
@ -73,7 +118,6 @@ public class DsyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
|
|
|
/**
|
|
|
* 获取频次字典
|
|
|
*
|
|
|
* @param pydm
|
|
|
* @return
|
|
|
* @throws Exception
|
|
|
*/
|