@fhirfly-io/terminology 0.13.0 → 0.14.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 CHANGED
@@ -1886,6 +1886,46 @@ var JcodeEndpoint = class {
1886
1886
  }
1887
1887
  };
1888
1888
 
1889
+ // src/endpoints/ddi.ts
1890
+ var DdiEndpoint = class {
1891
+ constructor(http) {
1892
+ this.http = http;
1893
+ }
1894
+ /**
1895
+ * Look up interaction reference data for a single drug.
1896
+ * @param identifier - RxCUI, drug name, or NDC code
1897
+ * @param options - Optional settings (e.g., filter to specific label sections)
1898
+ */
1899
+ async reference(identifier, options) {
1900
+ let path = `/v1/ddi/reference/${encodeURIComponent(identifier)}`;
1901
+ if (options?.sections?.length) {
1902
+ const params = new URLSearchParams();
1903
+ params.set("sections", options.sections.join(","));
1904
+ path += `?${params.toString()}`;
1905
+ }
1906
+ return this.http.get(path);
1907
+ }
1908
+ /**
1909
+ * Look up interaction reference data for multiple drugs.
1910
+ * @param drugs - Array of RxCUI, drug name, or NDC identifiers (max 25)
1911
+ * @param options - Optional settings (e.g., filter to specific label sections)
1912
+ * @throws {ValidationError} If drugs array is empty or exceeds 25 items
1913
+ */
1914
+ async referenceMany(drugs, options) {
1915
+ if (drugs.length === 0) {
1916
+ throw new ValidationError("At least one drug identifier is required");
1917
+ }
1918
+ if (drugs.length > 25) {
1919
+ throw new ValidationError(`Batch size ${drugs.length} exceeds maximum of 25 drugs`);
1920
+ }
1921
+ const body = { drugs };
1922
+ if (options?.sections?.length) {
1923
+ body.sections = options.sections;
1924
+ }
1925
+ return this.http.post("/v1/ddi/reference", body);
1926
+ }
1927
+ };
1928
+
1889
1929
  // src/client.ts
1890
1930
  var Fhirfly = class {
1891
1931
  http;
@@ -1986,6 +2026,10 @@ var Fhirfly = class {
1986
2026
  * Bidirectional mapping between HCPCS J-codes and NDC drug codes.
1987
2027
  */
1988
2028
  jcode;
2029
+ /**
2030
+ * Drug-Drug Interaction reference — FDA label interaction text + RxNorm enrichment.
2031
+ */
2032
+ ddi;
1989
2033
  /**
1990
2034
  * Create a new FHIRfly client.
1991
2035
  *
@@ -2044,11 +2088,13 @@ var Fhirfly = class {
2044
2088
  this.msdrg = new MsdrgEndpoint(this.http);
2045
2089
  this.pos = new PosEndpoint(this.http);
2046
2090
  this.jcode = new JcodeEndpoint(this.http);
2091
+ this.ddi = new DdiEndpoint(this.http);
2047
2092
  }
2048
2093
  };
2049
2094
 
2050
2095
  exports.ApiError = ApiError;
2051
2096
  exports.AuthenticationError = AuthenticationError;
2097
+ exports.DdiEndpoint = DdiEndpoint;
2052
2098
  exports.DmdEndpoint = DmdEndpoint;
2053
2099
  exports.Fhirfly = Fhirfly;
2054
2100
  exports.FhirflyError = FhirflyError;