npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@icreate/hb-basic-js-sdk

v0.0.18-beta.3

Published

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

Downloads

53

Readme

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'
  // 退出登录
  logout:'/user/logout'
  // 更据AccessKey获取token
  tokenByAccessKey:'/user/token'
  // 获取流水号格式
  serialNumberBookRuleList:'/serial/number/book/rule/list',
  // 获取用户信息详情
  getUserInfo: baseUrl + '/user/info/byId'

}

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

$request.api.login({ code: data.code, password: data.password })
$request.api.getUserInfoByToken({ token })