{"uid":"cap_l0GUkCAGGBUv6h3v4LNUC","slug":"gap-index-calculator-ley-2012-08ea2ae0","name":"GAP Index Calculator (Ley 2012)","description":"Deterministic published-formula arithmetic plus ICD-10-CM, RxNorm, and LOINC. Pay in USDC on Base via x402.","url":"https://api.magentlab.com/api/calc/gap_index?utm_source=zero.xyz","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":["sex","age","fvc_percent_predicted"],"properties":{"age":{"type":"integer","description":"Age in years (integer 18-120). Ley 2012: <=60 scores 0; 61-65 scores 1; >65 scores 2."},"sex":{"enum":["female","male"],"type":"string","description":"Sex (female or male). Ley 2012: female scores 0; male scores 1."},"dlco_cannot_perform":{"type":"boolean","description":"true when DLCO cannot be performed (Ley 2012 scores 3). Provide this or dlco_percent_predicted, not both."},"fvc_percent_predicted":{"type":"number","description":"FVC percent predicted (10-150). Ley 2012: >75 scores 0; 50-75 scores 1; <50 scores 2. 75.0 scores 1."},"dlco_percent_predicted":{"type":"number","description":"DLCO percent predicted (1-150). Provide this or dlco_cannot_perform=true, not both. Ley 2012: >55 scores 0; 36-55 scores 1; <=35 scores 2."}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":{"type":"json","example":{"path":"/api/calc/gap_index","count":2,"items":[{"sex":"female","score":0,"formula":"gap_index","citation":{"id":"ley-2012","doi":"10.7326/0003-4819-156-10-201205150-00004","pmid":"22586007","title":"A multidimensional index and staging system for idiopathic pulmonary fibrosis","source":"Ann Intern Med. 2012;156(10):684-691","authors":"Ley B, Ryerson CJ, Vittinghoff E, et al."},"age_years":55,"gap_stage":1,"max_score":8,"components":[{"value":"female","factor":"sex","points":0,"present":false},{"value":55,"factor":"age","points":0,"present":false},{"value":80,"factor":"fvc","points":0,"present":false},{"value":60,"factor":"dlco","points":0,"present":false}],"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_expression":"GAP = sex_points + age_points + fvc_points + dlco_points; female 0 male 1; age <=60 -> 0, 61-65 -> 1, >65 -> 2; FVC% >75 -> 0, 50-75 -> 1, <50 -> 2; DLCO% >55 -> 0, 36-55 -> 1, <=35 -> 2, cannot perform -> 3; stages I 0-3 / II 4-5 / III 6-8; max 8","dlco_cannot_perform":false,"fvc_percent_predicted":80,"dlco_percent_predicted":60},{"sex":"female","score":0,"formula":"gap_index","citation":{"id":"ley-2012","doi":"10.7326/0003-4819-156-10-201205150-00004","pmid":"22586007","title":"A multidimensional index and staging system for idiopathic pulmonary fibrosis","source":"Ann Intern Med. 2012;156(10):684-691","authors":"Ley B, Ryerson CJ, Vittinghoff E, et al."},"age_years":55,"gap_stage":1,"max_score":8,"components":[{"value":"female","factor":"sex","points":0,"present":false},{"value":55,"factor":"age","points":0,"present":false},{"value":80,"factor":"fvc","points":0,"present":false},{"value":60,"factor":"dlco","points":0,"present":false}],"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_expression":"GAP = sex_points + age_points + fvc_points + dlco_points; female 0 male 1; age <=60 -> 0, 61-65 -> 1, >65 -> 2; FVC% >75 -> 0, 50-75 -> 1, <50 -> 2; DLCO% >55 -> 0, 36-55 -> 1, <=35 -> 2, cannot perform -> 3; stages I 0-3 / II 4-5 / III 6-8; max 8","dlco_cannot_perform":false,"fvc_percent_predicted":80,"dlco_percent_predicted":60}]}},"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_OSAFL33YcpRptB7o52CBf","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":"Computes the Ley 2012 GAP (Gender, Age, Physiology) index total score (0–8) and stage (1–3) for idiopathic pulmonary fibrosis prognosis","exampleAgentPrompt":"Calculate the GAP index for a 68-year-old male patient with an FVC of 62% predicted and a DLCO of 48% predicted — give me the total score and stage.","exampleUseCases":[{"title":"IPF staging at clinic visit","prompt":"I need the GAP score and stage for a 72-year-old male with FVC 55% predicted and DLCO 38% predicted — he can perform the DLCO test."},{"title":"Prognosis for patient unable to perform DLCO","prompt":"Can you run the Ley 2012 GAP index for a 63-year-old female with FVC 71% predicted? She was unable to perform the DLCO test."},{"title":"Borderline age group scoring","prompt":"What is the GAP index and stage for a 61-year-old male with FVC 80% predicted and DLCO 58% predicted?"}],"resultDescription":"Returns the individual point contributions for sex, age, FVC, and DLCO, the total GAP score (0–8), and the corresponding GAP stage (Stage 1 for 0–3, Stage 2 for 4–5, Stage 3 for 6–8), with citation to Ley 2012.","failureModes":["Missing required parameter (sex, age, or fvc_percent_predicted) returns a 400-level error","Supplying both dlco_percent_predicted and dlco_cannot_perform=true simultaneously returns a validation error","Age or FVC values outside allowed ranges (age 18–120, FVC 10–150) may be rejected","DLCO value outside range 1–150 is rejected","Network or service errors return a 5xx response"],"whenToPreferThis":"Use this endpoint when you need a deterministic, citation-backed implementation of the Ley 2012 GAP index specifically — not a continuous or custom variant. It is ideal for clinical documentation, prior-authorization support, or EHR integration where a reproducible, auditable score is required. Prefer this over manual calculation whenever sex, age, FVC % predicted, and DLCO % predicted (or a cannot-perform flag) are available.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-11T18:40:44.950Z","isFirstParty":false,"canonicalSlug":"gap-index-calculator-ley-2012-08ea2ae0"}