业务情景:图文咨询医生后,医生(同意)回复了服务包,点击查看详情

image.png
vad.unLoginValueaddedService - getDeviceId()
获取了当前用户的设备ID 记入登录信息

  1. /**
  2. * 获取当前用户的deviceId
  3. *
  4. * @return
  5. */
  6. @RpcService
  7. public Integer getDeviceId() {
  8. return InnerService.getInnerService(ServicePackQRCodeService.class).getDeviceId();
  9. }

vad.unLoginValueaddedService - getServicePackDetail(String servicepackId)
获取服务包的详情,包含跳转页面的所有信息,需要传入服务包的id
返回体包含医生信息和服务包信息(ServicePackDoctorDTO)

   /**
     * 服务包详情
     * 返回体包含医生信息ServicePackDoctorDTO
     * @param servicepackId 服务包编码
     * @return
     */
    @RpcService
    public ServicePackDoctorDTO getServicePackDetail(String servicepackId) {
        return ServicepackAPI.getService(PatientPackService.class).getServicePackDetail(servicepackId);
    }

业务情景:在搜索栏查询医生、或者图文咨询页点击医生后,跳到医生主页

image.png
_
ev.evaluationService - canShowEvaluationForWx
[“1003234”]
查看是否可以显示Wx的评估,如果数据库有这个不需要显示评价的记录,则医生主页不显示评价

/**
     * @return
     */
    public boolean canShowEvaluationForWx() {

        try {
            Map<String, String> wxAppProperties = CurrentUserInfo.getCurrentWxProperties();
            if (null == wxAppProperties) {
                LOGGER.info("wxApp is null or is not wxApp, canShowEvaluationForWx judge is fail");
                return false;
            }
            String organId = wxAppProperties.get(WxAppPropsConstant.KEY_ORGANID);
            IEvaluationService evaluationService = AppContextHolder.getBean("ev.evaluationService", IEvaluationService.class);
            return evaluationService.canShowEvaluationForWx(Integer.parseInt(organId));
        }catch (Exception ex){
            LOGGER.error("get canShowEvaluationForWx error:",ex);
            return false;
        }
    }

vad.unLoginValueaddedService - showServicePack
[75610]
功能为是否要显示服务包。如果该医生或团队没有服务包则隐藏展示栏

/**
     * 服务包入口展示开关
     *
     * @param doctorId 当前登陆医生内码
     * @return
     */
    @RpcService
    public boolean showServicePack(int doctorId) {
        List<Integer> doctorIds = doctorGroupService.findDoctorIdsByMemberId(doctorId);
        if (ValidateUtil.blankList(doctorIds)) {
            doctorIds = new ArrayList<>();
        }
        doctorIds.add(doctorId);
        return getPackCountByList(doctorIds);
    }

    private boolean getPackCountByList(List<Integer> doctorIds) {
        Long count = servicePackDoctorDAO.getCountPackByDoctorIds(doctorIds);
        return ValidateUtil.notNullAndZeroLong(count);//长度不为零
    }

vad.unLoginValueaddedService - showServicePackDocPage
[75610]
与以上相似,是否要展示医生主页弹框

/**
     * 医生主页弹框展示开关
     *
     * @param doctorId 当前访问医生内码
     * @return
     */
    @RpcService
    public boolean showServicePackDocPage(int doctorId) {
        List<Integer> doctorIds = doctorGroupService.findDoctorIdsByMemberId(doctorId);
        if (ValidateUtil.blankList(doctorIds)) {
            doctorIds = new ArrayList<>();
        }
        doctorIds.add(doctorId);
        LOGGER.info("showServicePackDocPage doctorIds={}", JSONUtils.toString(doctorIds));
        Long count = servicePackDoctorDAO.getCountInSalePackByDoctorIds(doctorIds);
        return ValidateUtil.notNullAndZeroLong(count);
    }

eh.unLoginSevice - findScratchableForDoctorHomePageNew
[75610]
服务内容,获取服务设置相关接口

 /**
     * 获取服务设置相关接口
     * 考虑到微信端-支付宝端-web端,医生端,
     * 健康APP端的功能需求不同,分为两个服务分别获取
     *
     * @return
     * @2017/6/15 @author cuill 微信端评价是否显示
     */

    @RpcService
    public List<Scratchable> findScratchableForDoctorHomePageNew(Integer doctorId){
        ScratchableService scratchableService =
                AppContextHolder.getBean("eh.scratchableService", ScratchableService.class);
        List<Scratchable> scratchableList = scratchableService.findScratchableForDoctorHomePageNew(doctorId);
        return  scratchableList;
    }

ev.evaCollectUnloginService - getMindGiftInfoAndEvaluationInfo
[75610,1]
患者评价 - 心意,不在我们服务

vad.unLoginValueaddedService - doctorPagePackList
[75610,0,0]
显示患者端医生主页服务包列表

/**
     * 患者端医生主页服务包列表-第一期暂不支持分页
     *
     * @param doctorId 当前医生内码
     * @param start    分页开始位置(不分页传0)
     * @param limit    每页限制条数(不分页传0)
     * @return
     */
    @RpcService
    public List<ServicePackDoctorDTO> doctorPagePackList(Integer doctorId, int start, int limit) {
        if (ValidateUtil.nullOrZeroInteger(doctorId)) {
            throw new DAOException(DAOException.VALUE_NEEDED, "doctorId is required!");
        }
        List<ServicePackDoctorDTO> result = new ArrayList<>();
        List<ServicePackDoctor> packDoctors = servicePackDoctorDAO.findInSalesByDoctorId(doctorId, start, limit);
        if (ValidateUtil.blankList(packDoctors)) {
            packDoctors = new ArrayList<>();
        }
        List<Integer> doctorIds = doctorGroupService.findDoctorIdsByMemberId(doctorId);
        if (ValidateUtil.notBlankList(doctorIds)) {
            List<ServicePackDoctor> packDoctorList = servicePackDoctorDAO.findInSalesByDoctorIdsForPatient(doctorIds, start, limit);
            if (ValidateUtil.notBlankList(packDoctorList)) {
                packDoctors.addAll(packDoctorList);
            }
        }
        if (ValidateUtil.blankList(packDoctors)) {
            return result;
        }
        getContentsAndHaltPacks(result, packDoctors, false);
        return result;
    }

业务情景:进入医生主页后,点击图文咨询

还没进入选择就诊人页面前,还在加载时
consult.commonConsultService canRequestOnlineConsult
此接口判断用户是否能够申请图文咨询(点击后),返回true为能申请

 @RpcService
    public Boolean canRequestOnlineConsult(String requestMpi, Integer doctorId) {
        //2019.7 越权改造
        PrivilegeCheck.checkMpiId(requestMpi);
        ConsultDAO consultDao = DAOFactory.getDAO(ConsultDAO.class);
        DoctorService doctorService = ApplicationUtils.getBasicService(DoctorService.class);

        //判断是否存在有未完成的图文咨询单(电话咨询返回true能申请)
        List<Consult> list = consultDao.findApplyingConsultByRequestMpi(requestMpi, ConsultConstant.CONSULT_TYPE_GRAPHIC);
        if (ValidateUtil.notBlankList(list)) {
            for(Consult c : list){
                if(ValidateUtil.nullOrZeroInteger(c.getPayflag())){
                    logger.info("requestMpiId[" + requestMpi + "]图文咨询还未支付,不能再发起咨询");
                    String title = "您有一条待支付的咨询单,请先处理哦!";
                    Map<String, Object> errorObj = Maps.newHashMap();
                    errorObj.put("title", title);
                    errorObj.put("consultId", c.getConsultId());
                    throw new DAOException(ErrorCode.CONSULT_PENDING, JSONObject.toJSONString(errorObj));
                }
            }
            logger.info("requestMpiId[" + requestMpi + "]图文咨询还未结束,不能再发起咨询");
            throw new DAOException(ErrorCode.SERVICE_ERROR, "您的图文咨询还未结束,不能再发起咨询哦!");
        }

        PatientService patientService = ApplicationUtils.getBasicService(PatientService.class);
        PatientDTO pat=patientService.get(requestMpi);
        if(pat!=null) {
            String idCard = pat.getIdcard();
            if (StringUtils.isEmpty(idCard)) {
                return true;
            } else {
                String mpiId = requestMpi;
                ISameUserMaching sameUserMaching = ApplicationUtils.getBaseService(ISameUserMaching.class);
                HashMap<String, Boolean> map = sameUserMaching.patientsAndDoctor(mpiId, requestMpi, doctorId);
                //患者是否和医生为同一个人,true为同一个人
                Boolean patSameWithDoc = map.get("patSameWithDoc");
                //判断申请人是否和医生为同一个人,true为同一个人
                Boolean reqPatSameWithDoc = map.get("reqPatSameWithDoc");

                DoctorDTO targetDoctor = doctorService.get(doctorId);
                Boolean teams = targetDoctor.getTeams();
                if (null == teams) {
                    teams = false;
                }
                //个人图文咨询单
                if (!teams) {
                    //申请人/患者与目标医生不能为同一个人
                    if (patSameWithDoc && reqPatSameWithDoc) {
                        // 2016-6-18 luf:区分1秒弹框和确定,将 ErrorCode.SERVICE_ERROR 改成 608
                        logger.info("患者mpiId[" + mpiId + "],申请人requestMpi[" + requestMpi + "]与目标医生ConsultDoctor[" + doctorId + "]为同一个人");
                        throw new DAOException(608, "申请人与目标医生不能为同一个人");
                    }
                }
            }
        }

        return true;
    }

_
consult.consultService upToOnLineConsultNum
此接口判断是否达到日咨询量上限,到xxx表查询访问次数

 @RpcService
public boolean upToOnLineConsultNum(int doctorId) {
        Integer num = consultSetService.getOnLineConsultNum(doctorId);
        if (num <= 0) {
            return false;
        }
        Date today = DateConversion.getTodayStart(new Date());
        Date tomorrow = DateConversion.getDateAftXDays(today, 1);
        Long count = consultDAO.getCoutDocOnlineConsultNumToday(doctorId, today, tomorrow);
        if (count >= num) {
            return true;
        } else {
            return false;
        }
    }

consult.consultLabelService getDescriptoinLabelByDoc
标签运营平台可配

    @RpcService
    public List<String> getDescriptoinLabelByDoc(Integer docId) {
        ProfessionLabelService professionLabelService = BasicAPI.getService(ProfessionLabelService.class);
        return professionLabelService.getLabelByDoctorID(docId);
    }

eh.familyMemberService familyMemberListWithOrganDS
根据机构设置,查看就诊人列表

@RpcService
    public List<HashMap<String, Object>> familyMemberListWithOrganDS(String mpiId, Integer organId, Integer busType) {
        boolean flag = WholesomeService.getChildApplyMedicalCard();
        List<HashMap<String, Object>> list = familyMemberListWithOrgan(mpiId, organId, busType);
        for (HashMap<String, Object> h : list) {

            h.put("patient", ObjectCopyUtils.convert(h.get("patient"), PatientBeanDS.class));
            h.put("guardian", ObjectCopyUtils.convert(h.get("guardian"), GuardianBeanDS.class));
            //业务线查询就诊人卡类型
            PatientDTO p = ObjectCopyUtils.convert(h.get("patient"), PatientDTO.class);
            //儿童优先查健康卡 如果没有健康卡则查询就诊卡
            //人员卡类型 1:就诊卡 4:健康卡
            Integer healthCardType = 4;
            if(flag && ( PatientUserTypeEnum.CHILD_WITHID.getKey().equals(p.getPatientUserType()) || PatientUserTypeEnum.CHILD_WITHOUTID.getKey().equals(p.getPatientUserType()))){
                List<HealthCardDTO> healthCards = healthCardService.findWholesomeMpiID(p.getMpiId());
                if(CollectionUtils.isEmpty(healthCards)){
                    healthCards = healthCardService.findAllHospitalCards(p.getMpiId());
                    healthCardType = 1;
                    //有证儿童优先申领健康卡
                    if(CollectionUtils.isEmpty(healthCards) && PatientUserTypeEnum.CHILD_WITHID.getKey().equals(p.getPatientUserType())){
                        healthCardType = 4;
                    }
                }
            }
            h.put("healthCardType", healthCardType);
        }
        return list;
    }

consult.consultOPService getConsultDetailConfigByOrganId
【咨询申请页组件化】根据机构id获取运营平台咨询申请页模块配置信息

@RpcService
    public Map<String,Object> getConsultDetailConfigByOrganId(Integer organId){
        IConfigurationCenterUtilsService configurationService = ApplicationUtils.getBaseService(IConfigurationCenterUtilsService.class);
        String consultDetailConfig = (String)configurationService.getConfiguration(organId, "consultDetailConfig");
        Map map = JSONObject.parseObject(consultDetailConfig, Map.class);
        return map;
    }

consult.consultOPService getPatienNotesConfigurationByOrganId
根据机构内码获取患者须知弹窗

    @RpcService
    public Map<String, Object> getPatienNotesConfigurationByOrganId(Integer organId){
        LOGGER.info("getPatienNotesConfigurationByOrganId organId[{}]",organId);
        IConfigurationCenterUtilsService configurationCenterUtilsService = ApplicationUtils.getBaseService(IConfigurationCenterUtilsService.class);
        List<String> keys= Lists.newArrayList();
        keys.add(ConsultConstant.IS_OPEN_CONSULT_PATIENT_NOTICE);
        keys.add(ConsultConstant.CONSULT_PATIENT_NOTICE_TEXT);
        keys.add(ConsultConstant.CONSULT_PATIENT_NOTICE_CONSENT_TITLE);
        keys.add(ConsultConstant.CONSULT_PATIENT_NOTICE_CONSENT_TEXT);
        return configurationCenterUtilsService.findConfigurations(organId, keys);
    }

选择就诊人,点击下一步

eh.configurationCenterUtils getConfiguration
获取配置信息,如在线复诊申请页弹框中患者须知的文案配置

    @RpcService
    public Map<String, Object> getConfiguration(Integer organId,List<String> keys){
        IConfigurationCenterUtilsService configurationCenterUtilsService = ApplicationUtils.getBaseService(IConfigurationCenterUtilsService.class);
        Map<String, Object> configurations = configurationCenterUtilsService.findConfigurations(organId, keys);
        return configurations;
    }

输入文字,描述信息

image.png

consult.consultService hasFinishedConsult
[“2c94819b759637de0175b0b647a90004”]
根据当前患者查询是否有历史咨询单

@RpcService
    public Boolean hasFinishedConsult(String mpiid){
        //2019.7 越权改造
        PrivilegeCheck.checkMpiId(mpiid);
        ConsultDAO consultDAO = DAOFactory.getDAO(ConsultDAO.class);
        Long num = consultDAO.getFinishedConsultCount(mpiid);
        if(!ValidateUtil.nullOrZeroLong(num)){
            return true;
        }else {
            return false;
        }
    }

consult.commonConsultService canRequestOnlineConsult
[“2c94819b759637de0175b0b647a90004”,75643,2]
能否申请图文咨询

@RpcService
    public Boolean canRequestOnlineConsult(String requestMpi, Integer doctorId, Integer requestMode) {
        LOGGER.info("canRequestOnlineConsult start in, with param requestMpi[{}], doctorId[{}], reqeustMode[{}]", requestMpi, doctorId, requestMode);
        //2019.7 越权改造
        PrivilegeCheck.checkMpiId(requestMpi);
        ConsultDAO consultDao = getDAO(ConsultDAO.class);
        DoctorService doctorService = ApplicationUtils.getBasicService(DoctorService.class);
        DoctorDTO targetDoctor = doctorService.get(doctorId);
        Boolean teams = false;
        if (targetDoctor != null && targetDoctor.getTeams() != null) {
            teams = targetDoctor.getTeams();
        }

        //判断该患者和该医生是否有未结束的同种业务
        List<Consult> list = consultDao.findApplyingConsultByPatientsAndDoctorAndRequestMode(requestMpi, doctorId, requestMode);
        if (bussTypeUtils.getConfigByRequestMode(requestMode).canRequestOnlineConsult() && ValidateUtil.notBlankList(list)) {
            for (Consult c : list) {
                if (c.getConsultStatus().equals(ConsultConstant.CONSULT_STATUS_PENDING)) {
                    LOGGER.info("requestMpiId[{}]图文咨询还未支付,不能再发起咨询", requestMpi);
                    String title = "您有一条待支付的咨询单,请先处理哦!";
                    Map<String, Object> errorObj = Maps.newHashMap();
                    errorObj.put("title", title);
                    errorObj.put("consultId", c.getConsultId());
                    throw new DAOException(ErrorCode.CONSULT_PENDING, JSONObject.toJSONString(errorObj));
                } else {
                    LOGGER.info("canRequestConsult exists not ended consult, requestMode[{}]", requestMode);
                    Map<String, Object> errorObj = Maps.newHashMap();
                    errorObj.put("status", ValidateUtil.notBlankString(c.getSessionID()) ? 1 : 0);
                    errorObj.put("cid", c.getConsultId());
                    throw new DAOException(teams ? ErrorCode.REQUEST_MODE_EXISTS_TEAM : ErrorCode.REQUEST_MODE_EXISTS_PERSONAL,
                            JSONObject.toJSONString(errorObj));
                }
            }
        }
        PatientService patientService = ApplicationUtils.getBasicService(PatientService.class);
        PatientDTO pat = patientService.get(requestMpi);
        if (pat != null) {
            String idCard = pat.getIdcard();
            if (StringUtils.isEmpty(idCard)) {
                return true;
            } else {
                String mpiId = requestMpi;
                HashMap<String, Boolean> map = ApplicationUtils.getBaseService(ISameUserMaching.class).patientsAndDoctor(mpiId, requestMpi, doctorId);
                //患者是否和医生为同一个人,true为同一个人
                Boolean patSameWithDoc = map.get("patSameWithDoc");
                //判断申请人是否和医生为同一个人,true为同一个人
                Boolean reqPatSameWithDoc = map.get("reqPatSameWithDoc");

                // if (!teams) {//个人图文咨询单
                //申请人/患者与目标医生不能为同一个人
                // 默认患者和就诊人相同,所以返回值patSameWithDoc=reqPatSameWithDoc
                if (!teams && patSameWithDoc && reqPatSameWithDoc) {
                    // 2016-6-18 luf:区分1秒弹框和确定,将 ErrorCode.SERVICE_ERROR 改成 608
                    LOGGER.info("患者mpiId[{}],申请人requestMpi[{}]与目标医生ConsultDoctor[{}]为同一个人", mpiId, requestMpi, doctorId);
                    throw new DAOException(608, "申请人与目标医生不能为同一个人");
                }
                //     }
            }
        }
        return true;
    }

consult.commonConsultService canSubmitConsult
[{“mpiid”:”2c94819b759637de0175b0b647a90004”,”consultType”:1,”requestMode”:2,”requestMpi”:”2c94819b759637de0175b0b647a90004”,”requestTime”:””,”consultOrgan”:1,”consultDepart”:18621,”consultDoctor”:75643,”leaveMess”:”啦啦格”, “consultCost”:0, “consultPrice”:0,”canViewPacs”:1,”descriptionLabel”:””, “fromBodyCheckFlag”:0,”addrOfConsult”:”浙江省 杭州市”}]
查询是否能提交过咨询

@RpcService
    public Boolean canSubmitConsult(ConsultBean consultBean) {
        LOGGER.info("canSubmitConsult start in with param: consult[{}]", JSONObject.toJSONString(consultBean));
        Consult consult = getBean(consultBean, Consult.class);
        //校验数据是否完整
        isValidRequestConsultData(consult);
        //2019.7 越权改造
        PrivilegeCheck.checkMpiId(consult.getRequestMpi());

        DoctorService doctorService = ApplicationUtils.getBasicService(DoctorService.class);
        DoctorDTO targetDoctor = doctorService.get(consult.getConsultDoctor());
        Boolean teams = targetDoctor.getTeams();
        if (null == teams) {
            teams = false;
        }
        consult.setTeams(teams);

        return canRequestConsult(consult);
    }

eh.unLoginSevice getDoctorInfoForHealth
[75643,”2c94819b759637de0175b0b647a90004”]
患者端查看医生信息(个人医生信息)

 @RpcService
    public HashMap<String, Object> getDoctorInfoForHealth(Integer docId,
                                                          String mpi) {
        EmploymentService employmentService = BasicAPI.getService(EmploymentService.class);
        RelationDoctorDAO relationDao = DAOFactory
                .getDAO(RelationDoctorDAO.class);
        RecommendDAO recommDAO = DAOFactory.getDAO(RecommendDAO.class);

        Doctor doc = this.getByDoctorId(docId);

        if (doc == null) {
            throw new DAOException(600, "医生" + docId + "不存在");
        }

        EmploymentDTO emp = employmentService.getPrimaryEmpByDoctorId(docId);
        doc.setDepartment(emp.getDepartment());

        // 获取签约标记,关注标记,关注ID
        RelationDoctor relation = relationDao
                .getByMpiIdAndDoctorIdAndRelationType(mpi, docId);

        if (relation == null) {
            doc.setIsRelation(false);
            doc.setIsSign(false);
            doc.setRelationId(null);
        } else {
            Integer type = relation.getRelationType();
            Integer relationId = relation.getRelationDoctorId();
            doc.setIsSign(false);
            doc.setIsRelation(true);
            doc.setRelationId(relationId);
            if (type != null && type == 0) {
                doc.setIsSign(true);
            }
        }

        // 获取医生关注数(患者关注+医生关注)
        doc.setRelationNum(doctorRelationNumber(docId));

        // 2016-3-8 luf 根据患者端号源查询接口返回参数判断医生是否有号
        AppointSourceDAO asDao = DAOFactory.getDAO(AppointSourceDAO.class);
        List<Object[]> oss = asDao.findTotalByDcotorId(docId, 1);// 患者端固定传1
        if (oss != null && oss.size() > 0) {
            doc.setHaveAppoint(1);
        } else {
            doc.setHaveAppoint(0);
        }

        //异步更新Doctor字段haveAppoint
        //DoctorDAO docDao=DAOFactory.getDAO(DoctorDAO.class);
        //docDao.updateDoctorHaveAppoint(doc,docDao);

        ConsultSet docSet = new DoctorInfoService().getDoctorDisCountSet(docId, mpi, doc.getIsSign());

        List<Recommend> list = recommDAO.findByMpiIdAndDoctorId(mpi, docId);
        for (Recommend recommend : list) {
            // 0特需预约1图文咨询2电话咨询
            Integer recommendType = recommend.getRecommendType();
            switch (recommendType) {
                case 0:
                    docSet.setPatientTransferRecomFlag(true);
                    break;
                case 1:
                    docSet.setOnLineRecomFlag(true);
                    break;
                case 2:
                    docSet.setAppointRecomFlag(true);
                    break;
                default:
            }
        }

        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put("doctor", doc);
        map.put("consultSet", docSet);

        return map;
    }

consult.consultOPService queryConsultPermit
[2]
判断用户是否在黑名单内(true 不在黑名单中允许访问, false 在黑名单中不允许访问

@RpcService
    public Boolean queryConsultPermit(Integer subBusType){
        UserRoleToken userRoleToken = UserRoleToken.getCurrent();
        Boolean result = BasicAPI.getService(UserBlackListService.class).isBlackByUrtAndType(userRoleToken.getId(), ModuleEnum.All);
        return !result;
    }

consult.consultService upToOnLineConsultNum
[75643]
是否达到日咨询量上限

@RpcService
    public boolean upToOnLineConsultNum(int doctorId) {
        Integer num = consultSetService.getOnLineConsultNum(doctorId);
        if (num <= 0) {
            return false;
        }
        Date today = DateConversion.getTodayStart(new Date());
        Date tomorrow = DateConversion.getDateAftXDays(today, 1);
        Long count = consultDAO.getCoutDocOnlineConsultNumToday(doctorId, today, tomorrow);
        if (count >= num) {
            return true;
        } else {
            return false;
        }
    }

consult.consultLabelService getDescriptoinLabelByDoc
[75643]
获取文档描述标签

@RpcService
    public List<String> getDescriptoinLabelByDoc(Integer docId) {
        ProfessionLabelService professionLabelService = BasicAPI.getService(ProfessionLabelService.class);
        return professionLabelService.getLabelByDoctorID(docId);
    }

consult.consultOPService getConsultDetailConfigByOrganId

[1]
【咨询申请页组件化】根据机构id获取运营平台咨询申请页模块配置信息

@RpcService
    public Map<String,Object> getConsultDetailConfigByOrganId(Integer organId){
        IConfigurationCenterUtilsService configurationService = ApplicationUtils.getBaseService(IConfigurationCenterUtilsService.class);
        String consultDetailConfig = (String)configurationService.getConfiguration(organId, "consultDetailConfig");
        Map map = JSONObject.parseObject(consultDetailConfig, Map.class);
        return map;
    }

consult.consultOPService getPatienNotesConfigurationByOrganId
[1]
根据机构内码获取患者须知弹窗

@RpcService
    public Map<String, Object> getPatienNotesConfigurationByOrganId(Integer organId){
        LOGGER.info("getPatienNotesConfigurationByOrganId organId[{}]",organId);
        IConfigurationCenterUtilsService configurationCenterUtilsService = ApplicationUtils.getBaseService(IConfigurationCenterUtilsService.class);
        List<String> keys= Lists.newArrayList();
        keys.add(ConsultConstant.IS_OPEN_CONSULT_PATIENT_NOTICE);
        keys.add(ConsultConstant.CONSULT_PATIENT_NOTICE_TEXT);
        keys.add(ConsultConstant.CONSULT_PATIENT_NOTICE_CONSENT_TITLE);
        keys.add(ConsultConstant.CONSULT_PATIENT_NOTICE_CONSENT_TEXT);
        return configurationCenterUtilsService.findConfigurations(organId, keys);
    }

consult.consultExService getServicepackIdByPatAndDoc
[“2c94819b759637de0175b0b647a90004”,75643,2]
查询该申请人是否购买了健康管理

@RpcService
    public String getServicepackIdByPatAndDoc(String requestMpi, Integer doctorId, Integer requestMode) {
        logger.info("getServicepackIdByPatAndDoc:requestMpi:[{}],doctorId:[{}],requestMode:[{}]", requestMpi, doctorId, requestMode);
        if (StringUtils.isEmpty(requestMpi) || doctorId == null || requestMode == null) {
            throw new DAOException(DAOException.VALUE_NEEDED, "params is required");
        }
        //2019.7 越权改造
        PrivilegeCheck.checkMpiId(requestMpi);
        PatientPackService patientPackService = ApplicationUtils.getServicepackService(PatientPackService.class);
        ValidOrderPackDTO vopDto;
        //对应健康管理的mode
        if (ConsultConstant.CONSULT_TYPE_GRAPHIC.equals(requestMode)) {
            vopDto = patientPackService.getValidOrderPack(requestMpi, doctorId, 1);
        } else if (ConsultConstant.CONSULT_TYPE_POHONE.equals(requestMode)) {
            vopDto = patientPackService.getValidOrderPack(requestMpi, doctorId, 2);
        } else if (ConsultConstant.CONSULT_TYPE_PROFESSOR.equals(requestMode)) {
            vopDto = patientPackService.getValidOrderPack(requestMpi, doctorId, 3);
        } else {
            logger.error("getServicepackIdByPatAndDoc requestMode:[{}]", requestMode);
            throw new DAOException("requestMode is error");
        }

        if (!ObjectUtils.isEmpty(vopDto) && vopDto.getCount() != null) {
            if (vopDto.getCount() == 0) {
                return "";
            } else {
                return StringUtils.isEmpty(vopDto.getOrderId()) ? "" : vopDto.getOrderId();
            }
        } else {
            return "";
        }
    }

consult.ngariConsultService requestConsultAndCdrOtherdoc
[{“mpiid”:”2c94819b759637de0175b0b647a90004”,”consultType”:1,”requestMode”:2,”requestMpi”:”2c94819b759637de0175b0b647a90004”,”requestTime”:””,”consultOrgan”:1,”consultDepart”:18621,”consultDoctor”:75643,”leaveMess”:”啦啦啦啦啦啦奥奥给广大设计风格”,”consultCost”:0,”consultPrice”:0,”canViewPacs”:1,”descriptionLabel”:””,”fromBodyCheckFlag”:0,”addrOfConsult”:”浙江省 杭州市”,”teams”:false},[]]

basic.patientService getNameByMpiId
[“2c94819b759637de0175b0b647a90004”]

@RpcService
@DAOMethod(sql = "select patientName from Patient where mpiId=:mpiId")
public abstract String getNameByMpiId(@DAOParam("mpiId") String mpiId);

msg.consultMessageService findConsultMsgDetailWithDoctorId
[75643,0,20,null,2]
查找有关医生ID的咨询消息详细信息


@RpcService
public PageResult<Map<String, Object>> findConsultMsgDetailWithDoctorId(Integer doctorId, int startIndex, int pageSize, String version, Integer requestMode) {
    return consultMessageService.findConsultMsgDetailWithDoctorId(doctorId, startIndex, pageSize, version, requestMode);
}

和医生发消息阶段

msg.consultMessageService receiveMessageFromPatientWithRequestMode

[“im_0-392c21ce-6562-41e0-bfaa-6c93a62a62c1”,”im_0-392c21ce-6562-41e0-bfaa-6c93a62a62c1”,4663,1,”爱仕达多\n”,”2020-11-20 10:58”,2]

@RpcService
String receiveMessageFromPatientWithRequestMode(String hxMsgId, String customerKey, Integer consultId,
                                                String msgType, String msgContent, String customerTimeGroup, Integer requestMode);

业务情景:进入医生主页后,点击电话咨询

点击电话咨询,选择纠就诊人

eh.unLoginSevice getDoctorInfoForHealth
[75643,”2c94819b759637de0175b0b647a90004”]
患者端查看医生信息(个人医生信息)

 @RpcService
    public HashMap<String, Object> getDoctorInfoForHealth(Integer docId,
                                                          String mpi) {
        EmploymentService employmentService = BasicAPI.getService(EmploymentService.class);
        RelationDoctorDAO relationDao = DAOFactory
                .getDAO(RelationDoctorDAO.class);
        RecommendDAO recommDAO = DAOFactory.getDAO(RecommendDAO.class);

        Doctor doc = this.getByDoctorId(docId);

        if (doc == null) {
            throw new DAOException(600, "医生" + docId + "不存在");
        }

        EmploymentDTO emp = employmentService.getPrimaryEmpByDoctorId(docId);
        doc.setDepartment(emp.getDepartment());

        // 获取签约标记,关注标记,关注ID
        RelationDoctor relation = relationDao
                .getByMpiIdAndDoctorIdAndRelationType(mpi, docId);

        if (relation == null) {
            doc.setIsRelation(false);
            doc.setIsSign(false);
            doc.setRelationId(null);
        } else {
            Integer type = relation.getRelationType();
            Integer relationId = relation.getRelationDoctorId();
            doc.setIsSign(false);
            doc.setIsRelation(true);
            doc.setRelationId(relationId);
            if (type != null && type == 0) {
                doc.setIsSign(true);
            }
        }

        // 获取医生关注数(患者关注+医生关注)
        doc.setRelationNum(doctorRelationNumber(docId));

        // 2016-3-8 luf 根据患者端号源查询接口返回参数判断医生是否有号
        AppointSourceDAO asDao = DAOFactory.getDAO(AppointSourceDAO.class);
        List<Object[]> oss = asDao.findTotalByDcotorId(docId, 1);// 患者端固定传1
        if (oss != null && oss.size() > 0) {
            doc.setHaveAppoint(1);
        } else {
            doc.setHaveAppoint(0);
        }

        //异步更新Doctor字段haveAppoint
        //DoctorDAO docDao=DAOFactory.getDAO(DoctorDAO.class);
        //docDao.updateDoctorHaveAppoint(doc,docDao);

        ConsultSet docSet = new DoctorInfoService().getDoctorDisCountSet(docId, mpi, doc.getIsSign());

        List<Recommend> list = recommDAO.findByMpiIdAndDoctorId(mpi, docId);
        for (Recommend recommend : list) {
            // 0特需预约1图文咨询2电话咨询
            Integer recommendType = recommend.getRecommendType();
            switch (recommendType) {
                case 0:
                    docSet.setPatientTransferRecomFlag(true);
                    break;
                case 1:
                    docSet.setOnLineRecomFlag(true);
                    break;
                case 2:
                    docSet.setAppointRecomFlag(true);
                    break;
                default:
            }
        }

        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put("doctor", doc);
        map.put("consultSet", docSet);

        return map;
    }

consult.consultService getConsultDateTime
获取医生咨询时间

/**
     * 获取医生咨询时间
     *
     * @param consultDate
     * @param doctorId
     * @param page
     * @param limit
     * @return
     */
    @RpcService
    @Override
    public List<Map<String, Object>> getConsultDateTime(Date consultDate,
                                                        int doctorId, int page, int limit){
        //根据前端传入的时间,及翻页标记,算出要查询的咨询时间段
        Date dt = DateConversion.getDateAftXDays(consultDate, page);
        dt = DateConversion.getFormatDate(dt, "yyyy-MM-dd");
        Date now = DateConversion.getFormatDate(new Date(), "yyyy-MM-dd");
        if (dt.before(now)) {
            dt = now;
        }

        ConsultSetService consultSetService = ApplicationUtils.getBasicService(ConsultSetService.class);
        ConsultSetDTO cs = consultSetService.get(doctorId);
        List<Map<String, Object>> results = new ArrayList<Map<String, Object>>();
        if (cs == null) {
            return results;
        }

        HashMap<Integer, HashMap<String, Object>> map = getDoctorConsultDate(cs);
        if (map == null || map.isEmpty()) {
            return results;
        }
        while (results.size() < limit) {
            int week = DateConversion.getWeekOfDateInt(dt);
            HashMap<String, Object> timeSlot = map.get(week);
            if (timeSlot != null && !timeSlot.isEmpty()) {
                if (dt.equals(now)) {
                    Date end = (Date) timeSlot.get("endTime");
                    if (!end.after(DateConversion.getFormatDate(new Date(), "HH:mm:ss"))) {
                        if (page >= 0) {
                            page++;
                        } else {
                            page--;
                        }
                        dt = DateConversion.getDateAftXDays(consultDate, page);
                        dt = DateConversion.getFormatDate(dt, "yyyy-MM-dd");
                        continue;
                    }
                }
                HashMap<String, Object> result = new HashMap<String, Object>();
                result.put("startTime", timeSlot.get("startTime"));
                result.put("endTime", timeSlot.get("endTime"));
                result.put("consultDate", dt);
                results.add(result);
            }
            if (page >= 0) {
                page++;
            } else {
                page--;
            }
            dt = DateConversion.getDateAftXDays(consultDate, page);
            dt = DateConversion.getFormatDate(dt, "yyyy-MM-dd");
            if (dt.before(now)) {
                break;
            }
        }
        //咨询时间由远及近排序
        Collections.sort(results, new Comparator<Map<String, Object>>() {
            @Override
            public int compare(Map<String, Object> o1, Map<String, Object> o2) {
                Date consultDate1 = (Date) o1.get("consultDate");
                Date consultDate2 = (Date) o2.get("consultDate");
                return consultDate1.compareTo(consultDate2);
            }
        });
        return results;
    }

consult.consultOPService queryConsultPermit
判断用户是否在黑名单内

    @RpcService
    public Boolean queryConsultPermit(Integer subBusType){
        UserRoleToken userRoleToken = UserRoleToken.getCurrent();
        Boolean result = BasicAPI.getService(UserBlackListService.class).isBlackByUrtAndType(userRoleToken.getId(), ModuleEnum.All);
        return !result;
    }

以下接口与图文咨询端的接口一样
consult.consultLabelService getDescriptoinLabelByDoc
eh.familyMemberService familyMemberListWithOrganDS
consult.consultOPService getPatienNotesConfigurationByOrganId
eh.configurationCenterUtils getConfiguration
获取配置信息,如在线复诊申请页弹框中患者须知的文案配置

进入咨询详情界面

consult.consultService hasFinishedConsult
根据当前患者查询是否有历史咨询单
consult.consultOPService queryConsultPermit
consult.consultLabelService getDescriptoinLabelByDoc
eh.familyMemberService familyMemberListWithOrganDS
consult.consultService getConsultDateTime

提交成功后

consult.requestConsultService canSubmitConsult
basic.patientService updatePatientMobile
更新患者手机号

public boolean updatePatientMobile(String mpiId, String mobile) {
        logger.info("updatePatientMobile,mpiId:{},mobile:{}",mpiId,mobile);
        if(mobile.contains("*")) return true;
        if(!RegexUtil.isMobile(mobile)) throw new DAOException(609, "手机号格式不正确");
        try{
            Patient patient = patientDAO.get(mpiId);
            patient.setMobile(mobile);
            patient.setLastModify(new Date());
            patientDAO.update(patient);
        }catch (Exception e){
            logger.error("updatePatientMobile error",e);
            return false;
        }
        return true;
    }

consult.consultExService getServicepackIdByPatAndDoc
consult.ngariConsultService requestConsultAndCdrOtherdoc
请求咨询和其他医生

msg.consultMessageService findMessageForPhoneConsult
电话咨询详情页面,查看医生的留言记录

@RpcService
    public List<BusConsultMsgBean> findMessageForPhoneConsult(Integer consultId){
        return consultMessageService.findMessageForPhoneConsult(consultId);
    }

consult.consultService findCallRecordsByConsultId
电话咨询详情页,患者查看医生的拨打记录(微信)

@RpcService
    public List<CallRecordBean> findCallRecordsByConsultId(Integer consultId ){
        //2019.7 越权改造
        PrivilegeCheck.checkDocIdAndMpiByConsultId(consultId);
        ICallRecordService callRecordService = ApplicationUtils.getBaseService(ICallRecordService.class);
        List<CallRecordBean> callRecords = callRecordService.findByBussIdAndBussType(consultId,3);
        List<CallRecordBean> newCallRecords = Lists.newArrayList();
        for(CallRecordBean callRecord : callRecords){
            CallRecordBean c = new CallRecordBean();
            c.setCreateTime(callRecord.getCreateTime());
            c.setCallTime(callRecord.getCallTime());
            newCallRecords.add(c);
        }
        Collections.sort(newCallRecords, new Comparator<CallRecordBean>() {
            @Override
            public int compare(CallRecordBean o1, CallRecordBean o2) {
                return o1.getCreateTime().compareTo(o2.getCreateTime());
            }
        });
        return newCallRecords;
    }

业务情景:进入医生主页后,点击核销单健康管理,选择消息录入

进行接口追踪
getEncryptOrderDetail() 方法


    /**
     * 患者端健康管理订单详情
     *
     * @param id 健康管理订单编码
     * @return
     */
    @RpcService
    public ServicePackOrderDTO getEncryptOrderDetail(String id) {
        ServicePackOrderDTO servicePackOrderDTO = this.getOrderDetail(id);
        PatientDTO patientDTO = servicePackOrderDTO.getPatientDTO();
        if (null != patientDTO) {
            servicePackOrderDTO.setPatientDS(ObjectCopyUtils.convert(patientDTO, PatientDS.class));
            servicePackOrderDTO.setPatientDTO(null);
        }
        Integer orderStatus = servicePackOrderDTO.getOrderStatus();
        if (OrderStatus.IN_USE.getValue() == orderStatus || OrderStatus.TOBE_USED.getValue() == orderStatus) {
            servicePackOrderDTO.setWriteOffType(InnerService.getInnerService(ServiceContentPatientService.class).getWriteOffTypeByOrderId(id));
        }
        return servicePackOrderDTO;
    }

患者端健康管理订单详情
bindingPatientId()

/**
     * 患者健康管理订单绑定就诊人
     *
     * @param orderId 健康管理订单编号
     * @param mpiId   就诊人mpiId
     * @return
     */
    @RpcService
    public boolean bindingPatientId(String orderId, String mpiId) {
        if (ValidateUtil.blankString(orderId) || ValidateUtil.blankString(mpiId)) {
            throw new DAOException(DAOException.VALUE_NEEDED, "orderId or mpiId is required!");
        }
        ServicePackOrder packOrder = servicePackOrderDAO.getByOrderId(orderId);
        if (null == packOrder) {
            throw new DAOException(DAOException.VALUE_NEEDED, "packOrder is required!");
        }
        Integer orderStatus = packOrder.getOrderStatus();
        if (!orderStatus.equals(OrderStatus.TOBE_USED.getValue())) {
            throw new DAOException(ErrorCode.SERVICE_ERROR, "订单状态已更新");
        }
        Integer count = servicePackOrderDAO.updatePatientIdAndStatus(mpiId, OrderStatus.IN_USE.getValue(), orderId);
        if (null == count || count <= 0) {
            LOGGER.error("bindingPatientId fail,orderId=[{}],mpiId=[{}]", orderId, mpiId);
            return false;
        }
        try {
            packOrder.setPatientId(mpiId);
            RelationPatientService relationPatientService = InnerService.getInnerService(RelationPatientService.class);
            ServicepackPushService servicepackPushService = InnerService.getInnerService(ServicepackPushService.class);
            ServicePackDoctor packDoctor = servicePackDoctorDAO.getByServicepackId(packOrder.getServicepackId());
            relationPatientService.addRelationPatient(packOrder);
            patientOrderService.createServicePackFollow(orderId);
            servicepackPushService.pushServicepackBuySuccessNoPatToDoc(packOrder, packDoctor.getOrganId());
        } catch (Exception e) {
            LOGGER.error("bindingPatientId relation,create follow error....", e);
        }
        return true;
    }

generateNewOrder()方法

@RpcService
    public String generateNewOrder(final ServicePackOrderDTO orderTo, final List<OtherdocBean> otherdocList){
        //LOGGER.info("orderInfo:{}", JSON.toJSONString(orderTo));
       beforegenerateOrder(orderTo);
        try {
            orderTo.setDeviceId(SessionItemManager.instance().checkClientAndGet());
        } catch (Exception e) {
            LOGGER.info("generateNewOrder get deviceId from session exception! errorMessage[{}]", e.getMessage());
        }
        Integer result = 0;
        HibernateStatelessResultAction<ServicePackOrder> action = new AbstractHibernateStatelessResultAction<ServicePackOrder>() {
            @Override
            public void execute(StatelessSession arg0) throws Exception {
                //新增订单之前一定要先数量加一
                servicePackDoctorPlusOne(orderTo.getServicepackId());
                ServicePackOrder newOrder = saveOrder(orderTo);
                if (newOrder == null) {
                    setResult(null);
                } else {
                    saveServiceContentPatient(newOrder);
                    saveOtherDocBean(ServicePackConstant.OTHERDOCCLINICTYPE_OF_SERVICEPACK , newOrder.getId(), otherdocList);
                    setResult(newOrder);
                }
            }
        };
        HibernateSessionTemplate.instance().executeTrans(action);
        if (action.getResult() != null) {
            result = action.getResult().getId();
            String orderID = action.getResult().getOrderId();
            BigDecimal price = orderTo.getServicepackPrice();
            if(price.doubleValue() == 0d){
                updateOrderAfterPay(result);
                return orderID;
            }
        }
        return result.toString();
    }


1.进入医生主页选择更多的健康管理,点击选择核销健康管理,点击购买

image.pngimage.pngimage.png

获取健康管理的支付渠道

X-Service-Method: getServicePackPayChannel
X-Ca-Key: ngari-wx
X-Content-MD5: Ndul11U4qbvgtNpEInWaDg==
encoding: utf-8
X-Service-Id: vad.servicePackService
入参

[1]

响应体

{"code":500,"msg":"该客户端未配置支付渠道"}

image.pngimage.png

查询就诊人家庭里的成员

X-Service-Method: familyMemberListWithOrganDS
X-Ca-Key: ngari-wx
X-Content-MD5: uUX5HNg6/vHr8tmZHl9VRw==
encoding: utf-8
X-Service-Id: eh.familyMemberService
入参

["2c94819b759637de0175b0b647a90004",1,14]

响应体

{"code":200,"body":[{"healthCardType":4,"patient":{"loginId":"5faa2a913d630a6c7c66e11e","mpiId":"2c94819b759637de0175b0b647a90004","patientName":"*的秀","patientSex":"1","birthday":"2016-03-07","patientType":"1","idcard":"1101**********6513","mobile":"159****4567","homeArea":"3301","createDate":"2020-11-10 13:52:17","lastModify":"2020-11-10 14:45:50","status":1,"healthProfileFlag":false,"guardianName":"*的秀","guardianFlag":false,"certificate":"1101**********6513","certificateType":1,"fullHomeArea":"浙江省 杭州市","patientUserType":1,"authStatus":0,"guardianCertificate":"1101**********4632","isOwn":true,"ashFlag":false,"healthCards":[],"urt":4369990,"guardianCertificateType":1,"reclaimFlag":false,"clientConfigId":193,"defaultPatient":true,"patientSexText":"男","patientTypeText":"自费","statusText":"正常","educationText":"","cardTypeText":"","authStatusText":"未认证","patientUserTypeText":"儿童(有证件号)","certificateTypeText":"身份证","homeAreaText":"杭州市","marryText":"","jobText":"","nationText":"","countryText":"","stateText":"","birthPlaceText":"","bloodText":"","houseHoldText":"","residentText":"","guardianCertificateTypeText":"身份证","guardianCountryText":"","guardianRelationText":"","cardPatientTypeText":"","guardianGenderText":""},"completely":true,"guardian":{"name":"*的秀","age":20,"sex":"1"},"haveCardTypes":[],"age":4,"have12":true,"relation":true}]}
@RpcService
    public List<HashMap<String, Object>> getServicePackPayChannel(int busOrganId) {
        INgariPayService ngariPayService = BaseAPI.getService(INgariPayService.class);
        LOGGER.info("getServicePackPayChannel busOrganId=[{}]", busOrganId);
        List<HashMap<String, Object>> result;
        try {
            result = ngariPayService.getPayChannel(null, null, "servicepack", busOrganId);
        } catch (Exception e) {
            LOGGER.error("getServicePackPayChannel failed:{}", e);
            throw e;
        }
        return result;
    }

批量获取患者的机构配置

X-Service-Method: getOrganConfigForPatient
X-Ca-Key: ngari-wx
X-Content-MD5: Ndul11U4qbvgtNpEInWaDg==
encoding: utf-8
X-Service-Id: eh.organConfigService

[1]
{"code":200,"body":{"requiredIDCardFor90DaysInOther":false,"organChildApplyMedicalCard":false,"supportPatientType":["child","adult"]}}

2.完成支付之后

image.png

产生新的订单

X-Service-Method: generateNewOrder
X-Ca-Key: ngari-wx
X-Content-MD5: uTUDDumknytC4Qhti26CCA==
encoding: utf-8
X-Service-Id: vad.patientOrderService

[{"servicepackId":"bec43c20254248378c5dd4b6d2fa57b4","purchaserId":"5faa2a913d630a6c7c66e11e","patientId":"2c94819b759637de0175b0b647a90004","doctorId":75610,"servicepackName":"核销不限","diseaseDescription":""},[]]
{"code":200,"body":"e11ef99c532649c1a73570b3f5196a3b"}

患者端健康管理订单详情

X-Service-Method: getEncryptOrderDetail
X-Ca-Key: ngari-wx
X-Content-MD5: LKYxvVRrcKudLu15g0J6cg==
encoding: utf-8
X-Service-Id: vad.patientOrderService

["e11ef99c532649c1a73570b3f5196a3b"]
{"code":200,"body":{"id":795,"orderId":"e11ef99c532649c1a73570b3f5196a3b","servicepackId":"bec43c20254248378c5dd4b6d2fa57b4","purchaserId":"5faa2a913d630a6c7c66e11e","patientId":"2c94819b759637de0175b0b647a90004","doctorId":75610,"servicepackName":"核销不限","servicepackPrice":0.00,"startTime":"2020-12-11 14:30:16","endTime":"2023-09-06 14:30:16","orderStatus":1,"diseaseDescription":"","payflag":1,"deviceId":6808,"organId":1,"createTime":"2020-12-11 14:30:16","useFlag":false,"fromFlag":0,"payStatus":1,"serviceContentPatientDTOs":[{"contentId":2163,"orderId":"e11ef99c532649c1a73570b3f5196a3b","serviceType":7,"serviceNum":20,"servicerisidueNum":20,"alias":"面诊预约20","serviceNote":"面对面评估病情,根据病情提供就医指导","createTime":"2020-12-11 14:30:16","lastModified":"2020-12-11 14:30:16","nursingItems":"","nursingCategory":"","contentUseFlag":false,"writeOffFlag":false,"writeOffStatusText":"","serviceTypeText":"面诊预约"},{"contentId":2165,"orderId":"e11ef99c532649c1a73570b3f5196a3b","serviceType":7,"serviceNum":-1,"servicerisidueNum":-1,"alias":"面诊预约不限","serviceNote":"面对面评估病情,根据病情提供就医指导","createTime":"2020-12-11 14:30:16","lastModified":"2020-12-11 14:30:16","nursingItems":"","nursingCategory":"","contentUseFlag":false,"writeOffFlag":false,"writeOffStatusText":"","serviceTypeText":"面诊预约"}],"doctorDTO":{"urt":4369823,"doctorId":75610,"name":"双十一医生","gender":"1","userType":1,"birthDay":"1990-03-07 00:00:00","profession":"12","organProfession":1097,"domain":"1111111","proTitle":"100","doctorCertImage":"5e82bf532b8e0163c6519ec4","doctorCertImage2":"5e82bf532b8e0163c6519ec5","proTitleImage":"5e82bf532b8e0163c6519ec3","rating":9.9,"teams":false,"expert":false,"status":1,"createDt":"2020-03-31 00:00:00","lastModify":"2020-07-01 14:42:14","organ":1,"haveAppoint":0,"testPersonnel":0,"chief":0,"orderNum":1,"virtualDoctor":false,"source":1,"rewardFlag":false,"qrCode":"5fb4eccd3d630a60e041d48f","qrUrl":"http://weixin.qq.com/q/02CRSr8J84eF310000w07F","evaNum":3,"groupType":0,"generalDoctor":0,"searchRating":1029209.9,"consultAmount":311,"extendParam":{},"easemobStatus":1,"doctorSortNum":1000,"currentOrgan":1,"cloudAppointSourceFlag":0,"canReport":false,"hasReport":false,"organProfessionText":"口腔科","professionText":"口腔科","organText":"浙大附属邵逸夫医院","statusText":"正常","proTitleText":"研究员","doctorCertImageToken":"1607671817:ngaridev:ol99UdiYQf3xEd7yfejJZKuQPxw=","doctorCertImage2Token":"1607671817:ngaridev:AQP8oLp4oPgDF7ZGnHomNW17tAY=","proTitleImageToken":"1607671817:ngaridev:ragWN1HznnSLSHxhtZ-HLl7dotc=","genderText":"男","userTypeText":"医生","jobTitleText":"","educationText":"","onlineText":"","busyFlagText":"","departmentText":"","sourceText":"自主注册","leaderText":"","groupTypeText":"普通医生团队","groupModeText":"","appointSourceFlagText":"","cloudAppointSourceFlagText":"","currentOrganText":"浙大附属邵逸夫医院"},"patientDS":{"loginId":"5faa2a913d630a6c7c66e11e","mpiId":"2c94819b759637de0175b0b647a90004","patientName":"*的秀","patientSex":"1","birthday":"2016-03-07 00:00:00","patientType":"1","idcard":"1101**********6513","mobile":"159****4567","homeArea":"3301","createDate":"2020-11-10 13:52:17","lastModify":"2020-11-10 14:45:50","status":1,"guardianName":"*的秀","guardianFlag":false,"certificate":"1101**********6513","certificateType":1,"fullHomeArea":"浙江省 杭州市","patientUserType":1,"authStatus":0,"guardianCertificate":"1101**********4632","isOwn":true,"urt":4369990,"guardianCertificateType":1,"patientSexText":"男","authStatusText":"未认证","patientUserTypeText":"儿童(有证件号)","certificateTypeText":"身份证","patientTypeText":"自费","statusText":"正常","defaultPatient":true,"educationText":"","guardianCertificateTypeText":"身份证","expectClinicPeriodTypeText":"","homeAreaText":"杭州市","countryText":"","marryText":"","residentText":"","houseHoldText":"","jobText":"","nationText":"","stateText":"","birthPlaceText":""},"writeOffType":0,"refundType":1,"refundFlag":0,"payOrderStatus":1,"monitorPack":false,"payStatusText":"已支付","payOrderStatusText":"已支付","organIdText":"浙大附属邵逸夫医院","orderStatusText":"使用中","fromFlagText":"线上支付","doctorIdText":"双十一医生"}}

健康管理订单详情页是否显示退款按钮

X-Service-Method: canShowRefundButton
X-Ca-Key: ngari-wx
X-Content-MD5: LKYxvVRrcKudLu15g0J6cg==
encoding: utf-8
X-Service-Id: vad.servicePackOrderService
入参

["e11ef99c532649c1a73570b3f5196a3b"]
{"code":200,"body":false}

患者端查看医生信息(个人医生信息)

X-Service-Method: getDoctorInfoForHealth
X-Ca-Key: ngari-wx
X-Content-MD5: G+/ZJFWAI+qFiPs9O9p+jA==
encoding: utf-8
X-Service-Id: eh.unLoginSevice

请求

[75610,"2c94819b759637de0175b0b647a90004"]

返回

{"code":200,"body":{"doctor":{"urt":4369823,"doctorId":75610,"name":"双十一医生","gender":"1","userType":1,"birthDay":"1990-03-07 00:00:00","profession":"12","organProfession":1097,"email":"","weiXin":"","introduce":"","domain":"1111111","honour":"","proTitle":"100","jobTitle":"","education":"","photo":"","doctorCertImage":"5e82bf532b8e0163c6519ec4","doctorCertImage2":"5e82bf532b8e0163c6519ec5","proTitleImage":"5e82bf532b8e0163c6519ec3","rating":9.9,"teams":false,"expert":false,"status":1,"createDt":"2020-03-31 00:00:00","lastModify":"2020-07-01 14:42:14","organ":1,"haveAppoint":0,"department":18618,"testPersonnel":0,"chief":0,"orderNum":1,"relationNum":4,"isRelation":false,"isSign":false,"virtualDoctor":false,"source":1,"rewardFlag":false,"qrCode":"5fb4eccd3d630a60e041d48f","qrUrl":"http://weixin.qq.com/q/02CRSr8J84eF310000w07F","evaNum":3,"groupType":0,"generalDoctor":0,"searchRating":1029209.9,"articleId":"","consultAmount":311,"extendParam":{},"easemobStatus":1,"minkeElectronLicence":"","minkeDoctorCertCode":"","nurseWorkExperiencePhoto":"","nurseSpecializedCertPhotoList":"","doctorSortNum":1000,"currentOrgan":1,"cloudAppointSourceFlag":3,"canReport":false,"hasReport":false,"genderText":"男","organProfessionText":"口腔科","statusText":"正常","userTypeText":"医生","professionText":"口腔科","proTitleText":"研究员","jobTitleText":"","educationText":"","doctorCertImageToken":"1607671818:ngaridev:l70o_dFivd1EE2KvUywlxmKC0v0=","doctorCertImage2Token":"1607671818:ngaridev:EmcA7HGfWXWcWnIFnNRicNO7u-Q=","proTitleImageToken":"1607671818:ngaridev:ysAiV0XyqvE4_oEXuQJ2OqUvB_k=","onlineText":"","busyFlagText":"","organText":"浙大附属邵逸夫医院","departmentText":"口腔科","sourceText":"自主注册","leaderText":"","groupTypeText":"普通医生团队","groupModeText":"","appointSourceFlagText":"","cloudAppointSourceFlagText":"无号源","minkeElectronLicenceToken":"1607671818:ngaridev:Y91f0tAOuTxtvhlsCros6VZN4d0=","currentOrganText":"浙大附属邵逸夫医院"},"mindGiftInfo":{"mindGiftList":[{"mindGiftId":7831,"subBusType":2,"giftIcon":"19815","doctorAccount":0.0,"filtText":"热心为民","readFlag":1,"showDate":"2020-07-15 13:51:06","patientName":"**k","subBusTypeText":"图文咨询","busTypeText":"","doctorIdText":"","organText":"","departmentText":"","payFlagText":"","giftTypeText":"","mindGiftStatusText":"","readFlagText":"已读","giftIconToken":"1607671818:ngaridev:8xj_aRPaezsIJJMXoA7TFWInFbw="},{"mindGiftId":7829,"subBusType":2,"giftIcon":"19815","doctorAccount":0.0,"filtText":"热心为民","readFlag":1,"showDate":"2020-07-15 13:51:01","patientName":"**k","subBusTypeText":"图文咨询","busTypeText":"","doctorIdText":"","organText":"","departmentText":"","payFlagText":"","giftTypeText":"","mindGiftStatusText":"","readFlagText":"已读","giftIconToken":"1607671818:ngaridev:8xj_aRPaezsIJJMXoA7TFWInFbw="},{"mindGiftId":7821,"subBusType":2,"giftIcon":"19815","doctorAccount":0.0,"filtText":"热心为民","readFlag":1,"showDate":"2020-07-07 16:45:46","patientName":"**k","subBusTypeText":"图文咨询","busTypeText":"","doctorIdText":"","organText":"","departmentText":"","payFlagText":"","giftTypeText":"","mindGiftStatusText":"","readFlagText":"已读","giftIconToken":"1607671818:ngaridev:8xj_aRPaezsIJJMXoA7TFWInFbw="},{"mindGiftId":7816,"subBusType":2,"giftIcon":"19815","doctorAccount":0.0,"filtText":"12","readFlag":1,"showDate":"2020-07-07 15:01:32","patientName":"**k","subBusTypeText":"图文咨询","busTypeText":"","doctorIdText":"","organText":"","departmentText":"","payFlagText":"","giftTypeText":"","mindGiftStatusText":"","readFlagText":"已读","giftIconToken":"1607671818:ngaridev:8xj_aRPaezsIJJMXoA7TFWInFbw="},{"mindGiftId":7795,"subBusType":2,"giftIcon":"19815","doctorAccount":0.0,"filtText":"212121","readFlag":1,"showDate":"2020-07-01 15:12:03","patientName":"**k","subBusTypeText":"图文咨询","busTypeText":"","doctorIdText":"","organText":"","departmentText":"","payFlagText":"","giftTypeText":"","mindGiftStatusText":"","readFlagText":"已读","giftIconToken":"1607671818:ngaridev:8xj_aRPaezsIJJMXoA7TFWInFbw="}],"mindGiftNum":5},"evaInfo":{"evaList":[],"feedbackCountList":[],"evaNum":1},"appointConsultCallTimeLimit":120,"consultSet":{"onLineStatus":1,"onLineConsultPrice":0.0,"onLineConsultMessageButton":true,"onLineConsultMessage":20000,"appointStatus":1,"appointConsultPrice":0.0,"appointConsultCallTimeLimit":120,"professorConsultStatus":1,"professorConsultPrice":0.0,"recipeConsultStatus":1,"recipeConsultPrice":0.0,"patientTransferStatus":1,"patientTransferPrice":0.0,"signStatus":false,"signPrice":0.0,"appointDays":0,"platformOnLineConsultPrice":0.0,"platformAppointConsultPrice":0.1,"platformProfessorConsultPrice":0.1,"onLineRecomFlag":false,"appointRecomFlag":false,"patientTransferRecomFlag":false,"recipeConsultRecomFlag":false,"firstOnLineConsultFlag":false,"onLineConsultActualPrice":0.0,"onlineDisCountType":0,"firstAppointConsultFlag":false,"appointConsultActualPrice":0.0,"appointDisCountType":0,"canSign":false,"prescription":true,"platformOnLineConsultStatus":1,"platformAppointConsultStatus":1,"platformProfessorConsultStatus":1,"xiYaoRecipeRight":true,"zhongChengRecipeRight":true,"zhongRecipeRight":true,"gaoFangRecipeRight":true},"minkeElectronLicence":"","dogDaysFlag":false,"operation":true,"liveCourseFlag":false,"licenseImg":""}}

3.在自己主页中,进入我的咨询,点开审核健康管理

image.pngimage.pngimage.png

创建审核列表

X-Service-Method: createServiceWriteOffList
X-Ca-Key: ngari-wx

X-Content-MD5: X0jLs+HVHV074DbAthXYUg==
encoding: utf-8
X-Service-Id: vad.patientWriteOffService
入参

[{"orderId":"e11ef99c532649c1a73570b3f5196a3b","contentId":2163,"patientId":"2c94819b759637de0175b0b647a90004","requestUser":"2c94819b759637de0175b0b647a90004","expectantDoctor":75610,"expectedTime":null,"applicationNotes":"奥术大师大多所阿达"},[]]

返回体

{"code":200,"body":"1a3a35916d274df188005926334add56"}

image.pngimage.png

通过审核单id获取审核列表

X-Service-Method: getWriteOffListByWriteOffListId
X-Ca-Key: ngari-wx
X-Content-MD5: wa6OQ5NYul8B7aneoiZPcQ==
encoding: utf-8
X-Service-Id: vad.patientWriteOffService
入参

["1a3a35916d274df188005926334add56"]

返回体

{"code":200,"body":{"doctor":{"loginId":"5e742af07826c679a74991fd","urt":4369823,"doctorId":75610,"name":"双十一医生","gender":"1","userType":1,"birthDay":"1990-03-07 00:00:00","idNumber":"620102199003075134","profession":"12","organProfession":1097,"mobile":"18857148437","email":"","weiXin":"","introduce":"","domain":"1111111","honour":"","proTitle":"100","jobTitle":"","education":"","photo":"","doctorCertImage":"5e82bf532b8e0163c6519ec4","doctorCertImage2":"5e82bf532b8e0163c6519ec5","proTitleImage":"5e82bf532b8e0163c6519ec3","rating":9.9,"teams":false,"expert":false,"status":1,"createDt":"2020-03-31 00:00:00","lastModify":"2020-07-01 14:42:14","organ":1,"haveAppoint":0,"testPersonnel":0,"chief":0,"orderNum":1,"virtualDoctor":false,"source":1,"rewardFlag":false,"qrCode":"5fb4eccd3d630a60e041d48f","qrUrl":"http://weixin.qq.com/q/02CRSr8J84eF310000w07F","evaNum":3,"groupType":0,"generalDoctor":0,"searchRating":1029209.9,"articleId":"","consultAmount":311,"extendParam":{},"easemobStatus":1,"minkeElectronLicence":"","minkeDoctorCertCode":"","nurseWorkExperiencePhoto":"","nurseSpecializedCertPhotoList":"","doctorSortNum":1000,"currentOrgan":1,"cloudAppointSourceFlag":0,"canReport":false,"hasReport":false,"organProfessionText":"口腔科","professionText":"口腔科","organText":"浙大附属邵逸夫医院","statusText":"正常","proTitleText":"研究员","doctorCertImageToken":"1607678375:ngaridev:mTvw9nUgeyIzu8XPjJbP-y7epeA=","doctorCertImage2Token":"1607678375:ngaridev:EmqWekqAQQHJuIbUh7yTa-HV1K4=","proTitleImageToken":"1607678375:ngaridev:k9SNfLhwNML7ERDaXY7jLWvn3rk=","genderText":"男","userTypeText":"医生","jobTitleText":"","educationText":"","onlineText":"","busyFlagText":"","departmentText":"","sourceText":"自主注册","leaderText":"","groupTypeText":"普通医生团队","groupModeText":"","appointSourceFlagText":"","cloudAppointSourceFlagText":"","minkeElectronLicenceToken":"1607678375:ngaridev:DyC2efDhIlYD121z4AkcXL7JnLs=","currentOrganText":"浙大附属邵逸夫医院"},"writeOffList":{"id":719,"writeOffListId":"1a3a35916d274df188005926334add56","orderId":"e11ef99c532649c1a73570b3f5196a3b","servicepackId":"bec43c20254248378c5dd4b6d2fa57b4","servicepackName":"核销不限","servicepackDoctorId":75610,"servicepackOrganId":1,"contentId":2163,"serviceType":7,"patientId":"2c94819b759637de0175b0b647a90004","requestUser":"5faa2a913d630a6c7c66e11e","requestName":"张的秀","expectantDoctor":75610,"applicationNotes":"奥术大师大多所阿达","writeOffListStatus":0,"createTime":"2020-12-11 16:19:34","lastModified":"2020-12-11 16:19:34","alias":"面诊预约20","expectantDoctorText":"双十一医生","appointmentDoctorText":"","appointmentOrganText":"","appointmentDepartIdText":"","operationDoctorText":"","operationOrganText":"","cancellationModeText":"","writeOffListStatusText":"待审核","servicepackDoctorIdText":"双十一医生","servicepackOrganIdText":"浙大附属邵逸夫医院","serviceTypeText":"面诊预约","patientSexText":""},"patient":{"loginId":"5faa2a913d630a6c7c66e11e","mpiId":"2c94819b759637de0175b0b647a90004","patientName":"*的秀","patientSex":"1","birthday":"2016-03-07 00:00:00","patientType":"1","idcard":"1101**********6513","mobile":"159****4567","homeArea":"3301","createDate":"2020-11-10 13:52:17","lastModify":"2020-11-10 14:45:50","status":1,"guardianName":"*的秀","guardianFlag":false,"certificate":"1101**********6513","certificateType":1,"fullHomeArea":"浙江省 杭州市","patientUserType":1,"authStatus":0,"guardianCertificate":"1101**********4632","isOwn":true,"healthCards":[],"age":4,"urt":4369990,"guardianCertificateType":1,"patientSexText":"男","authStatusText":"未认证","patientUserTypeText":"儿童(有证件号)","certificateTypeText":"身份证","patientTypeText":"自费","statusText":"正常","defaultPatient":true,"educationText":"","guardianCertificateTypeText":"身份证","expectClinicPeriodTypeText":"","homeAreaText":"杭州市","countryText":"","marryText":"","residentText":"","houseHoldText":"","jobText":"","nationText":"","stateText":"","birthPlaceText":""},"otherDocBean":[]}}