package com.diagbot.web;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.diagbot.annotation.SysLogger;
import com.diagbot.dto.MedRecordContentOtherDTO;
import com.diagbot.dto.RespDTO;
import com.diagbot.entity.MedicalRecord;
import com.diagbot.facade.MedicalRecordOtherFacade;
import com.diagbot.vo.MedRecordContentOtherVO;
import com.diagbot.vo.MedRecordOtherVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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 javax.validation.Valid;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author Wsy
 * @since 2022-03-09
 */
@RestController
@RequestMapping("/qc/medRecordOther")
@Api(value = "病历详情其他信息API", tags = {"病历详情其他信息API"})
public class MedRecordOtherController {
    @Autowired
    private MedicalRecordOtherFacade medicalRecordOtherFacade;

    @ApiOperation(value = "病历详情其他信息总览",
            notes = "behospitalCode：病人住院序号<br>" +
                    "recTitle：病历标题<br>" +
                    "recDateStart：创建开始时间<br>" +
                    "recDateEnd：创建结束时间")
    @PostMapping("/getMedRecordOtherPage")
    @SysLogger("getMedRecordOtherPage")
    public RespDTO<IPage<MedicalRecord>> getMedRecordOtherPage(@RequestBody @Valid MedRecordOtherVO medRecordOtherVO) {
        IPage<MedicalRecord> dataIPage = medicalRecordOtherFacade.pageFac(medRecordOtherVO);
        return RespDTO.onSuc(dataIPage);
    }


    @ApiOperation(value = "文书内容展示（HTML）",
            notes = "recID：病历id<br>")
    @PostMapping("/getMedRecordContentOther")
    @SysLogger("getMedRecordContentOther")
    public RespDTO<MedRecordContentOtherDTO> getMedRecordContentOther(@RequestBody MedRecordContentOtherVO medRecordContentOtherVO) {
        return RespDTO.onSuc(medicalRecordOtherFacade.getRecordContentOther(medRecordContentOtherVO));
    }

}
