med-research-mcp 0.7.0 → 0.7.1

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.
@@ -614,7 +614,7 @@ var import_node_fs = require("fs");
614
614
  var import_node_path = require("path");
615
615
  var import_meta2 = {};
616
616
  function packageVersion() {
617
- if (true) return "0.7.0";
617
+ if (true) return "0.7.1";
618
618
  const moduleDir = typeof __dirname !== "undefined" ? __dirname : import_meta2.dirname;
619
619
  return JSON.parse((0, import_node_fs.readFileSync)((0, import_node_path.join)(moduleDir, "../../package.json"), "utf-8")).version;
620
620
  }
@@ -864,6 +864,8 @@ function unratedExcludedWarning(studyTypes, minDesignTier) {
864
864
  // src/core/pubmed.ts
865
865
  var EUTILS_BASE = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils";
866
866
  var ESEARCH_LIMIT = 9999;
867
+ var OPEN_DATE_FROM = "1000";
868
+ var OPEN_DATE_TO = "3000";
867
869
  var RELEVANCE_BLOCK = 500;
868
870
  var DEFAULT_BROAD_THRESHOLD = 1e5;
869
871
  var SOFT_BROAD_THRESHOLD = 1e4;
@@ -972,8 +974,8 @@ var NcbiClient = class {
972
974
  const params = new URLSearchParams({ db: "pubmed", term, retmode: "json" });
973
975
  if (input.dateRange?.from || input.dateRange?.to) {
974
976
  params.set("datetype", "pdat");
975
- if (input.dateRange.from) params.set("mindate", input.dateRange.from.replace(/-/g, "/"));
976
- if (input.dateRange.to) params.set("maxdate", input.dateRange.to.replace(/-/g, "/"));
977
+ params.set("mindate", (input.dateRange.from || OPEN_DATE_FROM).replace(/-/g, "/"));
978
+ params.set("maxdate", (input.dateRange.to || OPEN_DATE_TO).replace(/-/g, "/"));
977
979
  }
978
980
  const byDate = input.sort === "date";
979
981
  if (!byDate) params.set("sort", "relevance");
@@ -1559,14 +1561,13 @@ var EuropePmcAdapter = class extends RestAdapter {
1559
1561
  super(http);
1560
1562
  }
1561
1563
  buildQuery(input, types) {
1562
- let query = withoutPubMedTags(input.query);
1563
- if (types) query = `(${query}) AND (${types.map((t) => `PUB_TYPE:"${t}"`).join(" OR ")})`;
1564
+ const query = withoutPubMedTags(input.query);
1565
+ const clauses = [];
1566
+ if (types) clauses.push(types.map((t) => `PUB_TYPE:"${t}"`).join(" OR "));
1564
1567
  const from = isoDateBound(input.dateRange?.from, "from");
1565
1568
  const to = isoDateBound(input.dateRange?.to, "to");
1566
- if (from || to) {
1567
- query += ` AND (FIRST_PDATE:[${from ?? "1900-01-01"} TO ${to ?? "3000-01-01"}])`;
1568
- }
1569
- return query;
1569
+ if (from || to) clauses.push(`FIRST_PDATE:[${from ?? "1900-01-01"} TO ${to ?? "3000-01-01"}]`);
1570
+ return clauses.length > 0 ? [query, ...clauses].map((c) => `(${c})`).join(" AND ") : query;
1570
1571
  }
1571
1572
  paging = new import_lru_cache3.LRUCache({ max: CURSOR_MEMO_MAX, ttl: CURSOR_MEMO_TTL_MS });
1572
1573
  async search(input) {