药品相关
This commit is contained in:
@@ -25,7 +25,9 @@ import com.core.common.utils.SecurityUtils;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.core.common.utils.poi.ExcelUtil;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.enums.AccountStatus;
|
||||
import com.openhis.common.enums.ApplicableScope;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.medication.domain.Medication;
|
||||
import com.openhis.medication.domain.MedicationDefinition;
|
||||
@@ -118,16 +120,6 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
e.setActiveFlag_enumText(EnumUtils.getInfoByValue(AccountStatus.class, e.getActiveFlag()));
|
||||
// 适用范围
|
||||
e.setDomainEnum_enumText(EnumUtils.getInfoByValue(ApplicableScope.class, e.getDomainEnum()));
|
||||
// 药品分类
|
||||
e.setCategoryCode_enumText(EnumUtils.getInfoByValue(ItemCategory.class, e.getCategoryCode()));
|
||||
// 是否皮试
|
||||
e.setSkinTestFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getSkinTestFlag()));
|
||||
// 是否为注射药物
|
||||
e.setInjectFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getInjectFlag()));
|
||||
// 是否限制使用
|
||||
e.setRestrictedFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getRestrictedFlag()));
|
||||
// 儿童用药标志
|
||||
e.setChildrenFlag_enumText(EnumUtils.getInfoByValue(Whether.class, e.getChildrenFlag()));
|
||||
});
|
||||
|
||||
// 返回【药品录列表DTO】分页
|
||||
@@ -135,9 +127,9 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑供应商信息
|
||||
* 编辑药品目录信息
|
||||
*
|
||||
* @param medicationManageUpDto 供应商信息
|
||||
* @param medicationManageUpDto 药品目录信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> editMedication(@Validated @RequestBody MedicationManageUpDto medicationManageUpDto) {
|
||||
@@ -222,9 +214,9 @@ public class MedicationManageAppServiceImpl implements IMedicationManageAppServi
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加供应商信息
|
||||
* 添加药品目录信息
|
||||
*
|
||||
* @param medicationManageUpDto 供应商信息
|
||||
* @param medicationManageUpDto 药品目录信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> addMedication(@Validated @RequestBody MedicationManageUpDto medicationManageUpDto) {
|
||||
|
||||
@@ -117,7 +117,7 @@ public class DeviceManageController {
|
||||
* @param id 器材ID
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/information-one/{id}")
|
||||
@GetMapping("/information-one")
|
||||
public R<?> getDeviceOne(@PathVariable("id") Long id) {
|
||||
|
||||
return deviceManageAppService.getDeviceOne(id);
|
||||
|
||||
@@ -157,7 +157,7 @@ public class DiagnosisTreatmentController {
|
||||
* @param id 诊疗ID
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/information-one/{id}")
|
||||
@GetMapping("/information-one")
|
||||
public R<?> getDiseaseTreatmentOne(@PathVariable("id") Long id) {
|
||||
DiagnosisTreatmentDto diagnosisTreatmentDto = new DiagnosisTreatmentDto();
|
||||
// 根据ID查询【诊疗目录】
|
||||
|
||||
@@ -101,7 +101,7 @@ public class DiseaseManageController {
|
||||
* @param id 疾病ID
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/information-one/{id}")
|
||||
@GetMapping("/information-one")
|
||||
public R<?> getDiseaseOne(@PathVariable("id") Long id) {
|
||||
DiseaseManageDto diseaseManageDto = new DiseaseManageDto();
|
||||
// 根据ID查询【病种目录】
|
||||
|
||||
@@ -28,10 +28,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@AllArgsConstructor
|
||||
public class MedicationManageController {
|
||||
|
||||
// private final IMedicationDefinitionService iMedicationDefinitionService;
|
||||
// private final IMedicationService iMedicationService;
|
||||
// private final MedicationManageSearchMapper medicationManageSearchMapper;
|
||||
|
||||
@Autowired
|
||||
private IMedicationManageAppService medicationManageAppService;
|
||||
|
||||
@@ -42,16 +38,7 @@ public class MedicationManageController {
|
||||
*/
|
||||
@GetMapping("/information-init")
|
||||
public R<?> getMedicationInit() {
|
||||
|
||||
return medicationManageAppService.getMedicationInit();
|
||||
|
||||
// MedicationManageInitDto medicationManageInitDto = new MedicationManageInitDto();
|
||||
// // 获取状态
|
||||
// List<MedicationManageInitDto.statusEnumOption> statusEnumOptions = Stream.of(PublicationStatus.values())
|
||||
// .map(status -> new MedicationManageInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
// .collect(Collectors.toList());
|
||||
// medicationManageInitDto.setStatusFlagOptions(statusEnumOptions);
|
||||
// return R.ok(medicationManageInitDto);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -72,25 +59,8 @@ public class MedicationManageController {
|
||||
@RequestParam(value = "categoryCode", defaultValue = "") String categoryCode,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
return medicationManageAppService.getMedicationList(searchKey, ybMatchFlag, statusEnum, categoryCode, pageNo,
|
||||
pageSize, request);
|
||||
|
||||
// // 分页设置
|
||||
// Integer offset = (pageNo - 1) * pageSize;
|
||||
// // 获取租户ID
|
||||
// Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||
// // 查询药品目录列表
|
||||
// List<MedicationManageDto> medicationDetailList = medicationManageSearchMapper.getPage(searchKey, ybMatchFlag,
|
||||
// statusEnum, categoryCode, tenantId, pageSize, offset);
|
||||
// // 查询总记录数
|
||||
// long total =
|
||||
// medicationManageSearchMapper.getPageCount(searchKey, ybMatchFlag, statusEnum, categoryCode, tenantId);
|
||||
// // 创建Page对象并设置属性
|
||||
// Page<MedicationManageDto> medicationManageDtoPage = new Page<>(pageNo, pageSize, total);
|
||||
// medicationManageDtoPage.setRecords(medicationDetailList);
|
||||
// // 返回【药品录列表DTO】分页
|
||||
// return R.ok(medicationManageDtoPage);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -99,39 +69,15 @@ public class MedicationManageController {
|
||||
* @param id 药品ID
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/information-one/{id}")
|
||||
@GetMapping("/information-one")
|
||||
public R<?> getMedicationOne(@PathVariable("id") Long id) {
|
||||
|
||||
return medicationManageAppService.getMedicationOne(id);
|
||||
|
||||
// // 获取租户ID
|
||||
// Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||
// // 查询药品目录列表
|
||||
// MedicationManageDto medicationManageDto = medicationManageSearchMapper.getOne(id, tenantId);
|
||||
// // 返回【药品录列表DTO】列表
|
||||
// return R.ok(medicationManageDto);
|
||||
}
|
||||
|
||||
// 药品目录编辑
|
||||
@PutMapping("/information")
|
||||
public R<?> editMedication(@RequestBody MedicationManageUpDto medicationManageUpDto) {
|
||||
|
||||
return medicationManageAppService.editMedication(medicationManageUpDto);
|
||||
|
||||
// MedicationDefinition medicationDefinition = new MedicationDefinition();
|
||||
// Medication medication = new Medication();
|
||||
// BeanUtils.copyProperties(medicationManageUpDto, medication); // 子表信息
|
||||
// BeanUtils.copyProperties(medicationManageUpDto, medicationDefinition);// 主表信息
|
||||
//
|
||||
// // 更新子表药品信息
|
||||
// if (iMedicationService.updateById(medication)) {
|
||||
// // 更新主表药品信息
|
||||
// return iMedicationDefinitionService.updateById(medicationDefinition)
|
||||
// ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
||||
// : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
// } else {
|
||||
// return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -142,19 +88,6 @@ public class MedicationManageController {
|
||||
*/
|
||||
@PutMapping("/information-stop")
|
||||
public R<?> editMedicationStop(@RequestBody List<Long> ids) {
|
||||
// List<Medication> medicationList = new ArrayList<>();
|
||||
// // 取得更新值
|
||||
// for (Long detail : ids) {
|
||||
// Medication medication = new Medication();
|
||||
// medication.setId(detail);
|
||||
// medication.setStatusEnum(PublicationStatus.RETIRED);
|
||||
// medicationList.add(medication);
|
||||
// }
|
||||
// // 更新药品信息
|
||||
// return iMedicationService.updateBatchById(medicationList)
|
||||
// ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
||||
// : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
|
||||
return medicationManageAppService.editMedicationStop(ids);
|
||||
}
|
||||
|
||||
@@ -166,20 +99,7 @@ public class MedicationManageController {
|
||||
*/
|
||||
@PutMapping("/information-start")
|
||||
public R<?> editMedicationStart(@RequestBody List<Long> ids) {
|
||||
|
||||
return medicationManageAppService.editMedicationStart(ids);
|
||||
// List<Medication> medicationList = new ArrayList<>();
|
||||
// // 取得更新值
|
||||
// for (Long detail : ids) {
|
||||
// Medication medication = new Medication();
|
||||
// medication.setId(detail);
|
||||
// medication.setStatusEnum(PublicationStatus.ACTIVE);
|
||||
// medicationList.add(medication);
|
||||
// }
|
||||
// // 更新药品信息
|
||||
// return iMedicationService.updateBatchById(medicationList)
|
||||
// ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
||||
// : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -190,20 +110,7 @@ public class MedicationManageController {
|
||||
*/
|
||||
@PostMapping("/information")
|
||||
public R<?> addMedication(@Validated @RequestBody MedicationManageUpDto medicationManageUpDto) {
|
||||
|
||||
return medicationManageAppService.addMedication(medicationManageUpDto);
|
||||
|
||||
// MedicationDetail medicationDetail = new MedicationDetail();
|
||||
// BeanUtils.copyProperties(medicationManageUpDto, medicationDetail);
|
||||
// // 新增主表外来药品目录
|
||||
// if (iMedicationDefinitionService.addMedication(medicationDetail)) {
|
||||
// // 新增子表外来药品目录
|
||||
// return iMedicationService.addMedication(medicationDetail)
|
||||
// ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[] {"药品目录"}))
|
||||
// : R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
// } else {
|
||||
// return R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00008, null));
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -232,15 +139,6 @@ public class MedicationManageController {
|
||||
@RequestParam(value = "ybMatchFlag", defaultValue = "-1") Integer ybMatchFlag,
|
||||
@RequestParam(value = "statusEnum", defaultValue = "-1") Integer statusEnum,
|
||||
@RequestParam(value = "categoryCode", defaultValue = "") String categoryCode, HttpServletResponse response) {
|
||||
|
||||
return medicationManageAppService.exportMedication(searchKey, ybMatchFlag, statusEnum, categoryCode, response);
|
||||
|
||||
// // 获取租户ID
|
||||
// Integer tenantId = SecurityUtils.getLoginUser().getTenantId();
|
||||
// List<MedicationManageDto> list =
|
||||
// medicationManageSearchMapper.getList(searchKey, ybMatchFlag, statusEnum, categoryCode, tenantId);
|
||||
// ExcelUtil<MedicationManageDto> util = new ExcelUtil<>(MedicationManageDto.class);
|
||||
// util.exportExcel(response, list, "药品目录");
|
||||
// return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
import com.openhis.common.enums.PublicationStatus;
|
||||
|
||||
import lombok.Data;
|
||||
@@ -99,8 +100,8 @@ public class MedicationManageDto {
|
||||
private String wbStr;
|
||||
|
||||
/** 药品分类 */
|
||||
@Dict(dictCode = "medicine_category")
|
||||
private Integer categoryCode;
|
||||
private String categoryCode_enumText;
|
||||
|
||||
/** 商品名称 */
|
||||
private String merchandiseName;
|
||||
@@ -142,12 +143,12 @@ public class MedicationManageDto {
|
||||
private String pharmacologyCategoryCode;
|
||||
|
||||
/** 是否皮试 */
|
||||
@Dict(dictCode = "sys_yes_no")
|
||||
private Integer skinTestFlag;
|
||||
private String skinTestFlag_enumText;
|
||||
|
||||
/** 是否为注射药物 */
|
||||
@Dict(dictCode = "sys_yes_no")
|
||||
private Integer injectFlag;
|
||||
private String injectFlag_enumText;
|
||||
|
||||
/** 生产厂家 */
|
||||
private Long manufacturerId;
|
||||
@@ -156,15 +157,15 @@ public class MedicationManageDto {
|
||||
private Long supplyId;
|
||||
|
||||
/** 是否限制使用 */
|
||||
@Dict(dictCode = "sys_yes_no")
|
||||
private Integer restrictedFlag;
|
||||
private String restrictedFlag_enumText;
|
||||
|
||||
/** 限制使用范围 */
|
||||
private String restrictedScope;
|
||||
|
||||
/** 儿童用药标志 */
|
||||
@Dict(dictCode = "sys_yes_no")
|
||||
private Integer childrenFlag;
|
||||
private String childrenFlag_enumText;
|
||||
|
||||
/** 产品特性 */
|
||||
private Integer characteristic;
|
||||
|
||||
@@ -80,4 +80,16 @@ public class Medication extends HisBaseEntity {
|
||||
/** 药品定义 */
|
||||
private String definition;
|
||||
|
||||
/** 删除状态 */
|
||||
private String deleteFlag;
|
||||
|
||||
/** 用量限定 */
|
||||
private BigDecimal usageLimit;
|
||||
|
||||
/** DDD值 */
|
||||
private String dddCode;
|
||||
|
||||
/** DDD单位 */
|
||||
private String dddUnitCode;
|
||||
|
||||
}
|
||||
@@ -108,9 +108,18 @@ public class MedicationDefinition extends HisBaseEntity {
|
||||
/** 限制使用范围 */
|
||||
private String restrictedScope;
|
||||
|
||||
/** 是否使用 */
|
||||
private Integer activeFlag;
|
||||
|
||||
/** 儿童用药标志 */
|
||||
private Integer childrenFlag;
|
||||
|
||||
/** 产品特性 */
|
||||
private Integer characteristic;
|
||||
|
||||
/** 删除状态 */
|
||||
private String deleteFlag;
|
||||
|
||||
/** 最小库存警戒数量(常规单位) */
|
||||
private BigDecimal itemMinQuantity;
|
||||
|
||||
@@ -123,4 +132,25 @@ public class MedicationDefinition extends HisBaseEntity {
|
||||
/** 默认住院单位 */
|
||||
private String defInhospitalUnitCode;
|
||||
|
||||
/** 贯标国家编码 */
|
||||
private String nationalDrugCode;
|
||||
|
||||
/** 拆分属性 */
|
||||
private String partAttribute;
|
||||
|
||||
/** 抗生素分类 */
|
||||
private String antibioticCode;
|
||||
|
||||
/** 权限限制 */
|
||||
private Integer restrictedEnum;
|
||||
|
||||
/** 是否自制 */
|
||||
private Integer selfFlag;
|
||||
|
||||
/** 是否抗生素 */
|
||||
private Integer antibioticFlag;
|
||||
|
||||
/** 基药标识 */
|
||||
private Integer basicFlag;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user