| | |
| | | import com.sun.org.apache.xpath.internal.operations.Bool; |
| | | import jodd.util.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.security.PrivateKey; |
| | | import java.text.SimpleDateFormat; |
| | |
| | | private LtkjExamJcsqdService ltkjExamJcsqdService; |
| | | @Autowired |
| | | private LtkjExamJcbgdService ltkjExamJcbgdService; |
| | | @Autowired |
| | | private PacsApiMethodService pacsApiMethodService; |
| | | |
| | | // 体检开检查申请单调用此接口推送给pacs服务 |
| | | public boolean OrderAdd(String tjNumber) |
| | |
| | | return XmlUtil.mapToXmlStr(hashMap); |
| | | } |
| | | |
| | | //@PostMapping("QueryOrder") |
| | | // @PostMapping("QueryOrder") |
| | | private String queryOrder(@RequestBody String json){ |
| | | Map<String, Object> map = XmlUtil.xmlToMap(json); |
| | | JSONObject parseObj = JSONUtil.parseObj(map); |
| | |
| | | patientInfo.put("PatBirthday",customer.getCusBrithday()); |
| | | patientInfo.put("IdCard",customer.getCusIdcard()); |
| | | |
| | | // ArrayList<HashMap<String, Object>> examItems = new ArrayList<>(); |
| | | String examItems = ""; |
| | | // String examItems = ""; |
| | | HashMap<String, Object> examItem = new HashMap<>(); |
| | | List<Map<String,Object>> lists = new ArrayList<>(); |
| | | for (TjProject project : projects) { |
| | | HashMap<String, Object> examItem = new HashMap<>(); |
| | | examItem.put("HisID", tjOrder.getTjNumber() + String.valueOf(project.getProId()).substring(String.valueOf(project.getProId()).length() - 4)); |
| | | examItem.put("EmergencyFlag", "0"); |
| | | examItem.put("ExamItemID", project.getHisXmbm()); |
| | | examItem.put("ExamItemName", project.getHisXmmc()); |
| | | examItem.put("OrderDT", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(tjOrder.getCreateTime())); |
| | | HashMap<String, Object> examItems = new HashMap<>(); |
| | | examItems.put("HisID", tjOrder.getTjNumber() + String.valueOf(project.getProId()).substring(String.valueOf(project.getProId()).length() - 4)); |
| | | examItems.put("EmergencyFlag", "0"); |
| | | examItems.put("ExamItemID", project.getHisXmbm()); |
| | | examItems.put("ExamItemName", project.getHisXmmc()); |
| | | examItems.put("OrderDT", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(tjOrder.getCreateTime())); |
| | | SysDept dept = deptService.getById(project.getDeptId()); |
| | | examItem.put("Modality", dept.getModality()); |
| | | examItems += "<ExamItem>"+ |
| | | XmlUtil.mapToXmlStr(examItem) |
| | | .replaceAll("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>","") |
| | | .replaceAll("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>","") |
| | | .replaceAll("<xml>","") |
| | | .replaceAll("</xml>","") |
| | | +"</ExamItem>"; |
| | | examItems.put("Modality", dept.getModality()); |
| | | // examItems += "<ExamItem>"+ |
| | | // XmlUtil.mapToXmlStr(examItem) |
| | | // .replaceAll("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>","") |
| | | // .replaceAll("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>","") |
| | | // .replaceAll("<xml>","") |
| | | // .replaceAll("</xml>","") |
| | | // +"</ExamItem>"; |
| | | lists.add(examItems); |
| | | } |
| | | hashMap.put("ExamItemList", examItems); |
| | | examItem.put("ExamItem",list); |
| | | hashMap.put("ExamItemList", examItem); |
| | | hashMap.put("PatientInfor",patientInfo); |
| | | HashMap<String, Object> result = new HashMap<>(); |
| | | result.put("Code",1); |
| | |
| | | return XmlUtil.mapToXmlStr(hashMap) |
| | | .replaceAll("<","<").replaceAll(">",">"); |
| | | } |
| | | |
| | | @GetMapping("test") |
| | | public String test(){ |
| | | TjCustomer tjCustomer = customerService.getById(1870373229901938690L); |
| | | LambdaQueryWrapper<TjOrder> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(TjOrder::getUserId,tjCustomer.getCusId()); |
| | | TjOrder order = tjOrderService.getOne(wrapper); |
| | | pacsApiMethodService.OrderAdd(tjCustomer,order); |
| | | return "1111"; |
| | | } |
| | | } |