{
  "x402Version": 2,
  "id": 39310,
  "slug": "39310",
  "resource": "https://api.magentlab.com/api/calc/ap_prediction",
  "description": "Jin 2018 ED model for early diagnosis of acute pancreatitis when lipase is at least 3x ULN. Integer points: prior episodes 0/1/2/3/4, cholelithiasis +2, abdominal surgery in 2 months -2, epigastric pain +2, worsening pain +1, pain duration >=5 days -1, severity mild 0 / moderate +2 / severe +3, lipase fold +0/+1/+2. Score max 14; jin2018_high_ppv if score>=8; jin2024_accuracy_cut if score>=6. Not a diagnosis. Not an imaging order. Not Ranson, BISAP, or Glasgow-Imrie.",
  "type": "http",
  "serviceName": "magent",
  "resourceType": "Agent Service",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "payTo": "0x836Be278f1739fB4308091cD1852F7971Bc19Ee2",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount": "5000",
      "amountUsd": 0.005,
      "maxTimeoutSeconds": 600
    }
  ],
  "outputSchema": {
    "properties": {
      "example": {
        "type": "object"
      },
      "type": {
        "type": "string"
      }
    },
    "required": [
      "type"
    ],
    "type": "object"
  },
  "extensions": {
    "bazaar": {
      "info": {
        "iconUrl": "https://api.magentlab.com/favicon.ico",
        "input": {
          "body": {
            "items": [
              {
                "abdominal_surgery_2mo": false,
                "cholelithiasis": false,
                "epigastric_pain": false,
                "lipase_uln_fold": 4,
                "pain_duration_days": "lt_5",
                "pain_severity": "mild_0_3",
                "prior_ap_episodes": "0",
                "worsening_pain": false
              },
              {
                "abdominal_surgery_2mo": false,
                "cholelithiasis": false,
                "epigastric_pain": false,
                "lipase_uln_fold": 4,
                "pain_duration_days": "lt_5",
                "pain_severity": "mild_0_3",
                "prior_ap_episodes": "0",
                "worsening_pain": false
              }
            ]
          },
          "method": "POST",
          "type": "http"
        },
        "output": {
          "example": {
            "count": 2,
            "items": [
              {
                "citation": {
                  "authors": "Jin DX, McNabb-Baltar J, Suleiman SL, Wu BU, Khorasani R, Bollen TL, et al.",
                  "doi": "10.1097/MPA.0000000000001102",
                  "id": "jin-2018",
                  "pmid": "29975351",
                  "source": "Pancreas. 2018;47(7):871-879",
                  "title": "A Clinical Model for the Early Diagnosis of Acute Pancreatitis in the Emergency Department"
                },
                "components": [
                  {
                    "factor": "prior_ap_episodes",
                    "points": 0,
                    "present": true,
                    "value": "0"
                  },
                  {
                    "factor": "cholelithiasis",
                    "points": 0,
                    "present": false
                  },
                  {
                    "factor": "abdominal_surgery_2mo",
                    "points": 0,
                    "present": false
                  },
                  {
                    "factor": "epigastric_pain",
                    "points": 0,
                    "present": false
                  },
                  {
                    "factor": "worsening_pain",
                    "points": 0,
                    "present": false
                  },
                  {
                    "factor": "pain_duration_days",
                    "points": 0,
                    "present": true,
                    "value": "lt_5"
                  },
                  {
                    "factor": "pain_severity",
                    "points": 0,
                    "present": true,
                    "value": "mild_0_3"
                  },
                  {
                    "factor": "lipase_uln_fold",
                    "points": 0,
                    "present": true,
                    "value": 4
                  }
                ],
                "disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
                "formula": "ap_prediction",
                "formula_expression": "AP prediction = prior_ap_episodes (0→0, 1→1, 2→2, 3→3, 4_or_more→4) + cholelithiasis (true +2) + abdominal_surgery_2mo (true -2) + epigastric_pain (true +2) + worsening_pain (true +1) + pain_duration_days (lt_5 0, gte_5 -1) + pain_severity (mild_0_3 0, moderate_4_6 +2, severe_7_10 +3) + lipase_uln_fold (≥3 and <10 → 0, ≥10 and <20 → +1, ≥20 → +2); Jin 2018; max 14; jin2018_high_ppv iff score ≥ 8; jin2024_accuracy_cut iff score ≥ 6",
                "jin2018_high_ppv": false,
                "jin2024_accuracy_cut": false,
                "max_score": 14,
                "score": 0
              },
              {
                "citation": {
                  "authors": "Jin DX, McNabb-Baltar J, Suleiman SL, Wu BU, Khorasani R, Bollen TL, et al.",
                  "doi": "10.1097/MPA.0000000000001102",
                  "id": "jin-2018",
                  "pmid": "29975351",
                  "source": "Pancreas. 2018;47(7):871-879",
                  "title": "A Clinical Model for the Early Diagnosis of Acute Pancreatitis in the Emergency Department"
                },
                "components": [
                  {
                    "factor": "prior_ap_episodes",
                    "points": 0,
                    "present": true,
                    "value": "0"
                  },
                  {
                    "factor": "cholelithiasis",
                    "points": 0,
                    "present": false
                  },
                  {
                    "factor": "abdominal_surgery_2mo",
                    "points": 0,
                    "present": false
                  },
                  {
                    "factor": "epigastric_pain",
                    "points": 0,
                    "present": false
                  },
                  {
                    "factor": "worsening_pain",
                    "points": 0,
                    "present": false
                  },
                  {
                    "factor": "pain_duration_days",
                    "points": 0,
                    "present": true,
                    "value": "lt_5"
                  },
                  {
                    "factor": "pain_severity",
                    "points": 0,
                    "present": true,
                    "value": "mild_0_3"
                  },
                  {
                    "factor": "lipase_uln_fold",
                    "points": 0,
                    "present": true,
                    "value": 4
                  }
                ],
                "disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
                "formula": "ap_prediction",
                "formula_expression": "AP prediction = prior_ap_episodes (0→0, 1→1, 2→2, 3→3, 4_or_more→4) + cholelithiasis (true +2) + abdominal_surgery_2mo (true -2) + epigastric_pain (true +2) + worsening_pain (true +1) + pain_duration_days (lt_5 0, gte_5 -1) + pain_severity (mild_0_3 0, moderate_4_6 +2, severe_7_10 +3) + lipase_uln_fold (≥3 and <10 → 0, ≥10 and <20 → +1, ≥20 → +2); Jin 2018; max 14; jin2018_high_ppv iff score ≥ 8; jin2024_accuracy_cut iff score ≥ 6",
                "jin2018_high_ppv": false,
                "jin2024_accuracy_cut": false,
                "max_score": 14,
                "score": 0
              }
            ],
            "path": "/api/calc/ap_prediction"
          },
          "type": "json"
        }
      },
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "input": {
            "additionalProperties": false,
            "properties": {
              "body": {
                "additionalProperties": false,
                "properties": {
                  "items": {
                    "items": {
                      "properties": {
                        "abdominal_surgery_2mo": {
                          "description": "Caller-assigned abdominal surgery within 2 months (Jin 2018). true scores -2; false scores 0.",
                          "type": "boolean"
                        },
                        "cholelithiasis": {
                          "description": "Caller-assigned cholelithiasis (Jin 2018). true scores +2; false scores 0. magent does not read imaging.",
                          "type": "boolean"
                        },
                        "epigastric_pain": {
                          "description": "Caller-assigned epigastric pain (Jin 2018). true scores +2; false scores 0. magent does not examine the patient.",
                          "type": "boolean"
                        },
                        "lipase_uln_fold": {
                          "description": "Serum lipase as a fold of the laboratory ULN. Population is lipase ≥3× ULN (Jin 2018). ≥3 and <10 scores 0; ≥10 and <20 scores +1; ≥20 scores +2. Below 3 is invalid_ap_prediction.",
                          "type": "number"
                        },
                        "pain_duration_days": {
                          "description": "Caller-assigned pain-duration token (Jin 2018). lt_5 (<5 days) scores 0; gte_5 (≥5 days) scores -1. magent does not take a history.",
                          "enum": [
                            "lt_5",
                            "gte_5"
                          ],
                          "type": "string"
                        },
                        "pain_severity": {
                          "description": "Caller-assigned pain-severity token (Jin 2018). mild_0_3 (0-3) scores 0; moderate_4_6 (4-6) scores +2; severe_7_10 (7-10) scores +3. magent does not assign a pain scale.",
                          "enum": [
                            "mild_0_3",
                            "moderate_4_6",
                            "severe_7_10"
                          ],
                          "type": "string"
                        },
                        "prior_ap_episodes": {
                          "description": "Caller-assigned prior acute-pancreatitis episode token (Jin 2018). 0 scores 0; 1 scores 1; 2 scores 2; 3 scores 3; 4_or_more scores 4. magent does not take a history.",
                          "enum": [
                            "0",
                            "1",
                            "2",
                            "3",
                            "4_or_more"
                          ],
                          "type": "string"
                        },
                        "worsening_pain": {
                          "description": "Caller-assigned worsening pain (Jin 2018). true scores +1; false scores 0.",
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "prior_ap_episodes",
                        "cholelithiasis",
                        "abdominal_surgery_2mo",
                        "epigastric_pain",
                        "worsening_pain",
                        "pain_duration_days",
                        "pain_severity",
                        "lipase_uln_fold"
                      ],
                      "type": "object"
                    },
                    "maxItems": 25,
                    "minItems": 1,
                    "type": "array"
                  }
                },
                "required": [
                  "items"
                ],
                "type": "object"
              },
              "headers": {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              "method": {
                "const": "POST",
                "type": "string"
              },
              "type": {
                "const": "http",
                "type": "string"
              }
            },
            "required": [
              "type",
              "method"
            ],
            "type": "object"
          },
          "output": {
            "properties": {
              "example": {
                "type": "object"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "type": "object"
          }
        },
        "required": [
          "input"
        ],
        "type": "object"
      }
    }
  },
  "tags": [
    "pancreatitis",
    "lipase",
    "gi",
    "ed",
    "calculator",
    "bazaar"
  ],
  "sourceHost": "api.magentlab.com",
  "lastUpdated": "2026-10-12T23:41:00.511Z",
  "quality": {
    "calls30d": 5,
    "uniquePayers30d": 2,
    "lastCalledAt": "2026-10-12T23:41:00.367Z"
  },
  "metadata": {
    "serviceName": "magent",
    "extensions": {
      "bazaar": {
        "info": {
          "iconUrl": "https://api.magentlab.com/favicon.ico",
          "input": {
            "body": {
              "items": [
                {
                  "abdominal_surgery_2mo": false,
                  "cholelithiasis": false,
                  "epigastric_pain": false,
                  "lipase_uln_fold": 4,
                  "pain_duration_days": "lt_5",
                  "pain_severity": "mild_0_3",
                  "prior_ap_episodes": "0",
                  "worsening_pain": false
                },
                {
                  "abdominal_surgery_2mo": false,
                  "cholelithiasis": false,
                  "epigastric_pain": false,
                  "lipase_uln_fold": 4,
                  "pain_duration_days": "lt_5",
                  "pain_severity": "mild_0_3",
                  "prior_ap_episodes": "0",
                  "worsening_pain": false
                }
              ]
            },
            "method": "POST",
            "type": "http"
          },
          "output": {
            "example": {
              "count": 2,
              "items": [
                {
                  "citation": {
                    "authors": "Jin DX, McNabb-Baltar J, Suleiman SL, Wu BU, Khorasani R, Bollen TL, et al.",
                    "doi": "10.1097/MPA.0000000000001102",
                    "id": "jin-2018",
                    "pmid": "29975351",
                    "source": "Pancreas. 2018;47(7):871-879",
                    "title": "A Clinical Model for the Early Diagnosis of Acute Pancreatitis in the Emergency Department"
                  },
                  "components": [
                    {
                      "factor": "prior_ap_episodes",
                      "points": 0,
                      "present": true,
                      "value": "0"
                    },
                    {
                      "factor": "cholelithiasis",
                      "points": 0,
                      "present": false
                    },
                    {
                      "factor": "abdominal_surgery_2mo",
                      "points": 0,
                      "present": false
                    },
                    {
                      "factor": "epigastric_pain",
                      "points": 0,
                      "present": false
                    },
                    {
                      "factor": "worsening_pain",
                      "points": 0,
                      "present": false
                    },
                    {
                      "factor": "pain_duration_days",
                      "points": 0,
                      "present": true,
                      "value": "lt_5"
                    },
                    {
                      "factor": "pain_severity",
                      "points": 0,
                      "present": true,
                      "value": "mild_0_3"
                    },
                    {
                      "factor": "lipase_uln_fold",
                      "points": 0,
                      "present": true,
                      "value": 4
                    }
                  ],
                  "disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
                  "formula": "ap_prediction",
                  "formula_expression": "AP prediction = prior_ap_episodes (0→0, 1→1, 2→2, 3→3, 4_or_more→4) + cholelithiasis (true +2) + abdominal_surgery_2mo (true -2) + epigastric_pain (true +2) + worsening_pain (true +1) + pain_duration_days (lt_5 0, gte_5 -1) + pain_severity (mild_0_3 0, moderate_4_6 +2, severe_7_10 +3) + lipase_uln_fold (≥3 and <10 → 0, ≥10 and <20 → +1, ≥20 → +2); Jin 2018; max 14; jin2018_high_ppv iff score ≥ 8; jin2024_accuracy_cut iff score ≥ 6",
                  "jin2018_high_ppv": false,
                  "jin2024_accuracy_cut": false,
                  "max_score": 14,
                  "score": 0
                },
                {
                  "citation": {
                    "authors": "Jin DX, McNabb-Baltar J, Suleiman SL, Wu BU, Khorasani R, Bollen TL, et al.",
                    "doi": "10.1097/MPA.0000000000001102",
                    "id": "jin-2018",
                    "pmid": "29975351",
                    "source": "Pancreas. 2018;47(7):871-879",
                    "title": "A Clinical Model for the Early Diagnosis of Acute Pancreatitis in the Emergency Department"
                  },
                  "components": [
                    {
                      "factor": "prior_ap_episodes",
                      "points": 0,
                      "present": true,
                      "value": "0"
                    },
                    {
                      "factor": "cholelithiasis",
                      "points": 0,
                      "present": false
                    },
                    {
                      "factor": "abdominal_surgery_2mo",
                      "points": 0,
                      "present": false
                    },
                    {
                      "factor": "epigastric_pain",
                      "points": 0,
                      "present": false
                    },
                    {
                      "factor": "worsening_pain",
                      "points": 0,
                      "present": false
                    },
                    {
                      "factor": "pain_duration_days",
                      "points": 0,
                      "present": true,
                      "value": "lt_5"
                    },
                    {
                      "factor": "pain_severity",
                      "points": 0,
                      "present": true,
                      "value": "mild_0_3"
                    },
                    {
                      "factor": "lipase_uln_fold",
                      "points": 0,
                      "present": true,
                      "value": 4
                    }
                  ],
                  "disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
                  "formula": "ap_prediction",
                  "formula_expression": "AP prediction = prior_ap_episodes (0→0, 1→1, 2→2, 3→3, 4_or_more→4) + cholelithiasis (true +2) + abdominal_surgery_2mo (true -2) + epigastric_pain (true +2) + worsening_pain (true +1) + pain_duration_days (lt_5 0, gte_5 -1) + pain_severity (mild_0_3 0, moderate_4_6 +2, severe_7_10 +3) + lipase_uln_fold (≥3 and <10 → 0, ≥10 and <20 → +1, ≥20 → +2); Jin 2018; max 14; jin2018_high_ppv iff score ≥ 8; jin2024_accuracy_cut iff score ≥ 6",
                  "jin2018_high_ppv": false,
                  "jin2024_accuracy_cut": false,
                  "max_score": 14,
                  "score": 0
                }
              ],
              "path": "/api/calc/ap_prediction"
            },
            "type": "json"
          }
        },
        "schema": {
          "$schema": "https://json-schema.org/draft/2020-12/schema",
          "properties": {
            "input": {
              "additionalProperties": false,
              "properties": {
                "body": {
                  "additionalProperties": false,
                  "properties": {
                    "items": {
                      "items": {
                        "properties": {
                          "abdominal_surgery_2mo": {
                            "description": "Caller-assigned abdominal surgery within 2 months (Jin 2018). true scores -2; false scores 0.",
                            "type": "boolean"
                          },
                          "cholelithiasis": {
                            "description": "Caller-assigned cholelithiasis (Jin 2018). true scores +2; false scores 0. magent does not read imaging.",
                            "type": "boolean"
                          },
                          "epigastric_pain": {
                            "description": "Caller-assigned epigastric pain (Jin 2018). true scores +2; false scores 0. magent does not examine the patient.",
                            "type": "boolean"
                          },
                          "lipase_uln_fold": {
                            "description": "Serum lipase as a fold of the laboratory ULN. Population is lipase ≥3× ULN (Jin 2018). ≥3 and <10 scores 0; ≥10 and <20 scores +1; ≥20 scores +2. Below 3 is invalid_ap_prediction.",
                            "type": "number"
                          },
                          "pain_duration_days": {
                            "description": "Caller-assigned pain-duration token (Jin 2018). lt_5 (<5 days) scores 0; gte_5 (≥5 days) scores -1. magent does not take a history.",
                            "enum": [
                              "lt_5",
                              "gte_5"
                            ],
                            "type": "string"
                          },
                          "pain_severity": {
                            "description": "Caller-assigned pain-severity token (Jin 2018). mild_0_3 (0-3) scores 0; moderate_4_6 (4-6) scores +2; severe_7_10 (7-10) scores +3. magent does not assign a pain scale.",
                            "enum": [
                              "mild_0_3",
                              "moderate_4_6",
                              "severe_7_10"
                            ],
                            "type": "string"
                          },
                          "prior_ap_episodes": {
                            "description": "Caller-assigned prior acute-pancreatitis episode token (Jin 2018). 0 scores 0; 1 scores 1; 2 scores 2; 3 scores 3; 4_or_more scores 4. magent does not take a history.",
                            "enum": [
                              "0",
                              "1",
                              "2",
                              "3",
                              "4_or_more"
                            ],
                            "type": "string"
                          },
                          "worsening_pain": {
                            "description": "Caller-assigned worsening pain (Jin 2018). true scores +1; false scores 0.",
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "prior_ap_episodes",
                          "cholelithiasis",
                          "abdominal_surgery_2mo",
                          "epigastric_pain",
                          "worsening_pain",
                          "pain_duration_days",
                          "pain_severity",
                          "lipase_uln_fold"
                        ],
                        "type": "object"
                      },
                      "maxItems": 25,
                      "minItems": 1,
                      "type": "array"
                    }
                  },
                  "required": [
                    "items"
                  ],
                  "type": "object"
                },
                "headers": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "type": "object"
                },
                "method": {
                  "const": "POST",
                  "type": "string"
                },
                "type": {
                  "const": "http",
                  "type": "string"
                }
              },
              "required": [
                "type",
                "method"
              ],
              "type": "object"
            },
            "output": {
              "properties": {
                "example": {
                  "type": "object"
                },
                "type": {
                  "type": "string"
                }
              },
              "required": [
                "type"
              ],
              "type": "object"
            }
          },
          "required": [
            "input"
          ],
          "type": "object"
        }
      }
    }
  },
  "liveness": {
    "reliability": null
  },
  "verified": false,
  "featured": false,
  "provider": {
    "host": "api.magentlab.com",
    "manifest_name": "api.magentlab.com",
    "source": "cdp-mirror",
    "source_manifest_url": "https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources",
    "submitted_at": "2026-10-14T01:15:01.050Z"
  },
  "exampleResponse": {
    "example": {},
    "type": "string"
  }
}