@haste-health/hl7.fhir.r4.test-data 0.127.0 → 0.127.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# @haste-health/hl7.fhir.r4.test-data
|
|
2
|
+
|
|
3
|
+
Example FHIR R4 (4.0.1) resources for tests: the examples HL7 publishes with the R4 specification, mostly one per resource type, covering 67 resource types from `Account` to `ValueSet`. They are the files from the specification's examples download (`patient-example.json`, `observation-example.json`, `medicationrequest0301.json` and so on), with an `.index.json` so that `@haste-health/artifacts` can load them by resource type.
|
|
4
|
+
|
|
5
|
+
Haste Health uses them as fixtures. `@haste-health/fhir-validation` validates every example against the HL7 core StructureDefinitions in its structural and profile tests, and they are the sample inputs whenever a test needs a realistic resource of a given type.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install --save-dev @haste-health/hl7.fhir.r4.test-data
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { loadArtifacts } from "@haste-health/artifacts";
|
|
17
|
+
import { R4 } from "@haste-health/fhir-types/versions";
|
|
18
|
+
|
|
19
|
+
const patients = loadArtifacts({
|
|
20
|
+
fhirVersion: R4,
|
|
21
|
+
resourceType: "Patient",
|
|
22
|
+
currentDirectory: import.meta.dirname,
|
|
23
|
+
loadDevelopmentPackages: true,
|
|
24
|
+
onlyPackages: ["@haste-health/hl7.fhir.r4.test-data"],
|
|
25
|
+
});
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
`loadArtifacts` only reads `dependencies` unless `loadDevelopmentPackages` is set, so pass it when the package is a dev dependency, which it normally should be.
|
|
29
|
+
|
|
30
|
+
## Contents
|
|
31
|
+
|
|
32
|
+
- `examples-json/`: 69 JSON files holding 86 resources (a few files are Bundles whose entries count individually) across 67 resource types. Observation has three examples and Organization two; every other type has one. The folder also holds 10 XML copies and 21 `.json.out` files, which are not indexed and not loaded.
|
|
33
|
+
- `.index.json`: one entry per JSON file with its `resourceType`.
|
|
34
|
+
|
|
35
|
+
Resource types with an example: Account, AllergyIntolerance, Appointment, AppointmentResponse, AuditEvent, Basic, Binary, BodyStructure, CapabilityStatement, CareTeam, ClinicalImpression, CodeSystem, Communication, CompartmentDefinition, Composition, ConceptMap, Condition, Consent, DetectedIssue, Device, DeviceMetric, DeviceUseStatement, DiagnosticReport, DocumentReference, Encounter, Endpoint, EpisodeOfCare, FamilyMemberHistory, Flag, Goal, GraphDefinition, Group, HealthcareService, Immunization, ImplementationGuide, Linkage, List, Location, MedicationAdministration, MedicationDispense, MedicationRequest, MedicationStatement, MessageDefinition, MessageHeader, MolecularSequence, NamingSystem, Observation, OperationDefinition, OperationOutcome, Organization, Parameters, Patient, PaymentNotice, Person, Practitioner, PractitionerRole, Questionnaire, QuestionnaireResponse, RiskAssessment, Schedule, Slot, Specimen, StructureMap, Subscription, Substance, SupplyDelivery, ValueSet.
|
|
36
|
+
|
|
37
|
+
## Links
|
|
38
|
+
|
|
39
|
+
- [npm](https://www.npmjs.com/package/@haste-health/hl7.fhir.r4.test-data)
|
|
40
|
+
- [Source](https://github.com/HasteHealth/HasteHealth/tree/main/artifacts/r4/test-data)
|
|
41
|
+
- Upstream: [HL7 FHIR R4 downloads](https://hl7.org/fhir/R4/downloads.html) (the examples archive)
|
|
42
|
+
- Related packages: [@haste-health/artifacts](https://www.npmjs.com/package/@haste-health/artifacts), [@haste-health/hl7.fhir.r4.core](https://www.npmjs.com/package/@haste-health/hl7.fhir.r4.core), [@haste-health/hl7.fhir.r4b.test-data](https://www.npmjs.com/package/@haste-health/hl7.fhir.r4b.test-data)
|
|
43
|
+
|
|
44
|
+
The example resources are HL7 International's, published under [CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/). The packaging is part of [Haste Health](https://haste.health), licensed under [Apache-2.0](https://github.com/HasteHealth/HasteHealth/blob/main/LICENSE).
|