|
|
@ -155,6 +155,8 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
|
|
|
@Autowired
|
|
|
private PrescriptionEmrDao prescriptionEmrDao;
|
|
|
@Autowired
|
|
|
private PrescriptionInfoDao prescriptionInfoDao;
|
|
|
@Autowired
|
|
|
private BaseOrgDao orgDao;
|
|
|
|
|
|
private final static String saveUrl = "http://192.168.20.55:10023/ykyy/save";
|
|
|
@ -2340,7 +2342,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@deptCode@",jsonObject.getString("deptCode"));
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@baseSign@",jsonObject.getString("baseSign"));
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@outpatientCode@",jsonObject.getString("outpatientCode"));
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@patientClan@",jsonObject.getString("patientClan"));
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@patientMobile@",jsonObject.getString("patientMobile"));
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@Special@",prescriptionEmrDO.getSpecialHistory());
|
|
|
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@createTime@",sf.format(prescriptionEmrDO.getCreateTime()));
|
|
|
@ -2352,6 +2354,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@allergicHistory@",prescriptionEmrDO.getAllergicHistory());
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@physicalExamination@",prescriptionEmrDO.getPhysicalExamination());
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@assistExamination@",prescriptionEmrDO.getAssistExamination());
|
|
|
htmlDeo = replaceHtml(htmlDeo,"@info@",jsonObject.getString("info"));
|
|
|
}
|
|
|
}
|
|
|
prescriptionEmrDO.setHtmlStr(htmlDeo);
|
|
|
@ -2412,4 +2415,75 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
public void syncEmr(String prescriptionId) throws Exception {
|
|
|
List<WlyyPrescriptionDO> prescriptionDOS = new ArrayList<>();
|
|
|
if (StringUtils.isNoneBlank(prescriptionId)){
|
|
|
prescriptionDOS = prescriptionDao.findById(prescriptionId);
|
|
|
}else {
|
|
|
prescriptionDOS = prescriptionDao.findByStatus();
|
|
|
}
|
|
|
for (WlyyPrescriptionDO prescriptionDO:prescriptionDOS){
|
|
|
com.alibaba.fastjson.JSONObject object = new com.alibaba.fastjson.JSONObject();
|
|
|
BasePatientDO basePatientDO = basePatientDao.findById(prescriptionDO.getPatientCode());
|
|
|
WlyyOutpatientDO outpatientDO = outpatientDao.findById(prescriptionDO.getOutpatientId());
|
|
|
if (outpatientDO!=null){
|
|
|
if (null!=basePatientDO){
|
|
|
object.put("patientAge",IdCardUtil.getAgeForIdcard(basePatientDO.getIdcard()));
|
|
|
object.put("patientsex",IdCardUtil.getSexForIdcard(basePatientDO.getIdcard()));
|
|
|
object.put("patientName",basePatientDO.getName());
|
|
|
object.put("patientClan","0"); }
|
|
|
if (null!=outpatientDO){
|
|
|
object.put("deptCode",outpatientDO.getDeptName());
|
|
|
object.put("outpatientCode",outpatientDO.getRegisterNo());
|
|
|
object.put("eventno","R"+outpatientDO.getRegisterNo());
|
|
|
object.put("diseaseName",outpatientDO.getIcd10Name());
|
|
|
com.alibaba.fastjson.JSONObject jsonObject = ykyyService.getSignPicture(outpatientDO.getDoctor());
|
|
|
if (jsonObject!=null){
|
|
|
if (jsonObject.getString("code").equalsIgnoreCase("1000")){
|
|
|
com.alibaba.fastjson.JSONObject dataJson = jsonObject.getJSONObject("data");
|
|
|
object.put("baseSign",dataJson.getString("image"));
|
|
|
}
|
|
|
}
|
|
|
object.put("patientMobile",outpatientDO.getMobile());
|
|
|
}
|
|
|
|
|
|
|
|
|
String html = "";
|
|
|
List<WlyyPrescriptionInfoDO> infoDOs = prescriptionInfoDao.findByPrescriptionId(prescriptionDO.getId(),1);
|
|
|
for(int i=0;i<infoDOs.size();i++){
|
|
|
WlyyPrescriptionInfoDO infoDO = infoDOs.get(i);
|
|
|
int j = i+1;
|
|
|
html += "<tr key=\""+j+"\" >\n" +
|
|
|
"<td style=\"LINE-HEIGHT: 150%; padding: 5px 0;\" bgcolor=\"#ece9d8\" valign=\"top\" align=\"left\" value=\"his.clinic.recipeinfo.char\" type=\"7\" live=\"1\">\n" +
|
|
|
""+j+"、"+infoDO.getDrugName()+" \n" +
|
|
|
"</td>\n" +
|
|
|
"<td style=\"LINE-HEIGHT: 150%; padding: 5px 0;\" bgcolor=\"#ece9d8\" valign=\"top\" width=\"50\" align=\"left\" value=\"his.clinic.recipeinfo.char\" type=\"7\" live=\"1\">\n" +
|
|
|
"10ml\n" +
|
|
|
"</td>\n" +
|
|
|
"<td style=\"LINE-HEIGHT: 150%; padding: 5px 0;\" bgcolor=\"#ece9d8\" valign=\"top\" width=\"100\" align=\"left\" value=\"his.clinic.recipeinfo.char\" type=\"7\" live=\"1\">\n" +
|
|
|
"每次"+infoDO.getDosage()+infoDO.getUnitName()+"\n" +
|
|
|
"</td>\n" +
|
|
|
"<td style=\"LINE-HEIGHT: 150%; padding: 5px 0;\" bgcolor=\"#ece9d8\" valign=\"top\" width=\"100\" align=\"left\" value=\"his.clinic.recipeinfo.char\" type=\"7\" live=\"1\">\n" +
|
|
|
""+infoDO.getSupplyName()+"\n" +
|
|
|
"</td>\n" +
|
|
|
"<td style=\"LINE-HEIGHT: 150%; padding: 5px 0;\" bgcolor=\"#ece9d8\" valign=\"top\" width=\"100\" align=\"left\" value=\"his.clinic.recipeinfo.char\" type=\"7\" live=\"1\">\n" +
|
|
|
""+infoDO.getUsageName()+"\n" +
|
|
|
"</td>\n" +
|
|
|
"<td style=\"LINE-HEIGHT: 150%; padding: 5px 0;\" bgcolor=\"#ece9d8\" valign=\"top\" width=\"50\" align=\"left\" value=\"his.clinic.recipeinfo.char\" type=\"7\" live=\"1\">\n" +
|
|
|
""+infoDO.getDays()+"日\n" +
|
|
|
"</td>\n" +
|
|
|
"</tr>";
|
|
|
}
|
|
|
object.put("info",html);
|
|
|
WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO = prescriptionEmrDao.findEmrByPrescriptionId(prescriptionDO.getId());
|
|
|
if (wlyyPrescriptionEmrDO!=null){
|
|
|
returnEmrHtmlByHLW(object,wlyyPrescriptionEmrDO);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|