@fhirfly-io/terminology 0.11.0 → 0.12.0
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/dist/index.cjs +72 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +259 -1
- package/dist/index.d.ts +259 -1
- package/dist/index.js +72 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1525,6 +1525,71 @@ var Opcs4Endpoint = class {
|
|
|
1525
1525
|
}
|
|
1526
1526
|
};
|
|
1527
1527
|
|
|
1528
|
+
// src/endpoints/dmd.ts
|
|
1529
|
+
var DmdEndpoint = class {
|
|
1530
|
+
constructor(http) {
|
|
1531
|
+
this.http = http;
|
|
1532
|
+
}
|
|
1533
|
+
/**
|
|
1534
|
+
* Look up a single dm+d concept by code.
|
|
1535
|
+
*
|
|
1536
|
+
* @param code - dm+d code (SNOMED-style numeric identifier, 6-18 digits)
|
|
1537
|
+
* @param options - Response shape and include options
|
|
1538
|
+
* @returns dm+d concept data
|
|
1539
|
+
*
|
|
1540
|
+
* @example
|
|
1541
|
+
* ```ts
|
|
1542
|
+
* const result = await client.dmd.lookup("39732311000001104");
|
|
1543
|
+
* console.log(result.data.name); // "Paracetamol 500mg tablets"
|
|
1544
|
+
* ```
|
|
1545
|
+
*/
|
|
1546
|
+
async lookup(code, options) {
|
|
1547
|
+
return this.http.get(`/v1/dmd/${encodeURIComponent(code)}`, options);
|
|
1548
|
+
}
|
|
1549
|
+
/**
|
|
1550
|
+
* Look up multiple dm+d codes in a single request.
|
|
1551
|
+
*
|
|
1552
|
+
* @param codes - Array of dm+d codes (max 100)
|
|
1553
|
+
* @param options - Response shape, include, and batch options
|
|
1554
|
+
* @returns Batch response with results for each code
|
|
1555
|
+
*/
|
|
1556
|
+
async lookupMany(codes, options) {
|
|
1557
|
+
if (codes.length === 0) throw new ValidationError("codes array must not be empty");
|
|
1558
|
+
if (codes.length > 100) throw new ValidationError(`dm+d batch lookup supports max 100 codes, got ${codes.length}`);
|
|
1559
|
+
return this.http.post(
|
|
1560
|
+
"/v1/dmd/_batch",
|
|
1561
|
+
{ codes },
|
|
1562
|
+
options
|
|
1563
|
+
);
|
|
1564
|
+
}
|
|
1565
|
+
/**
|
|
1566
|
+
* Search for dm+d concepts.
|
|
1567
|
+
*
|
|
1568
|
+
* @param params - Search parameters (q, concept_type, status)
|
|
1569
|
+
* @param options - Pagination and response shape options
|
|
1570
|
+
* @returns Search results with facets
|
|
1571
|
+
*
|
|
1572
|
+
* @example
|
|
1573
|
+
* ```ts
|
|
1574
|
+
* // Search for paracetamol products
|
|
1575
|
+
* const results = await client.dmd.search({ q: "paracetamol" });
|
|
1576
|
+
*
|
|
1577
|
+
* // Filter by concept type
|
|
1578
|
+
* const results = await client.dmd.search({
|
|
1579
|
+
* q: "amoxicillin",
|
|
1580
|
+
* concept_type: "VMP"
|
|
1581
|
+
* });
|
|
1582
|
+
* ```
|
|
1583
|
+
*/
|
|
1584
|
+
async search(params, options) {
|
|
1585
|
+
return this.http.search("/v1/dmd/search", {
|
|
1586
|
+
...params,
|
|
1587
|
+
...options,
|
|
1588
|
+
include: options?.include?.join(",")
|
|
1589
|
+
});
|
|
1590
|
+
}
|
|
1591
|
+
};
|
|
1592
|
+
|
|
1528
1593
|
// src/client.ts
|
|
1529
1594
|
var Fhirfly = class {
|
|
1530
1595
|
http;
|
|
@@ -1590,6 +1655,11 @@ var Fhirfly = class {
|
|
|
1590
1655
|
* UK NHS procedural coding system.
|
|
1591
1656
|
*/
|
|
1592
1657
|
opcs4;
|
|
1658
|
+
/**
|
|
1659
|
+
* dm+d (Dictionary of Medicines and Devices) lookups.
|
|
1660
|
+
* UK NHS medicines reference data standard covering VTM/VMP/AMP/VMPP/AMPP.
|
|
1661
|
+
*/
|
|
1662
|
+
dmd;
|
|
1593
1663
|
/**
|
|
1594
1664
|
* Create a new FHIRfly client.
|
|
1595
1665
|
*
|
|
@@ -1641,11 +1711,13 @@ var Fhirfly = class {
|
|
|
1641
1711
|
this.sma = new SmaEndpoint(this.http);
|
|
1642
1712
|
this.hcc = new HccEndpoint(this.http);
|
|
1643
1713
|
this.opcs4 = new Opcs4Endpoint(this.http);
|
|
1714
|
+
this.dmd = new DmdEndpoint(this.http);
|
|
1644
1715
|
}
|
|
1645
1716
|
};
|
|
1646
1717
|
|
|
1647
1718
|
exports.ApiError = ApiError;
|
|
1648
1719
|
exports.AuthenticationError = AuthenticationError;
|
|
1720
|
+
exports.DmdEndpoint = DmdEndpoint;
|
|
1649
1721
|
exports.Fhirfly = Fhirfly;
|
|
1650
1722
|
exports.FhirflyError = FhirflyError;
|
|
1651
1723
|
exports.HccEndpoint = HccEndpoint;
|