# @haau3/sdk 中文文档

规范地址：https://npmcn.com/package/%40haau3/sdk/

版本：0\.4\.5
npm 元数据更新时间：2026-11-16T22:18:24.820Z
中文译文更新时间：2026-11-17T05:20:33.972Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40haau3/sdk
原文对照：https://npmcn.com/package/%40haau3/sdk/?lang=original
项目主页：https://platform.haau3.com/
源码仓库：https://github.com/haau3/haau3-node

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：947 kB，7 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- Node.js 要求：\>=22
- 运行依赖：1 个
- 首次发布：2026-10-18T19:22:06.983Z
- 最新版本发布：2026-11-16T22:18:24.495Z
- 近 30 天下载量：6471（2026-10-17 至 2026-11-15，npm 官方下载统计）
- 已发布版本数：36（近 12 个月 36 个）

## 中文简介

Haau3平台的TypeScript SDK API:来自 SMART Scheduling Links 出版商的预约档位, Medical Advance 和 ACA 市场计划福利,药物列表调节, RxNorm, LOINC 和 ICD-10-CM 术语, CMS 国家提供商 D

## 安装

```sh
npm install @haau3/sdk
```

也可以使用：`pnpm add @haau3/sdk`、`yarn add @haau3/sdk`、`bun add @haau3/sdk`

## README

# @haau3/sdk (英语)

类型脚本 SDK [haau3 平台 API](https://docs.haau3.com/),作为打字机:

-   **时间安排 :** 在一次搜索中打开来自许多SMART Scheduling Links出版社的预约槽.
-   **医疗津贴:** 作为FHIR的医疗保险优惠和ACA市场计划 `InsurancePlan`, (中文(简体) ), 可按州或县搜索, 哪些提供者在计划网络.
-   **医生列表:** 从一个病人的FHIR药物记录中 核对了一份药物清单.

在同一键和 FHIR 基数上: RxNorm, LOINC 和 ICD- 10- CM 查看, 值集和代码 验证(术语),来自CMS国家供应商目录的从业人员和组织 (提供目录),和PHQ-9等标准FHIR问卷.

Haau3平台API在预览中:它可能随着我们构建而改变,通常是为了添加特性或改进性能.

又为彼道: [`haau3` 关于 PyPI](https://pypi.org/project/haau3/),对于去: [`github.com/haau3/haau3-go`](https://pkg.go.dev/github.com/haau3/haau3-go)。 。 。 .

## 安装

```sh
npm install @haau3/sdk
```

节点22或更新. SDK只运行在服务器上: 它拒绝从浏览器开始, 您的 API 在那里 关键是公开的.

## 认证

创建 API 密钥 [互联网档案馆的存檔,存档日期2013-12-02](https://platform.haau3.com/),然后设置为 `HAAU3_API_KEY` 或者通过它作为 `apiKey`。要尝试没有密钥的 API,请先拨打 Sandbox (参见 "沙盒"下面".

或者从您的项目文件夹中 制作密钥 [haau3 命令行](https://github.com/haau3/haau3-cli)数字 : `npx haau3 login`,则 `npx haau3 keys create`,它写到工程的env文件中,从未显示. 装入 程序启动时的文件,例如 `node --env-file=.env` 或者说 `process.loadEnvFile()`。 。 。 . 下一个,Js装入 `process.env` 自己来.

```ts
import { Haau3 } from "@haau3/sdk";

const haau3 = new Haau3(); // reads HAAU3_API_KEY
```

## 第一通电话

```ts
// Open appointment slots, here in Cambridge.
const { slots } = await haau3.searchSlots({ city: "Cambridge", state: "MA", limit: 1 });
console.log(slots[0] ?? "No open slots matched.");
```

FHIR 的答案是: 法尔语 [@ types/ fhir (帮助)](https://www.npmjs.com/package/@types/fhir)R4 类型, 也 导出为 `fhir4` (单位:千美元)`import type { fhir4 } from "@haau3/sdk"`) (中文(简体) ).

## 每次打一个电话

```ts
import { structureDosageRequest } from "@haau3/sdk";

// Scheduling: open appointment slots, here in Boston.
const { slots, total } = await haau3.searchSlots({ city: "Boston", state: "MA", limit: 10 });

// Provider directory: a practitioner by NPI, from CMS's National Provider Directory.
const practitioners = await haau3.searchPractitioner({ identifier: "1093209884" });

// Terminology: a LOINC code's display and properties.
const glucose = await haau3.codeSystemLookup({ system: "http://loinc.org", code: "2345-7" });

// Questionnaires: a form by its id, such as the PHQ-9.
const phq9 = await haau3.readQuestionnaire("44249-1");

// Medical Benefits: a Medicare Advantage or ACA Marketplace plan, and which providers are in its network.
const plan = await haau3.readInsurancePlan("H2406-013-000");
const network = await haau3.checkInsurancePlanNetwork("H3359-038-000", { npi: ["1518929058"] });

// Pharmacy Benefits: what a medication would cost, as the CARIN pharmacy benefit check, from a FHIR
// message Bundle. It is not yet open to customers.
const checked = await haau3.processMessage(message);

// MedList: one reconciled medication list from one patient's FHIR medication records. It receives
// patient data, so send it only under an executed agreement. Test data labelled as such works on
// every plan, and markAsTestData labels a request and every resource in it. Label only made-up data.
const list = await haau3.reconcileMedications(records);

// Structured Sig: a prescription's free-text directions as a FHIR Dosage, each element coded where the
// words support it and a review flag on anything to check. Send the directions, never a patient.
// structureDosageRequest builds the request.
const structured = await haau3.structureDosage(structureDosageRequest({ text: "Take 1 tablet by mouth twice daily" }));

// The Sandbox: the same calls, answered with fixed answers and a test insurer's synthetic data. A test
// key sends every call there (see "The Sandbox" below). Its pharmacy benefit check answers its test
// members only (https://docs.haau3.com/sandbox/example-health-plan).
const sandbox = new Haau3({ apiKey: testKey });
const sandboxChecked = await sandbox.processMessage(sandboxMessage);
```

按服务分组的每一种方法,连同其要求和在docs.haau3.com上的网页链接,都存在于 [日记](https://github.com/haau3/haau3-node/blob/main/api.md)。每个名称由其操作命名 爱德, 及其参数和从已公布的 spec 键入的答案.

## 沙发盒

沙发盒, `https://sandbox.haau3.com`,是API的构建和测试环境. 这个 在生产道路上为生产作业提供服务: 药房福利检查由测试保险人以合成方式回答 数据。 见 [页面存档备份,存于互联网档案馆. docs.haau3.com](https://docs.haau3.com/authentication) 因果报应,因果报应.

您的密钥模式选择客户端发送每通电话的地方. 测试密钥( A)`haau3_sk_test_…`转到 沙盒和活键`haau3_sk_live_…`生产,所以 `HAAU3_API_KEY` 单独移动应用程序 从相相相相相相相相相相相相相相相相. Sandbox 也完全没有钥匙来回答. 与 `HAAU3_API_KEY` 未设置, 名称 作为环境:

```ts
const sandbox = new Haau3({ environment: "sandbox" }); // or set HAAU3_ENVIRONMENT=sandbox
const statement = await sandbox.fhirMetadata();
console.log(sandbox.environment, sandbox.baseURL); // "sandbox" "https://sandbox.haau3.com"
```

像活键一样,在测试和活键开始生产前制造的钥匙。 当 在寄出任何信息之前 客户就已经做了 错误说钥匙来自哪里, 它的 `code` 说它是什么:

-   测试密钥 `environment: "production"` (单位:千美元)`test-key-outside-sandbox`(三);
-   活键,或测试前制作的活键和活键 `"sandbox"` 或带沙盒的地址 作为 `baseURL` (单位:千美元)`live-key-in-sandbox`, (中文(简体) ), `older-key-in-sandbox`(三);
-   没有名为 Sandbox 的密钥(`no-api-key`(三);
-   a 一个 `environment` (单位:千美元) `baseURL` 在另一个环境的地址上与 (单位:千美元)`environment-conflicts-with-base-url`(三);
-   键,在它之前有任何东西 `haau3_sk_` 前缀, 如引用一个 env 文件保存 (单位:千美元)`api-key-not-alone`) (中文(简体) ).

`environment` 财务报告和审定财务报表 `baseURL` 客户说它解决了.

`sandboxProcessMessage` 财务报告和审定财务报表 `sandboxMetadata`,沙盒的第一个地址在 `/v1/sandbox/fhir/r4`,则已贬值:呼叫 `processMessage` 财务报告和审定财务报表 `fhirMetadata` 换句话说 直到现在 地址,一个客户端发送到Sandbox自己的主机 发送到那里的操作。 这个 原始内容 `request()` 因此,在测试密钥上发送的首发地址路径到 Sandbox的宿主,它不为它服务.

## 带有 AI 编码代理

一个代理可以直接读取文件 :

-   [文件:haau3.com/llms.txt](https://docs.haau3.com/llms.txt) 列出每个文件页为 Markdown.
-   [(原始内容存档于2017-09-26). docs.haau3.com/ skill.md](https://docs.haau3.com/skill.md) 是一个 [特工技能](https://agentskills.io/specification) 上面写着平台做什么 如何呼叫 这个. `npx skills add https://docs.haau3.com` 把它添加到您的项目编码代理.
-   `https://docs.haau3.com/mcp` 是搜索文件的MCP服务器。 补之:
    -   克劳德代码 : `claude mcp add --transport http haau3 https://docs.haau3.com/mcp`
    -   代码 : `codex mcp add haau3 --url https://docs.haau3.com/mcp`
    -   光标, 在 `.cursor/mcp.json`数字 : `{ "mcpServers": { "haau3": { "url": "https://docs.haau3.com/mcp" } } }`
    -   VS 代码 : `code --add-mcp '{"name":"haau3","type":"http","url":"https://docs.haau3.com/mcp"}'`

这个 [haau3 命令行](https://github.com/haau3/haau3-cli) 让经纪人不曾见过 钥匙. `npx haau3 doctor --json` 检查项目的设置,和 `npx haau3 test --json` 做一个 在没有钥匙时在沙盒里呼叫每个服务. `npx haau3 login`,则 `npx haau3 keys create`后,在工程的掩码文件中插入一个密钥 浏览器.

## 选项

| 选项 | 默认 |  |
| --- | --- | --- |
| `apiKey` | `process.env.HAAU3_API_KEY` | 您的平台 API 键 。 一个测试键叫做"沙盒",一种活键生产. |
| `environment` | `process.env.HAAU3_ENVIRONMENT`模式 | `"production"` 或者说 `"sandbox"`名称 `"sandbox"` 没有钥匙就叫它. |
| `baseURL` | `process.env.HAAU3_BASE_URL`,然后环境地址 | API所在的地方,为站立或代理. API 密钥只发送到那里 . |
| `timeout` | `65000` | 毫秒一次尝试可能需要. |
| `maxRetries` | `1` | 在超时,网络故障,429或5xx后进行回放. |
| `fetch` | 全球 `fetch` | 要发送请求的获取 . |
| `fetchOptions` | `{ cache: "no-store" }` | 传入 `fetch` 每一个请求,任何运行时间. |
| `appInfo` | 无 | 您的应用程序名称, 版本和 URL, 在 SDK 之后发送到用户代理 . |

每个电话都要接 `{ timeout, maxRetries, signal, correlationId, headers, fetchOptions }` 作为最后 理由,只要求:

```ts
await haau3.searchSlots({ state: "MA" }, { timeout: 10_000, maxRetries: 0 });
```

宣布自己的信头的操作将它作为另一个选项,从信头中命名 并按规格输入. `processMessage` 带 `payerAuthorization`编号 `Payer-Authorization`数字 : 成员本人经其保险人授权, `Bearer` 您的应用程序从 成员登录在那里。 SDK对照API发送前的表格检查,拒绝一个 aPI不会接受而不重复, 在呼叫后无所作为.

```ts
const checked = await haau3.processMessage(message, { payerAuthorization: `Bearer ${accessToken}` });
```

`fetchOptions` 任何你运行的时间 `fetch` 接听客户端或一个电话:代理 `dispatcher` 从节点的undici, Cloudflare's `cf`下一张 `next`, (中文(简体) ), `keepalive`. SDK的亲身经历 方法,信头,身体,信号和定向总是获胜.

```ts
import { ProxyAgent } from "undici";

const haau3 = new Haau3({ fetchOptions: { dispatcher: new ProxyAgent("http://proxy.internal:8080") } });
```

除非我们.. `fetchOptions` 套装 `cache`,每个请求都会随 `cache: "no-store"` 地点 运行时的取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取取 一个 答案是您密钥的活数据, 而不是获取缓存应该保存的东西 。 缓存框架 `fetch` 跟随它:在下个.js中,它也保留 `next build` 发送请求时发出请求 页面,以及 `{ next: { revalidate: 60 } }` 缓存一个答案. `{ cache: undefined }` 不发送 `cache` 一点也不.

`appInfo` 在用户代理中命名您的应用程序, 在 SDK 自己之后, 当您创建库时, 一个插件 或者SDK上的命令线 它需要一个 `name`,则a `version` (单位:千美元) `url` 如果你有他们 客户端发送的每个请求都携带:

```ts
const haau3 = new Haau3({ appInfo: { name: "my-plugin", version: "1.2.0" } });
// User-Agent: haau3-node/<version> (node 24) my-plugin/1.2.0
```

名字和版本各取字母,数字, `-`, (中文(简体) ), `.`, (中文(简体) ), `_` 和其他字符 RFC 9110 允许在用户代理产品中,没有空格或斜线。 A 类 `url` 是 http 或 https URL,发送到 括号后面。 当客户提出时,在发出请求之前,其他任何要求都会被拒绝. A 类 `user-agent` 在电话中 `headers` 替换全部用户代理, SDK 包含的部分 .

重试会等待一个短暂的,不断增长的间隔, 或 API 是什么 `Retry-After` 信头说,当它是 60秒或更短时间。 更长的时间 `Retry-After` 一次失败,带着它.

## 错误

每个错误都是 `Haau3Error`,与 `requestId` aPI回答说。 有四种类型:

```ts
import { AuthError, ForbiddenError, NoAnswerError, RefusedError } from "@haau3/sdk";

try {
  await haau3.readInsurancePlan(id);
} catch (error) {
  if (error instanceof RefusedError) {
    error.status; // 400, 404, 410 and so on
    error.code; // why, when the API names it: "not-the-example" from the Sandbox
    error.outcome; // the OperationOutcome; Scheduling's errors carry `problem`
  } else if (error instanceof NoAnswerError) {
    error.reason; // "timeout", "network", "rate-limited", "unavailable", "server-error" or "unreadable"
    error.retryAfter; // seconds, when the API said
    error.detail; // for a timeout or a network failure: what failed, such as "ECONNREFUSED" or "TimeoutError"
  } else if (error instanceof ForbiddenError) {
    // 403: the key was accepted, and it may not make this request
    error.code; // why, when the API names it: "test-key-outside-sandbox", "live-key-in-sandbox", "phi-agreement-required", "not-open-to-customers"
    error.outcome; // why, in the API's words
  } else if (error instanceof AuthError) {
    // 401: the key was missing, unknown or revoked
  }
}
```

403是一个 `ForbiddenError`从不 `AuthError`: 密钥已被接受, 所以没有什么 旋转。 内容 `code` 说为什么API给它取名, 和它的信息在文字上说相同。 测试 键只在 Sandbox 中工作(`test-key-outside-sandbox`:发送活键,活键不会 在那里工作(`live-key-in-sandbox`:发送测试键). 客户端将每个密钥发给自己 环境,所以你用 `baseURL` 或称堕落者 `sandbox…` 使用活键的方法. `phi-agreement-required` 指组织 可能不会发送病人数据,请求中并非每个资源都被标为测试数据: `markAsTestData` 标签编造的数据. `not-open-to-customers` 表示操作尚未打开 给客户:预期答案,而不是请求中的过错. 没有密码 尸体会说什么 组织不得这样做.

A 类 `RefusedError`是因为 `code` 命名 API 给出一个时的理由 : `not-the-example` 从 Sandbox,它只回答每个操作的有文献记载的例子并拒绝任何其他请求.

无法制作的客户端丢入 `Haau3Error` {\\fn黑体\\fs22\\bord1\\shad0\\3ahbe\\4ah00\\fscx67\\fscy66\\2chffffff\\3ch808080}在寄出东西之前 `code` 到分支 上,哪个 `ClientErrorCode` 类型列表。 留言对一个人和名字都这么说 来源、选项或变量:

```ts
import { Haau3, Haau3Error } from "@haau3/sdk";

try {
  const haau3 = new Haau3();
} catch (error) {
  if (error instanceof Haau3Error && error.code === "no-api-key") {
    // set HAAU3_API_KEY, or name the Sandbox to call it with no key
  }
}
```

密码是 `no-api-key`, (中文(简体) ), `invalid-api-key`, (中文(简体) ), `api-key-not-alone`, (中文(简体) ), `test-key-outside-sandbox`, (中文(简体) ), `live-key-in-sandbox`, (中文(简体) ), `older-key-in-sandbox`, (中文(简体) ), `invalid-environment`, (中文(简体) ), `invalid-base-url`, (中文(简体) ), `environment-conflicts-with-base-url`, (中文(简体) ), `invalid-app-info`, (中文(简体) ), `no-fetch` 财务报告和审定财务报表 `in-browser`。两个API 还用保留API的名字来回答.

何时 `HAAU3_API_KEY` 没有价值,但 `.env.local` 或者说 `.env` 在当前文件夹中设置 `no-api-key` 信件名称 并说如何装入 。 SDK只有在没有的时候才会看 密钥从 `HAAU3_API_KEY`,只打开正则文件,而从未保留或显示该值.

没有回答从不报告为空结果,空结果从不报告为出错. 错误 信息从不包含 API 回复的主体, 和 主体 (`outcome` 或者说 `problem`)为 记录错误时从不打印。 API 回答的每个错误 `attempts`, (中文(简体) ), `durationMs` 财务报告和审定财务报表 `statusText` 我也一样.

FHIR 解答将与其操作解答的资源类型相对应。 其他一切,一个 `Bundle` 其中 `InsurancePlan` 有人要求,说,是一个 `NoAnswerError` 有理无据 `"unreadable"`。检查属于资源类型,而不是它内部的每个元素:这些元素都是输入的 正如FHIR R4声明的那样,SDK不验证每个.

`error.toJSON()` 给出一个错误,作为可以安全日志的普通对象:它的名称、消息和 字段上方是设定的,从不表示 `cause`。 。 。 . `JSON.stringify(error)` 打印 一样.

## 请求编号和时间

每一种方法的答案都可以按原样等待,或者通过 `.withResponse()` 请求编号和编号 来得正好,名字也一样 `request()` 使用 :

```ts
const { data: plan, requestId, durationMs, attempts } = await haau3.readInsurancePlan(id).withResponse();
```

它携带 `status` 财务报告和审定财务报表 `statusText` 也:答案本身的文本,或标准文本(`"OK"`当它 没有,就像HTTP/2的答案一样.

引用 `requestId` 当您请求帮助时: 它会在API自己的日志中找到请求.

找到一个由你自己的ID的要求, 比如你的工作或你的追踪,通过它作为 `correlationId`。它必须是UUID,这是API所保持的;在它被拒绝之前,其他任何东西都会被拒绝 发送。 API保留了它与请求的记录, 它回到答案和 aPI 回答的每个错误 :

```ts
const { data, correlationId } = await haau3.readInsurancePlan(id, { correlationId: jobId }).withResponse();
```

## 拨号

`pages()` 生成 FHIR 搜索的第一个页面和之后的每一个页面,每个页面之后 `next` 链接于 客户端自己的主机并停止连接到一个已经读取的页面:

```ts
const first = await haau3.searchInsurancePlan({ "coverage-area-state": "NC" });
for await (const page of haau3.pages(first)) {
  for (const entry of page.entry ?? []) console.log(entry.resource?.id);
}
```

`resources()` 输入查找的每页中的每一资源:

```ts
for await (const resource of haau3.resources(first)) {
  if (resource.resourceType === "InsurancePlan") console.log(resource.name);
}
```

它产生每个搜索模式为 `match`,或者说没有。 资源 a `_include` 或者说 `_revinclude` 带来了, 和搜索自己的 `OperationOutcome`但不在其中; `pages()` 给 每一个条目。 排程搜索页面 `limit` 财务报告和审定财务报表 `offset`,然后回答 `total`。 。 。 .

`matches()` 给出一页的匹配类型,输入,没有请求,以及 `resolve()` 发现 提供该页面中的引用名称,例如一个 `_include` 带来:

```ts
const page = await haau3.searchHealthcareService({
  "service-category": "pharm",
  "location.address-state": "FL",
  "location.address-postalcode": "33131",
  _include: ["HealthcareService:organization", "HealthcareService:location"],
});

for (const pharmacy of haau3.matches(page, "HealthcareService")) {
  const organization = haau3.resolve(page, pharmacy.providedBy, { type: "Organization" });
  const store = haau3.resolve(page, pharmacy.location?.[0], { type: "Location" });
  console.log(pharmacy.name, organization?.identifier?.[0]?.value, store?.address?.city);
}
```

`resolve()` 遵循 FHIR 的 Bundle 引用规则:绝对引用为条目 那个 `fullUrl`; 相对的解决方式为通过时持有的条目地址 该资源作为 `from`,否则就是地址以该类型和编号结尾的一个条目; `#id` 可见于 `from`是因为 `contained`这是 `undefined` 当页面不持有资源时,以及 当两个条目可以是该条目的,或者资源不是该条目的 `type`。 。 。 .

## 读取参数答案

FHIR 行动回答: `Parameters` 其部件名称为: `$lookup`是因为 `display` 财务报告和审定财务报表 `property` 组件, `$structure-dosage`是因为 `dosage` 页:1. `parameters()` 给每个部分一个名字 `parameter()` 一个,两个都没有请求, 因为FHIR自己的SDKs读一个(Firely's `Get` 财务报告和审定财务报表 `GetSingleValue`哈皮尔的 `ParametersUtil`) (中文(简体) ). 部分在 `value[x]` 其业务 名称. `parameter()` 当两个部分共享名称时抛出.

```ts
const lookup = await haau3.codeSystemLookup({ system: "http://loinc.org", code: "2345-7" });
console.log(haau3.parameter(lookup, "display")?.valueString);
```

每个都是客户端方法和软件包导出的一个普通函数,所以您存储的答案可以是 在浏览器中读取没有客户端和密钥 :

```ts
import { parameter, type fhir4 } from "@haau3/sdk";

function dosageOf(stored: fhir4.Parameters): fhir4.Dosage | undefined {
  return parameter(stored, "dosage")?.valueDosage;
}
```

## 浏览和验证

`lookupResult()` 读取 `$lookup` 回答,键入: 代码,它的系统和版本,它的显示, 不论它是 `abstract` (不使用,如ICD-10-CM标题),每个名称和每个 属性。 财产 `type` 命名其FHIR 类型 `value`因此,检查它缩小了值. `designations()` 按使用和语言来查找代码名称: 其系统和代码一起使用, a rFC 4647 匹配一个语言,所以 `en` 发现 `en-US`. ICD-10-CM的短标题是: `SYNONYM_USE` 指定,如果它与显示不同,并且每个代码系统 API 持有显示的名称 再次使用 `PREFERRED_FOR_LANGUAGE_USE`。 。 。 .

```ts
import { designations, SYNONYM_USE } from "@haau3/sdk";

const answer = await haau3.codeSystemLookup({ system: "http://hl7.org/fhir/sid/icd-10-cm", code: "E08.37X1" });
const lookup = haau3.lookupResult(answer);
console.log(lookup.display, lookup.abstract);
console.log(designations(lookup, { use: SYNONYM_USE, language: "en" })[0]?.value);
for (const property of lookup.properties) {
  if (property.type === "boolean") console.log(property.code, property.value);
}
```

`validationResult()` 读取 `$validate-code` 答案,来自代码系统或值集: `result`, (中文(简体) ), `display` 财务报告和审定财务报表 `message`。不匹配答案的显示 `result: false` 密码是自己的 显示在旁边,这意味着代码是有效的,只有标签不同.

```ts
const check = haau3.validationResult(
  await haau3.codeSystemValidateCode({ url: "http://loinc.org", code: "2345-7", display: "Glucose" }),
);
if (!check.result) console.log(check.message, check.display);
```

读者不知道的部分,正如答案所给出的,保留在 `other` 其级别列表 发现在, 一部分FHIR允许一次 来两次抛出。 每一个都是客户端的方法和一个普通的 函数由软件包导出,所以您存储的答案可以在没有客户端的情况下被读取.

## 结构西格

`structureDosageRequest()` 构建请求 `$structure-dosage` 取自方向,而且, 可选的药物编码RxNorm或NDC,作为FHIR `CodeableConcept`。 。 。 . `RXNORM_SYSTEM` 财务报告和审定财务报表 `NDC_SYSTEM` 是他们的代码系统。 这是一个简单的功能,所以它构建一个批次条目 (单位:千美元)`b.structureDosage(structureDosageRequest({ text }))`) (中文(简体) ).

答案只有一个 `dosage` 部分,一个FHIR `Dosage`,在任何个人应该使用的审查旗 检查. `reviewFlags()` 阅读每个旗帜的代码,显示 和它所在方向的文字, 和剂量名称的版本 :

```ts
import { reviewFlags, RXNORM_SYSTEM, structureDosageRequest } from "@haau3/sdk";

const answer = await haau3.structureDosage(
  structureDosageRequest({
    text: "Take 1 tablet by mouth daily",
    medication: { coding: [{ system: RXNORM_SYSTEM, code: "311354" }] },
  }),
);
const dosage = haau3.parameter(answer, "dosage")?.valueDosage;
if (dosage) {
  const review = reviewFlags(dosage);
  for (const flag of review.flags) console.log(flag.code, flag.display, flag.words);
  console.log(review.engineVersion, review.vocabularyVersion, review.rxnormRelease);
}
```

## 一项中的几项请求

`batch()` 向FHIR基地发出多次行动请求。 通过的函数得到一个 使用客户端自身方法的构建器,称为同一种方式,它会制作条目而不是发送. 每个条目都有自己的结果,按给出的顺序:

```ts
const [plan, counties] = await haau3.batch((b) => [
  b.readInsurancePlan("H2406-013-000"),
  b.listInsurancePlanCounties({ state: "NC" }),
]);

if (plan.ok) {
  plan.data; // fhir4.InsurancePlan
} else {
  plan.error; // a RefusedError or a NoAnswerError, as readInsurancePlan alone would have thrown
}
```

用代码构建的列表同样有用:

```ts
const lookups = await haau3.batch((b) =>
  codes.map((code) => b.codeSystemLookup({ system: "http://loinc.org", code, property: "SHORTNAME" })),
);
```

每个条目被检查为单独呼叫,单独失败,而其他人则回答. 一个条目 失败不重审 。 这批货本身经过了重试,并像任何呼叫一样投出 `.withResponse()` 提供其请求的ID。 API最多可接收100个条目,最多1个MIB,并给出一个 批次60秒,所以发送一个更长的列表作为多批次。 FHIR基地的每个行动都可以进行 以批次进行,但 `processMessage` 财务报告和审定财务报表 `reconcileMedications`,该光谱标记 `x-haau3-batchable: false`。 。 。 .

送来一批 `Bundle` 你创造了你自己, `fhirBatch()` 拿着,还给我 `batch-response` 如来相.

## 任何行动

`get()` 财务报告和审定财务报表 `post()` 以路径调用操作: SDK 这个版本没有方法 然而,或有一个工具在光谱中找到。 每一个选择路径作为 spec 写入它, 每个的值 `{name}` 内 `pathParams`,则 `query`,则 `body` (计: `post()`)和FHIR类型,答案可能是: 内 `expects`除了每个呼叫选项 他们投出同样的错误,回答 `.withResponse()`,正如每个操作自己的方法所做的:

```ts
const { data: practitioner, requestId } = await haau3
  .get<Fhir4.Practitioner>("/v1/fhir/r4/Practitioner/{id}", {
    pathParams: { id: "Practitioner-1093209884" },
    expects: ["Practitioner"],
  })
  .withResponse();
```

每个值被编码到路径中,一个错误的信息将路径命名为您所写的路径,从不 数值。 A 类 `{name}` 无值,或无值 `{name}`,在发送任何信息之前被拒绝.

## 任何请求

`request()` 在你给出请求时发出请求,并返回API回答的内容,不管是什么 状态,包括其状态文本、标题、请求编号、尝试和持续时间:

```ts
const { status, statusText, body, requestId } = await haau3.request({ method: "GET", path: "/v1/scheduling/publishers" });
```

## 版本数

这个SDK是 `0.y.z` 当 API 处于预览状态时 : 微量发布可能会改变一个方法需要什么或者 答案,而补丁释放则永远不会. [变动情况](https://npmcn.com/package/%40haau3/sdk/CHANGELOG.md) 列出每个发布,以及 a 使用新版本的 API 的光谱名称; `SPEC_VERSION` 是一个a 释放来源.

## 许可证

[麻省理工学院](https://npmcn.com/package/%40haau3/sdk/LICENSE)

## 常见问题

### @haau3/sdk 是什么？

Haau3平台的TypeScript SDK API:来自 SMART Scheduling Links 出版商的预约档位, Medical Advance 和 ACA 市场计划福利,药物列表调节, RxNorm, LOINC 和 ICD-10-CM 术语, CMS 国家提供商 D

### 如何安装 @haau3/sdk？

在项目目录运行 npm install @haau3/sdk，或使用 pnpm add / yarn add / bun add。

### @haau3/sdk 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @haau3/sdk 支持 ESM 还是 CommonJS？

同时提供 ES Module 与 CommonJS 入口，import 和 require\(\) 都可以使用，打包工具会自动选择合适的版本。

### @haau3/sdk 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=22。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @haau3/sdk 可以商用吗？

@haau3/sdk 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @haau3/sdk 的下载量有多少？

根据 npm 官方下载统计，@haau3/sdk 在 2026/10/17 – 2026/11/15 这 30 天内被下载 6,471 次，日均约 216 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @haau3/sdk 还在维护吗？

最新版本 0\.4\.5 发布于 2026/11/17（今天）；至今共发布 36 个版本，其中过去 12 个月发布了 36 个；首次发布于 2026/10/19。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

