@claudebernard/fhir-prescription-mocks

中文文档
2.7.0发布于 2026/11/04TypeScriptESM + CJS近 30 天下载 2028

FHIR R5 mock data for prescription control — shared test fixtures

原始使用文档
文档目录15 节
  1. Installation
  2. Usage
  3. Available mocks
  4. Patient bundles
  5. Prescription bundles
  6. Automedication bundles
  7. FHIR profile
  8. Changelog
  9. 1.3.1 (2026-07-22)
  10. Bug Fixes
  11. Bug Fixes
  12. Features
  13. Changelog
  14. 1.2.6 (2026-07-09)
  15. Bug Fixes

@claudebernard/fhir-prescription-mocks

FHIR R5 mock bundles for prescription control — ready-to-use typed test fixtures for patient and prescription scenarios.

Published from the fhir-monorepo repository, whose version this package carries. Versions are therefore sparse: a release only reaches npm when the mock data or the package itself changed.

Installation

npm install --save-dev @claudebernard/fhir-prescription-mocks

Usage

All exports are typed as Bundle from fhir/r5.

import {
  patientComplete,
  prescriptionComplete,
} from "@claudebernard/fhir-prescription-mocks";

// patientComplete is a Bundle — use it directly in your tests
expect(myValidator.validate(patientComplete)).toBe(true);

Available mocks

Patient bundles

ExportDescription
patientMinimalMinimal patient with required fields only
patientCompleteFully populated patient
patientPediatricPediatric patient
patientMultipleConditionsPatient with several active conditions
patientRenalCreatinineClearanceRenal patient — creatinine clearance observation
patientRenalGfrAbsoluteRenal patient — absolute GFR observation
patientRenalGfrNormalizedRenal patient — normalized GFR observation
patientUnderweightPastObservationUnderweight patient with a past observation
patientUsaUSA patient

Prescription bundles

ExportDescription
prescriptionCompleteComplete prescription with multiple medications
prescriptionSingleMedicationPrescription with a single medication line
prescriptionWithAlternativePrescription including a therapeutic alternative
prescriptionWithDocumentReferencePrescription linked to a document reference
prescriptionPosologyPrescription with detailed dosage instructions
prescriptionUsaUSA prescription

Automedication bundles

ExportDescription
automedicationCompleteSelf-reported OTC medication use — MedicationStatement resources (paracetamol, aspirin, diclofenac) plus their referenced Medication resources

Only the exports listed above ship with the package (files: ["dist", "README.md"]) — the raw JSON of the monorepo's fhir-mock/data/ is not published. In particular composite-anonymous-context.json has no export yet, so it is not reachable from npm.

FHIR profile

All bundles conform to FHIR R5 and use French pharmaceutical coding systems (ATC, BCB, CIS, CIP13).

Changelog

1.3.1 (2026-07-22)

Bug Fixes

  • only trigger implementation-guides when data/ actually changes (374f820)

1.3.0 (2026-07-22)

Bug Fixes

  • repair mojibake encoding and use semantic example filenames (c84b690), closes #224

Features

  • decompose mock bundles by FHIR resource type (09ba754)

Changelog

1.2.6 (2026-07-09)

Bug Fixes

  • try adding the changelog to the npm readme (123efd3)

版本与发布记录

@claudebernard/fhir-prescription-mocks 共发布 32 个版本,首次发布于 2026/06/25;过去 12 个月发布了 32 个版本。

版本发布日期距今
2.7.0latest2026/11/045 天前
2.6.02026/10/2119 天前
2.5.32026/10/021 个月前
2.5.12026/10/021 个月前
2.5.02026/09/291 个月前
2.4.22026/09/141 个月前

关于 @claudebernard/fhir-prescription-mocks 的常见问题

@claudebernard/fhir-prescription-mocks 是什么?

FHIR R5 mock data for prescription control — shared test fixtures

如何安装 @claudebernard/fhir-prescription-mocks?

在项目目录运行 npm install @claudebernard/fhir-prescription-mocks,或使用 pnpm add / yarn add / bun add。

@claudebernard/fhir-prescription-mocks 支持 TypeScript 吗?

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

@claudebernard/fhir-prescription-mocks 支持 ESM 还是 CommonJS?

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

@claudebernard/fhir-prescription-mocks 可以商用吗?

@claudebernard/fhir-prescription-mocks 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@claudebernard/fhir-prescription-mocks 的下载量有多少?

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

@claudebernard/fhir-prescription-mocks 还在维护吗?

最新版本 2.7.0 发布于 2026/11/04(5 天前);至今共发布 32 个版本,其中过去 12 个月发布了 32 个;首次发布于 2026/06/25。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。