| | |
| | | |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.ltkj.common.core.domain.AjaxResult; |
| | | import com.ltkj.hosp.domain.TjCustomer; |
| | | import com.ltkj.hosp.hisDto.*; |
| | | import com.ltkj.hosp.service.ITjCustomerService; |
| | | import com.ltkj.system.service.ISysConfigService; |
| | | import com.ltkj.web.wxUtils.HttpClientUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | | import java.sql.Connection; |
| | | import java.sql.DriverManager; |
| | | import java.sql.SQLException; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.Properties; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | |
| | | /* @Authot:zjh |
| | | * @Date: 2024-05-28 |
| | | * */ |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class HisApiMethodService { |
| | | @Autowired |
| | | private ITjCustomerService tjCustomerService; |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | |
| | | private static String HIS_URL = ""; |
| | | |
| | | // 数据库配置文件路径 |
| | | // private static final String CONFIG_PATH = "/Users/chacca/开发相关/代码/ltkj_peis/ltkj-admin/src/main/resources/config.properties"; |
| | | private static final String CONFIG_PATH = "D:\\ltkjprojectconf\\config.properties"; |
| | | private static String CONFIG_PATH; |
| | | |
| | | static { |
| | | @Value ("${config.properties}") |
| | | public void setConfigPath(String configPath) { |
| | | CONFIG_PATH = configPath; |
| | | try { |
| | | FileInputStream inputStream = new FileInputStream(CONFIG_PATH); |
| | | Properties props = new Properties(); |
| | |
| | | } |
| | | } |
| | | |
| | | /* static { |
| | | try { |
| | | FileInputStream inputStream = new FileInputStream(CONFIG_PATH); |
| | | Properties props = new Properties(); |
| | | props.load(inputStream); |
| | | String url = props.getProperty("his_api_url"); |
| | | String port = props.getProperty("his_api_port"); |
| | | HIS_URL=url+":"+port+"/api/His/"; |
| | | } catch (IOException throwables) { |
| | | throwables.printStackTrace(); |
| | | } |
| | | }*/ |
| | | |
| | | |
| | | // @ApiOperation(value = "新增/修改门诊注册信息") |
| | | public AjaxResult Outpincreateapply (TjCustomer customer) { |
| | | String ysbm = configService.selectConfigByKey("request_default_ysbm"); |
| | | Map<String, Object> map = new HashMap<> (); |
| | | if (null != customer.getPationId () && !customer.getPationId().equals("0")) { |
| | | map.put ("Pationid", customer.getPationId ()); |
| | |
| | | map.put ("csrq", DateUtil.format(customer.getCusBrithday(),"yyyy-MM-dd")); |
| | | map.put ("brnl", customer.getAge ()); |
| | | map.put ("brnldw", customer.getAgeUnit ()); |
| | | map.put ("addr", customer.getAddr ()); |
| | | map.put ("addr", customer.getCusAddr()); |
| | | map.put ("gzdw", null); |
| | | map.put ("dwdz", null); |
| | | map.put ("lxr", customer.getCusName ()); |
| | |
| | | map.put ("mz", null); |
| | | map.put ("zy","职员"); |
| | | map.put ("fbbm", null); |
| | | map.put ("czy", "00029"); |
| | | map.put ("czy", ysbm); |
| | | map.put ("jkkkh",null); |
| | | map.put ("mindex_id",null); |
| | | // map.put ("zybm","职员"); |
| | |
| | | |
| | | // @ApiOperation(value = "新增/修改门诊诊断") |
| | | public AjaxResult Outpinimpapply (OutpinimpapplyDto dto) { |
| | | Map<String, Object> map = new HashMap<> (); |
| | | map.put ("his_registration_id", dto.getHisRegistrationId ()); |
| | | map.put ("mzzdid", dto.getMzzdid ()); |
| | | map.put ("sqysbm", dto.getSqysbm ()); |
| | | map.put ("mzksbm", dto.getMzksbm ()); |
| | | map.put ("fbrq", dto.getFbrq ()); |
| | | map.put ("zdrq", dto.getZdrq ()); |
| | | map.put ("czybm", dto.getCzybm ()); |
| | | map.put ("czyksbm", dto.getCzyksbm ()); |
| | | map.put ("zs", dto.getZs ()); |
| | | map.put ("bs", dto.getBs ()); |
| | | map.put ("clyz", dto.getClyz ()); |
| | | map.put ("jws", dto.getJws ()); |
| | | map.put ("tgjc", dto.getTgjc ()); |
| | | map.put ("gms", dto.getGms ()); |
| | | map.put ("jbbm", dto.getJbbm ()); |
| | | map.put ("jbbm1", dto.getJbbm1 ()); |
| | | map.put ("jbbm2", dto.getJbbm2 ()); |
| | | map.put ("tw", dto.getTw ()); |
| | | map.put ("mb", dto.getMb ()); |
| | | map.put ("hx", dto.getHx ()); |
| | | map.put ("bp", dto.getBp ()); |
| | | map.put ("fzbz", dto.getFzbz ()); |
| | | map.put ("hzqx", dto.getHzqx ()); |
| | | map.put ("sfqc", dto.getSfqc ()); |
| | | map.put ("qchs", dto.getQchs ()); |
| | | map.put ("sfqj", dto.getSfqj ()); |
| | | map.put ("ckrq", dto.getCkrq ()); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("his_registration_id",dto.getHisRegistrationId()); |
| | | map.put("mzzdid",dto.getMzzdid()); |
| | | map.put("sqysbm",dto.getSqysbm()); |
| | | map.put("mzksbm",dto.getMzksbm()); |
| | | map.put("fbrq",dto.getFbrq()); |
| | | map.put("zdrq",dto.getZdrq()); |
| | | map.put("czybm",dto.getCzybm()); |
| | | map.put("czyksbm",dto.getCzyksbm()); |
| | | map.put("zs",dto.getZs()); |
| | | map.put("bs",dto.getBs()); |
| | | map.put("clyz",dto.getClyz()); |
| | | map.put("jws",dto.getJws()); |
| | | map.put("tgjc",dto.getTgjc()); |
| | | map.put("gms",dto.getGms()); |
| | | map.put("jbbm",dto.getJbbm()); |
| | | map.put("jbbm1",dto.getJbbm1()); |
| | | map.put("jbbm2",dto.getJbbm2()); |
| | | map.put("fzbz",dto.getFzbz()); |
| | | map.put("hzqx",dto.getHzqx()); |
| | | map.put("sfqc",dto.getSfqc()); |
| | | map.put("qchs",dto.getQchs()); |
| | | map.put("sfqj",dto.getSfqj()); |
| | | map.put("jzqk",dto.getJzqk()); |
| | | String post = HttpClientUtils.sendPost (HIS_URL+"Outpinimpapply", map); |
| | | return AjaxResult.success ().put ("data", post); |
| | | } |
| | |
| | | map.put ("jcbw", dao.getJcbw ()); |
| | | map.put ("sfjz", dao.getSfjz ()); |
| | | map.put ("details", dao.getDetails ()); |
| | | log.info("HIS门诊检查申请 ->{},请求参数 ->{}",HIS_URL+"Outpinexamapply", JSONUtil.toJsonStr(map)); |
| | | String post = HttpClientUtils.sendPost (HIS_URL+"Outpinexamapply", map); |
| | | log.info("HIS门诊检查申请返回 ->{}",post); |
| | | return AjaxResult.success ().put ("data", post); |
| | | } |
| | | |
| | |
| | | public AjaxResult Outpinmedicapply (OutpinmedicapplyDto dao) { |
| | | Map<String, Object> map = new HashMap<> (); |
| | | map.put ("his_registration_id", dao.getHisRegistrationId ()); |
| | | map.put ("sfzh", dao.getHisRegistrationId ()); |
| | | map.put ("sfzh", dao.getSfzh ()); |
| | | map.put ("sqysbm", dao.getSqysbm ()); |
| | | map.put ("mzksbm", dao.getMzksbm ()); |
| | | map.put ("sjrq", dao.getSjrq ()); |
| | |
| | | map.put ("czyksbm", dao.getCzyksbm ()); |
| | | map.put ("cflxbm", dao.getCflxbm ()); |
| | | map.put ("yfbm", dao.getYfbm ()); |
| | | map.put ("fyts", dao.getFyts ()); |
| | | map.put ("mzzd", dao.getMzzd ()); |
| | | map.put ("details", dao.getDetails ()); |
| | | map.put ("fyts","1"); |
| | | map.put ("mzzd",""); |
| | | map.put ("details", dao.getDetails()); |
| | | String post = HttpClientUtils.sendPost (HIS_URL+"Outpinmedicapply", map); |
| | | return AjaxResult.success ().put ("data", post); |
| | | } |
| | |
| | | Map<String, Object> map = new HashMap<> (); |
| | | map.put ("his_registration_id", hisRegistrationId); |
| | | map.put ("czybm", czybm); |
| | | map.put ("zflxbm", sqdh); |
| | | map.put ("sqdh", sqdh); |
| | | String post = HttpClientUtils.sendPost (HIS_URL+"Outpindelmedicapply", map); |
| | | return AjaxResult.success ().put ("data", post); |
| | | } |
| | |
| | | String post = HttpClientUtils.sendPost (HIS_URL+"Getlabdetailinfo", map); |
| | | return AjaxResult.success ().put ("data", post); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // 192.168.0.123:12005/api/His/Getlabreginfoinfo |
| | | //{ |
| | | // "his_registration_id":"20250107000011", |
| | | // "pationid":"20240618000042", |
| | | // "ksrq":"2025-01-07 00:00:00", |
| | | // "jsrq":"2025-01-08 00:00:00", |
| | | // "pagecount":100, |
| | | // "page":1, |
| | | // "status":"已申请" |
| | | //} |
| | | |
| | | /** |
| | | * 获取His检验条码号 |
| | | * @return |
| | | */ |
| | | public AjaxResult Getlabreginfoinfo(String hisCardId,Boolean isZf,String today){ |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | Date todayDate = null; |
| | | try { |
| | | todayDate = dateFormat.parse(today); |
| | | } catch (ParseException e) { |
| | | return AjaxResult.error(); |
| | | } |
| | | String now = dateFormat.format(new Date()); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("his_registration_id",hisCardId); |
| | | map.put("ksrq",today); |
| | | map.put("pagecount",100); |
| | | map.put("page",1); |
| | | if (now.equals(today)){ |
| | | Calendar instance = Calendar.getInstance(); |
| | | instance.setTime(todayDate); |
| | | instance.add(Calendar.DAY_OF_MONTH,1); |
| | | String tomorrow = dateFormat.format(instance.getTime()); |
| | | map.put("jsrq",tomorrow); |
| | | }else { |
| | | map.put("jsrq",now); |
| | | } |
| | | if (!isZf) |
| | | map.put("status","已申请"); |
| | | else map.put("status","已作废"); |
| | | String post = HttpClientUtils.sendPost (HIS_URL+"Getlabreginfoinfo", map); |
| | | return AjaxResult.success ().put ("data", post); |
| | | } |
| | | } |