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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@aiii/aiii-psp-sdk

v0.0.166

Published

Aiii PSP SDK

Readme

@aiii/aiii-psp-sdk

AIII PSP/PAP API SDK - 醫療服務平台 API 整合套件

專案簡介

此套件提供完整的 AIII PSP API 整合方案,讓開發者能輕鬆串接 AIII 醫療服務平台的各種功能,包括醫師群組管理、病患資訊存取、醫療數據同步等。此 SDK 能大幅減少重複撰寫 API 呼叫的程式碼,提供類型安全且一致的介面。

主要功能:

  • 醫師群組 (Med Group)
  • 病患群組 (Patient Group)

安裝方式

在安裝前,請先設定 .npmrc 檔案以取得存取權限:

設定 .npmrc

在專案根目錄(與 package.json 同目錄)建立 .npmrc 檔案,內容如下:

//registry.npmjs.org/:_authToken=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

註:此 token 具有 @aiii 的 private 套件唯讀權限。

使用 npm 安裝

npm install @aiii/aiii-psp-sdk

使用 bun 安裝

bun add @aiii/aiii-psp-sdk

快速開始

以下是一個最小可執行的範例,展示如何初始化 SDK 並呼叫醫師群組 API:

import { PSP } from '@aiii/aiii-psp-sdk';

(async () => {
  // 建立 PSP 物件,設定 site 與 apiEndpoint
  const production = process.env.NODE_ENV === 'production'; // 後端環境變數
  // const production = environment.production ; // 前端環境變數 (如 Angular/React/Vue)


  const psp = new PSP({
    site: 'drCare',
    apiEndpoint: production
      ? 'https://aiii-api-pap-171888412817.asia-east1.run.app'
: 'https://aiii-api-pap-858619986767.asia-east1.run.app';
, // 設定 API 端點
    apiKey: 'your-api-key', // 設定 API 金鑰
    authToken: 'your-auth-token', // 設定 Auth Token, 前端使用 firebase auth 的 token, 後端使用產品 team 產出的 token
  });

  const medGroup = psp.medGroup; // 取得 medGroup 物件
  
  try {
    // 取得醫師群組列表
    const medGroupList = await medGroup.getMedGroupList({
      fullTextSearch: '',
    });
    console.log('醫師群組列表:', medGroupList);
  } catch (error) {
    console.error('API 呼叫錯誤:', error);
  }
})();

API 規格

API Endpoint:

  • 測試環境: https://aiii-api-pap-858619986767.asia-east1.run.app
  • 正式環境: https://aiii-api-pap.aiii.ai

API 使用方式

SDK 提供多種 API 模組,每個模組處理不同的功能領域。以下是主要模組與其用法:

醫師群組 API (medGroup)

以下是 medGroup 模組提供的功能和使用方式:

import { PSP } from '@aiii/aiii-psp-sdk';

const psp = new PSP({
  site: 'drCare',
  apiEndpoint: 'https://aiii-api-pap-858619986767.asia-east1.run.app',
  apiKey: 'your-api-key',
  authToken: 'your-auth-token',
});

// 範例 1: 取得醫師群組列表
const medGroupList = await psp.medGroup.getMedGroupList({
  fullTextSearch: '內科',
});

// 範例 2: 建立醫師群組
const newMedGroup = await psp.medGroup.createMedGroup({
  name: '心臟內科團隊',
  description: '專注於心臟疾病治療與研究',
  // 其他必要欄位...
});

// 範例 3: 取得單一醫師群組
const medGroup = await psp.medGroup.getMedGroupItem('med-group-id');

// 範例 4: 更新醫師群組
const updatedMedGroup = await psp.medGroup.updateMedGroup('med-group-key', {
  name: '心臟內科專科團隊',
  description: '更新的描述內容',
});

// 範例 5: 取得邀請連結
const inviteUrls = await psp.medGroup.getMedGroupInviteUrl('med-group-id');
console.log('病患群組邀請連結:', inviteUrls.patientGroup.url);
console.log('醫療群組邀請連結:', inviteUrls.medicalGroup.url);
console.log('醫師群組邀請連結:', inviteUrls.physicianGroup.url);

// 範例 6: 取得綁定的病患群組列表
const patientGroups = await psp.medGroup.getMedGroupLinkPatientGroupList('med-group-id');

// 範例 7: 變更醫師群組狀態
await psp.medGroup.updateMedGroupStatus('med-group-id', 'active');

// 範例 8: 刪除醫師群組
await psp.medGroup.deleteMedGroup('med-group-id');

其他 API 模組

SDK 還提供了其他 API 模組,如病患群組管理、醫療記錄存取等。請參考完整的 API 文件或原始碼以獲取更多資訊。

配置選項

初始化 SDK 時,可提供以下配置選項:

| 選項 | 類型 | 必填 | 預設值 | 說明 | |------|------|------|--------|------| | site | string | 是 | - | 站台識別碼 (site key) | | apiEndpoint | string | 是 | - | API 端點 URL | | apiKey | string | 是 | - | API 金鑰 | | authToken | string | 否 | undefined | 身分驗證 token,某些 API 操作必填 |

開發與貢獻指南

如果您想要貢獻此專案,請遵循以下步驟:

  1. Clone 儲存庫
git clone [email protected]:Aiii-Developers/aiii-api-pap.git
cd aiii-api-pap/sdk
  1. 安裝相依套件
npm install
  1. 進行修改並測試
npm run build # 建構 TypeScript
  1. 提交變更
    • 遵循 Conventional Commits 規範
    • 確保所有測試通過
    • 提交 Pull Request

本地開發

執行以下命令以進行本地開發:

npm run build -- --watch # 即時編譯變更

提示展示