提交验证出院,根据医嘱更新出院时间

master
wyb 2 years ago
parent 7a843abf2b
commit 4ce27aacd7

@ -0,0 +1,11 @@
[
{
"key": "HIS_ZY_CYYZ",
"desc": "提供病人住院出院医嘱查询",
"url": "http://192.168.5.74:8000/data-server/query",
"otherParam": {
"action": "HIS_ZY_CYYZ",
"accessKey":"1094ddfc-5445-57d0-cc6f-54d812931688"
}
}
]

@ -15,13 +15,19 @@ import com.docus.server.message.dto.WsNurseSubmitDTO;
import com.docus.server.message.feign.dto.CompensateTasRequest;
import com.docus.server.message.feign.service.CollectTaskService;
import com.docus.server.message.mapper.TBasicMapper;
import com.docus.server.message.rpc.ShunDePeopleRpc;
import com.docus.server.message.rpc.dto.HisZyCyYzDTO;
import com.docus.server.message.rpc.request.HisZyCyYzRequest;
import com.docus.server.message.rpc.response.HisZyCyYzResponse;
import com.docus.server.message.validate.RecordSubmitValidate;
import com.docus.server.message.validate.WsNurseSubmitValidate;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
@Slf4j
@Service
@ -29,6 +35,7 @@ public class SdBusinessServiceImpl implements SdBusinessService {
private CollectTaskService collectTaskService;
private TBasicMapper tBasicMapper;
private ShunDePeopleRpc shunDePeopleRpc;
@Autowired
public void setCollectTaskService(CollectTaskService collectTaskService) {
@ -40,6 +47,11 @@ public class SdBusinessServiceImpl implements SdBusinessService {
this.tBasicMapper = tBasicMapper;
}
@Autowired
public void setShunDePeopleRpc(ShunDePeopleRpc shunDePeopleRpc) {
this.shunDePeopleRpc = shunDePeopleRpc;
}
@Override
public MessageResponse recordSubmitHandle(Message message) {
try {
@ -51,6 +63,10 @@ public class SdBusinessServiceImpl implements SdBusinessService {
RecordSubmitValidate.verifyRecordSubmitDTO(recordSubmitDto);
List<String> patientIds = tBasicMapper.getPatientIdsByInpatientNoAndTimes(recordSubmitDto.getInHospIndexNo(), recordSubmitDto.getVisitNo());
verifyPatientIds(patientIds);
if(!isDischargeAndUpdDisDate(patientIds.get(0),recordSubmitDto.getInHospIndexNo(), recordSubmitDto.getVisitNo())){
throw new BaseException("此患者未出院!");
}
tBasicMapper.insertOrUpdateDoctorSubmitTime(patientIds.get(0), recordSubmitDto.getSubmitTime());
log.info("补偿电子病历任务 patientIds:{} collectId:{}", patientIds, taskConfig.getCollectorIds());
compensateTask(patientIds, taskConfig.getCollectorIds());
@ -82,6 +98,10 @@ public class SdBusinessServiceImpl implements SdBusinessService {
WsNurseSubmitValidate.verifyNurseSubmitDTO(nurseSubmitDTO);
List<String> patientIds = tBasicMapper.getPatientIdsByInpatientNoAndTimes(nurseSubmitDTO.getInHospIndexNo(), nurseSubmitDTO.getVisitNo());
verifyPatientIds(patientIds);
if(!isDischargeAndUpdDisDate(patientIds.get(0),nurseSubmitDTO.getInHospIndexNo(), nurseSubmitDTO.getVisitNo())){
throw new BaseException("此患者未出院!");
}
tBasicMapper.insertOrUpdateNurseSubmitTime(patientIds.get(0), nurseSubmitDTO.getSubmitTime());
tBasicMapper.insertOrUpdateNurseFileCount(patientIds.get(0), nurseSubmitDTO.getFilesCount());
log.info("补偿护理任务 patientIds:{} collectId:{}", patientIds, taskConfig.getCollectorIds());
@ -125,20 +145,59 @@ public class SdBusinessServiceImpl implements SdBusinessService {
if (patientIds.size() > 1) {
throw new BaseException("住院号+住院次数 ,系统中患者有多个!");
}
if (!isDischarge(patientIds.get(0))) {
throw new BaseException("该患者为在院状态,请在患者出院后提交!");
}
}
/**
*
* ,
*
* @param patientId
* @return
*/
private boolean isDischarge(String patientId) {
private boolean isDischargeAndUpdDisDate(String patientId, String inpatientNo, Integer admissTimes) {
// 第一次,出院则直接判断出院
int count = tBasicMapper.getDischargeCount(patientId);
return count > 0;
if (count > 0) {
return true;
}
// 没有出院,根据住院出院医嘱,更新出院时间再判断
HisZyCyYzRequest request = new HisZyCyYzRequest();
request.setVisitNo(inpatientNo);
request.setVisitTimes(String.valueOf(admissTimes));
HisZyCyYzResponse response = shunDePeopleRpc.hisZyCyYz(request);
// 医嘱没查询到,也表示未出院
if (isNullYzData(response)) {
return false;
}
HisZyCyYzDTO hisZyCyYzDTO = null;
List<HisZyCyYzDTO> zyCyYzDtos = response.getData();
// 3 5 状态可更新时间
List<String> status = Arrays.asList("3", "5");
for (HisZyCyYzDTO zyCyYzDTO : zyCyYzDtos) {
if (status.contains(zyCyYzDTO.getOrder_status())) {
hisZyCyYzDTO = zyCyYzDTO;
break;
}
}
// 根据3 5 状态未找到医嘱记录,不更新时间,判定为未出院
if (Objects.isNull(hisZyCyYzDTO)) {
return false;
}
// 更新出院时间
tBasicMapper.updateDisDateTime(patientId, hisZyCyYzDTO.getStop_time());
// 再次判断
int count2 = tBasicMapper.getDischargeCount(patientId);
return count2 > 0;
}
/**
*
* @param response
* @return true
*/
private boolean isNullYzData(HisZyCyYzResponse response) {
return Objects.isNull(response) || Func.isEmpty(response.getData()) || Objects.isNull(response.getData().get(0));
}

@ -0,0 +1,48 @@
package com.docus.server.message.config;
import com.alibaba.fastjson.JSONArray;
import com.docus.core.util.Func;
import com.docus.server.message.util.TableJsonRead;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
* @author wyb
*/
public class ShunDePeopleInterfaceConfig {
public static List<InterfaceConfig> getTaskConfig() {
final String configFilePath = "data-config";
final String configFileName = "sdRy-interface-config.json";
TableJsonRead tableJsonRead = new TableJsonRead();
String configJson = tableJsonRead.ReadContent(configFilePath, configFileName);
return JSONArray.parseArray(configJson, InterfaceConfig.class);
}
public static InterfaceConfig getTaskConfig(String key) {
List<InterfaceConfig> taskConfigs = getTaskConfig();
if(Func.isNotEmpty(taskConfigs)){
for (InterfaceConfig taskConfig : taskConfigs) {
if (key.equals(taskConfig.getKey())) {
return taskConfig;
}
}
}
return null;
}
@Data
public static class InterfaceConfig {
private String key;
private String desc;
private String url;
private Map<String, String> otherParam;
}
public static void main(String[] args) {
System.out.println(getTaskConfig("HIS_ZY_CYYZ"));
}
}

@ -1,11 +1,13 @@
package com.docus.server.message.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
@Mapper
public interface TBasicMapper {
List<String> getPatientIdsByInpatientNoAndTimes(@Param("inpatientNo") String inHospIndexNo, @Param("admissTimes") Integer visitNo);
@ -43,4 +45,12 @@ public interface TBasicMapper {
* @return
*/
int getDischargeCount(@Param("patientId") String patientId);
/**
*
* @param patientId
* @param disDate
* @return database
*/
int updateDisDateTime(@Param("patientId") String patientId,@Param("disDate") String disDate);
}

@ -0,0 +1,17 @@
package com.docus.server.message.rpc;
import com.docus.server.message.rpc.request.HisZyCyYzRequest;
import com.docus.server.message.rpc.response.HisZyCyYzResponse;
/**
*
* @author wyb
*/
public interface ShunDePeopleRpc {
/**
*
* @param request
* @return
*/
HisZyCyYzResponse hisZyCyYz(HisZyCyYzRequest request);
}

@ -0,0 +1,589 @@
package com.docus.server.message.rpc.dto;
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* HIS
*
* @author wyb
*/
@Data
@ApiModel("HIS 住院出院医嘱查询数据")
public class HisZyCyYzDTO {
@ApiModelProperty("科室编码")
@JSONField(name = "dept_code")
private String dept_code;
@ApiModelProperty("嘱托 费用标志")
@JSONField(name = "self_buy")
private String self_buy;
@ApiModelProperty("医生开立编码")
@JSONField(name = "order_doctor")
private String order_doctor;
@ApiModelProperty("药品代码")
@JSONField(name = "PHAM_STD_CODE")
private String PHAM_STD_CODE;
@ApiModelProperty("病房号码")
@JSONField(name = "roomno")
private String roomno;
@ApiModelProperty("原病区编码")
@JSONField(name = "orig_ward_code")
private String orig_ward_code;
@ApiModelProperty("医嘱开立时间")
@JSONField(name = "order_time")
private String order_time;
@ApiModelProperty("治疗单标志")
@JSONField(name = "TREAT_SHEET_FLAG")
private String TREAT_SHEET_FLAG;
@ApiModelProperty("")
@JSONField(name = "yb_type_name")
private String yb_type_name;
@ApiModelProperty("最后一次执行日期及时间")
@JSONField(name = "LAST_PERFORM_DATE_TIME")
private String LAST_PERFORM_DATE_TIME;
@ApiModelProperty("医嘱状态 1录入 2确认 3执行 5 :停止 6撤销 状态代码或者执行状态")
@JSONField(name = "order_status")
private String order_status;
@ApiModelProperty("用药途径")
@JSONField(name = "supply_name")
private String supply_name;
@ApiModelProperty("数量")
@JSONField(name = "AMOUNT")
private String AMOUNT;
@ApiModelProperty("父医嘱类型代码")
@JSONField(name = "p_order_type")
private String p_order_type;
@ApiModelProperty("药物类型编码")
@JSONField(name = "drug_type")
private String drug_type;
@ApiModelProperty("费用状态名称")
@JSONField(name = "fy_type_name")
private String fy_type_name;
@ApiModelProperty("")
@JSONField(name = "caoyao_fu")
private String caoyao_fu;
@ApiModelProperty("电话")
@JSONField(name = "tel")
private String tel;
@ApiModelProperty("临床路径编码")
@JSONField(name = "cps_id")
private String cps_id;
@ApiModelProperty("审核护士ID")
@JSONField(name = "nurse_confirm_code")
private String nurse_confirm_code;
@ApiModelProperty("单次用药剂量")
@JSONField(name = "doseage")
private String doseage;
@ApiModelProperty("医嘱取消时间")
@JSONField(name = "cancel_time")
private String cancel_time;
@ApiModelProperty("医嘱类型")
@JSONField(name = "group_name")
private String group_name;
@ApiModelProperty("用药天数")
@JSONField(name = "yydays")
private String yydays;
@ApiModelProperty("最后一次计价日期及时间")
@JSONField(name = "LAST_ACCTING_DATE_TIME")
private String LAST_ACCTING_DATE_TIME;
@ApiModelProperty("互斥类型名称")
@JSONField(name = "exclusive_name")
private String exclusive_name;
@ApiModelProperty("医嘱项目类型名称")
@JSONField(name = "order_item_name")
private String order_item_name;
@ApiModelProperty("药品小类")
@JSONField(name = "drug_sub_class")
private String drug_sub_class;
@ApiModelProperty("身份证号")
@JSONField(name = "social_code")
private String social_code;
@ApiModelProperty("")
@JSONField(name = "emergency_flag")
private String emergency_flag;
@ApiModelProperty("药物名称")
@JSONField(name = "drugname")
private String drugname;
@ApiModelProperty("")
@JSONField(name = "yzzt_code")
private String yzzt_code;
@ApiModelProperty("")
@JSONField(name = "back_status_name")
private String back_status_name;
@ApiModelProperty("医嘱编码")
@JSONField(name = "order_code")
private String order_code;
@ApiModelProperty("模板类型")
@JSONField(name = "muban_type")
private String muban_type;
@ApiModelProperty("健康档案编号")
@JSONField(name = "fileno")
private String fileno;
@ApiModelProperty("处方号")
@JSONField(name = "CURRENT_PRESC_NO")
private String CURRENT_PRESC_NO;
@ApiModelProperty("医嘱审核护士日期时间")
@JSONField(name = "nurse_confirm_time")
private String nurse_confirm_time;
@ApiModelProperty("是否药观")
@JSONField(name = "medviewflag")
private String medviewflag;
@ApiModelProperty("病人内部编码")
@JSONField(name = "global_pid")
private String global_pid;
@ApiModelProperty("组套标记")
@JSONField(name = "ztbj")
private String ztbj;
@ApiModelProperty("审核医生签名")
@JSONField(name = "confirm_opera_name")
private String confirm_opera_name;
@ApiModelProperty("医保类别名称")
@JSONField(name = "charge_group_name")
private String charge_group_name;
@ApiModelProperty("")
@JSONField(name = "hcyz_type_code")
private String hcyz_type_code;
@ApiModelProperty("开嘱科室编码")
@JSONField(name = "order_dept_sn")
private String order_dept_sn;
@ApiModelProperty("")
@JSONField(name = "zyypjs")
private String zyypjs;
@ApiModelProperty("用药标志")
@JSONField(name = "yybj")
private String yybj;
@ApiModelProperty("长临标志")
@JSONField(name = "long_once_flag")
private String long_once_flag;
@ApiModelProperty("护理类型名称")
@JSONField(name = "huli_type_name")
private String huli_type_name;
@ApiModelProperty("父医嘱类型名称")
@JSONField(name = "p_order_type_name")
private String p_order_type_name;
@ApiModelProperty("是否适应")
@JSONField(name = "fit_flag")
private String fit_flag;
@ApiModelProperty("医嘱取消人签名")
@JSONField(name = "cancel_name")
private String cancel_name;
@ApiModelProperty("医保类别")
@JSONField(name = "charge_group")
private String charge_group;
@ApiModelProperty("药品性质编码")
@JSONField(name = "ypxz")
private String ypxz;
@ApiModelProperty("开嘱科室名称")
@JSONField(name = "order_dept_name")
private String order_dept_name;
@ApiModelProperty("药品计价属性")
@JSONField(name = "DRUG_DILLING_ATTR")
private String DRUG_DILLING_ATTR;
@ApiModelProperty("病区编码")
@JSONField(name = "ward_code")
private String ward_code;
@ApiModelProperty("医嘱状态")
@JSONField(name = "status_name")
private String status_name;
@ApiModelProperty("")
@JSONField(name = "bihuan_order_type_name")
private String bihuan_order_type_name;
@ApiModelProperty("性别编码")
@JSONField(name = "sex")
private String sex;
@ApiModelProperty("药物剂型代码")
@JSONField(name = "dosage_type")
private String dosage_type;
@ApiModelProperty("")
@JSONField(name = "zyypcf")
private String zyypcf;
@ApiModelProperty("")
@JSONField(name = "op_id")
private String op_id;
@ApiModelProperty("药物类别编码")
@JSONField(name = "drug_class")
private String drug_class;
@ApiModelProperty("药物编码")
@JSONField(name = "drugcode")
private String drugcode;
@ApiModelProperty("药品性质名称")
@JSONField(name = "ypxzmc")
private String ypxzmc;
@ApiModelProperty("排斥医嘱号")
@JSONField(name = "exclu_order_sn")
private String exclu_order_sn;
@ApiModelProperty("护理登记编码")
@JSONField(name = "hl_code")
private String hl_code;
@ApiModelProperty("单次药物使用总剂量单位")
@JSONField(name = "unit_name1")
private String unit_name1;
@ApiModelProperty("医嘱备注")
@JSONField(name = "instruction")
private String instruction;
@ApiModelProperty("")
@JSONField(name = "back_status")
private String back_status;
@ApiModelProperty("")
@JSONField(name = "xzlhff_type_name")
private String xzlhff_type_name;
@ApiModelProperty("审核护士签名")
@JSONField(name = "nurse_confirm_name")
private String nurse_confirm_name;
@ApiModelProperty("是否皮试")
@JSONField(name = "skin_test")
private String skin_test;
@ApiModelProperty("医嘱序号")
@JSONField(name = "order_sn")
private String order_sn;
@ApiModelProperty("医嘱取消人ID")
@JSONField(name = "cancel_doctor")
private String cancel_doctor;
@ApiModelProperty("费用状态")
@JSONField(name = "fy_type")
private String fy_type;
@ApiModelProperty("")
@JSONField(name = "bihuan_order_type")
private String bihuan_order_type;
@ApiModelProperty("药品小类名称")
@JSONField(name = "drug_sub_class_name")
private String drug_sub_class_name;
@ApiModelProperty("姓名")
@JSONField(name = "pat_name")
private String pat_name;
@ApiModelProperty("抗生素标记")
@JSONField(name = "kssbj")
private String kssbj;
@ApiModelProperty("医嘱类型编码")
@JSONField(name = "group_type")
private String group_type;
@ApiModelProperty("停止人签名")
@JSONField(name = "stop_name")
private String stop_name;
@ApiModelProperty("")
@JSONField(name = "zyyyff")
private String zyyyff;
@ApiModelProperty("规格")
@JSONField(name = "spec")
private String spec;
@ApiModelProperty("毒麻精标志")
@JSONField(name = "poison_class")
private String poison_class;
@ApiModelProperty("医嘱项目类型编码")
@JSONField(name = "order_item_type")
private String order_item_type;
@ApiModelProperty("药物类别名称")
@JSONField(name = "drug_class_name")
private String drug_class_name;
@ApiModelProperty("床号")
@JSONField(name = "bedno")
private String bedno;
@ApiModelProperty("互斥类型代码")
@JSONField(name = "exclusive_type")
private String exclusive_type;
@ApiModelProperty("")
@JSONField(name = "zyjzf")
private String zyjzf;
@ApiModelProperty("科室名称")
@JSONField(name = "dept_code_name")
private String dept_code_name;
@ApiModelProperty("停止人ID")
@JSONField(name = "stop_opera")
private String stop_opera;
@ApiModelProperty("")
@JSONField(name = "hcyz_type_name")
private String hcyz_type_name;
@ApiModelProperty("包装序号")
@JSONField(name = "pack_sn")
private String pack_sn;
@ApiModelProperty("")
@JSONField(name = "admiss_date")
private String admiss_date;
@ApiModelProperty("护理等级")
@JSONField(name = "hl_name")
private String hl_name;
@ApiModelProperty("审核医生ID")
@JSONField(name = "confirm_opera_code")
private String confirm_opera_code;
@ApiModelProperty("计价属性")
@JSONField(name = "BILLING_ATTR")
private String BILLING_ATTR;
@ApiModelProperty("执行频率编码")
@JSONField(name = "frequ_code")
private String frequ_code;
@ApiModelProperty("")
@JSONField(name = "cfypzh")
private String cfypzh;
@ApiModelProperty("")
@JSONField(name = "yb_type_code")
private String yb_type_code;
@ApiModelProperty("原病区名称")
@JSONField(name = "orig_ward_name")
private String orig_ward_name;
@ApiModelProperty("单次用药剂量单位")
@JSONField(name = "unit_name")
private String unit_name;
@ApiModelProperty("医嘱开始时间")
@JSONField(name = "start_time")
private String start_time;
@ApiModelProperty("执行科室")
@JSONField(name = "exec_unit")
private String exec_unit;
@ApiModelProperty("开嘱医生")
@JSONField(name = "order_doctor_name")
private String order_doctor_name;
@ApiModelProperty("药物剂型")
@JSONField(name = "dosage_name")
private String dosage_name;
@ApiModelProperty("病人ID")
@JSONField(name = "patient_id")
private String patient_id;
@ApiModelProperty("皮试结果")
@JSONField(name = "skintest_result")
private String skintest_result;
@ApiModelProperty("执行科室")
@JSONField(name = "exec_name")
private String exec_name;
@ApiModelProperty("")
@JSONField(name = "fee_type_status")
private String fee_type_status;
@ApiModelProperty("住院号")
@JSONField(name = "visitNo")
private String visitNo;
@ApiModelProperty("长期或临时名称")
@JSONField(name = "long_once_name")
private String long_once_name;
@ApiModelProperty("毒麻标记")
@JSONField(name = "dmbj")
private String dmbj;
@ApiModelProperty("中西药标识")
@JSONField(name = "type_flag")
private String type_flag;
@ApiModelProperty("出生日期")
@JSONField(name = "birthday")
private String birthday;
@ApiModelProperty("处方药品组号")
@JSONField(name = "order_long_id")
private String order_long_id;
@ApiModelProperty("")
@JSONField(name = "xzlhff_type_code")
private String xzlhff_type_code;
@ApiModelProperty("医嘱停止时间")
@JSONField(name = "stop_time")
private String stop_time;
@ApiModelProperty("父医嘱号")
@JSONField(name = "p_order_sn")
private String p_order_sn;
@ApiModelProperty("执行频率")
@JSONField(name = "frequ_name")
private String frequ_name;
@ApiModelProperty("医嘱描述")
@JSONField(name = "order_description")
private String order_description;
@ApiModelProperty("父医嘱编码")
@JSONField(name = "p_order_code")
private String p_order_code;
@ApiModelProperty("医嘱名称")
@JSONField(name = "order_name")
private String order_name;
@ApiModelProperty("护理类型")
@JSONField(name = "hl_type")
private String hl_type;
@ApiModelProperty("临床路径项目序号")
@JSONField(name = "cps_order_sn")
private String cps_order_sn;
@ApiModelProperty("抗生素标志")
@JSONField(name = "zy_role")
private String zy_role;
@ApiModelProperty("病区名称")
@JSONField(name = "ward_code_name")
private String ward_code_name;
@ApiModelProperty("")
@JSONField(name = "hcyz_no")
private String hcyz_no;
@ApiModelProperty("中药细项号")
@JSONField(name = "cm_item_num")
private String cm_item_num;
@ApiModelProperty("")
@JSONField(name = "abbr_name")
private String abbr_name;
@ApiModelProperty("")
@JSONField(name = "fee_type_code")
private String fee_type_code;
@ApiModelProperty("医嘱审核日期时间")
@JSONField(name = "confirm_time")
private String confirm_time;
@ApiModelProperty("药物类型编码名称")
@JSONField(name = "drug_type_name")
private String drug_type_name;
@ApiModelProperty("性别")
@JSONField(name = "sex_name")
private String sex_name;
@ApiModelProperty("医嘱实际停止时间")
@JSONField(name = "complete_stop_time")
private String complete_stop_time;
@ApiModelProperty("用药途径编码")
@JSONField(name = "supply_code")
private String supply_code;
@ApiModelProperty("草药用法")
@JSONField(name = "cy_supply_name")
private String cy_supply_name;
@ApiModelProperty("规格名称")
@JSONField(name = "spec_name")
private String spec_name;
@ApiModelProperty("临床路径名称")
@JSONField(name = "cps_name")
private String cps_name;
@ApiModelProperty("住院次数")
@JSONField(name = "visitTimes")
private String visitTimes;
@ApiModelProperty("单次药物使用领量数量")
@JSONField(name = "charge_amount")
private String charge_amount;
}

@ -0,0 +1,58 @@
package com.docus.server.message.rpc.impl;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.docus.core.util.DateUtil;
import com.docus.server.message.config.ShunDePeopleInterfaceConfig;
import com.docus.server.message.rpc.ShunDePeopleRpc;
import com.docus.server.message.rpc.request.HisZyCyYzRequest;
import com.docus.server.message.rpc.response.HisZyCyYzResponse;
import com.docus.server.message.util.HttpUrlUtil;
import com.docus.server.message.util.IdUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.Map;
/**
*
* @author wyb
*/
@Slf4j
@Service
public class ShunDePeopleRpcImpl implements ShunDePeopleRpc {
@Override
public HisZyCyYzResponse hisZyCyYz(HisZyCyYzRequest request) {
ShunDePeopleInterfaceConfig.InterfaceConfig interfaceConfig = ShunDePeopleInterfaceConfig.getTaskConfig("HIS_ZY_CYYZ");
if(interfaceConfig==null){
log.warn("查询住院出院医嘱接口未配置!");
return null;
}
// 组织url
String standardUuId = IdUtil.standardUUID();
String timeMini = DateUtil.formatDateTimeMini(LocalDateTime.now());
Map<String, String> otherParam = interfaceConfig.getOtherParam();
otherParam.put("uuid",standardUuId);
otherParam.put("creationTime",timeMini);
String url = HttpUrlUtil.addUrlParam(interfaceConfig.getUrl(), otherParam);
try {
log.info("[{}]:查询住院出院医嘱接口地址:{}",standardUuId,url);
String resp = HttpUtil.post(url, JSON.toJSONString(request));
log.info("[{}]:查询住院出院医嘱接口返回值:{}",standardUuId,resp);
return JSON.parseObject(resp, new TypeReference<HisZyCyYzResponse>() {
});
}catch (Exception ex){
log.error("["+standardUuId+"]:"+"查询住院出院医嘱接口出错啦!===》"+ex.getMessage(),ex);
return null;
}
}
public static void main(String[] args) {
}
}

@ -0,0 +1,19 @@
package com.docus.server.message.rpc.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
*
*
* @author wyb
*/
@Data
@ApiModel("病人住院出院医嘱查询参数")
public class HisZyCyYzRequest {
@ApiModelProperty("住院号")
private String visitNo;
@ApiModelProperty("住院次数")
private String visitTimes;
}

@ -0,0 +1,209 @@
package com.docus.server.message.rpc.response;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.fastjson.annotation.JSONField;
import com.docus.server.message.rpc.dto.HisZyCyYzDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
*
* @author wyb
*/
@Data
@ApiModel("病人住院出院医嘱查询结果")
public class HisZyCyYzResponse {
@ApiModelProperty("")
@JSONField(name = "compcode")
private String compcode;
@ApiModelProperty("")
@JSONField(name = "compname")
private String compname;
@ApiModelProperty("结果编码")
@JSONField(name = "ResultCode")
private String ResultCode;
@ApiModelProperty("结果消息")
@JSONField(name = "ResultMessage")
private String ResultMessage;
@ApiModelProperty("数量")
@JSONField(name = "count")
private Integer count;
@ApiModelProperty("住院号")
@JSONField(name = "data")
private List<HisZyCyYzDTO> data;
public static void main(String[] args) {
String resp="{\n" +
"\"compcode\":\"HIS_ZY_CYYZ\",\n" +
"\"compname\":\"HIS住院出院医嘱查询服务\",\n" +
"\"count\":1,\n" +
"\"data\":[\n" +
"{\n" +
"\"global_pid\":263702,\n" +
"\"patient_id\":\"001153078900\",\n" +
"\"visitTimes\":3,\n" +
"\"visitNo\":\"10003188\",\n" +
"\"order_sn\":3.3725286E7,\n" +
"\"tel\":\"27753919\",\n" +
"\"social_code\":\"440606201702120263\",\n" +
"\"pat_name\":\"梁思颖\",\n" +
"\"sex\":\"2\",\n" +
"\"sex_name\":\"女性\",\n" +
"\"birthday\":\"2017-02-1200:00:00\",\n" +
"\"fileno\":\"-\",\n" +
"\"bedno\":\"51\",\n" +
"\"roomno\":null,\n" +
"\"group_type\":\"05\",\n" +
"\"group_name\":\"治疗处置医嘱\",\n" +
"\"dept_code\":\"07\",\n" +
"\"dept_code_name\":\"儿科\",\n" +
"\"ward_code\":\"B031101\",\n" +
"\"ward_code_name\":\"3号楼11楼病区\",\n" +
"\"order_dept_sn\":\"07\",\n" +
"\"order_dept_name\":\"儿科\",\n" +
"\"order_time\":\"2023-08-1710:28:35\",\n" +
"\"order_doctor\":\"1-503\",\n" +
"\"order_doctor_name\":\"陈小群\",\n" +
"\"confirm_time\":\"2023-08-1710:40:27\",\n" +
"\"confirm_opera_code\":\"1-503\",\n" +
"\"confirm_opera_name\":\"陈小群\",\n" +
"\"nurse_confirm_time\":\"2023-08-1710:41:54\",\n" +
"\"nurse_confirm_code\":\"2B129\",\n" +
"\"nurse_confirm_name\":\"吴假龄\",\n" +
"\"cancel_time\":null,\n" +
"\"cancel_doctor\":null,\n" +
"\"cancel_name\":null,\n" +
"\"stop_time\":\"2023-08-1712:00:02\",\n" +
"\"complete_stop_time\":\"2023-08-1710:41:54\",\n" +
"\"stop_name\":\"陈小群\",\n" +
"\"stop_opera\":\"1-503\",\n" +
"\"skin_test\":\"0\",\n" +
"\"skintest_result\":null,\n" +
"\"fit_flag\":\"0\",\n" +
"\"emergency_flag\":\"0\",\n" +
"\"medviewflag\":\"0\",\n" +
"\"order_code\":\"006204\",\n" +
"\"type_flag\":\"0\",\n" +
"\"order_name\":\"出院医嘱\",\n" +
"\"order_item_type\":\"s\",\n" +
"\"order_item_name\":\"出院医嘱\",\n" +
"\"order_status\":\"5\",\n" +
"\"status_name\":\"停止\",\n" +
"\"start_time\":\"2023-08-1712:00:00\",\n" +
"\"frequ_code\":\"ONCE\",\n" +
"\"frequ_name\":\"临时一次\",\n" +
"\"supply_code\":null,\n" +
"\"supply_name\":null,\n" +
"\"self_buy\":\"0\",\n" +
"\"doseage\":1.0,\n" +
"\"unit_name\":null,\n" +
"\"charge_amount\":1.0,\n" +
"\"unit_name1\":null,\n" +
"\"dosage_type\":null,\n" +
"\"dosage_name\":null,\n" +
"\"pack_sn\":\"**\",\n" +
"\"drugcode\":\"006204\",\n" +
"\"drugname\":\"出院医嘱\",\n" +
"\"drug_class\":null,\n" +
"\"drug_class_name\":null,\n" +
"\"drug_type\":null,\n" +
"\"drug_type_name\":null,\n" +
"\"order_long_id\":53,\n" +
"\"instruction\":null,\n" +
"\"exec_unit\":\"07\",\n" +
"\"exec_name\":\"儿科\",\n" +
"\"p_order_sn\":null,\n" +
"\"p_order_code\":\"006204\",\n" +
"\"p_order_type\":\"s\",\n" +
"\"p_order_type_name\":\"出院医嘱\",\n" +
"\"long_once_flag\":\"0\",\n" +
"\"long_once_name\":\"临时\",\n" +
"\"exclusive_type\":\"2\",\n" +
"\"exclusive_name\":\"全排斥\",\n" +
"\"exclu_order_sn\":null,\n" +
"\"orig_ward_code\":\"B031101\",\n" +
"\"orig_ward_name\":\"3号楼11楼病区\",\n" +
"\"order_description\":\"全排斥医嘱\",\n" +
"\"cm_item_num\":\"0\",\n" +
"\"hl_code\":\"0\",\n" +
"\"hl_name\":\"正常\",\n" +
"\"hl_type\":\"1\",\n" +
"\"huli_type_name\":\"常规\",\n" +
"\"fy_type\":\"0\",\n" +
"\"fy_type_name\":\"无\",\n" +
"\"charge_group\":null,\n" +
"\"charge_group_name\":null,\n" +
"\"muban_type\":\"3\",\n" +
"\"cfypzh\":\"\",\n" +
"\"zyjzf\":\"\",\n" +
"\"zyyyff\":\"\",\n" +
"\"zyypcf\":\"\",\n" +
"\"zyypjs\":\"\",\n" +
"\"yydays\":1,\n" +
"\"spec\":null,\n" +
"\"spec_name\":null,\n" +
"\"yb_type_code\":\"\",\n" +
"\"yb_type_name\":\"\",\n" +
"\"hcyz_type_code\":\"\",\n" +
"\"hcyz_type_name\":\"\",\n" +
"\"hcyz_no\":\"\",\n" +
"\"fee_type_code\":\"\",\n" +
"\"fee_type_status\":\"\",\n" +
"\"xzlhff_type_code\":\"\",\n" +
"\"xzlhff_type_name\":\"\",\n" +
"\"yzzt_code\":\"\",\n" +
"\"op_id\":null,\n" +
"\"back_status\":\"0\",\n" +
"\"back_status_name\":\"否\",\n" +
"\"abbr_name\":null,\n" +
"\"bihuan_order_type\":\"s\",\n" +
"\"bihuan_order_type_name\":\"出院医嘱\",\n" +
"\"caoyao_fu\":null,\n" +
"\"admiss_date\":\"2023-08-1109:24:34\",\n" +
"\"cps_order_sn\":null,\n" +
"\"cps_id\":null,\n" +
"\"cps_name\":null,\n" +
"\"BILLING_ATTR\":\"0\",\n" +
"\"LAST_PERFORM_DATE_TIME\":\"2023-08-1710:41:54\",\n" +
"\"LAST_ACCTING_DATE_TIME\":null,\n" +
"\"DRUG_DILLING_ATTR\":null,\n" +
"\"TREAT_SHEET_FLAG\":null,\n" +
"\"PHAM_STD_CODE\":\"\",\n" +
"\"AMOUNT\":1.0,\n" +
"\"CURRENT_PRESC_NO\":null,\n" +
"\"cy_supply_name\":null,\n" +
"\"ypxz\":null,\n" +
"\"ypxzmc\":null,\n" +
"\"zy_role\":null,\n" +
"\"poison_class\":null,\n" +
"\"kssbj\":null,\n" +
"\"dmbj\":null,\n" +
"\"yybj\":\"0\",\n" +
"\"ztbj\":null,\n" +
"\"drug_sub_class\":null,\n" +
"\"drug_sub_class_name\":null\n" +
"}\n" +
"],\n" +
"\"ResultCode\":\"0\",\n" +
"\"ResultMessage\":\"查询成功\"\n" +
"}";
HisZyCyYzResponse hisZyCyYzResponse = JSON.parseObject("resp", new TypeReference<HisZyCyYzResponse>() {
});
System.out.println(hisZyCyYzResponse);
}
}

@ -0,0 +1,54 @@
package com.docus.server.message.util;
import com.docus.core.util.Func;
import java.util.HashMap;
import java.util.Map;
/**
* http
*
* @author WYBDEV
*/
public class HttpUrlUtil {
/**
* url
*
* @param url url
* @param param
* @return url
*/
public static String addUrlParam(String url, Map<String, String> param) {
if (Func.isEmpty(param)) {
return url;
}
StringBuilder urlBuilder = new StringBuilder(url);
// url已经添加过参数的标记
String addFlag = "?";
// url 参数连接符号,如果没有添加过,连接符号置为空
String connect = "&";
if (!url.contains(addFlag)) {
urlBuilder.append("?");
connect = "";
}
for (Map.Entry<String, String> entry : param.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
urlBuilder.append(connect).append(key).append("=").append(value);
// 添加过参数,连接符置为&
connect = "&";
}
return urlBuilder.toString();
}
public static void main(String[] args) {
System.out.println(addUrlParam("http://www.baidu.com", null));
System.out.println(addUrlParam("http://www.baidu.com?word=1", null));
HashMap<String, String> stringStringHashMap = new HashMap<>();
stringStringHashMap.put("en","some");
System.out.println(addUrlParam("http://www.baidu.com", stringStringHashMap));
System.out.println(addUrlParam("http://www.baidu.com?word=1", stringStringHashMap));
}
}

@ -15,6 +15,11 @@
insert into `docus_medicalrecord`.`t_basic_extend` (patient_id,nurse_file_count) values (#{patientId},#{fileCount})
ON DUPLICATE KEY UPDATE nurse_file_count=#{fileCount}
</insert>
<update id="updateDisDateTime">
update `docus_medicalrecord`.`t_basic`
set `dis_date`=#{disDate}
where `patient_id`=#{patientId}
</update>
<select id="getPatientIdsByInpatientNoAndTimes" resultType="java.lang.String">

Loading…
Cancel
Save