Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@icreate/hb-basic-js-sdk

Package Overview
Dependencies
Maintainers
10
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@icreate/hb-basic-js-sdk

``` 0.0.11 新增获取门诊住院患者年龄 ```

  • 0.0.17-beta.13
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
10
Weekly downloads
 
Created
Source

feature

0.0.11 新增获取门诊住院患者年龄

引入

import HBBasicClient from '@icreate/hb-basic-js-sdk'

创建请求实例

const $request = new HBBasicClient({
  baseURL: 'http://192.168.2.234:20010/HBBasicServerApi',
  appId: 'his-enjoyor',
  secrect: 'HJCq5T4VqCzVWKjzNHTYB7QaTCloPC'
})

请求、响应拦截

// 添加请求拦截
$request.httpClient.interceptors.request.use(function (config) {
  config.headers = {
    token: sessionStorage.token ?? ''
  }
  console.log(config.url, config.data)
  return config
})
// 添加响应拦截
$request.httpClient.interceptors.response.use(
  function (response) {
    // console.log(response, '自定义响应拦截0')

    if (response.code === 200) {
      console.log(response.data && JSON.parse(response.data))
      return Promise.resolve(response.data && JSON.parse(response.data))
    } else {
      Message.error(response.message)
      return Promise.reject(response)
    }
  },
  function (error) {
    Message.error('Error')
    console.log(error, '自定义响应拦截error')
    return Promise.reject(error)
  }
)

api 调用

以下为全部 api 的实现(持续集成中...),返回值皆为 promise 对象。
const base = {
  // 登录
  login: '/user/login',
  // 判断科室是否存在对应的职能
  checkDept: '/org/check/dept/fun',
  // 根据 token 获取用户信息
  getUserInfoByToken: '/user/information',
  // 获取用户所在科室与病区
  getUserDeptList: '/user/dept/list',
  //修改用户密码
  setPassWord: '/user/password/update',
  //获取用户权限科室
  getAuthDeptList: '/user/auth/dept/list',
  //获取用户特殊权限列表
  getUserSpecRightList: '/user/special/right/list',
  //CA 登录接口
  caLogin: '/user/login/ca',
  //获取应用列表
  getApplist: '/app/list',
  //特殊权限注册
  registerSpecRight: '/special/right/register',
  //注册应用菜单
  registerAppMenu: '/app/menu/register',
  //注册应用菜单功能按钮
  registerAppMenuOper: '/app/menu/oper/register',
  //获取指定用户应用菜单列表
  getAppMenuList: '/app/menu/list',
  //获取指定用户菜单下的按钮列表
  getAppMenuOperList: '/app/menu/oper/list',
  // 获取用户权限应用列表
  getAppUserRightList: '/app/user/right/list',
  //记录用户最近访问菜单
  setVisitRecord: '/app/module/visit/record/save',
  //获取用户最近访问菜单列表
  getVisitRecordList: '/app/recent/module/list',
  //获取用户常用菜单列表
  getCommonMenuList: '/common/menu/list',
  //用户常用功能菜单注册
  registerCommonMenu: '/common/menu/register',
  //取消用户常用菜单注册
  registerCommonMenuCancel: '/common/menu/cancel/register',
  //用户常用菜单排序
  sortCommonMenu: '/common/menu/sort',
  //获取机构列表
  getOrgList: '/org/list',
  //根据科室或病区获取机构信息
  getInfoByDept: '/org/information/by/dept',
  //检查两个科室或病区是否属于同一分院
  checkOrgSame: '/org/check/same',
  //判断用户是否是某个病区领导(护士长)
  checkNurseUnitLeader: '/user/check/nursing/unit/leader',
  //判断用户是否是某个科室领导(科主任)
  checkDeptLeader: '/user/check/dept/leader',
  // 根据指定流水号编码获取流水号
  getSerialNum: '/serial/number/book/get',
  //注册流水号
  registerSerialNum: '/serial/number/book/register',
  //获取字典数据分页列表
  getDictDataPage: '/dict/data/page',
  //根据菜单类别获取菜单列表
  getAppMenuCateList: '/app/menu/category/list',
  //获取应用字典数据分页列表
  getAppDictDataPage: '/app/dict/data/page',
  //获取应用参数值列表
  getAppParamList: '/app/param/list',
  //根据应用菜单编码获取已注册系统参数列表
  getSystemParamList: '/system/param/list',
  //获取系统参数值
  getSystemParamValue: '/system/param/value',
  //设置系统参数
  setSystemParam: '/system/param/settings',
  //根据应用菜单编码获取已注册本地参数列表
  getLocalParamList: '/local/param/list',
  //获取本地参数值
  getLocalParamValue: '/local/param/value',
  //本地参数设置
  setLocalParam: '/local/param/settings',
  //本地参数值设置
  setLocalParamValue: '/local/param/value/settings',
  //获取系统参数值列表
  getSystemParamValueList: '/system/param/value/list',
  //客户端验证
  checkClient: '/client/check',
  //客户端注册
  registerClient: '/client/register',
  //根据客户端编码获取客户端信息
  getClientInfo: '/client/info',
  //获取数据验证规则列表
  getDataValidRuleList: '/data/validation/rule/list',
  // 获取全局唯一ID
  getUniqueKey: '/common/key/get',
  // 包上传注册
  packageRegister: '/package/register',
  // 获取机构下全部病区科室
  getDeptListByOrg: '/org/dept/list',
  // 获取机构下全部建筑与楼层
  getOrgBuildingList: '/org/building/list',
  // 获取机构或科室下的全部医生或护士
  getOrgUserList: '/org/user/list'
  // 获取字典数据
  getDictList: '/dict/get'
  // 获取住院患者年龄
  getInpatientAge:'/sys/getInpatientAge',
  // 获取门诊患者年龄
  getOutpatientAge:'/sys/getOutpatientAge'
  // 根据工号获取用户信息
  getUserByCode:'/user/code'
  // 根据全部用户信息
  getUserList:'/user/list'
  //  获取用户权限科室-病区
  getUserDeptWardList : baseUrl + '/user/dept/ward/list'
  //  验证用户密码
  userVerifyPassword: baseUrl + '/user/verify/password',
  //  获取注册的医生、护士
  getUserRegisterList: baseUrl + '/user/register/list'
  //  获取用户权限机构列表
  getUserAuthOrgList: baseUrl + '/user/auth/org/list'
  //  获取急诊科室
  getErDeptList: '/org/er/dept/list'
  //  获取医生病区
  getDoctorWard: '/user/doctor/ward'
  //  获取科室主任
  getDeptDirector: baseUrl + '/user/dept/director'
  //  获取诊区
  listConsultingArea: baseUrl + '/appt-std-register-type/list'
  //  获取诊室
  listConsultingRoom: baseUrl + '/appt-consulting-room/list'
  //  获取科室科目配置信息
  listDeptSubject: baseUrl + '/appt-dept-subject/list'
  //  获取班次配置
  listDuration: baseUrl + '/appt-duration/list'
  //  获取标准号类信息
  listStdRegisterType: baseUrl + '/appt-std-register-type/list'
  // 认证授权
  authorization:'/verify/api'

}

调用案例($request.api.key(), key 为上述对象的键名,参数会有提示,请严格按照提示进行传参):
$request.api.login({ code: data.code, password: data.password })
$request.api.getUserInfoByToken({ token })

FAQs

Package last updated on 26 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc