package thyyxxk.webserver.controller.mz;

import com.alibaba.fastjson.JSONArray;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
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 thyyxxk.webserver.config.auth.PassToken;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.mz.MzEmrPatientData;
import thyyxxk.webserver.entity.mz.MzEmrPatientVo;
import thyyxxk.webserver.service.mz.MzEmrService;
import thyyxxk.webserver.utils.ResultVoUtil;

import java.util.List;

/**
 * @Description:门诊电子病历
 * @Author:lihong
 * @Date: 2023/10/18
 */
@Slf4j
@RestController
@RequestMapping("/mzEmr")
public class MzEmrController {
     @Autowired
     private MzEmrService service;

     @PassToken
     @GetMapping("/getMzEmrModel")
    public ResultVo<JSONArray> getMzEmrModel(){
      return ResultVoUtil.success(service.getMzEmrModel());
    }
    @PassToken
    @PostMapping("/queryMzEmrTree")
    public ResultVo<List<MzEmrPatientData>>  queryMzEmrTree(@RequestBody MzEmrPatientVo param){
          return ResultVoUtil.success(service.queryMzEmrTree(param));
    }

    @PassToken
    @PostMapping("/queryMzPatientInfo")
    public ResultVo<MzEmrPatientVo>  queryMzPatientInfo(@RequestBody MzEmrPatientVo param){
        return ResultVoUtil.success(service.queryMzPatientInfo(param));
    }
    @PassToken
    @PostMapping("/saveMzEmrModel")
    public ResultVo<String>  saveMzEmrModel(@RequestBody MzEmrPatientData param){
        return service.saveMzEmrModel(param);
    }

}
