//package com.yihu.wlyy.web.patient.prenatalInspector;
//
//import com.fasterxml.jackson.databind.ObjectMapper;
//import com.yihu.wlyy.entity.patient.prenatal.PrenatalInspectorPreCard;
//import com.yihu.wlyy.service.app.prenatalInspector.PrenatalInspectorPreCardService;
//import com.yihu.wlyy.web.BaseController;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.annotations.ApiParam;
//import org.json.JSONArray;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.http.MediaType;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.RequestParam;
//import org.springframework.web.bind.annotation.ResponseBody;
//
///**
// * Created by yeshijie on 2017/6/7.
// */
//@Controller
//@RequestMapping(value = "/patient/prenatalnspector", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
//@Api(description = "患者端-产检")
//public class PrenatalInspectorContoller extends BaseController{
//
//    @Autowired
//    private PrenatalInspectorPreCardService preCardService;
//
//    private ObjectMapper objectMapper = new ObjectMapper();
//
//    @ApiOperation("添加预建卡")
//    @RequestMapping(value = "addPreCard", method = RequestMethod.POST)
//    @ResponseBody
//    public String addPreCard(@ApiParam(name = "json", value = "预建卡数据json", defaultValue = "{ \"patient\":\"915cca0a-5b1d-11e6-8344-fa163e8aee56\", \"name\":\"杨幂\", \"ssc\":\"123654\", \"birthday\":\"1990-01-01\", \"mobile\":\"13559488741\", \"lastMenstrualDate\":\"2017-05-30\", \"allergyHistory\":\"xxx\", \"maritalStatus\":\"1\", \"residentialAddress\":\"软件园二期55号楼\", \"residentialProvince\":\"福建省\", \"residentialCity\":\"厦门市\", \"residentialTown\":\"思明区\", \"permanentAddress\":\"软件园二期55号楼\", \"permanentProvince\":\"福建省\", \"permanentCity\":\"厦门市\", \"permanentTown\":\"思明区\", \"marryDate\":\"2017-01-02\", \"spouseName\":\"张三\", \"spouseBirthday\":\"1990-01-01\", \"spouseMobile\":\"13698745211\", \"eatFolate\":\"0\", \"drink\":\"0\", \"eatOtherDrugs\":\"xxx\", \"workUnit\":\"健康之路\", \"height\":\"160\", \"weight\":\"55\", \"vaginalDeliveryTimes\":0, \"caesareanSectionTimes\":0, \"menarcheAge\":14, \"menstrualPeriod\":7, \"menstrualCycle\":30, \"diseaseHistory\":\"xxx\", \"operationHistory\":\"xxx\", \"otherInformation\":\"xxx\"}")
//                             @RequestParam(value = "json", required = true) String json){
//        try {
//            PrenatalInspectorPreCard preCard = objectMapper.readValue(json,PrenatalInspectorPreCard.class);
//
//            preCardService.addPrenatalInspectorPreCard(preCard);
//            return success("预建卡保存成功！");
//        }catch (Exception e){
//            error(e);
//            return error(-1,"保存失败");
//        }
//    }
//
//    @ApiOperation("预建卡列表-孕检计划")
//    @RequestMapping(value = "preCardList", method = RequestMethod.GET)
//    @ResponseBody
//    public String preCardList(){
//        try {
////            JSONArray jsonArray = preCardService.preCardList(getUID());
//            JSONArray jsonArray = preCardService.preCardList("915cca0a-5b1d-11e6-8344-fa163e8aee56");
//            return write(200, "查询成功！", "list", jsonArray);
//        }catch (Exception e){
//            error(e);
//            return error(-1,"查询失败");
//        }
//    }
//
//    @ApiOperation("待产检计划列表")
//    @RequestMapping(value = "planList", method = RequestMethod.GET)
//    @ResponseBody
//    public String planList(@ApiParam(name = "inspectionCode", value = "预建卡code", defaultValue ="1555c32c626343e7aaa62e9cf76c97f2")
//            @RequestParam(value = "inspectionCode", required = true) String inspectionCode){
//        try {
//            JSONArray jsonArray = preCardService.planList(inspectionCode);
//            preCardService.sendPrenatalInspectorRemind();
//            return write(200, "查询成功！", "list", jsonArray);
//        }catch (Exception e){
//            error(e);
//            return error(-1,"获取失败");
//        }
//    }
//
//
//}
