{"uid":"cap_tDgUdscDvelsvXu6MsWUq","slug":"narcotics-bowel-syndrome-rome-iv-nbs-d2-calculator-5e669560","name":"Narcotics Bowel Syndrome (Rome IV NBS / D2) Calculator","description":"Keefer 2016 Rome IV NBS (D2). rome_iv_nbs is true iff chronic or frequently recurring abdominal pain on narcotics, pain not explained by a GI diagnosis, at least two of three NBS features, last-3-months criteria, and 6-month onset. nbs_features_met is 0-3. Caller assigns seven flags. ~75 mg oral morphine equivalent is copy-only. magent does not examine the patient or judge opioid dose. Not a diagnosis, not CAPS, not opioid-induced constipation.","url":"https://api.magentlab.com/api/calc/rome_iv_nbs","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","HEAD","DELETE"],"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"}},"queryParams":{"type":"object","required":["chronic_or_frequently_recurring_abdominal_pain_on_narcotics","pain_not_explained_by_current_or_previous_gi_diagnosis","pain_worsens_or_incompletely_resolves_with_continued_or_escalating_narcotics","marked_worsening_when_dose_wanes_improvement_when_reinstituted","progression_of_frequency_duration_intensity_of_pain_episodes","fulfilled_last_3_months","onset_at_least_6_months"],"properties":{"fulfilled_last_3_months":{"type":"boolean","description":"Criteria fulfilled for the last 3 months, as assigned (Keefer 2016). true or false as assigned by the caller. magent does not take a history."},"onset_at_least_6_months":{"type":"boolean","description":"Symptom onset at least 6 months prior to diagnosis, as assigned (Keefer 2016). true or false as assigned by the caller. magent does not take a history."},"pain_not_explained_by_current_or_previous_gi_diagnosis":{"type":"boolean","description":"The nature and intensity of the pain is not explained by a current or previous GI diagnosis (a structural diagnosis may exist but is not sufficient to explain the pain), as assigned (Keefer 2016). true or false as assigned by the caller. magent does not examine the patient."},"chronic_or_frequently_recurring_abdominal_pain_on_narcotics":{"type":"boolean","description":"Chronic or frequently recurring abdominal pain treated with acute high-dose or chronic narcotics; pain must occur most days, as assigned (Keefer 2016 Rome IV NBS / D2). Patients often take about 75 mg oral morphine equivalent; no particular time frame or dosage is required. true or false as assigned by the caller. magent does not examine the patient or judge opioid dose."},"progression_of_frequency_duration_intensity_of_pain_episodes":{"type":"boolean","description":"Progression of the frequency, duration, and intensity of pain episodes (one of three NBS features; at least two required). true or false as assigned by the caller."},"marked_worsening_when_dose_wanes_improvement_when_reinstituted":{"type":"boolean","description":"Marked worsening of pain when the narcotic dose wanes and improvement when narcotics are re-instituted (soar and crash; one of three NBS features; at least two required). true or false as assigned by the caller."},"pain_worsens_or_incompletely_resolves_with_continued_or_escalating_narcotics":{"type":"boolean","description":"Pain worsens or incompletely resolves with continued or escalating dosages of narcotics (one of three NBS features; at least two required). true or false as assigned by the caller."}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_NVn14oaKGKKfieI9JujUG","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Evaluates seven clinician-assigned flags to determine if a patient meets Rome IV Narcotics Bowel Syndrome (D2) criteria per Keefer 2016, returning a boolean diagnosis result and a 0-3 NBS feature count.","exampleAgentPrompt":"My patient has chronic abdominal pain treated with narcotics occurring most days, the pain isn't explained by any GI diagnosis, it worsens with continued opioid use, gets markedly worse when the dose wanes and better when reinstituted, and there's been progression in frequency and intensity — all criteria have been met for the last 3 months with onset over 6 months ago; do they meet Rome IV Narcotics Bowel Syndrome (D2) criteria and how many NBS features are satisfied?","exampleUseCases":[{"title":"GI consult NBS screening","prompt":"I'm seeing a patient with recurrent abdominal pain on chronic narcotics — pain not explained by any GI structural diagnosis, worsens with continued opioids, gets worse when the dose drops and better when it goes back up, and frequency has been escalating. Criteria met for the last 3 months, onset was over 6 months ago. Does this patient satisfy Rome IV NBS (D2) criteria and how many of the three NBS features are met?"},{"title":"Rule out NBS before pain escalation","prompt":"Before escalating opioids for this patient's abdominal pain, I want to rule out narcotics bowel syndrome. They have chronic abdominal pain on narcotics most days, pain is unexplained by a GI diagnosis, but pain does NOT worsen with continued opioids, does NOT get markedly worse when the dose wanes, and there's no progression in episodes. Criteria met for the last 3 months, onset at least 6 months ago — do they meet Rome IV NBS D2?"},{"title":"Chart documentation for opioid review","prompt":"For our opioid stewardship chart note, run Rome IV NBS on this patient: chronic abdominal pain on narcotics daily, pain not explained by GI diagnosis, worsens with continued or escalating narcotics, markedly worse when dose wanes, and frequency/intensity have progressed — yes to all three NBS features. Last-3-months and 6-month onset criteria both met. Return whether NBS is positive and the feature count."}],"resultDescription":"Returns a boolean rome_iv_nbs indicating whether the patient meets Rome IV Narcotics Bowel Syndrome (D2) criteria per Keefer 2016, and an integer nbs_features_met (0–3) counting how many of the three NBS-specific features (worsens with continued/escalating narcotics, marked worsening when dose wanes, progression of episodes) are present. Does not provide a clinical diagnosis, does not assess opioid dose, and is distinct from CAPS or opioid-induced constipation.","failureModes":["Missing any of the seven required boolean query parameters returns a validation error","Passing non-boolean values for flag parameters causes a schema error","Network or payment (x402) failure returns no result","Misassignment of flags by the caller produces incorrect NBS classification — garbage in, garbage out","Caller confusing NBS with CAPS or opioid-induced constipation leads to inappropriate use"],"whenToPreferThis":"Use this endpoint when a clinician or clinical decision support workflow needs to formally apply the Rome IV Narcotics Bowel Syndrome (D2) criteria (Keefer 2016) to a patient with chronic or recurring abdominal pain on opioids. Prefer over manual scoring when auditable, reproducible, structured output is needed. Not appropriate for diagnosing CAPS, opioid-induced constipation, or any other functional GI disorder.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T07:00:31.165Z","isFirstParty":false}