瀏覽代碼

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

huangwenjie 7 年之前
父節點
當前提交
ca2f3c2551

+ 287 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/PrenatalInspectorController.java

@ -0,0 +1,287 @@
package com.yihu.wlyy.service.controller;
import com.yihu.wlyy.service.common.model.Result;
import com.yihu.wlyy.service.service.ZysoftMaternalService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
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.RestController;
/**
 * Created by yeshijie on 2017/9/22.
 */
@RestController
@RequestMapping(value = "/third/prescription/")
@Api(description = "产检接口")
public class PrenatalInspectorController extends BaseController{
    @Autowired
    private ZysoftMaternalService maternalService;
    @RequestMapping(value = "getEhrMaternalFirstExamRecord",method = RequestMethod.POST)
    @ApiOperation("获取孕妇建卡信息")
    public Result getEhrMaternalFirstExamRecord(@ApiParam(name="idcard",value="身份证号",defaultValue = "352124761015122")
                                                @RequestParam(value = "idcard",required = true) String idcard,
                                                @ApiParam(name="hospital",value="医院code",defaultValue = "3502030500")
                                                @RequestParam(value = "hospital",required = true) String hospital) throws Exception
    {
        try {
            String re = maternalService.getEhrMaternalFirstExamRecord(idcard,hospital);
            return Result.success("获取孕妇建卡信息成功!",re);
        } catch (Exception ex) {
            ex.printStackTrace();
            return Result.error(ex.getMessage());
        }
    }
    @RequestMapping(value = "getEhrMaternalReExamRecord",method = RequestMethod.POST)
    @ApiOperation("获取非第一次产检记录")
    public Result getEhrMaternalReExamRecord(@ApiParam(name="idcard",value="身份证号",defaultValue = "352124761015122")
                                             @RequestParam(value = "idcard",required = true) String idcard,
                                             @ApiParam(name="hospital",value="医院code",defaultValue = "3502030500")
                                             @RequestParam(value = "hospital",required = true) String hospital) throws Exception{
        try {
            String re = maternalService.getEhrMaternalReExamRecord(idcard,hospital);
            return Result.success("获取非第一次产检记录成功!",re);
        } catch (Exception ex) {
            ex.printStackTrace();
            return Result.error(ex.getMessage());
        }
    }
    @RequestMapping(value = "getEhrMaternalBedPrecontractRecord",method = RequestMethod.POST)
    @ApiOperation("获取产床预约信息")
    public Result getEhrMaternalBedPrecontractRecord(@ApiParam(name="idcard",value="身份证号",defaultValue = "352124761015122")
                                                     @RequestParam(value = "idcard",required = true) String idcard,
                                                     @ApiParam(name="hospital",value="医院code",defaultValue = "3502030500")
                                                     @RequestParam(value = "hospital",required = true) String hospital) throws Exception{
        try {
            String re = maternalService.getEhrMaternalBedPrecontractRecord(idcard,hospital);
            return Result.success("获取产床预约信息成功!",re);
        } catch (Exception ex) {
            ex.printStackTrace();
            return Result.error(ex.getMessage());
        }
    }
    @RequestMapping(value = "getEhrMaternalPregnancyHighRecord",method = RequestMethod.POST)
    @ApiOperation("获取高危产妇信息")
    public Result getEhrMaternalPregnancyHighRecord(@ApiParam(name="idcard",value="身份证号",defaultValue = "352124761015122")
                                                        @RequestParam(value = "idcard",required = true) String idcard,
                                                    @ApiParam(name="hospital",value="医院code",defaultValue = "3502030500")
                                                        @RequestParam(value = "hospital",required = true) String hospital) throws Exception{
        try {
            String re = maternalService.getEhrMaternalPregnancyHighRecord(idcard,hospital);
            return Result.success("获取高危产妇信息成功!",re);
        } catch (Exception ex) {
            ex.printStackTrace();
            return Result.error(ex.getMessage());
        }
    }
    @RequestMapping(value = "getEhrMaternalDeliveryRecord",method = RequestMethod.POST)
    @ApiOperation("获取孕妇分娩信息")
    public Result getEhrMaternalDeliveryRecord(@ApiParam(name="idcard",value="身份证号",defaultValue = "352124761015122")
                                                   @RequestParam(value = "idcard",required = true) String idcard,
                                               @ApiParam(name="hospital",value="医院code",defaultValue = "3502030500")
                                                   @RequestParam(value = "hospital",required = true) String hospital) throws Exception{
        try {
            String re = maternalService.getEhrMaternalDeliveryRecord(idcard,hospital);
            return Result.success("获取孕妇分娩信息成功!",re);
        } catch (Exception ex) {
            ex.printStackTrace();
            return Result.error(ex.getMessage());
        }
    }
    @RequestMapping(value = "getEhrMaternalDeliveryChildRecord",method = RequestMethod.POST)
    @ApiOperation("获取新生儿基本信息")
    public Result getEhrMaternalDeliveryChildRecord(@ApiParam(name="idcard",value="身份证号",defaultValue = "352124761015122")
                                                        @RequestParam(value = "idcard",required = true) String idcard,
                                                    @ApiParam(name="hospital",value="医院code",defaultValue = "3502030500")
                                                        @RequestParam(value = "hospital",required = true) String hospital) throws Exception{
        try {
            String re = maternalService.getEhrMaternalDeliveryChildRecord(idcard,hospital);
            return Result.success("获取新生儿基本信息成功!",re);
        } catch (Exception ex) {
            ex.printStackTrace();
            return Result.error(ex.getMessage());
        }
    }
    @RequestMapping(value = "getEhrMaternalChildMedicalRecord",method = RequestMethod.POST)
    @ApiOperation("获取儿童健康体检0-6岁记录")
    public Result getEhrMaternalChildMedicalRecord(@ApiParam(name="idcard",value="身份证号",defaultValue = "352124761015122")
                                                       @RequestParam(value = "idcard",required = true) String idcard,
                                                   @ApiParam(name="hospital",value="医院code",defaultValue = "3502030500")
                                                       @RequestParam(value = "hospital",required = true) String hospital) throws Exception{
        try {
            String re = maternalService.getEhrMaternalChildMedicalRecord(idcard,hospital);
            return Result.success("获取儿童健康体检0-6岁记录成功!",re);
        } catch (Exception ex) {
            ex.printStackTrace();
            return Result.error(ex.getMessage());
        }
    }
    @RequestMapping(value = "getEhrMaternalHomeVisitRecord",method = RequestMethod.POST)
    @ApiOperation("获取新生儿访视信息")
    public Result getEhrMaternalHomeVisitRecord(@ApiParam(name="idcard",value="身份证号",defaultValue = "352124761015122")
                                                    @RequestParam(value = "idcard",required = true) String idcard,
                                                @ApiParam(name="hospital",value="医院code",defaultValue = "3502030500")
                                                    @RequestParam(value = "hospital",required = true) String hospital) throws Exception{
        try {
            String re = maternalService.getEhrMaternalHomeVisitRecord(idcard,hospital);
            return Result.success("获取新生儿访视信息成功!",re);
        } catch (Exception ex) {
            ex.printStackTrace();
            return Result.error(ex.getMessage());
        }
    }
    @RequestMapping(value = "getEhrMaternalChildImmuneRecord",method = RequestMethod.POST)
    @ApiOperation("获取新生儿免疫记录")
    public Result getEhrMaternalChildImmuneRecord(@ApiParam(name="idcard",value="身份证号",defaultValue = "352124761015122")
                                                      @RequestParam(value = "idcard",required = true) String idcard,
                                                  @ApiParam(name="hospital",value="医院code",defaultValue = "3502030500")
                                                      @RequestParam(value = "hospital",required = true) String hospital) throws Exception{
        try {
            String re = maternalService.getEhrMaternalChildImmuneRecord(idcard,hospital);
            return Result.success("获取新生儿免疫记录成功!",re);
        } catch (Exception ex) {
            ex.printStackTrace();
            return Result.error(ex.getMessage());
        }
    }
    @RequestMapping(value = "getEhrMaternalPreFirstExamRecord",method = RequestMethod.POST)
    @ApiOperation("获取孕妇预建卡信息")
    public Result getEhrMaternalPreFirstExamRecord(@ApiParam(name="idcard",value="身份证号",defaultValue = "352124761015122")
                                                       @RequestParam(value = "idcard",required = true) String idcard,
                                                   @ApiParam(name="hospital",value="医院code",defaultValue = "3502030500")
                                                       @RequestParam(value = "hospital",required = true) String hospital) throws Exception{
        try {
            String re = maternalService.getEhrMaternalPreFirstExamRecord(idcard,hospital);
            return Result.success("获取孕妇预建卡信息成功!",re);
        } catch (Exception ex) {
            ex.printStackTrace();
            return Result.error(ex.getMessage());
        }
    }
    @RequestMapping(value = "SaveEhrMaternalPreFirstExamRecord",method = RequestMethod.POST)
    @ApiOperation("上传孕妇预建卡信息")
    public Result SaveEhrMaternalPreFirstExamRecord(@ApiParam(name="code",value="预建卡code",defaultValue = "352124761015122")
                                                        @RequestParam(value = "code",required = true) String code) throws Exception{
        try {
            String re = maternalService.SaveEhrMaternalPreFirstExamRecord(code);
            return Result.success("上传孕妇预建卡信息成功!",re);
        } catch (Exception ex) {
            ex.printStackTrace();
            return Result.error(ex.getMessage());
        }
    }
    @RequestMapping(value = "SaveEhrMaternalHomeVisitRecord",method = RequestMethod.POST)
    @ApiOperation("上传新生儿访视信息")
    public Result SaveEhrMaternalHomeVisitRecord(@ApiParam(name="idcard",value="身份证号",defaultValue = "352124761015122")
                                                     @RequestParam(value = "idcard",required = true) String idcard,
                                                 @ApiParam(name="hospital",value="医院code",defaultValue = "3502030500")
                                                     @RequestParam(value = "hospital",required = true) String hospital) throws Exception{
        try {
            String re = maternalService.SaveEhrMaternalHomeVisitRecord(idcard,hospital);
            return Result.success("上传新生儿访视信息成功!",re);
        } catch (Exception ex) {
            ex.printStackTrace();
            return Result.error(ex.getMessage());
        }
    }
    @RequestMapping(value = "getEhrMaternalZSPreDeliveryRecord",method = RequestMethod.POST)
    @ApiOperation("获取待产记录")
    public Result getEhrMaternalZSPreDeliveryRecord(@ApiParam(name="idcard",value="身份证号",defaultValue = "352124761015122")
                                                        @RequestParam(value = "idcard",required = true) String idcard,
                                                    @ApiParam(name="hospital",value="医院code",defaultValue = "3502030500")
                                                        @RequestParam(value = "hospital",required = true) String hospital,
                                                    @ApiParam(name="searchTime",value="查询时间")
                                                        @RequestParam(value = "searchTime",required = false) String searchTime) throws Exception{
        try {
            String re = maternalService.getEhrMaternalZSPreDeliveryRecord(idcard,hospital,searchTime);
            return Result.success("获取待产记录成功!",re);
        } catch (Exception ex) {
            ex.printStackTrace();
            return Result.error(ex.getMessage());
        }
    }
    @RequestMapping(value = "getEhrMaternalZSDeliveryRecord",method = RequestMethod.POST)
    @ApiOperation("获取阴道分娩记录")
    public Result getEhrMaternalZSDeliveryRecord(@ApiParam(name="idcard",value="身份证号",defaultValue = "352124761015122")
                                                     @RequestParam(value = "idcard",required = true) String idcard,
                                                 @ApiParam(name="hospital",value="医院code",defaultValue = "3502030500")
                                                     @RequestParam(value = "hospital",required = true) String hospital,
                                                 @ApiParam(name="searchTime",value="查询时间")
                                                     @RequestParam(value = "searchTime",required = false) String searchTime) throws Exception{
        try {
            String re = maternalService.getEhrMaternalZSDeliveryRecord(idcard,hospital,searchTime);
            return Result.success("获取阴道分娩记录成功!",re);
        } catch (Exception ex) {
            ex.printStackTrace();
            return Result.error(ex.getMessage());
        }
    }
    @RequestMapping(value = "getEhrMaternalZSCaesareanBirthRecord",method = RequestMethod.POST)
    @ApiOperation("获取剖宫产记录")
    public Result getEhrMaternalZSCaesareanBirthRecord(@ApiParam(name="idcard",value="身份证号",defaultValue = "352124761015122")
                                                           @RequestParam(value = "idcard",required = true) String idcard,
                                                       @ApiParam(name="hospital",value="医院code",defaultValue = "3502030500")
                                                           @RequestParam(value = "hospital",required = true) String hospital,
                                                       @ApiParam(name="searchTime",value="查询时间")
                                                           @RequestParam(value = "searchTime",required = false) String searchTime) throws Exception{
        try {
            String re = maternalService.getEhrMaternalZSCaesareanBirthRecord(idcard,hospital,searchTime);
            return Result.success("获取剖宫产记录成功!",re);
        } catch (Exception ex) {
            ex.printStackTrace();
            return Result.error(ex.getMessage());
        }
    }
}

+ 91 - 71
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/ZysoftMaternalService.java

@ -17,8 +17,12 @@ public class ZysoftMaternalService extends ZysoftBaseService{
    /**
     * 7.32获取孕妇建卡信息(妇幼保健)
     */
    public String getEhrMaternalFirstExamRecord(String idcard,String searchTime,String hospital,String licence) throws Exception
    public String getEhrMaternalFirstExamRecord(String idcard,String hospitalCode) throws Exception
    {
        String[] hospitalMapping = getHospitalMapping(hospitalCode); //获取机构映射
        String hospital = hospitalMapping[0];
        String licence = hospitalMapping[1];
        Map<String,String> header = new HashMap<>();
        header.put("ORGCODE",hospital);
        header.put("LICENCE",licence);
@ -26,7 +30,6 @@ public class ZysoftMaternalService extends ZysoftBaseService{
        Map<String,String> params = new HashMap<>();
        params.put("ORG_CODE",hospital);
        params.put("IDENTITY_CARD_NO",idcard);
        params.put("SEARCH_TIME",searchTime);
        String response = postSecond("getEhrMaternalFirstExamRecord","获取孕妇建卡信息",params,null,header,false,1);
@ -36,13 +39,16 @@ public class ZysoftMaternalService extends ZysoftBaseService{
    /**
     * 7.33 获取非第一次产检记录
     * @param idcard
     * @param searchTime
     * @param hospital
     * @param licence
     * @param hospitalCode
     * @return
     * @throws Exception
     */
    public String getEhrMaternalReExamRecord(String idcard,String searchTime,String hospital,String licence) throws Exception{
    public String getEhrMaternalReExamRecord(String idcard,String hospitalCode) throws Exception{
        String[] hospitalMapping = getHospitalMapping(hospitalCode); //获取机构映射
        String hospital = hospitalMapping[0];
        String licence = hospitalMapping[1];
        Map<String,String> header = new HashMap<>();
        header.put("ORGCODE",hospital);
        header.put("LICENCE",licence);
@ -50,7 +56,6 @@ public class ZysoftMaternalService extends ZysoftBaseService{
        Map<String,String> params = new HashMap<>();
        params.put("ORG_CODE",hospital);
        params.put("IDENTITY_CARD_NO",idcard);
        params.put("SEARCH_TIME",searchTime);
        String response = postSecond("getEhrMaternalReExamRecord","获取非第一次产检记录",params,null,header,false,1);
@ -60,13 +65,15 @@ public class ZysoftMaternalService extends ZysoftBaseService{
    /**
     * 7.34 获取产床预约信息
     * @param idcard
     * @param searchTime
     * @param hospital
     * @param licence
     * @param hospitalCode
     * @return
     * @throws Exception
     */
    public String getEhrMaternalBedPrecontractRecord(String idcard,String searchTime,String hospital,String licence) throws Exception{
    public String getEhrMaternalBedPrecontractRecord(String idcard,String hospitalCode) throws Exception{
        String[] hospitalMapping = getHospitalMapping(hospitalCode); //获取机构映射
        String hospital = hospitalMapping[0];
        String licence = hospitalMapping[1];
        Map<String,String> header = new HashMap<>();
        header.put("ORGCODE",hospital);
        header.put("LICENCE",licence);
@ -74,7 +81,6 @@ public class ZysoftMaternalService extends ZysoftBaseService{
        Map<String,String> params = new HashMap<>();
        params.put("ORG_CODE",hospital);
        params.put("IDENTITY_CARD_NO",idcard);
        params.put("SEARCH_TIME",searchTime);
        String response = postSecond("getEhrMaternalBedPrecontractRecord","获取产床预约信息",params,null,header,false,1);
@ -84,13 +90,15 @@ public class ZysoftMaternalService extends ZysoftBaseService{
    /**
     * 7.35 获取高危产妇信息
     * @param idcard
     * @param searchTime
     * @param hospital
     * @param licence
     * @param hospitalCode
     * @return
     * @throws Exception
     */
    public String getEhrMaternalPregnancyHighRecord(String idcard,String searchTime,String hospital,String licence) throws Exception{
    public String getEhrMaternalPregnancyHighRecord(String idcard,String hospitalCode) throws Exception{
        String[] hospitalMapping = getHospitalMapping(hospitalCode); //获取机构映射
        String hospital = hospitalMapping[0];
        String licence = hospitalMapping[1];
        Map<String,String> header = new HashMap<>();
        header.put("ORGCODE",hospital);
        header.put("LICENCE",licence);
@ -98,7 +106,6 @@ public class ZysoftMaternalService extends ZysoftBaseService{
        Map<String,String> params = new HashMap<>();
        params.put("ORG_CODE",hospital);
        params.put("IDENTITY_CARD_NO",idcard);
        params.put("SEARCH_TIME",searchTime);
        String response = postSecond("getEhrMaternalPregnancyHighRecord","获取高危产妇信息",params,null,header,false,1);
@ -108,13 +115,15 @@ public class ZysoftMaternalService extends ZysoftBaseService{
    /**
     * 7.36 获取孕妇分娩信息
     * @param idcard
     * @param searchTime
     * @param hospital
     * @param licence
     * @param hospitalCode
     * @return
     * @throws Exception
     */
    public String getEhrMaternalDeliveryRecord(String idcard,String searchTime,String hospital,String licence) throws Exception{
    public String getEhrMaternalDeliveryRecord(String idcard,String hospitalCode) throws Exception{
        String[] hospitalMapping = getHospitalMapping(hospitalCode); //获取机构映射
        String hospital = hospitalMapping[0];
        String licence = hospitalMapping[1];
        Map<String,String> header = new HashMap<>();
        header.put("ORGCODE",hospital);
        header.put("LICENCE",licence);
@ -122,7 +131,6 @@ public class ZysoftMaternalService extends ZysoftBaseService{
        Map<String,String> params = new HashMap<>();
        params.put("ORG_CODE",hospital);
        params.put("IDENTITY_CARD_NO",idcard);
        params.put("SEARCH_TIME",searchTime);
        String response = postSecond("getEhrMaternalDeliveryRecord","获取孕妇分娩信息",params,null,header,false,1);
@ -132,13 +140,15 @@ public class ZysoftMaternalService extends ZysoftBaseService{
    /**
     * 7.37 获取新生儿基本信息
     * @param idcard
     * @param searchTime
     * @param hospital
     * @param licence
     * @param hospitalCode
     * @return
     * @throws Exception
     */
    public String getEhrMaternalDeliveryChildRecord(String idcard,String searchTime,String hospital,String licence) throws Exception{
    public String getEhrMaternalDeliveryChildRecord(String idcard,String hospitalCode) throws Exception{
        String[] hospitalMapping = getHospitalMapping(hospitalCode); //获取机构映射
        String hospital = hospitalMapping[0];
        String licence = hospitalMapping[1];
        Map<String,String> header = new HashMap<>();
        header.put("ORGCODE",hospital);
        header.put("LICENCE",licence);
@ -146,7 +156,6 @@ public class ZysoftMaternalService extends ZysoftBaseService{
        Map<String,String> params = new HashMap<>();
        params.put("ORG_CODE",hospital);
        params.put("IDENTITY_CARD_NO",idcard);
        params.put("SEARCH_TIME",searchTime);
        String response = postSecond("getEhrMaternalDeliveryChildRecord","获取新生儿基本信息",params,null,header,false,1);
@ -156,13 +165,15 @@ public class ZysoftMaternalService extends ZysoftBaseService{
    /**
     * 7.38 获取儿童健康体检0-6岁记录
     * @param idcard
     * @param searchTime
     * @param hospital
     * @param licence
     * @param hospitalCode
     * @return
     * @throws Exception
     */
    public String getEhrMaternalChildMedicalRecord(String idcard,String searchTime,String hospital,String licence) throws Exception{
    public String getEhrMaternalChildMedicalRecord(String idcard,String hospitalCode) throws Exception{
        String[] hospitalMapping = getHospitalMapping(hospitalCode); //获取机构映射
        String hospital = hospitalMapping[0];
        String licence = hospitalMapping[1];
        Map<String,String> header = new HashMap<>();
        header.put("ORGCODE",hospital);
        header.put("LICENCE",licence);
@ -170,7 +181,6 @@ public class ZysoftMaternalService extends ZysoftBaseService{
        Map<String,String> params = new HashMap<>();
        params.put("ORG_CODE",hospital);
        params.put("IDENTITY_CARD_NO",idcard);
        params.put("SEARCH_TIME",searchTime);
        String response = postSecond("getEhrMaternalChildMedicalRecord","获取儿童健康体检0-6岁记录",params,null,header,false,1);
@ -180,13 +190,15 @@ public class ZysoftMaternalService extends ZysoftBaseService{
    /**
     * 7.39 获取新生儿访视信息
     * @param idcard
     * @param searchTime
     * @param hospital
     * @param licence
     * @param hospitalCode
     * @return
     * @throws Exception
     */
    public String getEhrMaternalHomeVisitRecord(String idcard,String searchTime,String hospital,String licence) throws Exception{
    public String getEhrMaternalHomeVisitRecord(String idcard,String hospitalCode) throws Exception{
        String[] hospitalMapping = getHospitalMapping(hospitalCode); //获取机构映射
        String hospital = hospitalMapping[0];
        String licence = hospitalMapping[1];
        Map<String,String> header = new HashMap<>();
        header.put("ORGCODE",hospital);
        header.put("LICENCE",licence);
@ -194,7 +206,6 @@ public class ZysoftMaternalService extends ZysoftBaseService{
        Map<String,String> params = new HashMap<>();
        params.put("ORG_CODE",hospital);
        params.put("IDENTITY_CARD_NO",idcard);
        params.put("SEARCH_TIME",searchTime);
        String response = postSecond("getEhrMaternalHomeVisitRecord","获取新生儿访视信息",params,null,header,false,1);
@ -204,13 +215,15 @@ public class ZysoftMaternalService extends ZysoftBaseService{
    /**
     * 7.40 获取新生儿免疫记录
     * @param idcard
     * @param searchTime
     * @param hospital
     * @param licence
     * @param hospitalCode
     * @return
     * @throws Exception
     */
    public String getEhrMaternalChildImmuneRecord(String idcard,String searchTime,String hospital,String licence) throws Exception{
    public String getEhrMaternalChildImmuneRecord(String idcard,String hospitalCode) throws Exception{
        String[] hospitalMapping = getHospitalMapping(hospitalCode); //获取机构映射
        String hospital = hospitalMapping[0];
        String licence = hospitalMapping[1];
        Map<String,String> header = new HashMap<>();
        header.put("ORGCODE",hospital);
        header.put("LICENCE",licence);
@ -218,7 +231,6 @@ public class ZysoftMaternalService extends ZysoftBaseService{
        Map<String,String> params = new HashMap<>();
        params.put("ORG_CODE",hospital);
        params.put("IDENTITY_CARD_NO",idcard);
        params.put("SEARCH_TIME",searchTime);
        String response = postSecond("getEhrMaternalChildImmuneRecord","获取新生儿免疫记录",params,null,header,false,1);
@ -228,13 +240,14 @@ public class ZysoftMaternalService extends ZysoftBaseService{
    /**
     * 7.41 获取孕妇预建卡信息
     * @param idcard
     * @param searchTime
     * @param hospital
     * @param licence
     * @param hospitalCode
     * @return
     * @throws Exception
     */
    public String getEhrMaternalPreFirstExamRecord(String idcard,String searchTime,String hospital,String licence) throws Exception{
    public String getEhrMaternalPreFirstExamRecord(String idcard,String hospitalCode) throws Exception{
        String[] hospitalMapping = getHospitalMapping(hospitalCode); //获取机构映射
        String hospital = hospitalMapping[0];
        String licence = hospitalMapping[1];
        Map<String,String> header = new HashMap<>();
        header.put("ORGCODE",hospital);
        header.put("LICENCE",licence);
@ -242,7 +255,6 @@ public class ZysoftMaternalService extends ZysoftBaseService{
        Map<String,String> params = new HashMap<>();
        params.put("ORG_CODE",hospital);
        params.put("IDENTITY_CARD_NO",idcard);
        params.put("SEARCH_TIME",searchTime);
        String response = postSecond("getEhrMaternalPreFirstExamRecord","获取孕妇预建卡信息",params,null,header,false,1);
@ -251,22 +263,22 @@ public class ZysoftMaternalService extends ZysoftBaseService{
    /**
     * 7.42 上传孕妇预建卡信息
     * @param idcard
     * @param searchTime
     * @param hospital
     * @param licence
     * @param code 预建卡code
     * @return
     * @throws Exception
     */
    public String SaveEhrMaternalPreFirstExamRecord(String idcard,String searchTime,String hospital,String licence) throws Exception{
    public String SaveEhrMaternalPreFirstExamRecord(String code) throws Exception{
        String[] hospitalMapping = getHospitalMapping(null); //获取机构映射
        String hospital = hospitalMapping[0];
        String licence = hospitalMapping[1];
        Map<String,String> header = new HashMap<>();
        header.put("ORGCODE",hospital);
        header.put("LICENCE",licence);
        Map<String,String> params = new HashMap<>();
        params.put("ORG_CODE",hospital);
        params.put("IDENTITY_CARD_NO",idcard);
        params.put("SEARCH_TIME",searchTime);
        String response = postSecond("SaveEhrMaternalPreFirstExamRecord","上传孕妇预建卡信息",params,null,header,false,1);
@ -276,13 +288,14 @@ public class ZysoftMaternalService extends ZysoftBaseService{
    /**
     * 7.43 上传新生儿访视信息
     * @param idcard
     * @param searchTime
     * @param hospital
     * @param licence
     * @param hospitalCode
     * @return
     * @throws Exception
     */
    public String SaveEhrMaternalHomeVisitRecord(String idcard,String searchTime,String hospital,String licence) throws Exception{
    public String SaveEhrMaternalHomeVisitRecord(String idcard,String hospitalCode) throws Exception{
        String[] hospitalMapping = getHospitalMapping(hospitalCode); //获取机构映射
        String hospital = hospitalMapping[0];
        String licence = hospitalMapping[1];
        Map<String,String> header = new HashMap<>();
        header.put("ORGCODE",hospital);
        header.put("LICENCE",licence);
@ -290,7 +303,6 @@ public class ZysoftMaternalService extends ZysoftBaseService{
        Map<String,String> params = new HashMap<>();
        params.put("ORG_CODE",hospital);
        params.put("IDENTITY_CARD_NO",idcard);
        params.put("SEARCH_TIME",searchTime);
        String response = postSecond("SaveEhrMaternalHomeVisitRecord","上传新生儿访视信息",params,null,header,false,1);
@ -301,12 +313,15 @@ public class ZysoftMaternalService extends ZysoftBaseService{
     * 7.44 获取待产记录
     * @param idcard
     * @param searchTime
     * @param hospital
     * @param licence
     * @param hospitalCode
     * @return
     * @throws Exception
     */
    public String getEhrMaternalZSPreDeliveryRecord(String idcard,String searchTime,String hospital,String licence) throws Exception{
    public String getEhrMaternalZSPreDeliveryRecord(String idcard,String hospitalCode,String searchTime) throws Exception{
        String[] hospitalMapping = getHospitalMapping(hospitalCode); //获取机构映射
        String hospital = hospitalMapping[0];
        String licence = hospitalMapping[1];
        Map<String,String> header = new HashMap<>();
        header.put("ORGCODE",hospital);
        header.put("LICENCE",licence);
@ -314,7 +329,7 @@ public class ZysoftMaternalService extends ZysoftBaseService{
        Map<String,String> params = new HashMap<>();
        params.put("ORG_CODE",hospital);
        params.put("PUERPERA_ID_NUMBER",idcard);
        params.put("TPP_RECORD_DATE_TIME",searchTime);
        params.put("TPP_RECORD_DATE_TIME",searchTime);//身份证和查询时间必填一个,区间为一天
        String response = postSecond("getEhrMaternalZSPreDeliveryRecord","获取待产记录",params,null,header,false,1);
@ -325,12 +340,15 @@ public class ZysoftMaternalService extends ZysoftBaseService{
     * 7.45 获取阴道分娩记录
     * @param idcard
     * @param searchTime
     * @param hospital
     * @param licence
     * @param hospitalCode
     * @return
     * @throws Exception
     */
    public String getEhrMaternalZSDeliveryRecord(String idcard,String searchTime,String hospital,String licence) throws Exception{
    public String getEhrMaternalZSDeliveryRecord(String idcard,String hospitalCode,String searchTime) throws Exception{
        String[] hospitalMapping = getHospitalMapping(hospitalCode); //获取机构映射
        String hospital = hospitalMapping[0];
        String licence = hospitalMapping[1];
        Map<String,String> header = new HashMap<>();
        header.put("ORGCODE",hospital);
        header.put("LICENCE",licence);
@ -348,20 +366,22 @@ public class ZysoftMaternalService extends ZysoftBaseService{
    /**
     * 7.46 获取剖宫产记录
     * @param idcard
     * @param searchTime
     * @param hospital
     * @param licence
     * @param hospitalCode
     * @return
     * @throws Exception
     */
    public String getEhrMaternalZSCaesareanBirthRecord(String idcard,String searchTime,String hospital,String licence) throws Exception{
    public String getEhrMaternalZSCaesareanBirthRecord(String idcard,String hospitalCode,String searchTime) throws Exception{
        String[] hospitalMapping = getHospitalMapping(hospitalCode); //获取机构映射
        String hospital = hospitalMapping[0];
        String licence = hospitalMapping[1];
        Map<String,String> header = new HashMap<>();
        header.put("ORGCODE",hospital);
        header.put("LICENCE",licence);
        Map<String,String> params = new HashMap<>();
        params.put("ORG_CODE",hospital);
        params.put("PUERPERA_ID_NUMBER",idcard);
        params.put("PUERPERA_ID_NUMBER",idcard);//身份证和查询时间必填一个
        params.put("CREATE_TIME",searchTime);
        String response = postSecond("getEhrMaternalZSCaesareanBirthRecord","获取剖宫产记录",params,null,header,false,1);

+ 115 - 7
patient-co-service/wlyy_service/src/main/webapp/prescription_consulting/js/prescription_consulting_info.js

@ -4,9 +4,12 @@ var request = GetRequest(),
    dialroll,
    page = 1,
    prepend =  false; 
//var server = "http://192.168.131.24:8081/";
var imgUrlDomain = "http://10.95.22.10:8011/";//正式
//var server = "http://192.168.131.24:8081/";//本地
//var server = "http://172.19.103.88:8011/wlyy_service/";//测试
var server = "http://10.95.22.10:8011/wlyy_service/";//正式
// var imgUrlDomain = "http://172.19.103.54/";//测试
$(function(){
    dialroll = iscrollAssist.newVerScrollForPull($('.pull-iscroll-wrap'), pulldownAction, null);
@ -17,6 +20,7 @@ $(function(){
    $("#talkwrap").height(totH);
    
    getLogList();
    bindEvents();
})
function getLogList(){
@ -115,7 +119,7 @@ function addReply(msgObj, member, prepend){
    }
    
    var temp = '<dt style="height: auto; text-align: center;">'+
        '<a><img src="' + p + '" class="c-images-cycle" /></a></dt>' +
        '<a><img src="' + getImgUrl(p) + '" class="c-images-cycle" /></a></dt>' +
        '<div class="c-content"><span class="c-f12 name">' + member.name + '</span>'
    
    switch(parseInt(msgType)) {
@ -133,7 +137,7 @@ function addReply(msgObj, member, prepend){
                '</dd></dl>';
            break;
        case 2://图片
            temp += '<dd class="word-bread wb-img"><img width="100" height="100" src="'+ content +'" /></dd></dl>';
            temp += '<dd class="word-bread wb-img"><img width="100" height="100" src="'+ getImgUrl(content) +'" /></dd></dl>';
            break;
        case 3://语音
            var rec = JSON.parse(content);
@ -146,16 +150,16 @@ function addReply(msgObj, member, prepend){
        case 12://视频
            var videoInfo = content.split(",");
            var shichang = formatSeconds(videoInfo[2]);//时长
            if(type == 1){
                temp += '<dd class="preview-video" data-video="'+videoInfo[1]+'">'+
                        '<img class="video-img-left" src="'+videoInfo[0]+'">'+
            if(member.is_patient == 0){
                temp += '<dd class="preview-video" data-video="'+getImgUrl(videoInfo[1])+'">'+
                        '<img class="video-img-left" src="'+getImgUrl(videoInfo[0])+'">'+
                        '<img class="bofang-icon-left" src="images/bofang_icon.png">'+
                        '<img class="jianjiao-icon-left" src="images/zuoshanjiao_bg.png">'+
                        '<span class="shichang-time-left">'+shichang+'</span>'+
                    '</dd>';
            }else{
                temp += '<dd class="preview-video" data-video="'+videoInfo[1]+'">'+
                        '<img class="video-img-right" src="'+videoInfo[0]+'">'+
                temp += '<dd class="preview-video" data-video="'+getImgUrl(videoInfo[1])+'">'+
                        '<img class="video-img-right" src="'+getImgUrl(videoInfo[0])+'">'+
                        '<img class="bofang-icon-right" src="images/bofang_icon.png">'+
                        '<img class="jianjiao-icon-right" src="images/youshanjiao_bg.png">'+
                        '<span class="shichang-time-right">'+shichang+'</span>'+
@ -185,6 +189,47 @@ function addReply(msgObj, member, prepend){
    
}
function bindEvents(){
    $(".talk-box").on('click', '.audio', function(){
        dialog({
            contentType:'tipsbox', 
            skin:'bk-popup' ,
            bottom:true,
            content:'暂不支持多媒体内容播放'
        }).show();
//      if($playingDom){
//          aud.pause();
//          //aud.stop();
//          $playingDom.removeClass('active');
//          if($playingDom[0] == this){
//              $playingDom = null;
//              return;
//          }
//      }
//      $playingDom = $(this);
//      $playingDom.addClass('active');
//      var ser = JSON.parse($(this).attr('data-audio'));
//      aud.src = getImgUrl(ser.path);
//      aud.load();
//      aud.play();
    })
    //播放视频
    .on('click','.preview-video',function() {
        dialog({
            contentType:'tipsbox', 
            skin:'bk-popup' ,
            bottom:true,
            content:'暂不支持多媒体内容播放'
        }).show();
//          $(document.body).find('video').remove();
//          var url = $(this).attr('data-video');
//          var html = '<video style="display: none;"  controls preload="auto" width="1" height="1" src="'+url+'" ></video>';
//          $(document.body).append(html);
//          var video = $(document.body).find('video')[0];
//          video.play();
    });
}
function queryFailed(res){
    d.close();
   
@ -213,6 +258,48 @@ function GetRequest() {
   return theRequest;
}
//毫秒转换成时分秒
function formatSeconds(value){
    var theTime = parseInt(value/1000);// 秒
    var theTime1 = 0;// 分
    var theTime2 = 0;// 小时
    if(theTime > 60) {
        theTime1 = parseInt(theTime/60);
        theTime = parseInt(theTime%60);
            if(theTime1 > 60) {
                theTime2 = parseInt(theTime1/60);
                theTime1 = parseInt(theTime1%60);
            }
    }
    var result = ""+parseInt(theTime);//秒
    if(parseInt(theTime)<=9){
        result = "0"+parseInt(theTime);//秒
    }
    if(theTime1 > 0) {//分
        if(parseInt(theTime1)>9){
            result = ""+parseInt(theTime1)+":"+result;
        }else{
            result = "0"+parseInt(theTime1)+":"+result;
        }
    }
    if(theTime2 > 0) {//小时
        if(parseInt(theTime2)>9){
            result = ""+parseInt(theTime2)+":"+result;
        }else{
            result = "0"+parseInt(theTime2)+":"+result;
        }
    }
    var resResult = "";
    if(result.split(":").length==1){//秒
        resResult = "00:"+result;
    }else if(result.split(":").length==2){//分
        resResult = "00:"+result;
    }else{//时
        resResult = result;
    }
    return resResult;
}
Date.prototype.Format = function(formatStr)   
{   
    var str = formatStr;   
@ -238,4 +325,25 @@ Date.prototype.Format = function(formatStr)
    str=str.replace(/s|S/g,this.getSeconds());   
  
    return str;   
}
/*
 * 获取图片路径方法修改
 */
function getImgUrl(str){
    if(typeof str != 'string'){
        return "";
    }
    if(str.length == 0){
        return "";
    }else{
        if(str.indexOf("../")>-1){
            //访问本地路径
            return str;
        }else if((str.indexOf("http://")>-1) || (str.indexOf("https://")>-1)){
            return str;
        }else{
            //服务器上的图片路径
            return imgUrlDomain + str;
        }
    }
}