diff --git "a/cache/sample_cache.json" "b/cache/sample_cache.json" new file mode 100644--- /dev/null +++ "b/cache/sample_cache.json" @@ -0,0 +1,3303 @@ +{ + "sample_abdominal_ct": { + "segments": [ + { + "type": "prefix", + "label": "Examination", + "content": "EXAMINATION: CT abdomen and pelvis with IV contrast", + "intervals": [ + { + "startPos": 0, + "endPos": 51 + } + ], + "significance": null + }, + { + "type": "prefix", + "label": "Clinical Indication", + "content": "CLINICAL INDICATION: Abdominal pain, rule out acute pathology", + "intervals": [ + { + "startPos": 52, + "endPos": 113 + } + ], + "significance": null + }, + { + "type": "prefix", + "label": "Comparison", + "content": "COMPARISON: None available", + "intervals": [ + { + "startPos": 114, + "endPos": 140 + } + ], + "significance": null + }, + { + "type": "prefix", + "label": "Technique", + "content": "TECHNIQUE: Axial images of the abdomen and pelvis were obtained following administration of intravenous contrast material. Coronal and sagittal reformations were performed.", + "intervals": [ + { + "startPos": 141, + "endPos": 313 + } + ], + "significance": null + }, + { + "type": "body", + "label": "Lungs", + "content": "No acute abnormality is seen in the visualized lung bases.", + "intervals": [ + { + "startPos": 325, + "endPos": 383 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Liver", + "content": "The liver is normal in size and contour.", + "intervals": [ + { + "startPos": 384, + "endPos": 424 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Liver", + "content": "There is a 1.2 cm simple-appearing low-attenuation lesion in hepatic segment VII, consistent with a cyst.", + "intervals": [ + { + "startPos": 425, + "endPos": 530 + } + ], + "significance": "minor" + }, + { + "type": "body", + "label": "Gallbladder", + "content": "The gallbladder contains numerous calcified gallstones, compatible with cholelithiasis, without gallbladder wall thickening, pericholecystic fluid, or other sonographic signs of acute cholecystitis.", + "intervals": [ + { + "startPos": 531, + "endPos": 729 + } + ], + "significance": "minor" + }, + { + "type": "body", + "label": "Biliary", + "content": "The common bile duct is non-dilated, measuring approximately 4 mm.", + "intervals": [ + { + "startPos": 730, + "endPos": 796 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Pancreas", + "content": "The pancreas is unremarkable without focal mass or peripancreatic inflammatory stranding.", + "intervals": [ + { + "startPos": 797, + "endPos": 886 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Spleen", + "content": "The spleen appears unremarkable.", + "intervals": [ + { + "startPos": 887, + "endPos": 937 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Adrenal Glands", + "content": "The adrenal glands appear unremarkable.", + "intervals": [ + { + "startPos": 887, + "endPos": 937 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Kidneys", + "content": "A 9 mm simple left renal cyst is noted.", + "intervals": [ + { + "startPos": 938, + "endPos": 977 + } + ], + "significance": "minor" + }, + { + "type": "body", + "label": "Kidneys", + "content": "The kidneys are otherwise unremarkable without hydronephrosis or nephrolithiasis.", + "intervals": [ + { + "startPos": 978, + "endPos": 1059 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Bowel", + "content": "There is sigmoid diverticulosis without evidence of acute diverticulitis.", + "intervals": [ + { + "startPos": 1060, + "endPos": 1133 + } + ], + "significance": "minor" + }, + { + "type": "suffix", + "label": "suffix", + "content": "1. Cholelithiasis without evidence of acute cholecystitis.\n2. Hepatic and renal cysts.\n3. Sigmoid diverticulosis without acute diverticulitis.", + "intervals": [ + { + "startPos": 1147, + "endPos": 1289 + } + ], + "significance": null + } + ], + "annotated_document_json": { + "extractions": [ + { + "extraction_text": "EXAMINATION: CT abdomen and pelvis with IV contrast", + "extraction_class": "findings_prefix", + "attributes": { + "section": "Examination" + }, + "char_interval": { + "start_pos": 0, + "end_pos": 51 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "CLINICAL INDICATION: Abdominal pain, rule out acute pathology", + "extraction_class": "findings_prefix", + "attributes": { + "section": "Clinical Indication" + }, + "char_interval": { + "start_pos": 52, + "end_pos": 113 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "COMPARISON: None available", + "extraction_class": "findings_prefix", + "attributes": { + "section": "Comparison" + }, + "char_interval": { + "start_pos": 114, + "end_pos": 140 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "TECHNIQUE: Axial images of the abdomen and pelvis were obtained following administration of intravenous contrast material. Coronal and sagittal reformations were performed.", + "extraction_class": "findings_prefix", + "attributes": { + "section": "Technique" + }, + "char_interval": { + "start_pos": 141, + "end_pos": 313 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "No acute abnormality is seen in the visualized lung bases.", + "extraction_class": "findings_body", + "attributes": { + "section": "Lungs", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 325, + "end_pos": 383 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The liver is normal in size and contour.", + "extraction_class": "findings_body", + "attributes": { + "section": "Liver", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 384, + "end_pos": 424 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "There is a 1.2 cm simple-appearing low-attenuation lesion in hepatic segment VII, consistent with a cyst.", + "extraction_class": "findings_body", + "attributes": { + "section": "Liver", + "clinical_significance": "minor" + }, + "char_interval": { + "start_pos": 425, + "end_pos": 530 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The gallbladder contains numerous calcified gallstones, compatible with cholelithiasis, without gallbladder wall thickening, pericholecystic fluid, or other sonographic signs of acute cholecystitis.", + "extraction_class": "findings_body", + "attributes": { + "section": "Gallbladder", + "clinical_significance": "minor" + }, + "char_interval": { + "start_pos": 531, + "end_pos": 729 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The common bile duct is non-dilated, measuring approximately 4 mm.", + "extraction_class": "findings_body", + "attributes": { + "section": "Biliary", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 730, + "end_pos": 796 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The pancreas is unremarkable without focal mass or peripancreatic inflammatory stranding.", + "extraction_class": "findings_body", + "attributes": { + "section": "Pancreas", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 797, + "end_pos": 886 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The spleen appears unremarkable.", + "extraction_class": "findings_body", + "attributes": { + "section": "Spleen", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 887, + "end_pos": 937 + }, + "alignment_status": "AlignmentStatus.MATCH_FUZZY" + }, + { + "extraction_text": "The adrenal glands appear unremarkable.", + "extraction_class": "findings_body", + "attributes": { + "section": "Adrenal Glands", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 887, + "end_pos": 937 + }, + "alignment_status": "AlignmentStatus.MATCH_FUZZY" + }, + { + "extraction_text": "A 9 mm simple left renal cyst is noted.", + "extraction_class": "findings_body", + "attributes": { + "section": "Kidneys", + "clinical_significance": "minor" + }, + "char_interval": { + "start_pos": 938, + "end_pos": 977 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The kidneys are otherwise unremarkable without hydronephrosis or nephrolithiasis.", + "extraction_class": "findings_body", + "attributes": { + "section": "Kidneys", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 978, + "end_pos": 1059 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "There is sigmoid diverticulosis without evidence of acute diverticulitis.", + "extraction_class": "findings_body", + "attributes": { + "section": "Bowel", + "clinical_significance": "minor" + }, + "char_interval": { + "start_pos": 1060, + "end_pos": 1133 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "1. Cholelithiasis without evidence of acute cholecystitis.\n2. Hepatic and renal cysts.\n3. Sigmoid diverticulosis without acute diverticulitis.", + "extraction_class": "findings_suffix", + "attributes": {}, + "char_interval": { + "start_pos": 1147, + "end_pos": 1289 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + } + ] + }, + "text": "EXAMINATION:\n\nCT abdomen and pelvis with IV contrast\n\nCLINICAL INDICATION: Abdominal pain, rule out acute pathology\n\nCOMPARISON: None available\n\nTECHNIQUE: Axial images of the abdomen and pelvis were obtained following administration of intravenous contrast material. Coronal and sagittal reformations were performed.\n\n\nFINDINGS:\n\nLungs: No acute abnormality is seen in the visualized lung bases.\n\nLiver: The liver is normal in size and contour. There is a 1.2 cm simple-appearing low-attenuation lesion in hepatic segment VII, consistent with a cyst.\n\nGallbladder: The gallbladder contains numerous calcified gallstones, compatible with cholelithiasis, without gallbladder wall thickening, pericholecystic fluid, or other sonographic signs of acute cholecystitis.\n\nBiliary: The common bile duct is non-dilated, measuring approximately 4 mm.\n\nPancreas: The pancreas is unremarkable without focal mass or peripancreatic inflammatory stranding.\n\nSpleen: The spleen appears unremarkable.\n\nAdrenal Glands: The adrenal glands appear unremarkable.\n\nKidneys: A 9 mm simple left renal cyst is noted. The kidneys are otherwise unremarkable without hydronephrosis or nephrolithiasis.\n\nBowel: There is sigmoid diverticulosis without evidence of acute diverticulitis.\n\nIMPRESSION:\n\n1. Cholelithiasis without evidence of acute cholecystitis.\n2. Hepatic and renal cysts.\n3. Sigmoid diverticulosis without acute diverticulitis.", + "raw_prompt": "# RadExtract Prompt\n\n## Task Description\n\nYou are a medical assistant specialized in categorizing radiology text into sections:\n\n- **findings_prefix** -- All text that appears before the actual \"findings\" content.\n- **findings_body** -- The main 'Findings' section. Each finding is classified into a possible section through a list of attributes, some of which may also be assigned to a subheader.\n- **findings_suffix** -- Any text that appears after the \"findings\" portion (such as \"Impression\" or other concluding content).\n\n### Section Categories:\n- **findings_prefix**: Use only for header information before clinical findings (examination details, clinical indication, technique). Never use for actual clinical observations or pathological findings.\n- **findings_body**: Use for all clinical findings, observations, and pathological descriptions.\n- **findings_suffix**: Use only for conclusions, impressions, or recommendations that appear after the main findings.\n\n### Critical Rule:\nIf a report contains only clinical findings without any header information, do not create a findings_prefix extraction. Start directly with findings_body extractions for the clinical content.\n\n**Example of findings-only content (NO prefix needed):**\nInput: \"There is a small joint effusion. The cartilage shows thinning.\"\nCorrect: Create only findings_body extractions for each clinical finding.\nIncorrect: Do not categorize clinical findings as findings_prefix.\n\n### Professional Output Standards:\nAll extracted text must maintain the grammatical correctness and professional coherence expected in radiology reports. Ensure that:\n- All sentences are complete and grammatically correct\n- Medical terminology is used appropriately and consistently\n- The language remains professional and clinical in tone\n- Correct obvious typos (e.g., \"splen\" → \"spleen\", \"kidny\" → \"kidney\")\n- Any modifications to the original text preserve the intended medical meaning\n- Minor typos are corrected and optimal punctuation is used\n\n### Empty prefix or suffix sections:\nOnly create extractions for sections that actually exist in the text. Do not create empty prefix or suffix sections if there is no corresponding content in the source text. If the text is findings-only without any impression/conclusion, do not create a findings_suffix extraction.\n\n### Section Usage Guidelines:\n\n**findings_prefix**: Reserved exclusively for header information that appears before clinical findings, such as:\n- Examination details (type of study, technique)\n- Clinical indication or history\n- Comparison studies referenced\n- Technical parameters\n\n**findings_body**: Contains the actual clinical findings and observations from the imaging study.\n\n**findings_suffix**: Reserved for concluding content that follows the findings, such as impressions or recommendations.\n\n**Critical Rule**: Clinical findings should never be categorized as prefix content. If a report begins directly with clinical observations without any header information, create only findings_body and findings_suffix extractions as appropriate.\n\n### Special guidance for findings_prefix organization:\nWhen the report has detailed prefix information with clear section headers (like EXAMINATION, CLINICAL INDICATION, COMPARISON, TECHNIQUE), create separate extractions for each section rather than one large block. Use the \"section\" attribute to label each part:\n- \"Examination\" for exam type/title\n- \"Clinical Indication\" for clinical history/reason for study \n- \"Comparison\" for prior studies referenced\n- \"Technique\" for imaging parameters and acquisition details\n\n**Important:** Even when examination information appears at the beginning without an explicit \"EXAMINATION:\" header, it should still be labeled with section:\"Examination\". This includes standalone exam descriptions that identify the type of imaging study being performed.\n\nAlways recognize examination-type content and use section:\"Examination\" regardless of whether it has an explicit header.\n\nThis structured approach provides better organization and readability.\n\n### Critical for findings_suffix:\nDo NOT include headers like \"IMPRESSION:\", \"CONCLUSION:\", etc. in the extraction_text. Only extract the actual content that follows these headers. The formatting system will add appropriate headers automatically. \n\n**Example:** If the text contains \"IMPRESSION: 1. Severe arthritis. 2. Labral tear.\", extract only \"1. Severe arthritis. 2. Labral tear.\" as the extraction_text.\n\n### Additional Notes for findings_body:\n- If a single sentence references multiple structures with a shared status (e.g., \"liver, gallbladder, spleen appear unremarkable\"), please split them into separate extraction lines, each referencing the relevant structure.\n- If the text mentions subheaders like \"CT ABDOMEN\" or \"CERVICAL SPINE,\" only create/retain that subheader if it clearly organizes multiple organ-structure findings under it. Do not force subheaders if only 1 or 2 lines belong there. A subheader should ideally group 3+ sections to be meaningful.\n\n### Special guidance for spine reports:\n- For spine imaging (MRI, CT), organize findings by anatomical level using the format: \"Lumbar Spine Levels: L1-L2\", \"Lumbar Spine Levels: L2-L3\", \"Cervical Spine Levels: C5-C6\", etc.\n- Separate general spine findings (alignment, lordosis, vertebral heights) from level-specific findings\n- Use dedicated sections for: \"Spinal Cord\", \"Bones\" (for marrow/vertebral body lesions), \"Paraspinal Soft Tissues\" (for muscle findings)\n- Each spinal level should get its own section when findings are described level-by-level\n- This level-by-level organization is preferred over generic \"Spine\" labeling for clinical utility\n\n### Non-spine skeletal findings:\nFor non-spine skeletal findings, unify them under a single section like \"Bones.\" Only keep laterality (Right/Left) if there is symmetry in the findings.\n\n## Required JSON Format\n\nEach final answer must be valid JSON with an array key \"extractions\". Each \"extraction\" is an object with:\n\n```json\n{\n \"text\": \"...\",\n \"category\": \"findings_prefix\" | \"findings_body\" | \"findings_suffix\",\n \"attributes\": {}\n}\n```\n\nWithin \"attributes\" each attribute should be a key-value pair as shown in the examples below. The attribute **\"clinical_significance\"** MUST be included for findings_body extractions and should be one of: **\"normal\"**, **\"minor\"**, **\"significant\"**, or **\"not_applicable\"** to indicate the importance of the finding.\n\n---\n\n# Few-Shot Examples\n\nThe following examples demonstrate how to properly structure different types of radiology reports:\n\n## Example 1\n\n**Input Text:**\n```\nEXAMINATION: CT ABDOMEN AND PELVIS WITH IV CONTRAST\nCLINICAL INDICATION: Abdominal pain.\nCOMPARISON: None.\nTECHNIQUE: Axial images of the abdomen and pelvis were obtained following the administration of intravenous contrast material. Coronal and sagittal reformations were reviewed.\n\nFINDINGS:\nNo acute abnormality is seen in the visualized lung bases. The liver is normal in size and contour. There is a 1.2 cm simple-appearing low-attenuation lesion in hepatic segment VII, consistent with a cyst. The gallbladder contains numerous calcified gallstones, compatible with cholelithiasis.\n\nIMPRESSION:\n1. Cholelithiasis without evidence of acute cholecystitis.\n2. Hepatic cyst.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION: CT ABDOMEN AND PELVIS WITH IV CONTRAST\",\n \"attributes\": {\n \"section\": \"Examination\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"CLINICAL INDICATION: Abdominal pain.\",\n \"attributes\": {\n \"section\": \"Clinical Indication\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"COMPARISON: None.\",\n \"attributes\": {\n \"section\": \"Comparison\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"TECHNIQUE: Axial images of the abdomen and pelvis were obtained following the administration of intravenous contrast material. Coronal and sagittal reformations were reviewed.\",\n \"attributes\": {\n \"section\": \"Technique\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No acute abnormality is seen in the visualized lung bases.\",\n \"attributes\": {\n \"section\": \"Lungs\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The liver is normal in size and contour.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a 1.2 cm simple-appearing low-attenuation lesion in hepatic segment VII, consistent with a cyst.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The gallbladder contains numerous calcified gallstones, compatible with cholelithiasis.\",\n \"attributes\": {\n \"section\": \"Gallbladder\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Cholelithiasis without evidence of acute cholecystitis.\\n2. Hepatic cyst.\"\n }\n ]\n}\n```\n\n---\n\n## Example 2\n\n**Input Text:**\n```\nCLINICAL HISTORY:\nLow back pain, rule out disc herniation\n\nMRI LUMBAR SPINE WITHOUT CONTRAST:\n\nFINDINGS:\nThe lumbar lordosis is maintained. Vertebral body heights are preserved.\n\nThere is a small hemangioma in the L3 vertebral body.\n\nThe conus medullaris terminates at L1 and appears normal.\n\nAt L2-L3, there is mild disc desiccation without significant stenosis.\n\nAt L3-L4, a small posterior disc bulge causes mild central canal narrowing.\n\nAt L4-L5, there is a large posterior disc herniation with severe central canal stenosis and nerve root impingement.\n\nAt L5-S1, mild disc bulge without significant stenosis.\n\nThe paraspinal musculature appears unremarkable.\n\nIMPRESSION:\nLarge L4-L5 disc herniation with severe stenosis.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"CLINICAL HISTORY:\\nLow back pain, rule out disc herniation\\n\\nMRI LUMBAR SPINE WITHOUT CONTRAST:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lumbar lordosis is maintained. Vertebral body heights are preserved.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a small hemangioma in the L3 vertebral body.\",\n \"attributes\": {\n \"section\": \"Bones\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The conus medullaris terminates at L1 and appears normal.\",\n \"attributes\": {\n \"section\": \"Spinal Cord\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L2-L3, there is mild disc desiccation without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L2-L3\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L3-L4, a small posterior disc bulge causes mild central canal narrowing.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L3-L4\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L4-L5, there is a large posterior disc herniation with severe central canal stenosis and nerve root impingement.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L4-L5\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L5-S1, mild disc bulge without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L5-S1\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The paraspinal musculature appears unremarkable.\",\n \"attributes\": {\n \"section\": \"Paraspinal Soft Tissues\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Large L4-L5 disc herniation with severe stenosis.\"\n }\n ]\n}\n```\n\n---\n\n## Example 3\n\n**Input Text:**\n```\nINDICATION: \nNeck pain, radiculopathy\n\nMRI CERVICAL SPINE:\n\nFINDINGS:\nNormal cervical lordosis is maintained. No vertebral body compression fractures.\n\nThe cervical spinal cord demonstrates normal signal intensity.\n\nAt C3-C4, no significant disc disease or stenosis.\n\nAt C4-C5, mild disc osteophyte complex with mild foraminal narrowing.\n\nAt C5-C6, moderate disc herniation with moderate central canal stenosis.\n\nAt C6-C7, small disc bulge without significant stenosis.\n\nIMPRESSION:\nModerate C5-C6 disc herniation and stenosis.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"INDICATION: \\nNeck pain, radiculopathy\\n\\nMRI CERVICAL SPINE:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Normal cervical lordosis is maintained. No vertebral body compression fractures.\",\n \"attributes\": {\n \"section\": \"Cervical Spine\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The cervical spinal cord demonstrates normal signal intensity.\",\n \"attributes\": {\n \"section\": \"Spinal Cord\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C3-C4, no significant disc disease or stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C3-C4\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C4-C5, mild disc osteophyte complex with mild foraminal narrowing.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C4-C5\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C5-C6, moderate disc herniation with moderate central canal stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C5-C6\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C6-C7, small disc bulge without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C6-C7\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Moderate C5-C6 disc herniation and stenosis.\"\n }\n ]\n}\n```\n\n---\n\n## Example 4\n\n**Input Text:**\n```\nTECHNIQUE: \nMultidetector helical CT from lung bases to adrenals with and without intravenous contrast.\n\nFINDINGS:\nLIVER/GALLBLADDER/SPLEEN: The liver has a normal appearance. Gallbladder wall appears normal. The spleen is normal in size.\n\nPANCREAS/ADRENALS: The pancreas and bilateral adrenal glands appear unremarkable.\n\nRETROPERITONEUM: No lymphadenopathy. No fluid collection.\n\nIMPRESSION:\nNormal abdominal CT.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"TECHNIQUE: \\nMultidetector helical CT from lung bases to adrenals with and without intravenous contrast.\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The liver has a normal appearance.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Gallbladder wall appears normal.\",\n \"attributes\": {\n \"section\": \"Gallbladder\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The spleen is normal in size.\",\n \"attributes\": {\n \"section\": \"Spleen\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The pancreas and bilateral adrenal glands appear unremarkable.\",\n \"attributes\": {\n \"section\": \"Pancreas/Adrenals\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No lymphadenopathy.\",\n \"attributes\": {\n \"section\": \"Retroperitoneum\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No fluid collection.\",\n \"attributes\": {\n \"section\": \"Retroperitoneum\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal abdominal CT.\"\n }\n ]\n}\n```\n\n---\n\n## Example 5\n\n**Input Text:**\n```\nHISTORY: \nLower abdominal pain\n\nCT ABDOMEN/PELVIS WITH CONTRAST:\n\nFINDINGS:\nLIVER: Multiple hepatic metastases are present, measuring up to 3.2 cm.\n\nKIDNEYS: The left kidney shows moderate hydronephrosis. The right kidney appears normal.\n\nLYMPH NODES: Enlarged retroperitoneal lymph nodes, largest measuring 2.1 cm.\n\nIMPRESSION:\n1. Multiple hepatic metastases\n2. Left hydronephrosis \n3. Retroperitoneal lymphadenopathy\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"HISTORY: \\nLower abdominal pain\\n\\nCT ABDOMEN/PELVIS WITH CONTRAST:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Multiple hepatic metastases are present, measuring up to 3.2 cm.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The left kidney shows moderate hydronephrosis.\",\n \"attributes\": {\n \"section\": \"Kidneys\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The right kidney appears normal.\",\n \"attributes\": {\n \"section\": \"Kidneys\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Enlarged retroperitoneal lymph nodes, largest measuring 2.1 cm.\",\n \"attributes\": {\n \"section\": \"Lymph Nodes\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Multiple hepatic metastases\\n2. Left hydronephrosis \\n3. Retroperitoneal lymphadenopathy\"\n }\n ]\n}\n```\n\n---\n\n## Example 6\n\n**Input Text:**\n```\nEXAMINATION:\nMRI brain without contrast\n\nCLINICAL HISTORY:\nHeadaches\n\nFINDINGS:\nThe brain parenchyma demonstrates normal signal intensity. No mass lesions are identified.\n\nThe ventricular system is normal in size and configuration.\n\nNo abnormal enhancement is seen.\n\nIMPRESSION:\nNormal brain MRI.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION:\\nMRI brain without contrast\\n\\nCLINICAL HISTORY:\\nHeadaches\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The brain parenchyma demonstrates normal signal intensity.\",\n \"attributes\": {\n \"section\": \"Brain Parenchyma\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No mass lesions are identified.\",\n \"attributes\": {\n \"section\": \"Brain Parenchyma\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The ventricular system is normal in size and configuration.\",\n \"attributes\": {\n \"section\": \"Ventricular System\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No abnormal enhancement is seen.\",\n \"attributes\": {\n \"section\": \"Enhancement\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal brain MRI.\"\n }\n ]\n}\n```\n\n---\n\n## Example 7\n\n**Input Text:**\n```\nINDICATION:\nRight knee pain\n\nMRI RIGHT KNEE:\n\nFINDINGS:\nMENISCI: There is a complex tear of the medial meniscus. The lateral meniscus appears intact.\n\nLIGAMENTS: The ACL shows complete rupture. The PCL, MCL, and LCL are intact.\n\nBONES: Mild bone marrow edema is present in the medial femoral condyle.\n\nIMPRESSION:\n1. Complex medial meniscal tear\n2. Complete ACL rupture\n3. Bone marrow edema in medial femoral condyle\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"INDICATION:\\nRight knee pain\\n\\nMRI RIGHT KNEE:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a complex tear of the medial meniscus.\",\n \"attributes\": {\n \"section\": \"Menisci\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lateral meniscus appears intact.\",\n \"attributes\": {\n \"section\": \"Menisci\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The ACL shows complete rupture.\",\n \"attributes\": {\n \"section\": \"Ligaments\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The PCL, MCL, and LCL are intact.\",\n \"attributes\": {\n \"section\": \"Ligaments\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Mild bone marrow edema is present in the medial femoral condyle.\",\n \"attributes\": {\n \"section\": \"Bones\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Complex medial meniscal tear\\n2. Complete ACL rupture\\n3. Bone marrow edema in medial femoral condyle\"\n }\n ]\n}\n```\n\n---\n\n## Example 8\n\n**Input Text:**\n```\nEXAMINATION: CT CHEST\n\nFINDINGS:\nThe longs are clear bilaterally. The hart size is normal. No pleural effushion.\n\nIMPRESSION:\nNormal chest CT.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION: CT CHEST\",\n \"attributes\": {\n \"section\": \"Examination\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lungs are clear bilaterally.\",\n \"attributes\": {\n \"section\": \"Lungs\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The heart size is normal.\",\n \"attributes\": {\n \"section\": \"Heart\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No pleural effusion.\",\n \"attributes\": {\n \"section\": \"Pleura\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal chest CT.\"\n }\n ]\n}\n```\n\n\n\n## Inference Example:\n\n**Input Text:**\n```\nEXAMINATION: CT abdomen and pelvis with IV contrast\nCLINICAL INDICATION: Abdominal pain, rule out acute pathology\nCOMPARISON: None available\nTECHNIQUE: Axial images of the abdomen and pelvis were obtained following administration of intravenous contrast material. Coronal and sagittal reformations were performed.\n\nFINDINGS:\nNo acute abnormality is seen in the visualized lung bases. The liver is normal in size and contour. There is a 1.2 cm simple-appearing low-attenuation lesion in hepatic segment VII, consistent with a cyst. The gallbladder contains numerous calcified gallstones, compatible with cholelithiasis, without gallbladder wall thickening, pericholecystic fluid, or other sonographic signs of acute cholecystitis. The common bile duct is non-dilated, measuring approximately 4 mm. The pancreas is unremarkable without focal mass or peripancreatic inflammatory stranding. The spleen and adrenal glands appear unremarkable. A 9 mm simple left renal cyst is noted. The kidneys are otherwise unremarkable without hydronephrosis or nephrolithiasis. There is sigmoid diverticulosis without evidence of acute diverticulitis.\n\nIMPRESSION:\n1. Cholelithiasis without evidence of acute cholecystitis.\n2. Hepatic and renal cysts.\n3. Sigmoid diverticulosis without acute diverticulitis.\n```\n\n**Expected Output:**\n" + }, + "sample_lumbar_spine_mri": { + "segments": [ + { + "type": "prefix", + "label": "Examination", + "content": "Exam: MRI Lumbar Spine", + "intervals": [ + { + "startPos": 0, + "endPos": 22 + } + ], + "significance": null + }, + { + "type": "prefix", + "label": "Clinical Indication", + "content": "Clinical Indication: Low back pain, radiculopathy", + "intervals": [ + { + "startPos": 23, + "endPos": 72 + } + ], + "significance": null + }, + { + "type": "body", + "label": "Lumbar Spine", + "content": "There is mild degenerative anterolisthesis of L4 on L5.", + "intervals": [ + { + "startPos": 74, + "endPos": 129 + } + ], + "significance": "minor" + }, + { + "type": "body", + "label": "Lumbar Spine", + "content": "The normal lumbar lordosis is otherwise maintained.", + "intervals": [ + { + "startPos": 130, + "endPos": 181 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Lumbar Spine", + "content": "Vertebral body heights are preserved.", + "intervals": [ + { + "startPos": 182, + "endPos": 219 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Bones", + "content": "There is a T1 and T2 hyperintense lesion in the L2 vertebral body consistent with a benign hemangioma.", + "intervals": [ + { + "startPos": 220, + "endPos": 322 + } + ], + "significance": "minor" + }, + { + "type": "body", + "label": "Bones", + "content": "Marrow signal is otherwise unremarkable.", + "intervals": [ + { + "startPos": 323, + "endPos": 363 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Spinal Cord", + "content": "The conus medullaris terminates at a normal level and is unremarkable in signal intensity.", + "intervals": [ + { + "startPos": 364, + "endPos": 454 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Lumbar Spine Levels: L1-L2", + "content": "At L1-L2, there is mild disc desiccation without significant canal or foraminal stenosis.", + "intervals": [ + { + "startPos": 456, + "endPos": 555 + } + ], + "significance": "minor" + }, + { + "type": "body", + "label": "Lumbar Spine Levels: L2-L3", + "content": "At L2-L3, there is mild disc desiccation without significant canal or foraminal stenosis.", + "intervals": [ + { + "startPos": 456, + "endPos": 555 + } + ], + "significance": "minor" + }, + { + "type": "body", + "label": "Lumbar Spine Levels: L3-L4", + "content": "At L3-L4, a shallow posterior disc bulge and mild facet arthropathy result in mild central canal narrowing. The neural foramina are patent.", + "intervals": [ + { + "startPos": 556, + "endPos": 695 + } + ], + "significance": "minor" + }, + { + "type": "body", + "label": "Lumbar Spine Levels: L4-L5", + "content": "At L4-L5, there is advanced disc space narrowing and desiccation. A broad-based posterior disc protrusion with a superimposed left paracentral extrusion severely narrows the central canal and contacts the traversing left S1 nerve root. There is moderate left neural foraminal stenosis.", + "intervals": [ + { + "startPos": 696, + "endPos": 981 + } + ], + "significance": "significant" + }, + { + "type": "body", + "label": "Lumbar Spine Levels: L5-S1", + "content": "At L5-S1, mild disc desiccation is present without significant canal or foraminal stenosis.", + "intervals": [ + { + "startPos": 982, + "endPos": 1073 + } + ], + "significance": "minor" + }, + { + "type": "body", + "label": "Paraspinal Soft Tissues", + "content": "The paraspinal soft tissues are unremarkable.", + "intervals": [ + { + "startPos": 1074, + "endPos": 1119 + } + ], + "significance": "normal" + }, + { + "type": "suffix", + "label": "suffix", + "content": "1. Severe L4-L5 disc protrusion with superimposed left paracentral extrusion, resulting in severe central canal narrowing and contact with the left S1 nerve root.\n2. Multilevel degenerative disc disease, most advanced at L4-L5.\n3. Benign hemangioma in L2 vertebral body.", + "intervals": [ + { + "startPos": 1133, + "endPos": 1403 + } + ], + "significance": null + } + ], + "annotated_document_json": { + "extractions": [ + { + "extraction_text": "Exam: MRI Lumbar Spine", + "extraction_class": "findings_prefix", + "attributes": { + "section": "Examination" + }, + "char_interval": { + "start_pos": 0, + "end_pos": 22 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "Clinical Indication: Low back pain, radiculopathy", + "extraction_class": "findings_prefix", + "attributes": { + "section": "Clinical Indication" + }, + "char_interval": { + "start_pos": 23, + "end_pos": 72 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "There is mild degenerative anterolisthesis of L4 on L5.", + "extraction_class": "findings_body", + "attributes": { + "section": "Lumbar Spine", + "clinical_significance": "minor" + }, + "char_interval": { + "start_pos": 74, + "end_pos": 129 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The normal lumbar lordosis is otherwise maintained.", + "extraction_class": "findings_body", + "attributes": { + "section": "Lumbar Spine", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 130, + "end_pos": 181 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "Vertebral body heights are preserved.", + "extraction_class": "findings_body", + "attributes": { + "section": "Lumbar Spine", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 182, + "end_pos": 219 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "There is a T1 and T2 hyperintense lesion in the L2 vertebral body consistent with a benign hemangioma.", + "extraction_class": "findings_body", + "attributes": { + "section": "Bones", + "clinical_significance": "minor" + }, + "char_interval": { + "start_pos": 220, + "end_pos": 322 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "Marrow signal is otherwise unremarkable.", + "extraction_class": "findings_body", + "attributes": { + "section": "Bones", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 323, + "end_pos": 363 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The conus medullaris terminates at a normal level and is unremarkable in signal intensity.", + "extraction_class": "findings_body", + "attributes": { + "section": "Spinal Cord", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 364, + "end_pos": 454 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "At L1-L2, there is mild disc desiccation without significant canal or foraminal stenosis.", + "extraction_class": "findings_body", + "attributes": { + "section": "Lumbar Spine Levels: L1-L2", + "clinical_significance": "minor" + }, + "char_interval": { + "start_pos": 456, + "end_pos": 555 + }, + "alignment_status": "AlignmentStatus.MATCH_FUZZY" + }, + { + "extraction_text": "At L2-L3, there is mild disc desiccation without significant canal or foraminal stenosis.", + "extraction_class": "findings_body", + "attributes": { + "section": "Lumbar Spine Levels: L2-L3", + "clinical_significance": "minor" + }, + "char_interval": { + "start_pos": 456, + "end_pos": 555 + }, + "alignment_status": "AlignmentStatus.MATCH_FUZZY" + }, + { + "extraction_text": "At L3-L4, a shallow posterior disc bulge and mild facet arthropathy result in mild central canal narrowing. The neural foramina are patent.", + "extraction_class": "findings_body", + "attributes": { + "section": "Lumbar Spine Levels: L3-L4", + "clinical_significance": "minor" + }, + "char_interval": { + "start_pos": 556, + "end_pos": 695 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "At L4-L5, there is advanced disc space narrowing and desiccation. A broad-based posterior disc protrusion with a superimposed left paracentral extrusion severely narrows the central canal and contacts the traversing left S1 nerve root. There is moderate left neural foraminal stenosis.", + "extraction_class": "findings_body", + "attributes": { + "section": "Lumbar Spine Levels: L4-L5", + "clinical_significance": "significant" + }, + "char_interval": { + "start_pos": 696, + "end_pos": 981 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "At L5-S1, mild disc desiccation is present without significant canal or foraminal stenosis.", + "extraction_class": "findings_body", + "attributes": { + "section": "Lumbar Spine Levels: L5-S1", + "clinical_significance": "minor" + }, + "char_interval": { + "start_pos": 982, + "end_pos": 1073 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The paraspinal soft tissues are unremarkable.", + "extraction_class": "findings_body", + "attributes": { + "section": "Paraspinal Soft Tissues", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 1074, + "end_pos": 1119 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "1. Severe L4-L5 disc protrusion with superimposed left paracentral extrusion, resulting in severe central canal narrowing and contact with the left S1 nerve root.\n2. Multilevel degenerative disc disease, most advanced at L4-L5.\n3. Benign hemangioma in L2 vertebral body.", + "extraction_class": "findings_suffix", + "attributes": {}, + "char_interval": { + "start_pos": 1133, + "end_pos": 1403 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + } + ] + }, + "text": "EXAMINATION:\n\nMRI Lumbar Spine\n\nClinical Indication: Low back pain, radiculopathy\n\n\nFINDINGS:\n\nLumbar Spine: There is mild degenerative anterolisthesis of L4 on L5. The normal lumbar lordosis is otherwise maintained. Vertebral body heights are preserved.\n\nBones: There is a T1 and T2 hyperintense lesion in the L2 vertebral body consistent with a benign hemangioma. Marrow signal is otherwise unremarkable.\n\nSpinal Cord: The conus medullaris terminates at a normal level and is unremarkable in signal intensity.\n\nLumbar Spine Levels: L1-L2: At L1-L2, there is mild disc desiccation without significant canal or foraminal stenosis.\n\nLumbar Spine Levels: L2-L3: At L2-L3, there is mild disc desiccation without significant canal or foraminal stenosis.\n\nLumbar Spine Levels: L3-L4: At L3-L4, a shallow posterior disc bulge and mild facet arthropathy result in mild central canal narrowing. The neural foramina are patent.\n\nLumbar Spine Levels: L4-L5: At L4-L5, there is advanced disc space narrowing and desiccation. A broad-based posterior disc protrusion with a superimposed left paracentral extrusion severely narrows the central canal and contacts the traversing left S1 nerve root. There is moderate left neural foraminal stenosis.\n\nLumbar Spine Levels: L5-S1: At L5-S1, mild disc desiccation is present without significant canal or foraminal stenosis.\n\nParaspinal Soft Tissues: The paraspinal soft tissues are unremarkable.\n\nIMPRESSION:\n\n1. Severe L4-L5 disc protrusion with superimposed left paracentral extrusion, resulting in severe central canal narrowing and contact with the left S1 nerve root.\n2. Multilevel degenerative disc disease, most advanced at L4-L5.\n3. Benign hemangioma in L2 vertebral body.", + "raw_prompt": "# RadExtract Prompt\n\n## Task Description\n\nYou are a medical assistant specialized in categorizing radiology text into sections:\n\n- **findings_prefix** -- All text that appears before the actual \"findings\" content.\n- **findings_body** -- The main 'Findings' section. Each finding is classified into a possible section through a list of attributes, some of which may also be assigned to a subheader.\n- **findings_suffix** -- Any text that appears after the \"findings\" portion (such as \"Impression\" or other concluding content).\n\n### Section Categories:\n- **findings_prefix**: Use only for header information before clinical findings (examination details, clinical indication, technique). Never use for actual clinical observations or pathological findings.\n- **findings_body**: Use for all clinical findings, observations, and pathological descriptions.\n- **findings_suffix**: Use only for conclusions, impressions, or recommendations that appear after the main findings.\n\n### Critical Rule:\nIf a report contains only clinical findings without any header information, do not create a findings_prefix extraction. Start directly with findings_body extractions for the clinical content.\n\n**Example of findings-only content (NO prefix needed):**\nInput: \"There is a small joint effusion. The cartilage shows thinning.\"\nCorrect: Create only findings_body extractions for each clinical finding.\nIncorrect: Do not categorize clinical findings as findings_prefix.\n\n### Professional Output Standards:\nAll extracted text must maintain the grammatical correctness and professional coherence expected in radiology reports. Ensure that:\n- All sentences are complete and grammatically correct\n- Medical terminology is used appropriately and consistently\n- The language remains professional and clinical in tone\n- Correct obvious typos (e.g., \"splen\" → \"spleen\", \"kidny\" → \"kidney\")\n- Any modifications to the original text preserve the intended medical meaning\n- Minor typos are corrected and optimal punctuation is used\n\n### Empty prefix or suffix sections:\nOnly create extractions for sections that actually exist in the text. Do not create empty prefix or suffix sections if there is no corresponding content in the source text. If the text is findings-only without any impression/conclusion, do not create a findings_suffix extraction.\n\n### Section Usage Guidelines:\n\n**findings_prefix**: Reserved exclusively for header information that appears before clinical findings, such as:\n- Examination details (type of study, technique)\n- Clinical indication or history\n- Comparison studies referenced\n- Technical parameters\n\n**findings_body**: Contains the actual clinical findings and observations from the imaging study.\n\n**findings_suffix**: Reserved for concluding content that follows the findings, such as impressions or recommendations.\n\n**Critical Rule**: Clinical findings should never be categorized as prefix content. If a report begins directly with clinical observations without any header information, create only findings_body and findings_suffix extractions as appropriate.\n\n### Special guidance for findings_prefix organization:\nWhen the report has detailed prefix information with clear section headers (like EXAMINATION, CLINICAL INDICATION, COMPARISON, TECHNIQUE), create separate extractions for each section rather than one large block. Use the \"section\" attribute to label each part:\n- \"Examination\" for exam type/title\n- \"Clinical Indication\" for clinical history/reason for study \n- \"Comparison\" for prior studies referenced\n- \"Technique\" for imaging parameters and acquisition details\n\n**Important:** Even when examination information appears at the beginning without an explicit \"EXAMINATION:\" header, it should still be labeled with section:\"Examination\". This includes standalone exam descriptions that identify the type of imaging study being performed.\n\nAlways recognize examination-type content and use section:\"Examination\" regardless of whether it has an explicit header.\n\nThis structured approach provides better organization and readability.\n\n### Critical for findings_suffix:\nDo NOT include headers like \"IMPRESSION:\", \"CONCLUSION:\", etc. in the extraction_text. Only extract the actual content that follows these headers. The formatting system will add appropriate headers automatically. \n\n**Example:** If the text contains \"IMPRESSION: 1. Severe arthritis. 2. Labral tear.\", extract only \"1. Severe arthritis. 2. Labral tear.\" as the extraction_text.\n\n### Additional Notes for findings_body:\n- If a single sentence references multiple structures with a shared status (e.g., \"liver, gallbladder, spleen appear unremarkable\"), please split them into separate extraction lines, each referencing the relevant structure.\n- If the text mentions subheaders like \"CT ABDOMEN\" or \"CERVICAL SPINE,\" only create/retain that subheader if it clearly organizes multiple organ-structure findings under it. Do not force subheaders if only 1 or 2 lines belong there. A subheader should ideally group 3+ sections to be meaningful.\n\n### Special guidance for spine reports:\n- For spine imaging (MRI, CT), organize findings by anatomical level using the format: \"Lumbar Spine Levels: L1-L2\", \"Lumbar Spine Levels: L2-L3\", \"Cervical Spine Levels: C5-C6\", etc.\n- Separate general spine findings (alignment, lordosis, vertebral heights) from level-specific findings\n- Use dedicated sections for: \"Spinal Cord\", \"Bones\" (for marrow/vertebral body lesions), \"Paraspinal Soft Tissues\" (for muscle findings)\n- Each spinal level should get its own section when findings are described level-by-level\n- This level-by-level organization is preferred over generic \"Spine\" labeling for clinical utility\n\n### Non-spine skeletal findings:\nFor non-spine skeletal findings, unify them under a single section like \"Bones.\" Only keep laterality (Right/Left) if there is symmetry in the findings.\n\n## Required JSON Format\n\nEach final answer must be valid JSON with an array key \"extractions\". Each \"extraction\" is an object with:\n\n```json\n{\n \"text\": \"...\",\n \"category\": \"findings_prefix\" | \"findings_body\" | \"findings_suffix\",\n \"attributes\": {}\n}\n```\n\nWithin \"attributes\" each attribute should be a key-value pair as shown in the examples below. The attribute **\"clinical_significance\"** MUST be included for findings_body extractions and should be one of: **\"normal\"**, **\"minor\"**, **\"significant\"**, or **\"not_applicable\"** to indicate the importance of the finding.\n\n---\n\n# Few-Shot Examples\n\nThe following examples demonstrate how to properly structure different types of radiology reports:\n\n## Example 1\n\n**Input Text:**\n```\nEXAMINATION: CT ABDOMEN AND PELVIS WITH IV CONTRAST\nCLINICAL INDICATION: Abdominal pain.\nCOMPARISON: None.\nTECHNIQUE: Axial images of the abdomen and pelvis were obtained following the administration of intravenous contrast material. Coronal and sagittal reformations were reviewed.\n\nFINDINGS:\nNo acute abnormality is seen in the visualized lung bases. The liver is normal in size and contour. There is a 1.2 cm simple-appearing low-attenuation lesion in hepatic segment VII, consistent with a cyst. The gallbladder contains numerous calcified gallstones, compatible with cholelithiasis.\n\nIMPRESSION:\n1. Cholelithiasis without evidence of acute cholecystitis.\n2. Hepatic cyst.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION: CT ABDOMEN AND PELVIS WITH IV CONTRAST\",\n \"attributes\": {\n \"section\": \"Examination\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"CLINICAL INDICATION: Abdominal pain.\",\n \"attributes\": {\n \"section\": \"Clinical Indication\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"COMPARISON: None.\",\n \"attributes\": {\n \"section\": \"Comparison\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"TECHNIQUE: Axial images of the abdomen and pelvis were obtained following the administration of intravenous contrast material. Coronal and sagittal reformations were reviewed.\",\n \"attributes\": {\n \"section\": \"Technique\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No acute abnormality is seen in the visualized lung bases.\",\n \"attributes\": {\n \"section\": \"Lungs\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The liver is normal in size and contour.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a 1.2 cm simple-appearing low-attenuation lesion in hepatic segment VII, consistent with a cyst.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The gallbladder contains numerous calcified gallstones, compatible with cholelithiasis.\",\n \"attributes\": {\n \"section\": \"Gallbladder\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Cholelithiasis without evidence of acute cholecystitis.\\n2. Hepatic cyst.\"\n }\n ]\n}\n```\n\n---\n\n## Example 2\n\n**Input Text:**\n```\nCLINICAL HISTORY:\nLow back pain, rule out disc herniation\n\nMRI LUMBAR SPINE WITHOUT CONTRAST:\n\nFINDINGS:\nThe lumbar lordosis is maintained. Vertebral body heights are preserved.\n\nThere is a small hemangioma in the L3 vertebral body.\n\nThe conus medullaris terminates at L1 and appears normal.\n\nAt L2-L3, there is mild disc desiccation without significant stenosis.\n\nAt L3-L4, a small posterior disc bulge causes mild central canal narrowing.\n\nAt L4-L5, there is a large posterior disc herniation with severe central canal stenosis and nerve root impingement.\n\nAt L5-S1, mild disc bulge without significant stenosis.\n\nThe paraspinal musculature appears unremarkable.\n\nIMPRESSION:\nLarge L4-L5 disc herniation with severe stenosis.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"CLINICAL HISTORY:\\nLow back pain, rule out disc herniation\\n\\nMRI LUMBAR SPINE WITHOUT CONTRAST:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lumbar lordosis is maintained. Vertebral body heights are preserved.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a small hemangioma in the L3 vertebral body.\",\n \"attributes\": {\n \"section\": \"Bones\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The conus medullaris terminates at L1 and appears normal.\",\n \"attributes\": {\n \"section\": \"Spinal Cord\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L2-L3, there is mild disc desiccation without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L2-L3\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L3-L4, a small posterior disc bulge causes mild central canal narrowing.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L3-L4\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L4-L5, there is a large posterior disc herniation with severe central canal stenosis and nerve root impingement.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L4-L5\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L5-S1, mild disc bulge without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L5-S1\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The paraspinal musculature appears unremarkable.\",\n \"attributes\": {\n \"section\": \"Paraspinal Soft Tissues\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Large L4-L5 disc herniation with severe stenosis.\"\n }\n ]\n}\n```\n\n---\n\n## Example 3\n\n**Input Text:**\n```\nINDICATION: \nNeck pain, radiculopathy\n\nMRI CERVICAL SPINE:\n\nFINDINGS:\nNormal cervical lordosis is maintained. No vertebral body compression fractures.\n\nThe cervical spinal cord demonstrates normal signal intensity.\n\nAt C3-C4, no significant disc disease or stenosis.\n\nAt C4-C5, mild disc osteophyte complex with mild foraminal narrowing.\n\nAt C5-C6, moderate disc herniation with moderate central canal stenosis.\n\nAt C6-C7, small disc bulge without significant stenosis.\n\nIMPRESSION:\nModerate C5-C6 disc herniation and stenosis.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"INDICATION: \\nNeck pain, radiculopathy\\n\\nMRI CERVICAL SPINE:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Normal cervical lordosis is maintained. No vertebral body compression fractures.\",\n \"attributes\": {\n \"section\": \"Cervical Spine\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The cervical spinal cord demonstrates normal signal intensity.\",\n \"attributes\": {\n \"section\": \"Spinal Cord\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C3-C4, no significant disc disease or stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C3-C4\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C4-C5, mild disc osteophyte complex with mild foraminal narrowing.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C4-C5\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C5-C6, moderate disc herniation with moderate central canal stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C5-C6\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C6-C7, small disc bulge without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C6-C7\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Moderate C5-C6 disc herniation and stenosis.\"\n }\n ]\n}\n```\n\n---\n\n## Example 4\n\n**Input Text:**\n```\nTECHNIQUE: \nMultidetector helical CT from lung bases to adrenals with and without intravenous contrast.\n\nFINDINGS:\nLIVER/GALLBLADDER/SPLEEN: The liver has a normal appearance. Gallbladder wall appears normal. The spleen is normal in size.\n\nPANCREAS/ADRENALS: The pancreas and bilateral adrenal glands appear unremarkable.\n\nRETROPERITONEUM: No lymphadenopathy. No fluid collection.\n\nIMPRESSION:\nNormal abdominal CT.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"TECHNIQUE: \\nMultidetector helical CT from lung bases to adrenals with and without intravenous contrast.\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The liver has a normal appearance.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Gallbladder wall appears normal.\",\n \"attributes\": {\n \"section\": \"Gallbladder\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The spleen is normal in size.\",\n \"attributes\": {\n \"section\": \"Spleen\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The pancreas and bilateral adrenal glands appear unremarkable.\",\n \"attributes\": {\n \"section\": \"Pancreas/Adrenals\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No lymphadenopathy.\",\n \"attributes\": {\n \"section\": \"Retroperitoneum\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No fluid collection.\",\n \"attributes\": {\n \"section\": \"Retroperitoneum\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal abdominal CT.\"\n }\n ]\n}\n```\n\n---\n\n## Example 5\n\n**Input Text:**\n```\nHISTORY: \nLower abdominal pain\n\nCT ABDOMEN/PELVIS WITH CONTRAST:\n\nFINDINGS:\nLIVER: Multiple hepatic metastases are present, measuring up to 3.2 cm.\n\nKIDNEYS: The left kidney shows moderate hydronephrosis. The right kidney appears normal.\n\nLYMPH NODES: Enlarged retroperitoneal lymph nodes, largest measuring 2.1 cm.\n\nIMPRESSION:\n1. Multiple hepatic metastases\n2. Left hydronephrosis \n3. Retroperitoneal lymphadenopathy\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"HISTORY: \\nLower abdominal pain\\n\\nCT ABDOMEN/PELVIS WITH CONTRAST:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Multiple hepatic metastases are present, measuring up to 3.2 cm.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The left kidney shows moderate hydronephrosis.\",\n \"attributes\": {\n \"section\": \"Kidneys\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The right kidney appears normal.\",\n \"attributes\": {\n \"section\": \"Kidneys\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Enlarged retroperitoneal lymph nodes, largest measuring 2.1 cm.\",\n \"attributes\": {\n \"section\": \"Lymph Nodes\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Multiple hepatic metastases\\n2. Left hydronephrosis \\n3. Retroperitoneal lymphadenopathy\"\n }\n ]\n}\n```\n\n---\n\n## Example 6\n\n**Input Text:**\n```\nEXAMINATION:\nMRI brain without contrast\n\nCLINICAL HISTORY:\nHeadaches\n\nFINDINGS:\nThe brain parenchyma demonstrates normal signal intensity. No mass lesions are identified.\n\nThe ventricular system is normal in size and configuration.\n\nNo abnormal enhancement is seen.\n\nIMPRESSION:\nNormal brain MRI.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION:\\nMRI brain without contrast\\n\\nCLINICAL HISTORY:\\nHeadaches\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The brain parenchyma demonstrates normal signal intensity.\",\n \"attributes\": {\n \"section\": \"Brain Parenchyma\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No mass lesions are identified.\",\n \"attributes\": {\n \"section\": \"Brain Parenchyma\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The ventricular system is normal in size and configuration.\",\n \"attributes\": {\n \"section\": \"Ventricular System\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No abnormal enhancement is seen.\",\n \"attributes\": {\n \"section\": \"Enhancement\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal brain MRI.\"\n }\n ]\n}\n```\n\n---\n\n## Example 7\n\n**Input Text:**\n```\nINDICATION:\nRight knee pain\n\nMRI RIGHT KNEE:\n\nFINDINGS:\nMENISCI: There is a complex tear of the medial meniscus. The lateral meniscus appears intact.\n\nLIGAMENTS: The ACL shows complete rupture. The PCL, MCL, and LCL are intact.\n\nBONES: Mild bone marrow edema is present in the medial femoral condyle.\n\nIMPRESSION:\n1. Complex medial meniscal tear\n2. Complete ACL rupture\n3. Bone marrow edema in medial femoral condyle\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"INDICATION:\\nRight knee pain\\n\\nMRI RIGHT KNEE:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a complex tear of the medial meniscus.\",\n \"attributes\": {\n \"section\": \"Menisci\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lateral meniscus appears intact.\",\n \"attributes\": {\n \"section\": \"Menisci\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The ACL shows complete rupture.\",\n \"attributes\": {\n \"section\": \"Ligaments\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The PCL, MCL, and LCL are intact.\",\n \"attributes\": {\n \"section\": \"Ligaments\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Mild bone marrow edema is present in the medial femoral condyle.\",\n \"attributes\": {\n \"section\": \"Bones\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Complex medial meniscal tear\\n2. Complete ACL rupture\\n3. Bone marrow edema in medial femoral condyle\"\n }\n ]\n}\n```\n\n---\n\n## Example 8\n\n**Input Text:**\n```\nEXAMINATION: CT CHEST\n\nFINDINGS:\nThe longs are clear bilaterally. The hart size is normal. No pleural effushion.\n\nIMPRESSION:\nNormal chest CT.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION: CT CHEST\",\n \"attributes\": {\n \"section\": \"Examination\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lungs are clear bilaterally.\",\n \"attributes\": {\n \"section\": \"Lungs\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The heart size is normal.\",\n \"attributes\": {\n \"section\": \"Heart\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No pleural effusion.\",\n \"attributes\": {\n \"section\": \"Pleura\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal chest CT.\"\n }\n ]\n}\n```\n\n\n\n## Inference Example:\n\n**Input Text:**\n```\nExam: MRI Lumbar Spine\nClinical Indication: Low back pain, radiculopathy\n\nThere is mild degenerative anterolisthesis of L4 on L5. The normal lumbar lordosis is otherwise maintained. Vertebral body heights are preserved. There is a T1 and T2 hyperintense lesion in the L2 vertebral body consistent with a benign hemangioma. Marrow signal is otherwise unremarkable. The conus medullaris terminates at a normal level and is unremarkable in signal intensity.\n\nAt L1-L2 and L2-L3, there is mild disc desiccation without significant canal or foraminal stenosis. At L3-L4, a shallow posterior disc bulge and mild facet arthropathy result in mild central canal narrowing. The neural foramina are patent. At L4-L5, there is advanced disc space narrowing and desiccation. A broad-based posterior disc protrusion with a superimposed left paracentral extrusion severely narrows the central canal and contacts the traversing left S1 nerve root. There is moderate left neural foraminal stenosis. At L5-S1, mild disc desiccation is present without significant canal or foraminal stenosis. The paraspinal soft tissues are unremarkable.\n\nIMPRESSION:\n1. Severe L4-L5 disc protrusion with superimposed left paracentral extrusion, resulting in severe central canal narrowing and contact with the left S1 nerve root.\n2. Multilevel degenerative disc disease, most advanced at L4-L5.\n3. Benign hemangioma in L2 vertebral body.\n```\n\n**Expected Output:**\n" + }, + "sample_shoulder_mri": { + "segments": [ + { + "type": "body", + "label": "Rotator Cuff", + "content": "A full-thickness, full-width tear of the supraspinatus tendon is present, with the torn tendon end retracted approximately 2 cm medially to the level of the glenoid rim.", + "intervals": [ + { + "startPos": 0, + "endPos": 169 + } + ], + "significance": "significant" + }, + { + "type": "body", + "label": "Rotator Cuff", + "content": "There is moderate fatty infiltration and atrophy of the supraspinatus muscle.", + "intervals": [ + { + "startPos": 170, + "endPos": 247 + } + ], + "significance": "significant" + }, + { + "type": "body", + "label": "Rotator Cuff", + "content": "The infraspinatus, teres minor, and subscapularis tendons and muscles appear intact.", + "intervals": [ + { + "startPos": 248, + "endPos": 332 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Joint Space/Capsule", + "content": "There is a moderate joint effusion with synovial thickening.", + "intervals": [ + { + "startPos": 333, + "endPos": 393 + } + ], + "significance": "significant" + }, + { + "type": "body", + "label": "Glenoid Labrum", + "content": "The glenoid labrum shows a small superior labral tear.", + "intervals": [ + { + "startPos": 394, + "endPos": 448 + } + ], + "significance": "significant" + }, + { + "type": "body", + "label": "Biceps Tendon", + "content": "The biceps tendon is intact and properly positioned within the bicipital groove.", + "intervals": [ + { + "startPos": 449, + "endPos": 529 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Acromioclavicular Joint", + "content": "The acromioclavicular joint shows mild degenerative changes with small osteophytes but no significant narrowing.", + "intervals": [ + { + "startPos": 530, + "endPos": 642 + } + ], + "significance": "minor" + } + ], + "annotated_document_json": { + "extractions": [ + { + "extraction_text": "A full-thickness, full-width tear of the supraspinatus tendon is present, with the torn tendon end retracted approximately 2 cm medially to the level of the glenoid rim.", + "extraction_class": "findings_body", + "attributes": { + "section": "Rotator Cuff", + "clinical_significance": "significant" + }, + "char_interval": { + "start_pos": 0, + "end_pos": 169 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "There is moderate fatty infiltration and atrophy of the supraspinatus muscle.", + "extraction_class": "findings_body", + "attributes": { + "section": "Rotator Cuff", + "clinical_significance": "significant" + }, + "char_interval": { + "start_pos": 170, + "end_pos": 247 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The infraspinatus, teres minor, and subscapularis tendons and muscles appear intact.", + "extraction_class": "findings_body", + "attributes": { + "section": "Rotator Cuff", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 248, + "end_pos": 332 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "There is a moderate joint effusion with synovial thickening.", + "extraction_class": "findings_body", + "attributes": { + "section": "Joint Space/Capsule", + "clinical_significance": "significant" + }, + "char_interval": { + "start_pos": 333, + "end_pos": 393 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The glenoid labrum shows a small superior labral tear.", + "extraction_class": "findings_body", + "attributes": { + "section": "Glenoid Labrum", + "clinical_significance": "significant" + }, + "char_interval": { + "start_pos": 394, + "end_pos": 448 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The biceps tendon is intact and properly positioned within the bicipital groove.", + "extraction_class": "findings_body", + "attributes": { + "section": "Biceps Tendon", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 449, + "end_pos": 529 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The acromioclavicular joint shows mild degenerative changes with small osteophytes but no significant narrowing.", + "extraction_class": "findings_body", + "attributes": { + "section": "Acromioclavicular Joint", + "clinical_significance": "minor" + }, + "char_interval": { + "start_pos": 530, + "end_pos": 642 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + } + ] + }, + "text": "FINDINGS:\n\nRotator Cuff: A full-thickness, full-width tear of the supraspinatus tendon is present, with the torn tendon end retracted approximately 2 cm medially to the level of the glenoid rim. There is moderate fatty infiltration and atrophy of the supraspinatus muscle. The infraspinatus, teres minor, and subscapularis tendons and muscles appear intact.\n\nJoint Space/Capsule: There is a moderate joint effusion with synovial thickening.\n\nGlenoid Labrum: The glenoid labrum shows a small superior labral tear.\n\nBiceps Tendon: The biceps tendon is intact and properly positioned within the bicipital groove.\n\nAcromioclavicular Joint: The acromioclavicular joint shows mild degenerative changes with small osteophytes but no significant narrowing.", + "raw_prompt": "# RadExtract Prompt\n\n## Task Description\n\nYou are a medical assistant specialized in categorizing radiology text into sections:\n\n- **findings_prefix** -- All text that appears before the actual \"findings\" content.\n- **findings_body** -- The main 'Findings' section. Each finding is classified into a possible section through a list of attributes, some of which may also be assigned to a subheader.\n- **findings_suffix** -- Any text that appears after the \"findings\" portion (such as \"Impression\" or other concluding content).\n\n### Section Categories:\n- **findings_prefix**: Use only for header information before clinical findings (examination details, clinical indication, technique). Never use for actual clinical observations or pathological findings.\n- **findings_body**: Use for all clinical findings, observations, and pathological descriptions.\n- **findings_suffix**: Use only for conclusions, impressions, or recommendations that appear after the main findings.\n\n### Critical Rule:\nIf a report contains only clinical findings without any header information, do not create a findings_prefix extraction. Start directly with findings_body extractions for the clinical content.\n\n**Example of findings-only content (NO prefix needed):**\nInput: \"There is a small joint effusion. The cartilage shows thinning.\"\nCorrect: Create only findings_body extractions for each clinical finding.\nIncorrect: Do not categorize clinical findings as findings_prefix.\n\n### Professional Output Standards:\nAll extracted text must maintain the grammatical correctness and professional coherence expected in radiology reports. Ensure that:\n- All sentences are complete and grammatically correct\n- Medical terminology is used appropriately and consistently\n- The language remains professional and clinical in tone\n- Correct obvious typos (e.g., \"splen\" → \"spleen\", \"kidny\" → \"kidney\")\n- Any modifications to the original text preserve the intended medical meaning\n- Minor typos are corrected and optimal punctuation is used\n\n### Empty prefix or suffix sections:\nOnly create extractions for sections that actually exist in the text. Do not create empty prefix or suffix sections if there is no corresponding content in the source text. If the text is findings-only without any impression/conclusion, do not create a findings_suffix extraction.\n\n### Section Usage Guidelines:\n\n**findings_prefix**: Reserved exclusively for header information that appears before clinical findings, such as:\n- Examination details (type of study, technique)\n- Clinical indication or history\n- Comparison studies referenced\n- Technical parameters\n\n**findings_body**: Contains the actual clinical findings and observations from the imaging study.\n\n**findings_suffix**: Reserved for concluding content that follows the findings, such as impressions or recommendations.\n\n**Critical Rule**: Clinical findings should never be categorized as prefix content. If a report begins directly with clinical observations without any header information, create only findings_body and findings_suffix extractions as appropriate.\n\n### Special guidance for findings_prefix organization:\nWhen the report has detailed prefix information with clear section headers (like EXAMINATION, CLINICAL INDICATION, COMPARISON, TECHNIQUE), create separate extractions for each section rather than one large block. Use the \"section\" attribute to label each part:\n- \"Examination\" for exam type/title\n- \"Clinical Indication\" for clinical history/reason for study \n- \"Comparison\" for prior studies referenced\n- \"Technique\" for imaging parameters and acquisition details\n\n**Important:** Even when examination information appears at the beginning without an explicit \"EXAMINATION:\" header, it should still be labeled with section:\"Examination\". This includes standalone exam descriptions that identify the type of imaging study being performed.\n\nAlways recognize examination-type content and use section:\"Examination\" regardless of whether it has an explicit header.\n\nThis structured approach provides better organization and readability.\n\n### Critical for findings_suffix:\nDo NOT include headers like \"IMPRESSION:\", \"CONCLUSION:\", etc. in the extraction_text. Only extract the actual content that follows these headers. The formatting system will add appropriate headers automatically. \n\n**Example:** If the text contains \"IMPRESSION: 1. Severe arthritis. 2. Labral tear.\", extract only \"1. Severe arthritis. 2. Labral tear.\" as the extraction_text.\n\n### Additional Notes for findings_body:\n- If a single sentence references multiple structures with a shared status (e.g., \"liver, gallbladder, spleen appear unremarkable\"), please split them into separate extraction lines, each referencing the relevant structure.\n- If the text mentions subheaders like \"CT ABDOMEN\" or \"CERVICAL SPINE,\" only create/retain that subheader if it clearly organizes multiple organ-structure findings under it. Do not force subheaders if only 1 or 2 lines belong there. A subheader should ideally group 3+ sections to be meaningful.\n\n### Special guidance for spine reports:\n- For spine imaging (MRI, CT), organize findings by anatomical level using the format: \"Lumbar Spine Levels: L1-L2\", \"Lumbar Spine Levels: L2-L3\", \"Cervical Spine Levels: C5-C6\", etc.\n- Separate general spine findings (alignment, lordosis, vertebral heights) from level-specific findings\n- Use dedicated sections for: \"Spinal Cord\", \"Bones\" (for marrow/vertebral body lesions), \"Paraspinal Soft Tissues\" (for muscle findings)\n- Each spinal level should get its own section when findings are described level-by-level\n- This level-by-level organization is preferred over generic \"Spine\" labeling for clinical utility\n\n### Non-spine skeletal findings:\nFor non-spine skeletal findings, unify them under a single section like \"Bones.\" Only keep laterality (Right/Left) if there is symmetry in the findings.\n\n## Required JSON Format\n\nEach final answer must be valid JSON with an array key \"extractions\". Each \"extraction\" is an object with:\n\n```json\n{\n \"text\": \"...\",\n \"category\": \"findings_prefix\" | \"findings_body\" | \"findings_suffix\",\n \"attributes\": {}\n}\n```\n\nWithin \"attributes\" each attribute should be a key-value pair as shown in the examples below. The attribute **\"clinical_significance\"** MUST be included for findings_body extractions and should be one of: **\"normal\"**, **\"minor\"**, **\"significant\"**, or **\"not_applicable\"** to indicate the importance of the finding.\n\n---\n\n# Few-Shot Examples\n\nThe following examples demonstrate how to properly structure different types of radiology reports:\n\n## Example 1\n\n**Input Text:**\n```\nEXAMINATION: CT ABDOMEN AND PELVIS WITH IV CONTRAST\nCLINICAL INDICATION: Abdominal pain.\nCOMPARISON: None.\nTECHNIQUE: Axial images of the abdomen and pelvis were obtained following the administration of intravenous contrast material. Coronal and sagittal reformations were reviewed.\n\nFINDINGS:\nNo acute abnormality is seen in the visualized lung bases. The liver is normal in size and contour. There is a 1.2 cm simple-appearing low-attenuation lesion in hepatic segment VII, consistent with a cyst. The gallbladder contains numerous calcified gallstones, compatible with cholelithiasis.\n\nIMPRESSION:\n1. Cholelithiasis without evidence of acute cholecystitis.\n2. Hepatic cyst.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION: CT ABDOMEN AND PELVIS WITH IV CONTRAST\",\n \"attributes\": {\n \"section\": \"Examination\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"CLINICAL INDICATION: Abdominal pain.\",\n \"attributes\": {\n \"section\": \"Clinical Indication\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"COMPARISON: None.\",\n \"attributes\": {\n \"section\": \"Comparison\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"TECHNIQUE: Axial images of the abdomen and pelvis were obtained following the administration of intravenous contrast material. Coronal and sagittal reformations were reviewed.\",\n \"attributes\": {\n \"section\": \"Technique\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No acute abnormality is seen in the visualized lung bases.\",\n \"attributes\": {\n \"section\": \"Lungs\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The liver is normal in size and contour.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a 1.2 cm simple-appearing low-attenuation lesion in hepatic segment VII, consistent with a cyst.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The gallbladder contains numerous calcified gallstones, compatible with cholelithiasis.\",\n \"attributes\": {\n \"section\": \"Gallbladder\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Cholelithiasis without evidence of acute cholecystitis.\\n2. Hepatic cyst.\"\n }\n ]\n}\n```\n\n---\n\n## Example 2\n\n**Input Text:**\n```\nCLINICAL HISTORY:\nLow back pain, rule out disc herniation\n\nMRI LUMBAR SPINE WITHOUT CONTRAST:\n\nFINDINGS:\nThe lumbar lordosis is maintained. Vertebral body heights are preserved.\n\nThere is a small hemangioma in the L3 vertebral body.\n\nThe conus medullaris terminates at L1 and appears normal.\n\nAt L2-L3, there is mild disc desiccation without significant stenosis.\n\nAt L3-L4, a small posterior disc bulge causes mild central canal narrowing.\n\nAt L4-L5, there is a large posterior disc herniation with severe central canal stenosis and nerve root impingement.\n\nAt L5-S1, mild disc bulge without significant stenosis.\n\nThe paraspinal musculature appears unremarkable.\n\nIMPRESSION:\nLarge L4-L5 disc herniation with severe stenosis.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"CLINICAL HISTORY:\\nLow back pain, rule out disc herniation\\n\\nMRI LUMBAR SPINE WITHOUT CONTRAST:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lumbar lordosis is maintained. Vertebral body heights are preserved.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a small hemangioma in the L3 vertebral body.\",\n \"attributes\": {\n \"section\": \"Bones\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The conus medullaris terminates at L1 and appears normal.\",\n \"attributes\": {\n \"section\": \"Spinal Cord\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L2-L3, there is mild disc desiccation without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L2-L3\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L3-L4, a small posterior disc bulge causes mild central canal narrowing.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L3-L4\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L4-L5, there is a large posterior disc herniation with severe central canal stenosis and nerve root impingement.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L4-L5\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L5-S1, mild disc bulge without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L5-S1\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The paraspinal musculature appears unremarkable.\",\n \"attributes\": {\n \"section\": \"Paraspinal Soft Tissues\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Large L4-L5 disc herniation with severe stenosis.\"\n }\n ]\n}\n```\n\n---\n\n## Example 3\n\n**Input Text:**\n```\nINDICATION: \nNeck pain, radiculopathy\n\nMRI CERVICAL SPINE:\n\nFINDINGS:\nNormal cervical lordosis is maintained. No vertebral body compression fractures.\n\nThe cervical spinal cord demonstrates normal signal intensity.\n\nAt C3-C4, no significant disc disease or stenosis.\n\nAt C4-C5, mild disc osteophyte complex with mild foraminal narrowing.\n\nAt C5-C6, moderate disc herniation with moderate central canal stenosis.\n\nAt C6-C7, small disc bulge without significant stenosis.\n\nIMPRESSION:\nModerate C5-C6 disc herniation and stenosis.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"INDICATION: \\nNeck pain, radiculopathy\\n\\nMRI CERVICAL SPINE:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Normal cervical lordosis is maintained. No vertebral body compression fractures.\",\n \"attributes\": {\n \"section\": \"Cervical Spine\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The cervical spinal cord demonstrates normal signal intensity.\",\n \"attributes\": {\n \"section\": \"Spinal Cord\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C3-C4, no significant disc disease or stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C3-C4\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C4-C5, mild disc osteophyte complex with mild foraminal narrowing.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C4-C5\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C5-C6, moderate disc herniation with moderate central canal stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C5-C6\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C6-C7, small disc bulge without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C6-C7\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Moderate C5-C6 disc herniation and stenosis.\"\n }\n ]\n}\n```\n\n---\n\n## Example 4\n\n**Input Text:**\n```\nTECHNIQUE: \nMultidetector helical CT from lung bases to adrenals with and without intravenous contrast.\n\nFINDINGS:\nLIVER/GALLBLADDER/SPLEEN: The liver has a normal appearance. Gallbladder wall appears normal. The spleen is normal in size.\n\nPANCREAS/ADRENALS: The pancreas and bilateral adrenal glands appear unremarkable.\n\nRETROPERITONEUM: No lymphadenopathy. No fluid collection.\n\nIMPRESSION:\nNormal abdominal CT.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"TECHNIQUE: \\nMultidetector helical CT from lung bases to adrenals with and without intravenous contrast.\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The liver has a normal appearance.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Gallbladder wall appears normal.\",\n \"attributes\": {\n \"section\": \"Gallbladder\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The spleen is normal in size.\",\n \"attributes\": {\n \"section\": \"Spleen\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The pancreas and bilateral adrenal glands appear unremarkable.\",\n \"attributes\": {\n \"section\": \"Pancreas/Adrenals\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No lymphadenopathy.\",\n \"attributes\": {\n \"section\": \"Retroperitoneum\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No fluid collection.\",\n \"attributes\": {\n \"section\": \"Retroperitoneum\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal abdominal CT.\"\n }\n ]\n}\n```\n\n---\n\n## Example 5\n\n**Input Text:**\n```\nHISTORY: \nLower abdominal pain\n\nCT ABDOMEN/PELVIS WITH CONTRAST:\n\nFINDINGS:\nLIVER: Multiple hepatic metastases are present, measuring up to 3.2 cm.\n\nKIDNEYS: The left kidney shows moderate hydronephrosis. The right kidney appears normal.\n\nLYMPH NODES: Enlarged retroperitoneal lymph nodes, largest measuring 2.1 cm.\n\nIMPRESSION:\n1. Multiple hepatic metastases\n2. Left hydronephrosis \n3. Retroperitoneal lymphadenopathy\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"HISTORY: \\nLower abdominal pain\\n\\nCT ABDOMEN/PELVIS WITH CONTRAST:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Multiple hepatic metastases are present, measuring up to 3.2 cm.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The left kidney shows moderate hydronephrosis.\",\n \"attributes\": {\n \"section\": \"Kidneys\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The right kidney appears normal.\",\n \"attributes\": {\n \"section\": \"Kidneys\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Enlarged retroperitoneal lymph nodes, largest measuring 2.1 cm.\",\n \"attributes\": {\n \"section\": \"Lymph Nodes\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Multiple hepatic metastases\\n2. Left hydronephrosis \\n3. Retroperitoneal lymphadenopathy\"\n }\n ]\n}\n```\n\n---\n\n## Example 6\n\n**Input Text:**\n```\nEXAMINATION:\nMRI brain without contrast\n\nCLINICAL HISTORY:\nHeadaches\n\nFINDINGS:\nThe brain parenchyma demonstrates normal signal intensity. No mass lesions are identified.\n\nThe ventricular system is normal in size and configuration.\n\nNo abnormal enhancement is seen.\n\nIMPRESSION:\nNormal brain MRI.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION:\\nMRI brain without contrast\\n\\nCLINICAL HISTORY:\\nHeadaches\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The brain parenchyma demonstrates normal signal intensity.\",\n \"attributes\": {\n \"section\": \"Brain Parenchyma\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No mass lesions are identified.\",\n \"attributes\": {\n \"section\": \"Brain Parenchyma\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The ventricular system is normal in size and configuration.\",\n \"attributes\": {\n \"section\": \"Ventricular System\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No abnormal enhancement is seen.\",\n \"attributes\": {\n \"section\": \"Enhancement\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal brain MRI.\"\n }\n ]\n}\n```\n\n---\n\n## Example 7\n\n**Input Text:**\n```\nINDICATION:\nRight knee pain\n\nMRI RIGHT KNEE:\n\nFINDINGS:\nMENISCI: There is a complex tear of the medial meniscus. The lateral meniscus appears intact.\n\nLIGAMENTS: The ACL shows complete rupture. The PCL, MCL, and LCL are intact.\n\nBONES: Mild bone marrow edema is present in the medial femoral condyle.\n\nIMPRESSION:\n1. Complex medial meniscal tear\n2. Complete ACL rupture\n3. Bone marrow edema in medial femoral condyle\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"INDICATION:\\nRight knee pain\\n\\nMRI RIGHT KNEE:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a complex tear of the medial meniscus.\",\n \"attributes\": {\n \"section\": \"Menisci\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lateral meniscus appears intact.\",\n \"attributes\": {\n \"section\": \"Menisci\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The ACL shows complete rupture.\",\n \"attributes\": {\n \"section\": \"Ligaments\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The PCL, MCL, and LCL are intact.\",\n \"attributes\": {\n \"section\": \"Ligaments\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Mild bone marrow edema is present in the medial femoral condyle.\",\n \"attributes\": {\n \"section\": \"Bones\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Complex medial meniscal tear\\n2. Complete ACL rupture\\n3. Bone marrow edema in medial femoral condyle\"\n }\n ]\n}\n```\n\n---\n\n## Example 8\n\n**Input Text:**\n```\nEXAMINATION: CT CHEST\n\nFINDINGS:\nThe longs are clear bilaterally. The hart size is normal. No pleural effushion.\n\nIMPRESSION:\nNormal chest CT.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION: CT CHEST\",\n \"attributes\": {\n \"section\": \"Examination\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lungs are clear bilaterally.\",\n \"attributes\": {\n \"section\": \"Lungs\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The heart size is normal.\",\n \"attributes\": {\n \"section\": \"Heart\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No pleural effusion.\",\n \"attributes\": {\n \"section\": \"Pleura\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal chest CT.\"\n }\n ]\n}\n```\n\n\n\n## Inference Example:\n\n**Input Text:**\n```\nA full-thickness, full-width tear of the supraspinatus tendon is present, with the torn tendon end retracted approximately 2 cm medially to the level of the glenoid rim. There is moderate fatty infiltration and atrophy of the supraspinatus muscle. The infraspinatus, teres minor, and subscapularis tendons and muscles appear intact. There is a moderate joint effusion with synovial thickening. The glenoid labrum shows a small superior labral tear. The biceps tendon is intact and properly positioned within the bicipital groove. The acromioclavicular joint shows mild degenerative changes with small osteophytes but no significant narrowing.\n```\n\n**Expected Output:**\n" + }, + "sample_abdominal_mri_pkd": { + "segments": [ + { + "type": "prefix", + "label": "Examination", + "content": "EXAMINATION: MRI abdomen without and with gadolinium contrast", + "intervals": [ + { + "startPos": 0, + "endPos": 61 + } + ], + "significance": null + }, + { + "type": "prefix", + "label": "Clinical Indication", + "content": "CLINICAL INDICATION: Polycystic kidney disease with suspected cyst infection, flank pain, fever", + "intervals": [ + { + "startPos": 62, + "endPos": 157 + } + ], + "significance": null + }, + { + "type": "prefix", + "label": "Comparison", + "content": "COMPARISON: CT abdomen from 3 months ago", + "intervals": [ + { + "startPos": 158, + "endPos": 198 + } + ], + "significance": null + }, + { + "type": "prefix", + "label": "Technique", + "content": "TECHNIQUE: Axial and coronal T1-weighted, T2-weighted, and post-gadolinium images were obtained.", + "intervals": [ + { + "startPos": 199, + "endPos": 295 + } + ], + "significance": null + }, + { + "type": "body", + "label": "Kidneys", + "content": "Both kidneys are markedly enlarged. The right kidney measures 18.2 cm and the left kidney measures 17.8 cm in length.", + "intervals": [ + { + "startPos": 307, + "endPos": 424 + } + ], + "significance": "significant" + }, + { + "type": "body", + "label": "Kidneys", + "content": "Innumerable thin-walled cysts of varying sizes are present throughout both kidneys, consistent with autosomal dominant polycystic kidney disease.", + "intervals": [ + { + "startPos": 425, + "endPos": 570 + } + ], + "significance": "significant" + }, + { + "type": "body", + "label": "Kidneys", + "content": "Several cysts demonstrate T1 hyperintensity consistent with hemorrhagic or proteinaceous content, particularly a 4.2 cm cyst in the right upper pole and a 3.1 cm cyst in the left mid-pole.", + "intervals": [ + { + "startPos": 571, + "endPos": 759 + } + ], + "significance": "significant" + }, + { + "type": "body", + "label": "Kidneys", + "content": "A complex 5.8 cm cyst in the left lower pole demonstrates thick irregular walls, internal septations, and rim enhancement following contrast administration, highly suspicious for an infected cyst.", + "intervals": [ + { + "startPos": 758, + "endPos": 955 + } + ], + "significance": "significant" + }, + { + "type": "body", + "label": "Kidneys", + "content": "Surrounding perinephric inflammatory stranding is present.", + "intervals": [ + { + "startPos": 956, + "endPos": 1014 + } + ], + "significance": "significant" + }, + { + "type": "body", + "label": "Kidneys", + "content": "An additional 2.8 cm cyst in the right lower pole shows similar findings concerning for secondary infection.", + "intervals": [ + { + "startPos": 1015, + "endPos": 1123 + } + ], + "significance": "significant" + }, + { + "type": "body", + "label": "Kidneys", + "content": "No hydronephrosis is identified despite the numerous cysts.", + "intervals": [ + { + "startPos": 1377, + "endPos": 1436 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Liver", + "content": "Multiple hepatic cysts are noted, the largest measuring 3.4 cm in segment IV.", + "intervals": [ + { + "startPos": 1125, + "endPos": 1202 + } + ], + "significance": "minor" + }, + { + "type": "body", + "label": "Liver", + "content": "The liver is otherwise normal in signal intensity and enhancement pattern.", + "intervals": [ + { + "startPos": 1203, + "endPos": 1277 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Spleen", + "content": "The spleen appears unremarkable.", + "intervals": [ + { + "startPos": 1278, + "endPos": 1339 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Pancreas", + "content": "The pancreas appears unremarkable.", + "intervals": [ + { + "startPos": 1278, + "endPos": 1339 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Adrenal Glands", + "content": "The adrenal glands appear unremarkable.", + "intervals": [ + { + "startPos": 1278, + "endPos": 1339 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Abdomen/Pelvis", + "content": "There is mild ascites in the pelvis.", + "intervals": [ + { + "startPos": 1340, + "endPos": 1376 + } + ], + "significance": "minor" + }, + { + "type": "suffix", + "label": "suffix", + "content": "1. Autosomal dominant polycystic kidney disease with bilateral renal enlargement and innumerable cysts.\n2. Probable infected cysts in the left lower pole (5.8 cm) and right lower pole (2.8 cm) with surrounding inflammatory changes.\n3. Multiple hemorrhagic cysts bilaterally.\n4. Multiple hepatic cysts.\n5. Mild ascites.", + "intervals": [ + { + "startPos": 1450, + "endPos": 1768 + } + ], + "significance": null + } + ], + "annotated_document_json": { + "extractions": [ + { + "extraction_text": "EXAMINATION: MRI abdomen without and with gadolinium contrast", + "extraction_class": "findings_prefix", + "attributes": { + "section": "Examination" + }, + "char_interval": { + "start_pos": 0, + "end_pos": 61 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "CLINICAL INDICATION: Polycystic kidney disease with suspected cyst infection, flank pain, fever", + "extraction_class": "findings_prefix", + "attributes": { + "section": "Clinical Indication" + }, + "char_interval": { + "start_pos": 62, + "end_pos": 157 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "COMPARISON: CT abdomen from 3 months ago", + "extraction_class": "findings_prefix", + "attributes": { + "section": "Comparison" + }, + "char_interval": { + "start_pos": 158, + "end_pos": 198 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "TECHNIQUE: Axial and coronal T1-weighted, T2-weighted, and post-gadolinium images were obtained.", + "extraction_class": "findings_prefix", + "attributes": { + "section": "Technique" + }, + "char_interval": { + "start_pos": 199, + "end_pos": 295 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "Both kidneys are markedly enlarged. The right kidney measures 18.2 cm and the left kidney measures 17.8 cm in length.", + "extraction_class": "findings_body", + "attributes": { + "section": "Kidneys", + "clinical_significance": "significant" + }, + "char_interval": { + "start_pos": 307, + "end_pos": 424 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "Innumerable thin-walled cysts of varying sizes are present throughout both kidneys, consistent with autosomal dominant polycystic kidney disease.", + "extraction_class": "findings_body", + "attributes": { + "section": "Kidneys", + "clinical_significance": "significant" + }, + "char_interval": { + "start_pos": 425, + "end_pos": 570 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "Several cysts demonstrate T1 hyperintensity consistent with hemorrhagic or proteinaceous content, particularly a 4.2 cm cyst in the right upper pole and a 3.1 cm cyst in the left mid-pole.", + "extraction_class": "findings_body", + "attributes": { + "section": "Kidneys", + "clinical_significance": "significant" + }, + "char_interval": { + "start_pos": 571, + "end_pos": 759 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "A complex 5.8 cm cyst in the left lower pole demonstrates thick irregular walls, internal septations, and rim enhancement following contrast administration, highly suspicious for an infected cyst.", + "extraction_class": "findings_body", + "attributes": { + "section": "Kidneys", + "clinical_significance": "significant" + }, + "char_interval": { + "start_pos": 758, + "end_pos": 955 + }, + "alignment_status": "AlignmentStatus.MATCH_FUZZY" + }, + { + "extraction_text": "Surrounding perinephric inflammatory stranding is present.", + "extraction_class": "findings_body", + "attributes": { + "section": "Kidneys", + "clinical_significance": "significant" + }, + "char_interval": { + "start_pos": 956, + "end_pos": 1014 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "An additional 2.8 cm cyst in the right lower pole shows similar findings concerning for secondary infection.", + "extraction_class": "findings_body", + "attributes": { + "section": "Kidneys", + "clinical_significance": "significant" + }, + "char_interval": { + "start_pos": 1015, + "end_pos": 1123 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "Multiple hepatic cysts are noted, the largest measuring 3.4 cm in segment IV.", + "extraction_class": "findings_body", + "attributes": { + "section": "Liver", + "clinical_significance": "minor" + }, + "char_interval": { + "start_pos": 1125, + "end_pos": 1202 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The liver is otherwise normal in signal intensity and enhancement pattern.", + "extraction_class": "findings_body", + "attributes": { + "section": "Liver", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 1203, + "end_pos": 1277 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The spleen appears unremarkable.", + "extraction_class": "findings_body", + "attributes": { + "section": "Spleen", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 1278, + "end_pos": 1339 + }, + "alignment_status": "AlignmentStatus.MATCH_FUZZY" + }, + { + "extraction_text": "The pancreas appears unremarkable.", + "extraction_class": "findings_body", + "attributes": { + "section": "Pancreas", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 1278, + "end_pos": 1339 + }, + "alignment_status": "AlignmentStatus.MATCH_FUZZY" + }, + { + "extraction_text": "The adrenal glands appear unremarkable.", + "extraction_class": "findings_body", + "attributes": { + "section": "Adrenal Glands", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 1278, + "end_pos": 1339 + }, + "alignment_status": "AlignmentStatus.MATCH_FUZZY" + }, + { + "extraction_text": "There is mild ascites in the pelvis.", + "extraction_class": "findings_body", + "attributes": { + "section": "Abdomen/Pelvis", + "clinical_significance": "minor" + }, + "char_interval": { + "start_pos": 1340, + "end_pos": 1376 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "No hydronephrosis is identified despite the numerous cysts.", + "extraction_class": "findings_body", + "attributes": { + "section": "Kidneys", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 1377, + "end_pos": 1436 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "1. Autosomal dominant polycystic kidney disease with bilateral renal enlargement and innumerable cysts.\n2. Probable infected cysts in the left lower pole (5.8 cm) and right lower pole (2.8 cm) with surrounding inflammatory changes.\n3. Multiple hemorrhagic cysts bilaterally.\n4. Multiple hepatic cysts.\n5. Mild ascites.", + "extraction_class": "findings_suffix", + "attributes": {}, + "char_interval": { + "start_pos": 1450, + "end_pos": 1768 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + } + ] + }, + "text": "EXAMINATION:\n\nMRI abdomen without and with gadolinium contrast\n\nCLINICAL INDICATION: Polycystic kidney disease with suspected cyst infection, flank pain, fever\n\nCOMPARISON: CT abdomen from 3 months ago\n\nTECHNIQUE: Axial and coronal T1-weighted, T2-weighted, and post-gadolinium images were obtained.\n\n\nFINDINGS:\n\nKidneys: Both kidneys are markedly enlarged. The right kidney measures 18.2 cm and the left kidney measures 17.8 cm in length. Innumerable thin-walled cysts of varying sizes are present throughout both kidneys, consistent with autosomal dominant polycystic kidney disease. Several cysts demonstrate T1 hyperintensity consistent with hemorrhagic or proteinaceous content, particularly a 4.2 cm cyst in the right upper pole and a 3.1 cm cyst in the left mid-pole. A complex 5.8 cm cyst in the left lower pole demonstrates thick irregular walls, internal septations, and rim enhancement following contrast administration, highly suspicious for an infected cyst. Surrounding perinephric inflammatory stranding is present. An additional 2.8 cm cyst in the right lower pole shows similar findings concerning for secondary infection. No hydronephrosis is identified despite the numerous cysts.\n\nLiver: Multiple hepatic cysts are noted, the largest measuring 3.4 cm in segment IV. The liver is otherwise normal in signal intensity and enhancement pattern.\n\nSpleen: The spleen appears unremarkable.\n\nPancreas: The pancreas appears unremarkable.\n\nAdrenal Glands: The adrenal glands appear unremarkable.\n\nAbdomen/Pelvis: There is mild ascites in the pelvis.\n\nIMPRESSION:\n\n1. Autosomal dominant polycystic kidney disease with bilateral renal enlargement and innumerable cysts.\n2. Probable infected cysts in the left lower pole (5.8 cm) and right lower pole (2.8 cm) with surrounding inflammatory changes.\n3. Multiple hemorrhagic cysts bilaterally.\n4. Multiple hepatic cysts.\n5. Mild ascites.", + "raw_prompt": "# RadExtract Prompt\n\n## Task Description\n\nYou are a medical assistant specialized in categorizing radiology text into sections:\n\n- **findings_prefix** -- All text that appears before the actual \"findings\" content.\n- **findings_body** -- The main 'Findings' section. Each finding is classified into a possible section through a list of attributes, some of which may also be assigned to a subheader.\n- **findings_suffix** -- Any text that appears after the \"findings\" portion (such as \"Impression\" or other concluding content).\n\n### Section Categories:\n- **findings_prefix**: Use only for header information before clinical findings (examination details, clinical indication, technique). Never use for actual clinical observations or pathological findings.\n- **findings_body**: Use for all clinical findings, observations, and pathological descriptions.\n- **findings_suffix**: Use only for conclusions, impressions, or recommendations that appear after the main findings.\n\n### Critical Rule:\nIf a report contains only clinical findings without any header information, do not create a findings_prefix extraction. Start directly with findings_body extractions for the clinical content.\n\n**Example of findings-only content (NO prefix needed):**\nInput: \"There is a small joint effusion. The cartilage shows thinning.\"\nCorrect: Create only findings_body extractions for each clinical finding.\nIncorrect: Do not categorize clinical findings as findings_prefix.\n\n### Professional Output Standards:\nAll extracted text must maintain the grammatical correctness and professional coherence expected in radiology reports. Ensure that:\n- All sentences are complete and grammatically correct\n- Medical terminology is used appropriately and consistently\n- The language remains professional and clinical in tone\n- Correct obvious typos (e.g., \"splen\" → \"spleen\", \"kidny\" → \"kidney\")\n- Any modifications to the original text preserve the intended medical meaning\n- Minor typos are corrected and optimal punctuation is used\n\n### Empty prefix or suffix sections:\nOnly create extractions for sections that actually exist in the text. Do not create empty prefix or suffix sections if there is no corresponding content in the source text. If the text is findings-only without any impression/conclusion, do not create a findings_suffix extraction.\n\n### Section Usage Guidelines:\n\n**findings_prefix**: Reserved exclusively for header information that appears before clinical findings, such as:\n- Examination details (type of study, technique)\n- Clinical indication or history\n- Comparison studies referenced\n- Technical parameters\n\n**findings_body**: Contains the actual clinical findings and observations from the imaging study.\n\n**findings_suffix**: Reserved for concluding content that follows the findings, such as impressions or recommendations.\n\n**Critical Rule**: Clinical findings should never be categorized as prefix content. If a report begins directly with clinical observations without any header information, create only findings_body and findings_suffix extractions as appropriate.\n\n### Special guidance for findings_prefix organization:\nWhen the report has detailed prefix information with clear section headers (like EXAMINATION, CLINICAL INDICATION, COMPARISON, TECHNIQUE), create separate extractions for each section rather than one large block. Use the \"section\" attribute to label each part:\n- \"Examination\" for exam type/title\n- \"Clinical Indication\" for clinical history/reason for study \n- \"Comparison\" for prior studies referenced\n- \"Technique\" for imaging parameters and acquisition details\n\n**Important:** Even when examination information appears at the beginning without an explicit \"EXAMINATION:\" header, it should still be labeled with section:\"Examination\". This includes standalone exam descriptions that identify the type of imaging study being performed.\n\nAlways recognize examination-type content and use section:\"Examination\" regardless of whether it has an explicit header.\n\nThis structured approach provides better organization and readability.\n\n### Critical for findings_suffix:\nDo NOT include headers like \"IMPRESSION:\", \"CONCLUSION:\", etc. in the extraction_text. Only extract the actual content that follows these headers. The formatting system will add appropriate headers automatically. \n\n**Example:** If the text contains \"IMPRESSION: 1. Severe arthritis. 2. Labral tear.\", extract only \"1. Severe arthritis. 2. Labral tear.\" as the extraction_text.\n\n### Additional Notes for findings_body:\n- If a single sentence references multiple structures with a shared status (e.g., \"liver, gallbladder, spleen appear unremarkable\"), please split them into separate extraction lines, each referencing the relevant structure.\n- If the text mentions subheaders like \"CT ABDOMEN\" or \"CERVICAL SPINE,\" only create/retain that subheader if it clearly organizes multiple organ-structure findings under it. Do not force subheaders if only 1 or 2 lines belong there. A subheader should ideally group 3+ sections to be meaningful.\n\n### Special guidance for spine reports:\n- For spine imaging (MRI, CT), organize findings by anatomical level using the format: \"Lumbar Spine Levels: L1-L2\", \"Lumbar Spine Levels: L2-L3\", \"Cervical Spine Levels: C5-C6\", etc.\n- Separate general spine findings (alignment, lordosis, vertebral heights) from level-specific findings\n- Use dedicated sections for: \"Spinal Cord\", \"Bones\" (for marrow/vertebral body lesions), \"Paraspinal Soft Tissues\" (for muscle findings)\n- Each spinal level should get its own section when findings are described level-by-level\n- This level-by-level organization is preferred over generic \"Spine\" labeling for clinical utility\n\n### Non-spine skeletal findings:\nFor non-spine skeletal findings, unify them under a single section like \"Bones.\" Only keep laterality (Right/Left) if there is symmetry in the findings.\n\n## Required JSON Format\n\nEach final answer must be valid JSON with an array key \"extractions\". Each \"extraction\" is an object with:\n\n```json\n{\n \"text\": \"...\",\n \"category\": \"findings_prefix\" | \"findings_body\" | \"findings_suffix\",\n \"attributes\": {}\n}\n```\n\nWithin \"attributes\" each attribute should be a key-value pair as shown in the examples below. The attribute **\"clinical_significance\"** MUST be included for findings_body extractions and should be one of: **\"normal\"**, **\"minor\"**, **\"significant\"**, or **\"not_applicable\"** to indicate the importance of the finding.\n\n---\n\n# Few-Shot Examples\n\nThe following examples demonstrate how to properly structure different types of radiology reports:\n\n## Example 1\n\n**Input Text:**\n```\nEXAMINATION: CT ABDOMEN AND PELVIS WITH IV CONTRAST\nCLINICAL INDICATION: Abdominal pain.\nCOMPARISON: None.\nTECHNIQUE: Axial images of the abdomen and pelvis were obtained following the administration of intravenous contrast material. Coronal and sagittal reformations were reviewed.\n\nFINDINGS:\nNo acute abnormality is seen in the visualized lung bases. The liver is normal in size and contour. There is a 1.2 cm simple-appearing low-attenuation lesion in hepatic segment VII, consistent with a cyst. The gallbladder contains numerous calcified gallstones, compatible with cholelithiasis.\n\nIMPRESSION:\n1. Cholelithiasis without evidence of acute cholecystitis.\n2. Hepatic cyst.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION: CT ABDOMEN AND PELVIS WITH IV CONTRAST\",\n \"attributes\": {\n \"section\": \"Examination\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"CLINICAL INDICATION: Abdominal pain.\",\n \"attributes\": {\n \"section\": \"Clinical Indication\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"COMPARISON: None.\",\n \"attributes\": {\n \"section\": \"Comparison\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"TECHNIQUE: Axial images of the abdomen and pelvis were obtained following the administration of intravenous contrast material. Coronal and sagittal reformations were reviewed.\",\n \"attributes\": {\n \"section\": \"Technique\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No acute abnormality is seen in the visualized lung bases.\",\n \"attributes\": {\n \"section\": \"Lungs\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The liver is normal in size and contour.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a 1.2 cm simple-appearing low-attenuation lesion in hepatic segment VII, consistent with a cyst.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The gallbladder contains numerous calcified gallstones, compatible with cholelithiasis.\",\n \"attributes\": {\n \"section\": \"Gallbladder\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Cholelithiasis without evidence of acute cholecystitis.\\n2. Hepatic cyst.\"\n }\n ]\n}\n```\n\n---\n\n## Example 2\n\n**Input Text:**\n```\nCLINICAL HISTORY:\nLow back pain, rule out disc herniation\n\nMRI LUMBAR SPINE WITHOUT CONTRAST:\n\nFINDINGS:\nThe lumbar lordosis is maintained. Vertebral body heights are preserved.\n\nThere is a small hemangioma in the L3 vertebral body.\n\nThe conus medullaris terminates at L1 and appears normal.\n\nAt L2-L3, there is mild disc desiccation without significant stenosis.\n\nAt L3-L4, a small posterior disc bulge causes mild central canal narrowing.\n\nAt L4-L5, there is a large posterior disc herniation with severe central canal stenosis and nerve root impingement.\n\nAt L5-S1, mild disc bulge without significant stenosis.\n\nThe paraspinal musculature appears unremarkable.\n\nIMPRESSION:\nLarge L4-L5 disc herniation with severe stenosis.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"CLINICAL HISTORY:\\nLow back pain, rule out disc herniation\\n\\nMRI LUMBAR SPINE WITHOUT CONTRAST:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lumbar lordosis is maintained. Vertebral body heights are preserved.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a small hemangioma in the L3 vertebral body.\",\n \"attributes\": {\n \"section\": \"Bones\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The conus medullaris terminates at L1 and appears normal.\",\n \"attributes\": {\n \"section\": \"Spinal Cord\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L2-L3, there is mild disc desiccation without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L2-L3\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L3-L4, a small posterior disc bulge causes mild central canal narrowing.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L3-L4\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L4-L5, there is a large posterior disc herniation with severe central canal stenosis and nerve root impingement.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L4-L5\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L5-S1, mild disc bulge without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L5-S1\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The paraspinal musculature appears unremarkable.\",\n \"attributes\": {\n \"section\": \"Paraspinal Soft Tissues\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Large L4-L5 disc herniation with severe stenosis.\"\n }\n ]\n}\n```\n\n---\n\n## Example 3\n\n**Input Text:**\n```\nINDICATION: \nNeck pain, radiculopathy\n\nMRI CERVICAL SPINE:\n\nFINDINGS:\nNormal cervical lordosis is maintained. No vertebral body compression fractures.\n\nThe cervical spinal cord demonstrates normal signal intensity.\n\nAt C3-C4, no significant disc disease or stenosis.\n\nAt C4-C5, mild disc osteophyte complex with mild foraminal narrowing.\n\nAt C5-C6, moderate disc herniation with moderate central canal stenosis.\n\nAt C6-C7, small disc bulge without significant stenosis.\n\nIMPRESSION:\nModerate C5-C6 disc herniation and stenosis.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"INDICATION: \\nNeck pain, radiculopathy\\n\\nMRI CERVICAL SPINE:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Normal cervical lordosis is maintained. No vertebral body compression fractures.\",\n \"attributes\": {\n \"section\": \"Cervical Spine\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The cervical spinal cord demonstrates normal signal intensity.\",\n \"attributes\": {\n \"section\": \"Spinal Cord\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C3-C4, no significant disc disease or stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C3-C4\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C4-C5, mild disc osteophyte complex with mild foraminal narrowing.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C4-C5\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C5-C6, moderate disc herniation with moderate central canal stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C5-C6\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C6-C7, small disc bulge without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C6-C7\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Moderate C5-C6 disc herniation and stenosis.\"\n }\n ]\n}\n```\n\n---\n\n## Example 4\n\n**Input Text:**\n```\nTECHNIQUE: \nMultidetector helical CT from lung bases to adrenals with and without intravenous contrast.\n\nFINDINGS:\nLIVER/GALLBLADDER/SPLEEN: The liver has a normal appearance. Gallbladder wall appears normal. The spleen is normal in size.\n\nPANCREAS/ADRENALS: The pancreas and bilateral adrenal glands appear unremarkable.\n\nRETROPERITONEUM: No lymphadenopathy. No fluid collection.\n\nIMPRESSION:\nNormal abdominal CT.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"TECHNIQUE: \\nMultidetector helical CT from lung bases to adrenals with and without intravenous contrast.\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The liver has a normal appearance.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Gallbladder wall appears normal.\",\n \"attributes\": {\n \"section\": \"Gallbladder\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The spleen is normal in size.\",\n \"attributes\": {\n \"section\": \"Spleen\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The pancreas and bilateral adrenal glands appear unremarkable.\",\n \"attributes\": {\n \"section\": \"Pancreas/Adrenals\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No lymphadenopathy.\",\n \"attributes\": {\n \"section\": \"Retroperitoneum\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No fluid collection.\",\n \"attributes\": {\n \"section\": \"Retroperitoneum\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal abdominal CT.\"\n }\n ]\n}\n```\n\n---\n\n## Example 5\n\n**Input Text:**\n```\nHISTORY: \nLower abdominal pain\n\nCT ABDOMEN/PELVIS WITH CONTRAST:\n\nFINDINGS:\nLIVER: Multiple hepatic metastases are present, measuring up to 3.2 cm.\n\nKIDNEYS: The left kidney shows moderate hydronephrosis. The right kidney appears normal.\n\nLYMPH NODES: Enlarged retroperitoneal lymph nodes, largest measuring 2.1 cm.\n\nIMPRESSION:\n1. Multiple hepatic metastases\n2. Left hydronephrosis \n3. Retroperitoneal lymphadenopathy\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"HISTORY: \\nLower abdominal pain\\n\\nCT ABDOMEN/PELVIS WITH CONTRAST:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Multiple hepatic metastases are present, measuring up to 3.2 cm.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The left kidney shows moderate hydronephrosis.\",\n \"attributes\": {\n \"section\": \"Kidneys\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The right kidney appears normal.\",\n \"attributes\": {\n \"section\": \"Kidneys\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Enlarged retroperitoneal lymph nodes, largest measuring 2.1 cm.\",\n \"attributes\": {\n \"section\": \"Lymph Nodes\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Multiple hepatic metastases\\n2. Left hydronephrosis \\n3. Retroperitoneal lymphadenopathy\"\n }\n ]\n}\n```\n\n---\n\n## Example 6\n\n**Input Text:**\n```\nEXAMINATION:\nMRI brain without contrast\n\nCLINICAL HISTORY:\nHeadaches\n\nFINDINGS:\nThe brain parenchyma demonstrates normal signal intensity. No mass lesions are identified.\n\nThe ventricular system is normal in size and configuration.\n\nNo abnormal enhancement is seen.\n\nIMPRESSION:\nNormal brain MRI.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION:\\nMRI brain without contrast\\n\\nCLINICAL HISTORY:\\nHeadaches\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The brain parenchyma demonstrates normal signal intensity.\",\n \"attributes\": {\n \"section\": \"Brain Parenchyma\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No mass lesions are identified.\",\n \"attributes\": {\n \"section\": \"Brain Parenchyma\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The ventricular system is normal in size and configuration.\",\n \"attributes\": {\n \"section\": \"Ventricular System\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No abnormal enhancement is seen.\",\n \"attributes\": {\n \"section\": \"Enhancement\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal brain MRI.\"\n }\n ]\n}\n```\n\n---\n\n## Example 7\n\n**Input Text:**\n```\nINDICATION:\nRight knee pain\n\nMRI RIGHT KNEE:\n\nFINDINGS:\nMENISCI: There is a complex tear of the medial meniscus. The lateral meniscus appears intact.\n\nLIGAMENTS: The ACL shows complete rupture. The PCL, MCL, and LCL are intact.\n\nBONES: Mild bone marrow edema is present in the medial femoral condyle.\n\nIMPRESSION:\n1. Complex medial meniscal tear\n2. Complete ACL rupture\n3. Bone marrow edema in medial femoral condyle\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"INDICATION:\\nRight knee pain\\n\\nMRI RIGHT KNEE:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a complex tear of the medial meniscus.\",\n \"attributes\": {\n \"section\": \"Menisci\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lateral meniscus appears intact.\",\n \"attributes\": {\n \"section\": \"Menisci\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The ACL shows complete rupture.\",\n \"attributes\": {\n \"section\": \"Ligaments\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The PCL, MCL, and LCL are intact.\",\n \"attributes\": {\n \"section\": \"Ligaments\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Mild bone marrow edema is present in the medial femoral condyle.\",\n \"attributes\": {\n \"section\": \"Bones\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Complex medial meniscal tear\\n2. Complete ACL rupture\\n3. Bone marrow edema in medial femoral condyle\"\n }\n ]\n}\n```\n\n---\n\n## Example 8\n\n**Input Text:**\n```\nEXAMINATION: CT CHEST\n\nFINDINGS:\nThe longs are clear bilaterally. The hart size is normal. No pleural effushion.\n\nIMPRESSION:\nNormal chest CT.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION: CT CHEST\",\n \"attributes\": {\n \"section\": \"Examination\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lungs are clear bilaterally.\",\n \"attributes\": {\n \"section\": \"Lungs\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The heart size is normal.\",\n \"attributes\": {\n \"section\": \"Heart\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No pleural effusion.\",\n \"attributes\": {\n \"section\": \"Pleura\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal chest CT.\"\n }\n ]\n}\n```\n\n\n\n## Inference Example:\n\n**Input Text:**\n```\nEXAMINATION: MRI abdomen without and with gadolinium contrast\nCLINICAL INDICATION: Polycystic kidney disease with suspected cyst infection, flank pain, fever\nCOMPARISON: CT abdomen from 3 months ago\nTECHNIQUE: Axial and coronal T1-weighted, T2-weighted, and post-gadolinium images were obtained.\n\nFINDINGS:\nBoth kidneys are markedly enlarged. The right kidney measures 18.2 cm and the left kidney measures 17.8 cm in length. Innumerable thin-walled cysts of varying sizes are present throughout both kidneys, consistent with autosomal dominant polycystic kidney disease. Several cysts demonstrate T1 hyperintensity consistent with hemorrhagic or proteinaceous content, particularly a 4.2 cm cyst in the right upper pole and a 3.1 cm cyst in the left mid-pole. \n\nA complex 5.8 cm cyst in the left lower pole demonstrates thick irregular walls, internal septations, and rim enhancement following contrast administration, highly suspicious for infected cyst. Surrounding perinephric inflammatory stranding is present. An additional 2.8 cm cyst in the right lower pole shows similar findings concerning for secondary infection.\n\nMultiple hepatic cysts are noted, the largest measuring 3.4 cm in segment IV. The liver is otherwise normal in signal intensity and enhancement pattern. The spleen, pancreas, and adrenal glands appear unremarkable. There is mild ascites in the pelvis. No hydronephrosis is identified despite the numerous cysts.\n\nIMPRESSION:\n1. Autosomal dominant polycystic kidney disease with bilateral renal enlargement and innumerable cysts.\n2. Probable infected cysts in the left lower pole (5.8 cm) and right lower pole (2.8 cm) with surrounding inflammatory changes.\n3. Multiple hemorrhagic cysts bilaterally.\n4. Multiple hepatic cysts.\n5. Mild ascites.\n```\n\n**Expected Output:**\n" + }, + "sample_hip_mri": { + "segments": [ + { + "type": "body", + "label": "Joint", + "content": "There is a small joint effusion.", + "intervals": [ + { + "startPos": 0, + "endPos": 32 + } + ], + "significance": "minor" + }, + { + "type": "body", + "label": "Cartilage", + "content": "Diffuse thinning of the articular cartilage is noted at the weight-bearing superior acetabulum and femoral head, with near full-thickness loss anterosuperiorly.", + "intervals": [ + { + "startPos": 33, + "endPos": 193 + } + ], + "significance": "significant" + }, + { + "type": "body", + "label": "Labrum", + "content": "A degenerative labral tear is present at the anterosuperior acetabulum.", + "intervals": [ + { + "startPos": 194, + "endPos": 265 + } + ], + "significance": "significant" + }, + { + "type": "body", + "label": "Joint Capsule", + "content": "The joint capsule shows mild thickening.", + "intervals": [ + { + "startPos": 266, + "endPos": 306 + } + ], + "significance": "minor" + }, + { + "type": "body", + "label": "Bones", + "content": "Moderate subchondral bone marrow edema is seen in the femoral head and acetabulum.", + "intervals": [ + { + "startPos": 307, + "endPos": 389 + } + ], + "significance": "significant" + }, + { + "type": "body", + "label": "Bones", + "content": "Small subchondral cysts are noted in the superior acetabulum.", + "intervals": [ + { + "startPos": 390, + "endPos": 451 + } + ], + "significance": "minor" + }, + { + "type": "body", + "label": "Tendons", + "content": "The hip abductor tendons show signal alteration consistent with tendinosis, and there is a partial-thickness tear of the gluteus medius tendon at its greater trochanteric insertion.", + "intervals": [ + { + "startPos": 452, + "endPos": 633 + } + ], + "significance": "significant" + }, + { + "type": "suffix", + "label": "suffix", + "content": "1. Moderate to severe osteoarthritis with cartilage loss and subchondral changes.\n2. Anterosuperior labral tear.\n3. Partial-thickness gluteus medius tendon tear with tendinosis.", + "intervals": [ + { + "startPos": 647, + "endPos": 824 + } + ], + "significance": null + } + ], + "annotated_document_json": { + "extractions": [ + { + "extraction_text": "There is a small joint effusion.", + "extraction_class": "findings_body", + "attributes": { + "section": "Joint", + "clinical_significance": "minor" + }, + "char_interval": { + "start_pos": 0, + "end_pos": 32 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "Diffuse thinning of the articular cartilage is noted at the weight-bearing superior acetabulum and femoral head, with near full-thickness loss anterosuperiorly.", + "extraction_class": "findings_body", + "attributes": { + "section": "Cartilage", + "clinical_significance": "significant" + }, + "char_interval": { + "start_pos": 33, + "end_pos": 193 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "A degenerative labral tear is present at the anterosuperior acetabulum.", + "extraction_class": "findings_body", + "attributes": { + "section": "Labrum", + "clinical_significance": "significant" + }, + "char_interval": { + "start_pos": 194, + "end_pos": 265 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The joint capsule shows mild thickening.", + "extraction_class": "findings_body", + "attributes": { + "section": "Joint Capsule", + "clinical_significance": "minor" + }, + "char_interval": { + "start_pos": 266, + "end_pos": 306 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "Moderate subchondral bone marrow edema is seen in the femoral head and acetabulum.", + "extraction_class": "findings_body", + "attributes": { + "section": "Bones", + "clinical_significance": "significant" + }, + "char_interval": { + "start_pos": 307, + "end_pos": 389 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "Small subchondral cysts are noted in the superior acetabulum.", + "extraction_class": "findings_body", + "attributes": { + "section": "Bones", + "clinical_significance": "minor" + }, + "char_interval": { + "start_pos": 390, + "end_pos": 451 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The hip abductor tendons show signal alteration consistent with tendinosis, and there is a partial-thickness tear of the gluteus medius tendon at its greater trochanteric insertion.", + "extraction_class": "findings_body", + "attributes": { + "section": "Tendons", + "clinical_significance": "significant" + }, + "char_interval": { + "start_pos": 452, + "end_pos": 633 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "1. Moderate to severe osteoarthritis with cartilage loss and subchondral changes.\n2. Anterosuperior labral tear.\n3. Partial-thickness gluteus medius tendon tear with tendinosis.", + "extraction_class": "findings_suffix", + "attributes": {}, + "char_interval": { + "start_pos": 647, + "end_pos": 824 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + } + ] + }, + "text": "FINDINGS:\n\nJoint: There is a small joint effusion.\n\nCartilage: Diffuse thinning of the articular cartilage is noted at the weight-bearing superior acetabulum and femoral head, with near full-thickness loss anterosuperiorly.\n\nLabrum: A degenerative labral tear is present at the anterosuperior acetabulum.\n\nJoint Capsule: The joint capsule shows mild thickening.\n\nBones: Moderate subchondral bone marrow edema is seen in the femoral head and acetabulum. Small subchondral cysts are noted in the superior acetabulum.\n\nTendons: The hip abductor tendons show signal alteration consistent with tendinosis, and there is a partial-thickness tear of the gluteus medius tendon at its greater trochanteric insertion.\n\nIMPRESSION:\n\n1. Moderate to severe osteoarthritis with cartilage loss and subchondral changes.\n2. Anterosuperior labral tear.\n3. Partial-thickness gluteus medius tendon tear with tendinosis.", + "raw_prompt": "# RadExtract Prompt\n\n## Task Description\n\nYou are a medical assistant specialized in categorizing radiology text into sections:\n\n- **findings_prefix** -- All text that appears before the actual \"findings\" content.\n- **findings_body** -- The main 'Findings' section. Each finding is classified into a possible section through a list of attributes, some of which may also be assigned to a subheader.\n- **findings_suffix** -- Any text that appears after the \"findings\" portion (such as \"Impression\" or other concluding content).\n\n### Section Categories:\n- **findings_prefix**: Use only for header information before clinical findings (examination details, clinical indication, technique). Never use for actual clinical observations or pathological findings.\n- **findings_body**: Use for all clinical findings, observations, and pathological descriptions.\n- **findings_suffix**: Use only for conclusions, impressions, or recommendations that appear after the main findings.\n\n### Critical Rule:\nIf a report contains only clinical findings without any header information, do not create a findings_prefix extraction. Start directly with findings_body extractions for the clinical content.\n\n**Example of findings-only content (NO prefix needed):**\nInput: \"There is a small joint effusion. The cartilage shows thinning.\"\nCorrect: Create only findings_body extractions for each clinical finding.\nIncorrect: Do not categorize clinical findings as findings_prefix.\n\n### Professional Output Standards:\nAll extracted text must maintain the grammatical correctness and professional coherence expected in radiology reports. Ensure that:\n- All sentences are complete and grammatically correct\n- Medical terminology is used appropriately and consistently\n- The language remains professional and clinical in tone\n- Correct obvious typos (e.g., \"splen\" → \"spleen\", \"kidny\" → \"kidney\")\n- Any modifications to the original text preserve the intended medical meaning\n- Minor typos are corrected and optimal punctuation is used\n\n### Empty prefix or suffix sections:\nOnly create extractions for sections that actually exist in the text. Do not create empty prefix or suffix sections if there is no corresponding content in the source text. If the text is findings-only without any impression/conclusion, do not create a findings_suffix extraction.\n\n### Section Usage Guidelines:\n\n**findings_prefix**: Reserved exclusively for header information that appears before clinical findings, such as:\n- Examination details (type of study, technique)\n- Clinical indication or history\n- Comparison studies referenced\n- Technical parameters\n\n**findings_body**: Contains the actual clinical findings and observations from the imaging study.\n\n**findings_suffix**: Reserved for concluding content that follows the findings, such as impressions or recommendations.\n\n**Critical Rule**: Clinical findings should never be categorized as prefix content. If a report begins directly with clinical observations without any header information, create only findings_body and findings_suffix extractions as appropriate.\n\n### Special guidance for findings_prefix organization:\nWhen the report has detailed prefix information with clear section headers (like EXAMINATION, CLINICAL INDICATION, COMPARISON, TECHNIQUE), create separate extractions for each section rather than one large block. Use the \"section\" attribute to label each part:\n- \"Examination\" for exam type/title\n- \"Clinical Indication\" for clinical history/reason for study \n- \"Comparison\" for prior studies referenced\n- \"Technique\" for imaging parameters and acquisition details\n\n**Important:** Even when examination information appears at the beginning without an explicit \"EXAMINATION:\" header, it should still be labeled with section:\"Examination\". This includes standalone exam descriptions that identify the type of imaging study being performed.\n\nAlways recognize examination-type content and use section:\"Examination\" regardless of whether it has an explicit header.\n\nThis structured approach provides better organization and readability.\n\n### Critical for findings_suffix:\nDo NOT include headers like \"IMPRESSION:\", \"CONCLUSION:\", etc. in the extraction_text. Only extract the actual content that follows these headers. The formatting system will add appropriate headers automatically. \n\n**Example:** If the text contains \"IMPRESSION: 1. Severe arthritis. 2. Labral tear.\", extract only \"1. Severe arthritis. 2. Labral tear.\" as the extraction_text.\n\n### Additional Notes for findings_body:\n- If a single sentence references multiple structures with a shared status (e.g., \"liver, gallbladder, spleen appear unremarkable\"), please split them into separate extraction lines, each referencing the relevant structure.\n- If the text mentions subheaders like \"CT ABDOMEN\" or \"CERVICAL SPINE,\" only create/retain that subheader if it clearly organizes multiple organ-structure findings under it. Do not force subheaders if only 1 or 2 lines belong there. A subheader should ideally group 3+ sections to be meaningful.\n\n### Special guidance for spine reports:\n- For spine imaging (MRI, CT), organize findings by anatomical level using the format: \"Lumbar Spine Levels: L1-L2\", \"Lumbar Spine Levels: L2-L3\", \"Cervical Spine Levels: C5-C6\", etc.\n- Separate general spine findings (alignment, lordosis, vertebral heights) from level-specific findings\n- Use dedicated sections for: \"Spinal Cord\", \"Bones\" (for marrow/vertebral body lesions), \"Paraspinal Soft Tissues\" (for muscle findings)\n- Each spinal level should get its own section when findings are described level-by-level\n- This level-by-level organization is preferred over generic \"Spine\" labeling for clinical utility\n\n### Non-spine skeletal findings:\nFor non-spine skeletal findings, unify them under a single section like \"Bones.\" Only keep laterality (Right/Left) if there is symmetry in the findings.\n\n## Required JSON Format\n\nEach final answer must be valid JSON with an array key \"extractions\". Each \"extraction\" is an object with:\n\n```json\n{\n \"text\": \"...\",\n \"category\": \"findings_prefix\" | \"findings_body\" | \"findings_suffix\",\n \"attributes\": {}\n}\n```\n\nWithin \"attributes\" each attribute should be a key-value pair as shown in the examples below. The attribute **\"clinical_significance\"** MUST be included for findings_body extractions and should be one of: **\"normal\"**, **\"minor\"**, **\"significant\"**, or **\"not_applicable\"** to indicate the importance of the finding.\n\n---\n\n# Few-Shot Examples\n\nThe following examples demonstrate how to properly structure different types of radiology reports:\n\n## Example 1\n\n**Input Text:**\n```\nEXAMINATION: CT ABDOMEN AND PELVIS WITH IV CONTRAST\nCLINICAL INDICATION: Abdominal pain.\nCOMPARISON: None.\nTECHNIQUE: Axial images of the abdomen and pelvis were obtained following the administration of intravenous contrast material. Coronal and sagittal reformations were reviewed.\n\nFINDINGS:\nNo acute abnormality is seen in the visualized lung bases. The liver is normal in size and contour. There is a 1.2 cm simple-appearing low-attenuation lesion in hepatic segment VII, consistent with a cyst. The gallbladder contains numerous calcified gallstones, compatible with cholelithiasis.\n\nIMPRESSION:\n1. Cholelithiasis without evidence of acute cholecystitis.\n2. Hepatic cyst.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION: CT ABDOMEN AND PELVIS WITH IV CONTRAST\",\n \"attributes\": {\n \"section\": \"Examination\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"CLINICAL INDICATION: Abdominal pain.\",\n \"attributes\": {\n \"section\": \"Clinical Indication\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"COMPARISON: None.\",\n \"attributes\": {\n \"section\": \"Comparison\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"TECHNIQUE: Axial images of the abdomen and pelvis were obtained following the administration of intravenous contrast material. Coronal and sagittal reformations were reviewed.\",\n \"attributes\": {\n \"section\": \"Technique\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No acute abnormality is seen in the visualized lung bases.\",\n \"attributes\": {\n \"section\": \"Lungs\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The liver is normal in size and contour.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a 1.2 cm simple-appearing low-attenuation lesion in hepatic segment VII, consistent with a cyst.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The gallbladder contains numerous calcified gallstones, compatible with cholelithiasis.\",\n \"attributes\": {\n \"section\": \"Gallbladder\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Cholelithiasis without evidence of acute cholecystitis.\\n2. Hepatic cyst.\"\n }\n ]\n}\n```\n\n---\n\n## Example 2\n\n**Input Text:**\n```\nCLINICAL HISTORY:\nLow back pain, rule out disc herniation\n\nMRI LUMBAR SPINE WITHOUT CONTRAST:\n\nFINDINGS:\nThe lumbar lordosis is maintained. Vertebral body heights are preserved.\n\nThere is a small hemangioma in the L3 vertebral body.\n\nThe conus medullaris terminates at L1 and appears normal.\n\nAt L2-L3, there is mild disc desiccation without significant stenosis.\n\nAt L3-L4, a small posterior disc bulge causes mild central canal narrowing.\n\nAt L4-L5, there is a large posterior disc herniation with severe central canal stenosis and nerve root impingement.\n\nAt L5-S1, mild disc bulge without significant stenosis.\n\nThe paraspinal musculature appears unremarkable.\n\nIMPRESSION:\nLarge L4-L5 disc herniation with severe stenosis.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"CLINICAL HISTORY:\\nLow back pain, rule out disc herniation\\n\\nMRI LUMBAR SPINE WITHOUT CONTRAST:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lumbar lordosis is maintained. Vertebral body heights are preserved.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a small hemangioma in the L3 vertebral body.\",\n \"attributes\": {\n \"section\": \"Bones\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The conus medullaris terminates at L1 and appears normal.\",\n \"attributes\": {\n \"section\": \"Spinal Cord\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L2-L3, there is mild disc desiccation without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L2-L3\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L3-L4, a small posterior disc bulge causes mild central canal narrowing.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L3-L4\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L4-L5, there is a large posterior disc herniation with severe central canal stenosis and nerve root impingement.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L4-L5\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L5-S1, mild disc bulge without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L5-S1\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The paraspinal musculature appears unremarkable.\",\n \"attributes\": {\n \"section\": \"Paraspinal Soft Tissues\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Large L4-L5 disc herniation with severe stenosis.\"\n }\n ]\n}\n```\n\n---\n\n## Example 3\n\n**Input Text:**\n```\nINDICATION: \nNeck pain, radiculopathy\n\nMRI CERVICAL SPINE:\n\nFINDINGS:\nNormal cervical lordosis is maintained. No vertebral body compression fractures.\n\nThe cervical spinal cord demonstrates normal signal intensity.\n\nAt C3-C4, no significant disc disease or stenosis.\n\nAt C4-C5, mild disc osteophyte complex with mild foraminal narrowing.\n\nAt C5-C6, moderate disc herniation with moderate central canal stenosis.\n\nAt C6-C7, small disc bulge without significant stenosis.\n\nIMPRESSION:\nModerate C5-C6 disc herniation and stenosis.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"INDICATION: \\nNeck pain, radiculopathy\\n\\nMRI CERVICAL SPINE:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Normal cervical lordosis is maintained. No vertebral body compression fractures.\",\n \"attributes\": {\n \"section\": \"Cervical Spine\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The cervical spinal cord demonstrates normal signal intensity.\",\n \"attributes\": {\n \"section\": \"Spinal Cord\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C3-C4, no significant disc disease or stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C3-C4\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C4-C5, mild disc osteophyte complex with mild foraminal narrowing.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C4-C5\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C5-C6, moderate disc herniation with moderate central canal stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C5-C6\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C6-C7, small disc bulge without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C6-C7\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Moderate C5-C6 disc herniation and stenosis.\"\n }\n ]\n}\n```\n\n---\n\n## Example 4\n\n**Input Text:**\n```\nTECHNIQUE: \nMultidetector helical CT from lung bases to adrenals with and without intravenous contrast.\n\nFINDINGS:\nLIVER/GALLBLADDER/SPLEEN: The liver has a normal appearance. Gallbladder wall appears normal. The spleen is normal in size.\n\nPANCREAS/ADRENALS: The pancreas and bilateral adrenal glands appear unremarkable.\n\nRETROPERITONEUM: No lymphadenopathy. No fluid collection.\n\nIMPRESSION:\nNormal abdominal CT.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"TECHNIQUE: \\nMultidetector helical CT from lung bases to adrenals with and without intravenous contrast.\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The liver has a normal appearance.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Gallbladder wall appears normal.\",\n \"attributes\": {\n \"section\": \"Gallbladder\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The spleen is normal in size.\",\n \"attributes\": {\n \"section\": \"Spleen\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The pancreas and bilateral adrenal glands appear unremarkable.\",\n \"attributes\": {\n \"section\": \"Pancreas/Adrenals\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No lymphadenopathy.\",\n \"attributes\": {\n \"section\": \"Retroperitoneum\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No fluid collection.\",\n \"attributes\": {\n \"section\": \"Retroperitoneum\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal abdominal CT.\"\n }\n ]\n}\n```\n\n---\n\n## Example 5\n\n**Input Text:**\n```\nHISTORY: \nLower abdominal pain\n\nCT ABDOMEN/PELVIS WITH CONTRAST:\n\nFINDINGS:\nLIVER: Multiple hepatic metastases are present, measuring up to 3.2 cm.\n\nKIDNEYS: The left kidney shows moderate hydronephrosis. The right kidney appears normal.\n\nLYMPH NODES: Enlarged retroperitoneal lymph nodes, largest measuring 2.1 cm.\n\nIMPRESSION:\n1. Multiple hepatic metastases\n2. Left hydronephrosis \n3. Retroperitoneal lymphadenopathy\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"HISTORY: \\nLower abdominal pain\\n\\nCT ABDOMEN/PELVIS WITH CONTRAST:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Multiple hepatic metastases are present, measuring up to 3.2 cm.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The left kidney shows moderate hydronephrosis.\",\n \"attributes\": {\n \"section\": \"Kidneys\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The right kidney appears normal.\",\n \"attributes\": {\n \"section\": \"Kidneys\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Enlarged retroperitoneal lymph nodes, largest measuring 2.1 cm.\",\n \"attributes\": {\n \"section\": \"Lymph Nodes\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Multiple hepatic metastases\\n2. Left hydronephrosis \\n3. Retroperitoneal lymphadenopathy\"\n }\n ]\n}\n```\n\n---\n\n## Example 6\n\n**Input Text:**\n```\nEXAMINATION:\nMRI brain without contrast\n\nCLINICAL HISTORY:\nHeadaches\n\nFINDINGS:\nThe brain parenchyma demonstrates normal signal intensity. No mass lesions are identified.\n\nThe ventricular system is normal in size and configuration.\n\nNo abnormal enhancement is seen.\n\nIMPRESSION:\nNormal brain MRI.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION:\\nMRI brain without contrast\\n\\nCLINICAL HISTORY:\\nHeadaches\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The brain parenchyma demonstrates normal signal intensity.\",\n \"attributes\": {\n \"section\": \"Brain Parenchyma\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No mass lesions are identified.\",\n \"attributes\": {\n \"section\": \"Brain Parenchyma\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The ventricular system is normal in size and configuration.\",\n \"attributes\": {\n \"section\": \"Ventricular System\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No abnormal enhancement is seen.\",\n \"attributes\": {\n \"section\": \"Enhancement\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal brain MRI.\"\n }\n ]\n}\n```\n\n---\n\n## Example 7\n\n**Input Text:**\n```\nINDICATION:\nRight knee pain\n\nMRI RIGHT KNEE:\n\nFINDINGS:\nMENISCI: There is a complex tear of the medial meniscus. The lateral meniscus appears intact.\n\nLIGAMENTS: The ACL shows complete rupture. The PCL, MCL, and LCL are intact.\n\nBONES: Mild bone marrow edema is present in the medial femoral condyle.\n\nIMPRESSION:\n1. Complex medial meniscal tear\n2. Complete ACL rupture\n3. Bone marrow edema in medial femoral condyle\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"INDICATION:\\nRight knee pain\\n\\nMRI RIGHT KNEE:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a complex tear of the medial meniscus.\",\n \"attributes\": {\n \"section\": \"Menisci\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lateral meniscus appears intact.\",\n \"attributes\": {\n \"section\": \"Menisci\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The ACL shows complete rupture.\",\n \"attributes\": {\n \"section\": \"Ligaments\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The PCL, MCL, and LCL are intact.\",\n \"attributes\": {\n \"section\": \"Ligaments\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Mild bone marrow edema is present in the medial femoral condyle.\",\n \"attributes\": {\n \"section\": \"Bones\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Complex medial meniscal tear\\n2. Complete ACL rupture\\n3. Bone marrow edema in medial femoral condyle\"\n }\n ]\n}\n```\n\n---\n\n## Example 8\n\n**Input Text:**\n```\nEXAMINATION: CT CHEST\n\nFINDINGS:\nThe longs are clear bilaterally. The hart size is normal. No pleural effushion.\n\nIMPRESSION:\nNormal chest CT.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION: CT CHEST\",\n \"attributes\": {\n \"section\": \"Examination\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lungs are clear bilaterally.\",\n \"attributes\": {\n \"section\": \"Lungs\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The heart size is normal.\",\n \"attributes\": {\n \"section\": \"Heart\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No pleural effusion.\",\n \"attributes\": {\n \"section\": \"Pleura\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal chest CT.\"\n }\n ]\n}\n```\n\n\n\n## Inference Example:\n\n**Input Text:**\n```\nThere is a small joint effusion. Diffuse thinning of the articular cartilage is noted at the weight-bearing superior acetabulum and femoral head, with near full-thickness loss anterosuperiorly. A degenerative labral tear is present at the anterosuperior acetabulum. The joint capsule shows mild thickening. Moderate subchondral bone marrow edema is seen in the femoral head and acetabulum. Small subchondral cysts are noted in the superior acetabulum. The hip abductor tendons show signal alteration consistent with tendinosis, and there is a partial-thickness tear of the gluteus medius tendon at its greater trochanteric insertion.\n\nIMPRESSION:\n1. Moderate to severe osteoarthritis with cartilage loss and subchondral changes.\n2. Anterosuperior labral tear.\n3. Partial-thickness gluteus medius tendon tear with tendinosis.\n```\n\n**Expected Output:**\n" + }, + "sample_chest_xray": { + "segments": [ + { + "type": "prefix", + "label": "Examination", + "content": "Study: Chest Radiograph", + "intervals": [ + { + "startPos": 0, + "endPos": 23 + } + ], + "significance": null + }, + { + "type": "body", + "label": "Heart", + "content": "The cardiac silhouette is normal in size and contour.", + "intervals": [ + { + "startPos": 25, + "endPos": 78 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Mediastinum", + "content": "The mediastinal contours are within normal limits.", + "intervals": [ + { + "startPos": 79, + "endPos": 129 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Lungs", + "content": "There is a 8 mm well-circumscribed nodule in the right upper lobe.", + "intervals": [ + { + "startPos": 130, + "endPos": 196 + } + ], + "significance": "significant" + }, + { + "type": "body", + "label": "Lungs", + "content": "The remainder of the lungs are clear without consolidation, pneumothorax, or pleural effusion.", + "intervals": [ + { + "startPos": 197, + "endPos": 291 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Vasculature", + "content": "The pulmonary vasculature appears normal.", + "intervals": [ + { + "startPos": 292, + "endPos": 333 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Bones", + "content": "No acute bony abnormalities are identified.", + "intervals": [ + { + "startPos": 334, + "endPos": 377 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Abdomen", + "content": "The visualized upper abdomen is unremarkable.", + "intervals": [ + { + "startPos": 378, + "endPos": 423 + } + ], + "significance": "normal" + } + ], + "annotated_document_json": { + "extractions": [ + { + "extraction_text": "Study: Chest Radiograph", + "extraction_class": "findings_prefix", + "attributes": { + "section": "Examination" + }, + "char_interval": { + "start_pos": 0, + "end_pos": 23 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The cardiac silhouette is normal in size and contour.", + "extraction_class": "findings_body", + "attributes": { + "section": "Heart", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 25, + "end_pos": 78 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The mediastinal contours are within normal limits.", + "extraction_class": "findings_body", + "attributes": { + "section": "Mediastinum", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 79, + "end_pos": 129 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "There is a 8 mm well-circumscribed nodule in the right upper lobe.", + "extraction_class": "findings_body", + "attributes": { + "section": "Lungs", + "clinical_significance": "significant" + }, + "char_interval": { + "start_pos": 130, + "end_pos": 196 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The remainder of the lungs are clear without consolidation, pneumothorax, or pleural effusion.", + "extraction_class": "findings_body", + "attributes": { + "section": "Lungs", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 197, + "end_pos": 291 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The pulmonary vasculature appears normal.", + "extraction_class": "findings_body", + "attributes": { + "section": "Vasculature", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 292, + "end_pos": 333 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "No acute bony abnormalities are identified.", + "extraction_class": "findings_body", + "attributes": { + "section": "Bones", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 334, + "end_pos": 377 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The visualized upper abdomen is unremarkable.", + "extraction_class": "findings_body", + "attributes": { + "section": "Abdomen", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 378, + "end_pos": 423 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + } + ] + }, + "text": "EXAMINATION:\n\nChest Radiograph\n\n\nFINDINGS:\n\nHeart: The cardiac silhouette is normal in size and contour.\n\nMediastinum: The mediastinal contours are within normal limits.\n\nLungs: There is a 8 mm well-circumscribed nodule in the right upper lobe. The remainder of the lungs are clear without consolidation, pneumothorax, or pleural effusion.\n\nVasculature: The pulmonary vasculature appears normal.\n\nBones: No acute bony abnormalities are identified.\n\nAbdomen: The visualized upper abdomen is unremarkable.", + "raw_prompt": "# RadExtract Prompt\n\n## Task Description\n\nYou are a medical assistant specialized in categorizing radiology text into sections:\n\n- **findings_prefix** -- All text that appears before the actual \"findings\" content.\n- **findings_body** -- The main 'Findings' section. Each finding is classified into a possible section through a list of attributes, some of which may also be assigned to a subheader.\n- **findings_suffix** -- Any text that appears after the \"findings\" portion (such as \"Impression\" or other concluding content).\n\n### Section Categories:\n- **findings_prefix**: Use only for header information before clinical findings (examination details, clinical indication, technique). Never use for actual clinical observations or pathological findings.\n- **findings_body**: Use for all clinical findings, observations, and pathological descriptions.\n- **findings_suffix**: Use only for conclusions, impressions, or recommendations that appear after the main findings.\n\n### Critical Rule:\nIf a report contains only clinical findings without any header information, do not create a findings_prefix extraction. Start directly with findings_body extractions for the clinical content.\n\n**Example of findings-only content (NO prefix needed):**\nInput: \"There is a small joint effusion. The cartilage shows thinning.\"\nCorrect: Create only findings_body extractions for each clinical finding.\nIncorrect: Do not categorize clinical findings as findings_prefix.\n\n### Professional Output Standards:\nAll extracted text must maintain the grammatical correctness and professional coherence expected in radiology reports. Ensure that:\n- All sentences are complete and grammatically correct\n- Medical terminology is used appropriately and consistently\n- The language remains professional and clinical in tone\n- Correct obvious typos (e.g., \"splen\" → \"spleen\", \"kidny\" → \"kidney\")\n- Any modifications to the original text preserve the intended medical meaning\n- Minor typos are corrected and optimal punctuation is used\n\n### Empty prefix or suffix sections:\nOnly create extractions for sections that actually exist in the text. Do not create empty prefix or suffix sections if there is no corresponding content in the source text. If the text is findings-only without any impression/conclusion, do not create a findings_suffix extraction.\n\n### Section Usage Guidelines:\n\n**findings_prefix**: Reserved exclusively for header information that appears before clinical findings, such as:\n- Examination details (type of study, technique)\n- Clinical indication or history\n- Comparison studies referenced\n- Technical parameters\n\n**findings_body**: Contains the actual clinical findings and observations from the imaging study.\n\n**findings_suffix**: Reserved for concluding content that follows the findings, such as impressions or recommendations.\n\n**Critical Rule**: Clinical findings should never be categorized as prefix content. If a report begins directly with clinical observations without any header information, create only findings_body and findings_suffix extractions as appropriate.\n\n### Special guidance for findings_prefix organization:\nWhen the report has detailed prefix information with clear section headers (like EXAMINATION, CLINICAL INDICATION, COMPARISON, TECHNIQUE), create separate extractions for each section rather than one large block. Use the \"section\" attribute to label each part:\n- \"Examination\" for exam type/title\n- \"Clinical Indication\" for clinical history/reason for study \n- \"Comparison\" for prior studies referenced\n- \"Technique\" for imaging parameters and acquisition details\n\n**Important:** Even when examination information appears at the beginning without an explicit \"EXAMINATION:\" header, it should still be labeled with section:\"Examination\". This includes standalone exam descriptions that identify the type of imaging study being performed.\n\nAlways recognize examination-type content and use section:\"Examination\" regardless of whether it has an explicit header.\n\nThis structured approach provides better organization and readability.\n\n### Critical for findings_suffix:\nDo NOT include headers like \"IMPRESSION:\", \"CONCLUSION:\", etc. in the extraction_text. Only extract the actual content that follows these headers. The formatting system will add appropriate headers automatically. \n\n**Example:** If the text contains \"IMPRESSION: 1. Severe arthritis. 2. Labral tear.\", extract only \"1. Severe arthritis. 2. Labral tear.\" as the extraction_text.\n\n### Additional Notes for findings_body:\n- If a single sentence references multiple structures with a shared status (e.g., \"liver, gallbladder, spleen appear unremarkable\"), please split them into separate extraction lines, each referencing the relevant structure.\n- If the text mentions subheaders like \"CT ABDOMEN\" or \"CERVICAL SPINE,\" only create/retain that subheader if it clearly organizes multiple organ-structure findings under it. Do not force subheaders if only 1 or 2 lines belong there. A subheader should ideally group 3+ sections to be meaningful.\n\n### Special guidance for spine reports:\n- For spine imaging (MRI, CT), organize findings by anatomical level using the format: \"Lumbar Spine Levels: L1-L2\", \"Lumbar Spine Levels: L2-L3\", \"Cervical Spine Levels: C5-C6\", etc.\n- Separate general spine findings (alignment, lordosis, vertebral heights) from level-specific findings\n- Use dedicated sections for: \"Spinal Cord\", \"Bones\" (for marrow/vertebral body lesions), \"Paraspinal Soft Tissues\" (for muscle findings)\n- Each spinal level should get its own section when findings are described level-by-level\n- This level-by-level organization is preferred over generic \"Spine\" labeling for clinical utility\n\n### Non-spine skeletal findings:\nFor non-spine skeletal findings, unify them under a single section like \"Bones.\" Only keep laterality (Right/Left) if there is symmetry in the findings.\n\n## Required JSON Format\n\nEach final answer must be valid JSON with an array key \"extractions\". Each \"extraction\" is an object with:\n\n```json\n{\n \"text\": \"...\",\n \"category\": \"findings_prefix\" | \"findings_body\" | \"findings_suffix\",\n \"attributes\": {}\n}\n```\n\nWithin \"attributes\" each attribute should be a key-value pair as shown in the examples below. The attribute **\"clinical_significance\"** MUST be included for findings_body extractions and should be one of: **\"normal\"**, **\"minor\"**, **\"significant\"**, or **\"not_applicable\"** to indicate the importance of the finding.\n\n---\n\n# Few-Shot Examples\n\nThe following examples demonstrate how to properly structure different types of radiology reports:\n\n## Example 1\n\n**Input Text:**\n```\nEXAMINATION: CT ABDOMEN AND PELVIS WITH IV CONTRAST\nCLINICAL INDICATION: Abdominal pain.\nCOMPARISON: None.\nTECHNIQUE: Axial images of the abdomen and pelvis were obtained following the administration of intravenous contrast material. Coronal and sagittal reformations were reviewed.\n\nFINDINGS:\nNo acute abnormality is seen in the visualized lung bases. The liver is normal in size and contour. There is a 1.2 cm simple-appearing low-attenuation lesion in hepatic segment VII, consistent with a cyst. The gallbladder contains numerous calcified gallstones, compatible with cholelithiasis.\n\nIMPRESSION:\n1. Cholelithiasis without evidence of acute cholecystitis.\n2. Hepatic cyst.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION: CT ABDOMEN AND PELVIS WITH IV CONTRAST\",\n \"attributes\": {\n \"section\": \"Examination\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"CLINICAL INDICATION: Abdominal pain.\",\n \"attributes\": {\n \"section\": \"Clinical Indication\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"COMPARISON: None.\",\n \"attributes\": {\n \"section\": \"Comparison\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"TECHNIQUE: Axial images of the abdomen and pelvis were obtained following the administration of intravenous contrast material. Coronal and sagittal reformations were reviewed.\",\n \"attributes\": {\n \"section\": \"Technique\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No acute abnormality is seen in the visualized lung bases.\",\n \"attributes\": {\n \"section\": \"Lungs\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The liver is normal in size and contour.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a 1.2 cm simple-appearing low-attenuation lesion in hepatic segment VII, consistent with a cyst.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The gallbladder contains numerous calcified gallstones, compatible with cholelithiasis.\",\n \"attributes\": {\n \"section\": \"Gallbladder\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Cholelithiasis without evidence of acute cholecystitis.\\n2. Hepatic cyst.\"\n }\n ]\n}\n```\n\n---\n\n## Example 2\n\n**Input Text:**\n```\nCLINICAL HISTORY:\nLow back pain, rule out disc herniation\n\nMRI LUMBAR SPINE WITHOUT CONTRAST:\n\nFINDINGS:\nThe lumbar lordosis is maintained. Vertebral body heights are preserved.\n\nThere is a small hemangioma in the L3 vertebral body.\n\nThe conus medullaris terminates at L1 and appears normal.\n\nAt L2-L3, there is mild disc desiccation without significant stenosis.\n\nAt L3-L4, a small posterior disc bulge causes mild central canal narrowing.\n\nAt L4-L5, there is a large posterior disc herniation with severe central canal stenosis and nerve root impingement.\n\nAt L5-S1, mild disc bulge without significant stenosis.\n\nThe paraspinal musculature appears unremarkable.\n\nIMPRESSION:\nLarge L4-L5 disc herniation with severe stenosis.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"CLINICAL HISTORY:\\nLow back pain, rule out disc herniation\\n\\nMRI LUMBAR SPINE WITHOUT CONTRAST:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lumbar lordosis is maintained. Vertebral body heights are preserved.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a small hemangioma in the L3 vertebral body.\",\n \"attributes\": {\n \"section\": \"Bones\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The conus medullaris terminates at L1 and appears normal.\",\n \"attributes\": {\n \"section\": \"Spinal Cord\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L2-L3, there is mild disc desiccation without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L2-L3\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L3-L4, a small posterior disc bulge causes mild central canal narrowing.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L3-L4\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L4-L5, there is a large posterior disc herniation with severe central canal stenosis and nerve root impingement.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L4-L5\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L5-S1, mild disc bulge without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L5-S1\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The paraspinal musculature appears unremarkable.\",\n \"attributes\": {\n \"section\": \"Paraspinal Soft Tissues\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Large L4-L5 disc herniation with severe stenosis.\"\n }\n ]\n}\n```\n\n---\n\n## Example 3\n\n**Input Text:**\n```\nINDICATION: \nNeck pain, radiculopathy\n\nMRI CERVICAL SPINE:\n\nFINDINGS:\nNormal cervical lordosis is maintained. No vertebral body compression fractures.\n\nThe cervical spinal cord demonstrates normal signal intensity.\n\nAt C3-C4, no significant disc disease or stenosis.\n\nAt C4-C5, mild disc osteophyte complex with mild foraminal narrowing.\n\nAt C5-C6, moderate disc herniation with moderate central canal stenosis.\n\nAt C6-C7, small disc bulge without significant stenosis.\n\nIMPRESSION:\nModerate C5-C6 disc herniation and stenosis.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"INDICATION: \\nNeck pain, radiculopathy\\n\\nMRI CERVICAL SPINE:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Normal cervical lordosis is maintained. No vertebral body compression fractures.\",\n \"attributes\": {\n \"section\": \"Cervical Spine\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The cervical spinal cord demonstrates normal signal intensity.\",\n \"attributes\": {\n \"section\": \"Spinal Cord\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C3-C4, no significant disc disease or stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C3-C4\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C4-C5, mild disc osteophyte complex with mild foraminal narrowing.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C4-C5\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C5-C6, moderate disc herniation with moderate central canal stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C5-C6\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C6-C7, small disc bulge without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C6-C7\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Moderate C5-C6 disc herniation and stenosis.\"\n }\n ]\n}\n```\n\n---\n\n## Example 4\n\n**Input Text:**\n```\nTECHNIQUE: \nMultidetector helical CT from lung bases to adrenals with and without intravenous contrast.\n\nFINDINGS:\nLIVER/GALLBLADDER/SPLEEN: The liver has a normal appearance. Gallbladder wall appears normal. The spleen is normal in size.\n\nPANCREAS/ADRENALS: The pancreas and bilateral adrenal glands appear unremarkable.\n\nRETROPERITONEUM: No lymphadenopathy. No fluid collection.\n\nIMPRESSION:\nNormal abdominal CT.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"TECHNIQUE: \\nMultidetector helical CT from lung bases to adrenals with and without intravenous contrast.\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The liver has a normal appearance.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Gallbladder wall appears normal.\",\n \"attributes\": {\n \"section\": \"Gallbladder\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The spleen is normal in size.\",\n \"attributes\": {\n \"section\": \"Spleen\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The pancreas and bilateral adrenal glands appear unremarkable.\",\n \"attributes\": {\n \"section\": \"Pancreas/Adrenals\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No lymphadenopathy.\",\n \"attributes\": {\n \"section\": \"Retroperitoneum\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No fluid collection.\",\n \"attributes\": {\n \"section\": \"Retroperitoneum\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal abdominal CT.\"\n }\n ]\n}\n```\n\n---\n\n## Example 5\n\n**Input Text:**\n```\nHISTORY: \nLower abdominal pain\n\nCT ABDOMEN/PELVIS WITH CONTRAST:\n\nFINDINGS:\nLIVER: Multiple hepatic metastases are present, measuring up to 3.2 cm.\n\nKIDNEYS: The left kidney shows moderate hydronephrosis. The right kidney appears normal.\n\nLYMPH NODES: Enlarged retroperitoneal lymph nodes, largest measuring 2.1 cm.\n\nIMPRESSION:\n1. Multiple hepatic metastases\n2. Left hydronephrosis \n3. Retroperitoneal lymphadenopathy\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"HISTORY: \\nLower abdominal pain\\n\\nCT ABDOMEN/PELVIS WITH CONTRAST:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Multiple hepatic metastases are present, measuring up to 3.2 cm.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The left kidney shows moderate hydronephrosis.\",\n \"attributes\": {\n \"section\": \"Kidneys\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The right kidney appears normal.\",\n \"attributes\": {\n \"section\": \"Kidneys\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Enlarged retroperitoneal lymph nodes, largest measuring 2.1 cm.\",\n \"attributes\": {\n \"section\": \"Lymph Nodes\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Multiple hepatic metastases\\n2. Left hydronephrosis \\n3. Retroperitoneal lymphadenopathy\"\n }\n ]\n}\n```\n\n---\n\n## Example 6\n\n**Input Text:**\n```\nEXAMINATION:\nMRI brain without contrast\n\nCLINICAL HISTORY:\nHeadaches\n\nFINDINGS:\nThe brain parenchyma demonstrates normal signal intensity. No mass lesions are identified.\n\nThe ventricular system is normal in size and configuration.\n\nNo abnormal enhancement is seen.\n\nIMPRESSION:\nNormal brain MRI.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION:\\nMRI brain without contrast\\n\\nCLINICAL HISTORY:\\nHeadaches\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The brain parenchyma demonstrates normal signal intensity.\",\n \"attributes\": {\n \"section\": \"Brain Parenchyma\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No mass lesions are identified.\",\n \"attributes\": {\n \"section\": \"Brain Parenchyma\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The ventricular system is normal in size and configuration.\",\n \"attributes\": {\n \"section\": \"Ventricular System\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No abnormal enhancement is seen.\",\n \"attributes\": {\n \"section\": \"Enhancement\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal brain MRI.\"\n }\n ]\n}\n```\n\n---\n\n## Example 7\n\n**Input Text:**\n```\nINDICATION:\nRight knee pain\n\nMRI RIGHT KNEE:\n\nFINDINGS:\nMENISCI: There is a complex tear of the medial meniscus. The lateral meniscus appears intact.\n\nLIGAMENTS: The ACL shows complete rupture. The PCL, MCL, and LCL are intact.\n\nBONES: Mild bone marrow edema is present in the medial femoral condyle.\n\nIMPRESSION:\n1. Complex medial meniscal tear\n2. Complete ACL rupture\n3. Bone marrow edema in medial femoral condyle\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"INDICATION:\\nRight knee pain\\n\\nMRI RIGHT KNEE:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a complex tear of the medial meniscus.\",\n \"attributes\": {\n \"section\": \"Menisci\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lateral meniscus appears intact.\",\n \"attributes\": {\n \"section\": \"Menisci\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The ACL shows complete rupture.\",\n \"attributes\": {\n \"section\": \"Ligaments\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The PCL, MCL, and LCL are intact.\",\n \"attributes\": {\n \"section\": \"Ligaments\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Mild bone marrow edema is present in the medial femoral condyle.\",\n \"attributes\": {\n \"section\": \"Bones\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Complex medial meniscal tear\\n2. Complete ACL rupture\\n3. Bone marrow edema in medial femoral condyle\"\n }\n ]\n}\n```\n\n---\n\n## Example 8\n\n**Input Text:**\n```\nEXAMINATION: CT CHEST\n\nFINDINGS:\nThe longs are clear bilaterally. The hart size is normal. No pleural effushion.\n\nIMPRESSION:\nNormal chest CT.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION: CT CHEST\",\n \"attributes\": {\n \"section\": \"Examination\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lungs are clear bilaterally.\",\n \"attributes\": {\n \"section\": \"Lungs\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The heart size is normal.\",\n \"attributes\": {\n \"section\": \"Heart\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No pleural effusion.\",\n \"attributes\": {\n \"section\": \"Pleura\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal chest CT.\"\n }\n ]\n}\n```\n\n\n\n## Inference Example:\n\n**Input Text:**\n```\nStudy: Chest Radiograph\n\nThe cardiac silhouette is normal in size and contour. The mediastinal contours are within normal limits. There is a 8 mm well-circumscribed nodule in the right upper lobe. The remainder of the lungs are clear without consolidation, pneumothorax, or pleural effusion. The pulmonary vasculature appears normal. No acute bony abnormalities are identified. The visualized upper abdomen is unremarkable.\n```\n\n**Expected Output:**\n" + }, + "sample_cta_pulmonary_embolus": { + "segments": [ + { + "type": "prefix", + "label": "Examination", + "content": "EXAMINATION: CT angiography of the chest for pulmonary embolism", + "intervals": [ + { + "startPos": 0, + "endPos": 63 + } + ], + "significance": null + }, + { + "type": "prefix", + "label": "Clinical Indication", + "content": "CLINICAL INDICATION: Shortness of breath, chest pain, elevated D-dimer, rule out pulmonary embolism", + "intervals": [ + { + "startPos": 64, + "endPos": 163 + } + ], + "significance": null + }, + { + "type": "prefix", + "label": "Comparison", + "content": "COMPARISON: Chest X-ray from 2 days ago", + "intervals": [ + { + "startPos": 164, + "endPos": 203 + } + ], + "significance": null + }, + { + "type": "prefix", + "label": "Technique", + "content": "TECHNIQUE: Axial CT images of the chest were obtained following rapid intravenous administration of iodinated contrast material. Images were reconstructed in axial, coronal, and sagittal planes with MIP and VRT reformations.", + "intervals": [ + { + "startPos": 204, + "endPos": 428 + } + ], + "significance": null + }, + { + "type": "body", + "label": "Pulmonary Vasculature", + "content": "There are multiple filling defects consistent with acute pulmonary emboli involving the right main pulmonary artery extending into the right upper and middle lobe segmental branches. Additional smaller emboli are present in the left lower lobe subsegmental arteries.", + "intervals": [ + { + "startPos": 440, + "endPos": 706 + } + ], + "significance": "significant" + }, + { + "type": "body", + "label": "Pulmonary Vasculature", + "content": "The main pulmonary artery is mildly dilated, measuring 3.2 cm in diameter.", + "intervals": [ + { + "startPos": 707, + "endPos": 781 + } + ], + "significance": "minor" + }, + { + "type": "body", + "label": "Heart", + "content": "There is mild right heart strain with flattening of the interventricular septum and enlargement of the right ventricle.", + "intervals": [ + { + "startPos": 782, + "endPos": 901 + } + ], + "significance": "significant" + }, + { + "type": "body", + "label": "Heart", + "content": "No evidence of right heart failure or pericardial effusion.", + "intervals": [ + { + "startPos": 902, + "endPos": 961 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Lungs", + "content": "The lungs show mild bilateral lower lobe atelectasis.", + "intervals": [ + { + "startPos": 963, + "endPos": 1054 + } + ], + "significance": "minor" + }, + { + "type": "body", + "label": "Lungs", + "content": "No consolidation or pneumothorax is identified.", + "intervals": [ + { + "startPos": 1055, + "endPos": 1102 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Pleura", + "content": "Small bilateral pleural effusions are present.", + "intervals": [ + { + "startPos": 1004, + "endPos": 1054 + } + ], + "significance": "minor" + }, + { + "type": "body", + "label": "Mediastinum", + "content": "The mediastinal and hilar lymph nodes are not enlarged.", + "intervals": [ + { + "startPos": 1103, + "endPos": 1158 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Mediastinum", + "content": "The aorta and great vessels appear normal.", + "intervals": [ + { + "startPos": 1159, + "endPos": 1201 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Abdomen", + "content": "The visualized portions of the upper abdomen are unremarkable.", + "intervals": [ + { + "startPos": 1202, + "endPos": 1264 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Bones", + "content": "No acute bony abnormalities are identified.", + "intervals": [ + { + "startPos": 1265, + "endPos": 1308 + } + ], + "significance": "normal" + }, + { + "type": "suffix", + "label": "suffix", + "content": "1. Acute pulmonary emboli involving the right main, upper and middle lobe segmental arteries, and left lower lobe subsegmental arteries.\n2. Mild pulmonary hypertension with right heart strain.\n3. Small bilateral pleural effusions and bilateral lower lobe atelectasis.", + "intervals": [ + { + "startPos": 1322, + "endPos": 1589 + } + ], + "significance": null + } + ], + "annotated_document_json": { + "extractions": [ + { + "extraction_text": "EXAMINATION: CT angiography of the chest for pulmonary embolism", + "extraction_class": "findings_prefix", + "attributes": { + "section": "Examination" + }, + "char_interval": { + "start_pos": 0, + "end_pos": 63 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "CLINICAL INDICATION: Shortness of breath, chest pain, elevated D-dimer, rule out pulmonary embolism", + "extraction_class": "findings_prefix", + "attributes": { + "section": "Clinical Indication" + }, + "char_interval": { + "start_pos": 64, + "end_pos": 163 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "COMPARISON: Chest X-ray from 2 days ago", + "extraction_class": "findings_prefix", + "attributes": { + "section": "Comparison" + }, + "char_interval": { + "start_pos": 164, + "end_pos": 203 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "TECHNIQUE: Axial CT images of the chest were obtained following rapid intravenous administration of iodinated contrast material. Images were reconstructed in axial, coronal, and sagittal planes with MIP and VRT reformations.", + "extraction_class": "findings_prefix", + "attributes": { + "section": "Technique" + }, + "char_interval": { + "start_pos": 204, + "end_pos": 428 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "There are multiple filling defects consistent with acute pulmonary emboli involving the right main pulmonary artery extending into the right upper and middle lobe segmental branches. Additional smaller emboli are present in the left lower lobe subsegmental arteries.", + "extraction_class": "findings_body", + "attributes": { + "section": "Pulmonary Vasculature", + "clinical_significance": "significant" + }, + "char_interval": { + "start_pos": 440, + "end_pos": 706 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The main pulmonary artery is mildly dilated, measuring 3.2 cm in diameter.", + "extraction_class": "findings_body", + "attributes": { + "section": "Pulmonary Vasculature", + "clinical_significance": "minor" + }, + "char_interval": { + "start_pos": 707, + "end_pos": 781 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "There is mild right heart strain with flattening of the interventricular septum and enlargement of the right ventricle.", + "extraction_class": "findings_body", + "attributes": { + "section": "Heart", + "clinical_significance": "significant" + }, + "char_interval": { + "start_pos": 782, + "end_pos": 901 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "No evidence of right heart failure or pericardial effusion.", + "extraction_class": "findings_body", + "attributes": { + "section": "Heart", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 902, + "end_pos": 961 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The lungs show mild bilateral lower lobe atelectasis.", + "extraction_class": "findings_body", + "attributes": { + "section": "Lungs", + "clinical_significance": "minor" + }, + "char_interval": { + "start_pos": 963, + "end_pos": 1054 + }, + "alignment_status": "AlignmentStatus.MATCH_FUZZY" + }, + { + "extraction_text": "Small bilateral pleural effusions are present.", + "extraction_class": "findings_body", + "attributes": { + "section": "Pleura", + "clinical_significance": "minor" + }, + "char_interval": { + "start_pos": 1004, + "end_pos": 1054 + }, + "alignment_status": "AlignmentStatus.MATCH_FUZZY" + }, + { + "extraction_text": "No consolidation or pneumothorax is identified.", + "extraction_class": "findings_body", + "attributes": { + "section": "Lungs", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 1055, + "end_pos": 1102 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The mediastinal and hilar lymph nodes are not enlarged.", + "extraction_class": "findings_body", + "attributes": { + "section": "Mediastinum", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 1103, + "end_pos": 1158 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The aorta and great vessels appear normal.", + "extraction_class": "findings_body", + "attributes": { + "section": "Mediastinum", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 1159, + "end_pos": 1201 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The visualized portions of the upper abdomen are unremarkable.", + "extraction_class": "findings_body", + "attributes": { + "section": "Abdomen", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 1202, + "end_pos": 1264 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "No acute bony abnormalities are identified.", + "extraction_class": "findings_body", + "attributes": { + "section": "Bones", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 1265, + "end_pos": 1308 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "1. Acute pulmonary emboli involving the right main, upper and middle lobe segmental arteries, and left lower lobe subsegmental arteries.\n2. Mild pulmonary hypertension with right heart strain.\n3. Small bilateral pleural effusions and bilateral lower lobe atelectasis.", + "extraction_class": "findings_suffix", + "attributes": {}, + "char_interval": { + "start_pos": 1322, + "end_pos": 1589 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + } + ] + }, + "text": "EXAMINATION:\n\nCT angiography of the chest for pulmonary embolism\n\nCLINICAL INDICATION: Shortness of breath, chest pain, elevated D-dimer, rule out pulmonary embolism\n\nCOMPARISON: Chest X-ray from 2 days ago\n\nTECHNIQUE: Axial CT images of the chest were obtained following rapid intravenous administration of iodinated contrast material. Images were reconstructed in axial, coronal, and sagittal planes with MIP and VRT reformations.\n\n\nFINDINGS:\n\nPulmonary Vasculature: There are multiple filling defects consistent with acute pulmonary emboli involving the right main pulmonary artery extending into the right upper and middle lobe segmental branches. Additional smaller emboli are present in the left lower lobe subsegmental arteries. The main pulmonary artery is mildly dilated, measuring 3.2 cm in diameter.\n\nHeart: There is mild right heart strain with flattening of the interventricular septum and enlargement of the right ventricle. No evidence of right heart failure or pericardial effusion.\n\nLungs: The lungs show mild bilateral lower lobe atelectasis. No consolidation or pneumothorax is identified.\n\nPleura: Small bilateral pleural effusions are present.\n\nMediastinum: The mediastinal and hilar lymph nodes are not enlarged. The aorta and great vessels appear normal.\n\nAbdomen: The visualized portions of the upper abdomen are unremarkable.\n\nBones: No acute bony abnormalities are identified.\n\nIMPRESSION:\n\n1. Acute pulmonary emboli involving the right main, upper and middle lobe segmental arteries, and left lower lobe subsegmental arteries.\n2. Mild pulmonary hypertension with right heart strain.\n3. Small bilateral pleural effusions and bilateral lower lobe atelectasis.", + "raw_prompt": "# RadExtract Prompt\n\n## Task Description\n\nYou are a medical assistant specialized in categorizing radiology text into sections:\n\n- **findings_prefix** -- All text that appears before the actual \"findings\" content.\n- **findings_body** -- The main 'Findings' section. Each finding is classified into a possible section through a list of attributes, some of which may also be assigned to a subheader.\n- **findings_suffix** -- Any text that appears after the \"findings\" portion (such as \"Impression\" or other concluding content).\n\n### Section Categories:\n- **findings_prefix**: Use only for header information before clinical findings (examination details, clinical indication, technique). Never use for actual clinical observations or pathological findings.\n- **findings_body**: Use for all clinical findings, observations, and pathological descriptions.\n- **findings_suffix**: Use only for conclusions, impressions, or recommendations that appear after the main findings.\n\n### Critical Rule:\nIf a report contains only clinical findings without any header information, do not create a findings_prefix extraction. Start directly with findings_body extractions for the clinical content.\n\n**Example of findings-only content (NO prefix needed):**\nInput: \"There is a small joint effusion. The cartilage shows thinning.\"\nCorrect: Create only findings_body extractions for each clinical finding.\nIncorrect: Do not categorize clinical findings as findings_prefix.\n\n### Professional Output Standards:\nAll extracted text must maintain the grammatical correctness and professional coherence expected in radiology reports. Ensure that:\n- All sentences are complete and grammatically correct\n- Medical terminology is used appropriately and consistently\n- The language remains professional and clinical in tone\n- Correct obvious typos (e.g., \"splen\" → \"spleen\", \"kidny\" → \"kidney\")\n- Any modifications to the original text preserve the intended medical meaning\n- Minor typos are corrected and optimal punctuation is used\n\n### Empty prefix or suffix sections:\nOnly create extractions for sections that actually exist in the text. Do not create empty prefix or suffix sections if there is no corresponding content in the source text. If the text is findings-only without any impression/conclusion, do not create a findings_suffix extraction.\n\n### Section Usage Guidelines:\n\n**findings_prefix**: Reserved exclusively for header information that appears before clinical findings, such as:\n- Examination details (type of study, technique)\n- Clinical indication or history\n- Comparison studies referenced\n- Technical parameters\n\n**findings_body**: Contains the actual clinical findings and observations from the imaging study.\n\n**findings_suffix**: Reserved for concluding content that follows the findings, such as impressions or recommendations.\n\n**Critical Rule**: Clinical findings should never be categorized as prefix content. If a report begins directly with clinical observations without any header information, create only findings_body and findings_suffix extractions as appropriate.\n\n### Special guidance for findings_prefix organization:\nWhen the report has detailed prefix information with clear section headers (like EXAMINATION, CLINICAL INDICATION, COMPARISON, TECHNIQUE), create separate extractions for each section rather than one large block. Use the \"section\" attribute to label each part:\n- \"Examination\" for exam type/title\n- \"Clinical Indication\" for clinical history/reason for study \n- \"Comparison\" for prior studies referenced\n- \"Technique\" for imaging parameters and acquisition details\n\n**Important:** Even when examination information appears at the beginning without an explicit \"EXAMINATION:\" header, it should still be labeled with section:\"Examination\". This includes standalone exam descriptions that identify the type of imaging study being performed.\n\nAlways recognize examination-type content and use section:\"Examination\" regardless of whether it has an explicit header.\n\nThis structured approach provides better organization and readability.\n\n### Critical for findings_suffix:\nDo NOT include headers like \"IMPRESSION:\", \"CONCLUSION:\", etc. in the extraction_text. Only extract the actual content that follows these headers. The formatting system will add appropriate headers automatically. \n\n**Example:** If the text contains \"IMPRESSION: 1. Severe arthritis. 2. Labral tear.\", extract only \"1. Severe arthritis. 2. Labral tear.\" as the extraction_text.\n\n### Additional Notes for findings_body:\n- If a single sentence references multiple structures with a shared status (e.g., \"liver, gallbladder, spleen appear unremarkable\"), please split them into separate extraction lines, each referencing the relevant structure.\n- If the text mentions subheaders like \"CT ABDOMEN\" or \"CERVICAL SPINE,\" only create/retain that subheader if it clearly organizes multiple organ-structure findings under it. Do not force subheaders if only 1 or 2 lines belong there. A subheader should ideally group 3+ sections to be meaningful.\n\n### Special guidance for spine reports:\n- For spine imaging (MRI, CT), organize findings by anatomical level using the format: \"Lumbar Spine Levels: L1-L2\", \"Lumbar Spine Levels: L2-L3\", \"Cervical Spine Levels: C5-C6\", etc.\n- Separate general spine findings (alignment, lordosis, vertebral heights) from level-specific findings\n- Use dedicated sections for: \"Spinal Cord\", \"Bones\" (for marrow/vertebral body lesions), \"Paraspinal Soft Tissues\" (for muscle findings)\n- Each spinal level should get its own section when findings are described level-by-level\n- This level-by-level organization is preferred over generic \"Spine\" labeling for clinical utility\n\n### Non-spine skeletal findings:\nFor non-spine skeletal findings, unify them under a single section like \"Bones.\" Only keep laterality (Right/Left) if there is symmetry in the findings.\n\n## Required JSON Format\n\nEach final answer must be valid JSON with an array key \"extractions\". Each \"extraction\" is an object with:\n\n```json\n{\n \"text\": \"...\",\n \"category\": \"findings_prefix\" | \"findings_body\" | \"findings_suffix\",\n \"attributes\": {}\n}\n```\n\nWithin \"attributes\" each attribute should be a key-value pair as shown in the examples below. The attribute **\"clinical_significance\"** MUST be included for findings_body extractions and should be one of: **\"normal\"**, **\"minor\"**, **\"significant\"**, or **\"not_applicable\"** to indicate the importance of the finding.\n\n---\n\n# Few-Shot Examples\n\nThe following examples demonstrate how to properly structure different types of radiology reports:\n\n## Example 1\n\n**Input Text:**\n```\nEXAMINATION: CT ABDOMEN AND PELVIS WITH IV CONTRAST\nCLINICAL INDICATION: Abdominal pain.\nCOMPARISON: None.\nTECHNIQUE: Axial images of the abdomen and pelvis were obtained following the administration of intravenous contrast material. Coronal and sagittal reformations were reviewed.\n\nFINDINGS:\nNo acute abnormality is seen in the visualized lung bases. The liver is normal in size and contour. There is a 1.2 cm simple-appearing low-attenuation lesion in hepatic segment VII, consistent with a cyst. The gallbladder contains numerous calcified gallstones, compatible with cholelithiasis.\n\nIMPRESSION:\n1. Cholelithiasis without evidence of acute cholecystitis.\n2. Hepatic cyst.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION: CT ABDOMEN AND PELVIS WITH IV CONTRAST\",\n \"attributes\": {\n \"section\": \"Examination\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"CLINICAL INDICATION: Abdominal pain.\",\n \"attributes\": {\n \"section\": \"Clinical Indication\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"COMPARISON: None.\",\n \"attributes\": {\n \"section\": \"Comparison\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"TECHNIQUE: Axial images of the abdomen and pelvis were obtained following the administration of intravenous contrast material. Coronal and sagittal reformations were reviewed.\",\n \"attributes\": {\n \"section\": \"Technique\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No acute abnormality is seen in the visualized lung bases.\",\n \"attributes\": {\n \"section\": \"Lungs\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The liver is normal in size and contour.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a 1.2 cm simple-appearing low-attenuation lesion in hepatic segment VII, consistent with a cyst.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The gallbladder contains numerous calcified gallstones, compatible with cholelithiasis.\",\n \"attributes\": {\n \"section\": \"Gallbladder\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Cholelithiasis without evidence of acute cholecystitis.\\n2. Hepatic cyst.\"\n }\n ]\n}\n```\n\n---\n\n## Example 2\n\n**Input Text:**\n```\nCLINICAL HISTORY:\nLow back pain, rule out disc herniation\n\nMRI LUMBAR SPINE WITHOUT CONTRAST:\n\nFINDINGS:\nThe lumbar lordosis is maintained. Vertebral body heights are preserved.\n\nThere is a small hemangioma in the L3 vertebral body.\n\nThe conus medullaris terminates at L1 and appears normal.\n\nAt L2-L3, there is mild disc desiccation without significant stenosis.\n\nAt L3-L4, a small posterior disc bulge causes mild central canal narrowing.\n\nAt L4-L5, there is a large posterior disc herniation with severe central canal stenosis and nerve root impingement.\n\nAt L5-S1, mild disc bulge without significant stenosis.\n\nThe paraspinal musculature appears unremarkable.\n\nIMPRESSION:\nLarge L4-L5 disc herniation with severe stenosis.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"CLINICAL HISTORY:\\nLow back pain, rule out disc herniation\\n\\nMRI LUMBAR SPINE WITHOUT CONTRAST:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lumbar lordosis is maintained. Vertebral body heights are preserved.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a small hemangioma in the L3 vertebral body.\",\n \"attributes\": {\n \"section\": \"Bones\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The conus medullaris terminates at L1 and appears normal.\",\n \"attributes\": {\n \"section\": \"Spinal Cord\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L2-L3, there is mild disc desiccation without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L2-L3\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L3-L4, a small posterior disc bulge causes mild central canal narrowing.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L3-L4\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L4-L5, there is a large posterior disc herniation with severe central canal stenosis and nerve root impingement.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L4-L5\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L5-S1, mild disc bulge without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L5-S1\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The paraspinal musculature appears unremarkable.\",\n \"attributes\": {\n \"section\": \"Paraspinal Soft Tissues\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Large L4-L5 disc herniation with severe stenosis.\"\n }\n ]\n}\n```\n\n---\n\n## Example 3\n\n**Input Text:**\n```\nINDICATION: \nNeck pain, radiculopathy\n\nMRI CERVICAL SPINE:\n\nFINDINGS:\nNormal cervical lordosis is maintained. No vertebral body compression fractures.\n\nThe cervical spinal cord demonstrates normal signal intensity.\n\nAt C3-C4, no significant disc disease or stenosis.\n\nAt C4-C5, mild disc osteophyte complex with mild foraminal narrowing.\n\nAt C5-C6, moderate disc herniation with moderate central canal stenosis.\n\nAt C6-C7, small disc bulge without significant stenosis.\n\nIMPRESSION:\nModerate C5-C6 disc herniation and stenosis.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"INDICATION: \\nNeck pain, radiculopathy\\n\\nMRI CERVICAL SPINE:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Normal cervical lordosis is maintained. No vertebral body compression fractures.\",\n \"attributes\": {\n \"section\": \"Cervical Spine\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The cervical spinal cord demonstrates normal signal intensity.\",\n \"attributes\": {\n \"section\": \"Spinal Cord\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C3-C4, no significant disc disease or stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C3-C4\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C4-C5, mild disc osteophyte complex with mild foraminal narrowing.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C4-C5\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C5-C6, moderate disc herniation with moderate central canal stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C5-C6\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C6-C7, small disc bulge without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C6-C7\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Moderate C5-C6 disc herniation and stenosis.\"\n }\n ]\n}\n```\n\n---\n\n## Example 4\n\n**Input Text:**\n```\nTECHNIQUE: \nMultidetector helical CT from lung bases to adrenals with and without intravenous contrast.\n\nFINDINGS:\nLIVER/GALLBLADDER/SPLEEN: The liver has a normal appearance. Gallbladder wall appears normal. The spleen is normal in size.\n\nPANCREAS/ADRENALS: The pancreas and bilateral adrenal glands appear unremarkable.\n\nRETROPERITONEUM: No lymphadenopathy. No fluid collection.\n\nIMPRESSION:\nNormal abdominal CT.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"TECHNIQUE: \\nMultidetector helical CT from lung bases to adrenals with and without intravenous contrast.\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The liver has a normal appearance.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Gallbladder wall appears normal.\",\n \"attributes\": {\n \"section\": \"Gallbladder\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The spleen is normal in size.\",\n \"attributes\": {\n \"section\": \"Spleen\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The pancreas and bilateral adrenal glands appear unremarkable.\",\n \"attributes\": {\n \"section\": \"Pancreas/Adrenals\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No lymphadenopathy.\",\n \"attributes\": {\n \"section\": \"Retroperitoneum\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No fluid collection.\",\n \"attributes\": {\n \"section\": \"Retroperitoneum\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal abdominal CT.\"\n }\n ]\n}\n```\n\n---\n\n## Example 5\n\n**Input Text:**\n```\nHISTORY: \nLower abdominal pain\n\nCT ABDOMEN/PELVIS WITH CONTRAST:\n\nFINDINGS:\nLIVER: Multiple hepatic metastases are present, measuring up to 3.2 cm.\n\nKIDNEYS: The left kidney shows moderate hydronephrosis. The right kidney appears normal.\n\nLYMPH NODES: Enlarged retroperitoneal lymph nodes, largest measuring 2.1 cm.\n\nIMPRESSION:\n1. Multiple hepatic metastases\n2. Left hydronephrosis \n3. Retroperitoneal lymphadenopathy\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"HISTORY: \\nLower abdominal pain\\n\\nCT ABDOMEN/PELVIS WITH CONTRAST:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Multiple hepatic metastases are present, measuring up to 3.2 cm.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The left kidney shows moderate hydronephrosis.\",\n \"attributes\": {\n \"section\": \"Kidneys\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The right kidney appears normal.\",\n \"attributes\": {\n \"section\": \"Kidneys\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Enlarged retroperitoneal lymph nodes, largest measuring 2.1 cm.\",\n \"attributes\": {\n \"section\": \"Lymph Nodes\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Multiple hepatic metastases\\n2. Left hydronephrosis \\n3. Retroperitoneal lymphadenopathy\"\n }\n ]\n}\n```\n\n---\n\n## Example 6\n\n**Input Text:**\n```\nEXAMINATION:\nMRI brain without contrast\n\nCLINICAL HISTORY:\nHeadaches\n\nFINDINGS:\nThe brain parenchyma demonstrates normal signal intensity. No mass lesions are identified.\n\nThe ventricular system is normal in size and configuration.\n\nNo abnormal enhancement is seen.\n\nIMPRESSION:\nNormal brain MRI.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION:\\nMRI brain without contrast\\n\\nCLINICAL HISTORY:\\nHeadaches\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The brain parenchyma demonstrates normal signal intensity.\",\n \"attributes\": {\n \"section\": \"Brain Parenchyma\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No mass lesions are identified.\",\n \"attributes\": {\n \"section\": \"Brain Parenchyma\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The ventricular system is normal in size and configuration.\",\n \"attributes\": {\n \"section\": \"Ventricular System\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No abnormal enhancement is seen.\",\n \"attributes\": {\n \"section\": \"Enhancement\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal brain MRI.\"\n }\n ]\n}\n```\n\n---\n\n## Example 7\n\n**Input Text:**\n```\nINDICATION:\nRight knee pain\n\nMRI RIGHT KNEE:\n\nFINDINGS:\nMENISCI: There is a complex tear of the medial meniscus. The lateral meniscus appears intact.\n\nLIGAMENTS: The ACL shows complete rupture. The PCL, MCL, and LCL are intact.\n\nBONES: Mild bone marrow edema is present in the medial femoral condyle.\n\nIMPRESSION:\n1. Complex medial meniscal tear\n2. Complete ACL rupture\n3. Bone marrow edema in medial femoral condyle\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"INDICATION:\\nRight knee pain\\n\\nMRI RIGHT KNEE:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a complex tear of the medial meniscus.\",\n \"attributes\": {\n \"section\": \"Menisci\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lateral meniscus appears intact.\",\n \"attributes\": {\n \"section\": \"Menisci\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The ACL shows complete rupture.\",\n \"attributes\": {\n \"section\": \"Ligaments\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The PCL, MCL, and LCL are intact.\",\n \"attributes\": {\n \"section\": \"Ligaments\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Mild bone marrow edema is present in the medial femoral condyle.\",\n \"attributes\": {\n \"section\": \"Bones\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Complex medial meniscal tear\\n2. Complete ACL rupture\\n3. Bone marrow edema in medial femoral condyle\"\n }\n ]\n}\n```\n\n---\n\n## Example 8\n\n**Input Text:**\n```\nEXAMINATION: CT CHEST\n\nFINDINGS:\nThe longs are clear bilaterally. The hart size is normal. No pleural effushion.\n\nIMPRESSION:\nNormal chest CT.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION: CT CHEST\",\n \"attributes\": {\n \"section\": \"Examination\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lungs are clear bilaterally.\",\n \"attributes\": {\n \"section\": \"Lungs\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The heart size is normal.\",\n \"attributes\": {\n \"section\": \"Heart\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No pleural effusion.\",\n \"attributes\": {\n \"section\": \"Pleura\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal chest CT.\"\n }\n ]\n}\n```\n\n\n\n## Inference Example:\n\n**Input Text:**\n```\nEXAMINATION: CT angiography of the chest for pulmonary embolism\nCLINICAL INDICATION: Shortness of breath, chest pain, elevated D-dimer, rule out pulmonary embolism\nCOMPARISON: Chest X-ray from 2 days ago\nTECHNIQUE: Axial CT images of the chest were obtained following rapid intravenous administration of iodinated contrast material. Images were reconstructed in axial, coronal, and sagittal planes with MIP and VRT reformations.\n\nFINDINGS:\nThere are multiple filling defects consistent with acute pulmonary emboli involving the right main pulmonary artery extending into the right upper and middle lobe segmental branches. Additional smaller emboli are present in the left lower lobe subsegmental arteries. The main pulmonary artery is mildly dilated, measuring 3.2 cm in diameter. There is mild right heart strain with flattening of the interventricular septum and enlargement of the right ventricle. No evidence of right heart failure or pericardial effusion.\n\nThe lungs show mild bilateral lower lobe atelectasis and small bilateral pleural effusions. No consolidation or pneumothorax is identified. The mediastinal and hilar lymph nodes are not enlarged. The aorta and great vessels appear normal. The visualized portions of the upper abdomen are unremarkable. No acute bony abnormalities are identified.\n\nIMPRESSION:\n1. Acute pulmonary emboli involving the right main, upper and middle lobe segmental arteries, and left lower lobe subsegmental arteries.\n2. Mild pulmonary hypertension with right heart strain.\n3. Small bilateral pleural effusions and bilateral lower lobe atelectasis.\n```\n\n**Expected Output:**\n" + }, + "sample_abdominal_ultrasound": { + "segments": [ + { + "type": "prefix", + "label": "Examination", + "content": "EXAMINATION: Ultrasound of the abdomen", + "intervals": [ + { + "startPos": 0, + "endPos": 38 + } + ], + "significance": null + }, + { + "type": "prefix", + "label": "Clinical Indication", + "content": "CLINICAL INDICATION: Right upper quadrant pain, abnormal liver function tests", + "intervals": [ + { + "startPos": 39, + "endPos": 116 + } + ], + "significance": null + }, + { + "type": "prefix", + "label": "Comparison", + "content": "COMPARISON: None available", + "intervals": [ + { + "startPos": 117, + "endPos": 143 + } + ], + "significance": null + }, + { + "type": "prefix", + "label": "Technique", + "content": "TECHNIQUE: Real-time ultrasound examination of the abdomen was performed using a curved array transducer. Multiple images were obtained in sagittal, transverse, and oblique planes.", + "intervals": [ + { + "startPos": 144, + "endPos": 324 + } + ], + "significance": null + }, + { + "type": "body", + "label": "Liver", + "content": "The liver is normal in size measuring 15.2 cm in the midclavicular line.", + "intervals": [ + { + "startPos": 336, + "endPos": 408 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Liver", + "content": "The hepatic parenchyma demonstrates increased echogenicity consistent with fatty infiltration.", + "intervals": [ + { + "startPos": 409, + "endPos": 503 + } + ], + "significance": "minor" + }, + { + "type": "body", + "label": "Liver", + "content": "There is a well-defined hyperechoic lesion in the right hepatic lobe measuring 2.1 x 1.8 cm, consistent with a hemangioma.", + "intervals": [ + { + "startPos": 504, + "endPos": 626 + } + ], + "significance": "minor" + }, + { + "type": "body", + "label": "Liver", + "content": "No focal hepatic masses or intrahepatic biliary dilatation is identified.", + "intervals": [ + { + "startPos": 627, + "endPos": 700 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Liver", + "content": "Portal vein flow is normal on Doppler evaluation.", + "intervals": [ + { + "startPos": 701, + "endPos": 750 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Gallbladder", + "content": "The gallbladder is distended and contains multiple echogenic foci with posterior acoustic shadowing, consistent with cholelithiasis. The largest stone measures approximately 1.5 cm.", + "intervals": [ + { + "startPos": 751, + "endPos": 932 + } + ], + "significance": "minor" + }, + { + "type": "body", + "label": "Gallbladder", + "content": "The gallbladder wall measures 2 mm in thickness, which is within normal limits.", + "intervals": [ + { + "startPos": 933, + "endPos": 1012 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Gallbladder", + "content": "No pericholecystic fluid is identified.", + "intervals": [ + { + "startPos": 1013, + "endPos": 1052 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Biliary", + "content": "Common bile duct measures 4 mm, which is normal.", + "intervals": [ + { + "startPos": 1053, + "endPos": 1101 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Pancreas", + "content": "The visualized portions of the pancreatic head and body appear normal in echogenicity and size. The pancreatic duct is not dilated.", + "intervals": [ + { + "startPos": 1102, + "endPos": 1233 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Kidneys", + "content": "The right kidney measures 10.8 cm and the left kidney measures 11.1 cm. Both kidneys demonstrate normal cortical echogenicity and corticomedullary differentiation. No hydronephrosis, stones, or masses are identified.", + "intervals": [ + { + "startPos": 1234, + "endPos": 1450 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Spleen", + "content": "The spleen is normal in size and echogenicity, measuring 10.2 cm in length.", + "intervals": [ + { + "startPos": 1451, + "endPos": 1526 + } + ], + "significance": "normal" + }, + { + "type": "suffix", + "label": "suffix", + "content": "1. Cholelithiasis without evidence of acute cholecystitis.\n2. Hepatic steatosis (fatty liver).\n3. 2.1 cm hepatic hemangioma in the right lobe.\n4. Normal kidneys, spleen, and visualized pancreas.", + "intervals": [ + { + "startPos": 1540, + "endPos": 1734 + } + ], + "significance": null + } + ], + "annotated_document_json": { + "extractions": [ + { + "extraction_text": "EXAMINATION: Ultrasound of the abdomen", + "extraction_class": "findings_prefix", + "attributes": { + "section": "Examination" + }, + "char_interval": { + "start_pos": 0, + "end_pos": 38 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "CLINICAL INDICATION: Right upper quadrant pain, abnormal liver function tests", + "extraction_class": "findings_prefix", + "attributes": { + "section": "Clinical Indication" + }, + "char_interval": { + "start_pos": 39, + "end_pos": 116 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "COMPARISON: None available", + "extraction_class": "findings_prefix", + "attributes": { + "section": "Comparison" + }, + "char_interval": { + "start_pos": 117, + "end_pos": 143 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "TECHNIQUE: Real-time ultrasound examination of the abdomen was performed using a curved array transducer. Multiple images were obtained in sagittal, transverse, and oblique planes.", + "extraction_class": "findings_prefix", + "attributes": { + "section": "Technique" + }, + "char_interval": { + "start_pos": 144, + "end_pos": 324 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The liver is normal in size measuring 15.2 cm in the midclavicular line.", + "extraction_class": "findings_body", + "attributes": { + "section": "Liver", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 336, + "end_pos": 408 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The hepatic parenchyma demonstrates increased echogenicity consistent with fatty infiltration.", + "extraction_class": "findings_body", + "attributes": { + "section": "Liver", + "clinical_significance": "minor" + }, + "char_interval": { + "start_pos": 409, + "end_pos": 503 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "There is a well-defined hyperechoic lesion in the right hepatic lobe measuring 2.1 x 1.8 cm, consistent with a hemangioma.", + "extraction_class": "findings_body", + "attributes": { + "section": "Liver", + "clinical_significance": "minor" + }, + "char_interval": { + "start_pos": 504, + "end_pos": 626 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "No focal hepatic masses or intrahepatic biliary dilatation is identified.", + "extraction_class": "findings_body", + "attributes": { + "section": "Liver", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 627, + "end_pos": 700 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "Portal vein flow is normal on Doppler evaluation.", + "extraction_class": "findings_body", + "attributes": { + "section": "Liver", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 701, + "end_pos": 750 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The gallbladder is distended and contains multiple echogenic foci with posterior acoustic shadowing, consistent with cholelithiasis. The largest stone measures approximately 1.5 cm.", + "extraction_class": "findings_body", + "attributes": { + "section": "Gallbladder", + "clinical_significance": "minor" + }, + "char_interval": { + "start_pos": 751, + "end_pos": 932 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The gallbladder wall measures 2 mm in thickness, which is within normal limits.", + "extraction_class": "findings_body", + "attributes": { + "section": "Gallbladder", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 933, + "end_pos": 1012 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "No pericholecystic fluid is identified.", + "extraction_class": "findings_body", + "attributes": { + "section": "Gallbladder", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 1013, + "end_pos": 1052 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "Common bile duct measures 4 mm, which is normal.", + "extraction_class": "findings_body", + "attributes": { + "section": "Biliary", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 1053, + "end_pos": 1101 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The visualized portions of the pancreatic head and body appear normal in echogenicity and size. The pancreatic duct is not dilated.", + "extraction_class": "findings_body", + "attributes": { + "section": "Pancreas", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 1102, + "end_pos": 1233 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The right kidney measures 10.8 cm and the left kidney measures 11.1 cm. Both kidneys demonstrate normal cortical echogenicity and corticomedullary differentiation. No hydronephrosis, stones, or masses are identified.", + "extraction_class": "findings_body", + "attributes": { + "section": "Kidneys", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 1234, + "end_pos": 1450 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The spleen is normal in size and echogenicity, measuring 10.2 cm in length.", + "extraction_class": "findings_body", + "attributes": { + "section": "Spleen", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 1451, + "end_pos": 1526 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "1. Cholelithiasis without evidence of acute cholecystitis.\n2. Hepatic steatosis (fatty liver).\n3. 2.1 cm hepatic hemangioma in the right lobe.\n4. Normal kidneys, spleen, and visualized pancreas.", + "extraction_class": "findings_suffix", + "attributes": {}, + "char_interval": { + "start_pos": 1540, + "end_pos": 1734 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + } + ] + }, + "text": "EXAMINATION:\n\nUltrasound of the abdomen\n\nCLINICAL INDICATION: Right upper quadrant pain, abnormal liver function tests\n\nCOMPARISON: None available\n\nTECHNIQUE: Real-time ultrasound examination of the abdomen was performed using a curved array transducer. Multiple images were obtained in sagittal, transverse, and oblique planes.\n\n\nFINDINGS:\n\nLiver: The liver is normal in size measuring 15.2 cm in the midclavicular line. The hepatic parenchyma demonstrates increased echogenicity consistent with fatty infiltration. There is a well-defined hyperechoic lesion in the right hepatic lobe measuring 2.1 x 1.8 cm, consistent with a hemangioma. No focal hepatic masses or intrahepatic biliary dilatation is identified. Portal vein flow is normal on Doppler evaluation.\n\nGallbladder: The gallbladder is distended and contains multiple echogenic foci with posterior acoustic shadowing, consistent with cholelithiasis. The largest stone measures approximately 1.5 cm. The gallbladder wall measures 2 mm in thickness, which is within normal limits. No pericholecystic fluid is identified.\n\nBiliary: Common bile duct measures 4 mm, which is normal.\n\nPancreas: The visualized portions of the pancreatic head and body appear normal in echogenicity and size. The pancreatic duct is not dilated.\n\nKidneys: The right kidney measures 10.8 cm and the left kidney measures 11.1 cm. Both kidneys demonstrate normal cortical echogenicity and corticomedullary differentiation. No hydronephrosis, stones, or masses are identified.\n\nSpleen: The spleen is normal in size and echogenicity, measuring 10.2 cm in length.\n\nIMPRESSION:\n\n1. Cholelithiasis without evidence of acute cholecystitis.\n2. Hepatic steatosis (fatty liver).\n3. 2.1 cm hepatic hemangioma in the right lobe.\n4. Normal kidneys, spleen, and visualized pancreas.", + "raw_prompt": "# RadExtract Prompt\n\n## Task Description\n\nYou are a medical assistant specialized in categorizing radiology text into sections:\n\n- **findings_prefix** -- All text that appears before the actual \"findings\" content.\n- **findings_body** -- The main 'Findings' section. Each finding is classified into a possible section through a list of attributes, some of which may also be assigned to a subheader.\n- **findings_suffix** -- Any text that appears after the \"findings\" portion (such as \"Impression\" or other concluding content).\n\n### Section Categories:\n- **findings_prefix**: Use only for header information before clinical findings (examination details, clinical indication, technique). Never use for actual clinical observations or pathological findings.\n- **findings_body**: Use for all clinical findings, observations, and pathological descriptions.\n- **findings_suffix**: Use only for conclusions, impressions, or recommendations that appear after the main findings.\n\n### Critical Rule:\nIf a report contains only clinical findings without any header information, do not create a findings_prefix extraction. Start directly with findings_body extractions for the clinical content.\n\n**Example of findings-only content (NO prefix needed):**\nInput: \"There is a small joint effusion. The cartilage shows thinning.\"\nCorrect: Create only findings_body extractions for each clinical finding.\nIncorrect: Do not categorize clinical findings as findings_prefix.\n\n### Professional Output Standards:\nAll extracted text must maintain the grammatical correctness and professional coherence expected in radiology reports. Ensure that:\n- All sentences are complete and grammatically correct\n- Medical terminology is used appropriately and consistently\n- The language remains professional and clinical in tone\n- Correct obvious typos (e.g., \"splen\" → \"spleen\", \"kidny\" → \"kidney\")\n- Any modifications to the original text preserve the intended medical meaning\n- Minor typos are corrected and optimal punctuation is used\n\n### Empty prefix or suffix sections:\nOnly create extractions for sections that actually exist in the text. Do not create empty prefix or suffix sections if there is no corresponding content in the source text. If the text is findings-only without any impression/conclusion, do not create a findings_suffix extraction.\n\n### Section Usage Guidelines:\n\n**findings_prefix**: Reserved exclusively for header information that appears before clinical findings, such as:\n- Examination details (type of study, technique)\n- Clinical indication or history\n- Comparison studies referenced\n- Technical parameters\n\n**findings_body**: Contains the actual clinical findings and observations from the imaging study.\n\n**findings_suffix**: Reserved for concluding content that follows the findings, such as impressions or recommendations.\n\n**Critical Rule**: Clinical findings should never be categorized as prefix content. If a report begins directly with clinical observations without any header information, create only findings_body and findings_suffix extractions as appropriate.\n\n### Special guidance for findings_prefix organization:\nWhen the report has detailed prefix information with clear section headers (like EXAMINATION, CLINICAL INDICATION, COMPARISON, TECHNIQUE), create separate extractions for each section rather than one large block. Use the \"section\" attribute to label each part:\n- \"Examination\" for exam type/title\n- \"Clinical Indication\" for clinical history/reason for study \n- \"Comparison\" for prior studies referenced\n- \"Technique\" for imaging parameters and acquisition details\n\n**Important:** Even when examination information appears at the beginning without an explicit \"EXAMINATION:\" header, it should still be labeled with section:\"Examination\". This includes standalone exam descriptions that identify the type of imaging study being performed.\n\nAlways recognize examination-type content and use section:\"Examination\" regardless of whether it has an explicit header.\n\nThis structured approach provides better organization and readability.\n\n### Critical for findings_suffix:\nDo NOT include headers like \"IMPRESSION:\", \"CONCLUSION:\", etc. in the extraction_text. Only extract the actual content that follows these headers. The formatting system will add appropriate headers automatically. \n\n**Example:** If the text contains \"IMPRESSION: 1. Severe arthritis. 2. Labral tear.\", extract only \"1. Severe arthritis. 2. Labral tear.\" as the extraction_text.\n\n### Additional Notes for findings_body:\n- If a single sentence references multiple structures with a shared status (e.g., \"liver, gallbladder, spleen appear unremarkable\"), please split them into separate extraction lines, each referencing the relevant structure.\n- If the text mentions subheaders like \"CT ABDOMEN\" or \"CERVICAL SPINE,\" only create/retain that subheader if it clearly organizes multiple organ-structure findings under it. Do not force subheaders if only 1 or 2 lines belong there. A subheader should ideally group 3+ sections to be meaningful.\n\n### Special guidance for spine reports:\n- For spine imaging (MRI, CT), organize findings by anatomical level using the format: \"Lumbar Spine Levels: L1-L2\", \"Lumbar Spine Levels: L2-L3\", \"Cervical Spine Levels: C5-C6\", etc.\n- Separate general spine findings (alignment, lordosis, vertebral heights) from level-specific findings\n- Use dedicated sections for: \"Spinal Cord\", \"Bones\" (for marrow/vertebral body lesions), \"Paraspinal Soft Tissues\" (for muscle findings)\n- Each spinal level should get its own section when findings are described level-by-level\n- This level-by-level organization is preferred over generic \"Spine\" labeling for clinical utility\n\n### Non-spine skeletal findings:\nFor non-spine skeletal findings, unify them under a single section like \"Bones.\" Only keep laterality (Right/Left) if there is symmetry in the findings.\n\n## Required JSON Format\n\nEach final answer must be valid JSON with an array key \"extractions\". Each \"extraction\" is an object with:\n\n```json\n{\n \"text\": \"...\",\n \"category\": \"findings_prefix\" | \"findings_body\" | \"findings_suffix\",\n \"attributes\": {}\n}\n```\n\nWithin \"attributes\" each attribute should be a key-value pair as shown in the examples below. The attribute **\"clinical_significance\"** MUST be included for findings_body extractions and should be one of: **\"normal\"**, **\"minor\"**, **\"significant\"**, or **\"not_applicable\"** to indicate the importance of the finding.\n\n---\n\n# Few-Shot Examples\n\nThe following examples demonstrate how to properly structure different types of radiology reports:\n\n## Example 1\n\n**Input Text:**\n```\nEXAMINATION: CT ABDOMEN AND PELVIS WITH IV CONTRAST\nCLINICAL INDICATION: Abdominal pain.\nCOMPARISON: None.\nTECHNIQUE: Axial images of the abdomen and pelvis were obtained following the administration of intravenous contrast material. Coronal and sagittal reformations were reviewed.\n\nFINDINGS:\nNo acute abnormality is seen in the visualized lung bases. The liver is normal in size and contour. There is a 1.2 cm simple-appearing low-attenuation lesion in hepatic segment VII, consistent with a cyst. The gallbladder contains numerous calcified gallstones, compatible with cholelithiasis.\n\nIMPRESSION:\n1. Cholelithiasis without evidence of acute cholecystitis.\n2. Hepatic cyst.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION: CT ABDOMEN AND PELVIS WITH IV CONTRAST\",\n \"attributes\": {\n \"section\": \"Examination\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"CLINICAL INDICATION: Abdominal pain.\",\n \"attributes\": {\n \"section\": \"Clinical Indication\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"COMPARISON: None.\",\n \"attributes\": {\n \"section\": \"Comparison\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"TECHNIQUE: Axial images of the abdomen and pelvis were obtained following the administration of intravenous contrast material. Coronal and sagittal reformations were reviewed.\",\n \"attributes\": {\n \"section\": \"Technique\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No acute abnormality is seen in the visualized lung bases.\",\n \"attributes\": {\n \"section\": \"Lungs\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The liver is normal in size and contour.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a 1.2 cm simple-appearing low-attenuation lesion in hepatic segment VII, consistent with a cyst.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The gallbladder contains numerous calcified gallstones, compatible with cholelithiasis.\",\n \"attributes\": {\n \"section\": \"Gallbladder\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Cholelithiasis without evidence of acute cholecystitis.\\n2. Hepatic cyst.\"\n }\n ]\n}\n```\n\n---\n\n## Example 2\n\n**Input Text:**\n```\nCLINICAL HISTORY:\nLow back pain, rule out disc herniation\n\nMRI LUMBAR SPINE WITHOUT CONTRAST:\n\nFINDINGS:\nThe lumbar lordosis is maintained. Vertebral body heights are preserved.\n\nThere is a small hemangioma in the L3 vertebral body.\n\nThe conus medullaris terminates at L1 and appears normal.\n\nAt L2-L3, there is mild disc desiccation without significant stenosis.\n\nAt L3-L4, a small posterior disc bulge causes mild central canal narrowing.\n\nAt L4-L5, there is a large posterior disc herniation with severe central canal stenosis and nerve root impingement.\n\nAt L5-S1, mild disc bulge without significant stenosis.\n\nThe paraspinal musculature appears unremarkable.\n\nIMPRESSION:\nLarge L4-L5 disc herniation with severe stenosis.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"CLINICAL HISTORY:\\nLow back pain, rule out disc herniation\\n\\nMRI LUMBAR SPINE WITHOUT CONTRAST:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lumbar lordosis is maintained. Vertebral body heights are preserved.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a small hemangioma in the L3 vertebral body.\",\n \"attributes\": {\n \"section\": \"Bones\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The conus medullaris terminates at L1 and appears normal.\",\n \"attributes\": {\n \"section\": \"Spinal Cord\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L2-L3, there is mild disc desiccation without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L2-L3\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L3-L4, a small posterior disc bulge causes mild central canal narrowing.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L3-L4\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L4-L5, there is a large posterior disc herniation with severe central canal stenosis and nerve root impingement.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L4-L5\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L5-S1, mild disc bulge without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L5-S1\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The paraspinal musculature appears unremarkable.\",\n \"attributes\": {\n \"section\": \"Paraspinal Soft Tissues\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Large L4-L5 disc herniation with severe stenosis.\"\n }\n ]\n}\n```\n\n---\n\n## Example 3\n\n**Input Text:**\n```\nINDICATION: \nNeck pain, radiculopathy\n\nMRI CERVICAL SPINE:\n\nFINDINGS:\nNormal cervical lordosis is maintained. No vertebral body compression fractures.\n\nThe cervical spinal cord demonstrates normal signal intensity.\n\nAt C3-C4, no significant disc disease or stenosis.\n\nAt C4-C5, mild disc osteophyte complex with mild foraminal narrowing.\n\nAt C5-C6, moderate disc herniation with moderate central canal stenosis.\n\nAt C6-C7, small disc bulge without significant stenosis.\n\nIMPRESSION:\nModerate C5-C6 disc herniation and stenosis.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"INDICATION: \\nNeck pain, radiculopathy\\n\\nMRI CERVICAL SPINE:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Normal cervical lordosis is maintained. No vertebral body compression fractures.\",\n \"attributes\": {\n \"section\": \"Cervical Spine\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The cervical spinal cord demonstrates normal signal intensity.\",\n \"attributes\": {\n \"section\": \"Spinal Cord\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C3-C4, no significant disc disease or stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C3-C4\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C4-C5, mild disc osteophyte complex with mild foraminal narrowing.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C4-C5\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C5-C6, moderate disc herniation with moderate central canal stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C5-C6\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C6-C7, small disc bulge without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C6-C7\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Moderate C5-C6 disc herniation and stenosis.\"\n }\n ]\n}\n```\n\n---\n\n## Example 4\n\n**Input Text:**\n```\nTECHNIQUE: \nMultidetector helical CT from lung bases to adrenals with and without intravenous contrast.\n\nFINDINGS:\nLIVER/GALLBLADDER/SPLEEN: The liver has a normal appearance. Gallbladder wall appears normal. The spleen is normal in size.\n\nPANCREAS/ADRENALS: The pancreas and bilateral adrenal glands appear unremarkable.\n\nRETROPERITONEUM: No lymphadenopathy. No fluid collection.\n\nIMPRESSION:\nNormal abdominal CT.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"TECHNIQUE: \\nMultidetector helical CT from lung bases to adrenals with and without intravenous contrast.\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The liver has a normal appearance.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Gallbladder wall appears normal.\",\n \"attributes\": {\n \"section\": \"Gallbladder\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The spleen is normal in size.\",\n \"attributes\": {\n \"section\": \"Spleen\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The pancreas and bilateral adrenal glands appear unremarkable.\",\n \"attributes\": {\n \"section\": \"Pancreas/Adrenals\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No lymphadenopathy.\",\n \"attributes\": {\n \"section\": \"Retroperitoneum\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No fluid collection.\",\n \"attributes\": {\n \"section\": \"Retroperitoneum\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal abdominal CT.\"\n }\n ]\n}\n```\n\n---\n\n## Example 5\n\n**Input Text:**\n```\nHISTORY: \nLower abdominal pain\n\nCT ABDOMEN/PELVIS WITH CONTRAST:\n\nFINDINGS:\nLIVER: Multiple hepatic metastases are present, measuring up to 3.2 cm.\n\nKIDNEYS: The left kidney shows moderate hydronephrosis. The right kidney appears normal.\n\nLYMPH NODES: Enlarged retroperitoneal lymph nodes, largest measuring 2.1 cm.\n\nIMPRESSION:\n1. Multiple hepatic metastases\n2. Left hydronephrosis \n3. Retroperitoneal lymphadenopathy\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"HISTORY: \\nLower abdominal pain\\n\\nCT ABDOMEN/PELVIS WITH CONTRAST:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Multiple hepatic metastases are present, measuring up to 3.2 cm.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The left kidney shows moderate hydronephrosis.\",\n \"attributes\": {\n \"section\": \"Kidneys\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The right kidney appears normal.\",\n \"attributes\": {\n \"section\": \"Kidneys\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Enlarged retroperitoneal lymph nodes, largest measuring 2.1 cm.\",\n \"attributes\": {\n \"section\": \"Lymph Nodes\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Multiple hepatic metastases\\n2. Left hydronephrosis \\n3. Retroperitoneal lymphadenopathy\"\n }\n ]\n}\n```\n\n---\n\n## Example 6\n\n**Input Text:**\n```\nEXAMINATION:\nMRI brain without contrast\n\nCLINICAL HISTORY:\nHeadaches\n\nFINDINGS:\nThe brain parenchyma demonstrates normal signal intensity. No mass lesions are identified.\n\nThe ventricular system is normal in size and configuration.\n\nNo abnormal enhancement is seen.\n\nIMPRESSION:\nNormal brain MRI.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION:\\nMRI brain without contrast\\n\\nCLINICAL HISTORY:\\nHeadaches\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The brain parenchyma demonstrates normal signal intensity.\",\n \"attributes\": {\n \"section\": \"Brain Parenchyma\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No mass lesions are identified.\",\n \"attributes\": {\n \"section\": \"Brain Parenchyma\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The ventricular system is normal in size and configuration.\",\n \"attributes\": {\n \"section\": \"Ventricular System\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No abnormal enhancement is seen.\",\n \"attributes\": {\n \"section\": \"Enhancement\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal brain MRI.\"\n }\n ]\n}\n```\n\n---\n\n## Example 7\n\n**Input Text:**\n```\nINDICATION:\nRight knee pain\n\nMRI RIGHT KNEE:\n\nFINDINGS:\nMENISCI: There is a complex tear of the medial meniscus. The lateral meniscus appears intact.\n\nLIGAMENTS: The ACL shows complete rupture. The PCL, MCL, and LCL are intact.\n\nBONES: Mild bone marrow edema is present in the medial femoral condyle.\n\nIMPRESSION:\n1. Complex medial meniscal tear\n2. Complete ACL rupture\n3. Bone marrow edema in medial femoral condyle\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"INDICATION:\\nRight knee pain\\n\\nMRI RIGHT KNEE:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a complex tear of the medial meniscus.\",\n \"attributes\": {\n \"section\": \"Menisci\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lateral meniscus appears intact.\",\n \"attributes\": {\n \"section\": \"Menisci\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The ACL shows complete rupture.\",\n \"attributes\": {\n \"section\": \"Ligaments\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The PCL, MCL, and LCL are intact.\",\n \"attributes\": {\n \"section\": \"Ligaments\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Mild bone marrow edema is present in the medial femoral condyle.\",\n \"attributes\": {\n \"section\": \"Bones\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Complex medial meniscal tear\\n2. Complete ACL rupture\\n3. Bone marrow edema in medial femoral condyle\"\n }\n ]\n}\n```\n\n---\n\n## Example 8\n\n**Input Text:**\n```\nEXAMINATION: CT CHEST\n\nFINDINGS:\nThe longs are clear bilaterally. The hart size is normal. No pleural effushion.\n\nIMPRESSION:\nNormal chest CT.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION: CT CHEST\",\n \"attributes\": {\n \"section\": \"Examination\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lungs are clear bilaterally.\",\n \"attributes\": {\n \"section\": \"Lungs\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The heart size is normal.\",\n \"attributes\": {\n \"section\": \"Heart\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No pleural effusion.\",\n \"attributes\": {\n \"section\": \"Pleura\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal chest CT.\"\n }\n ]\n}\n```\n\n\n\n## Inference Example:\n\n**Input Text:**\n```\nEXAMINATION: Ultrasound of the abdomen\nCLINICAL INDICATION: Right upper quadrant pain, abnormal liver function tests\nCOMPARISON: None available\nTECHNIQUE: Real-time ultrasound examination of the abdomen was performed using a curved array transducer. Multiple images were obtained in sagittal, transverse, and oblique planes.\n\nFINDINGS:\nThe liver is normal in size measuring 15.2 cm in the midclavicular line. The hepatic parenchyma demonstrates increased echogenicity consistent with fatty infiltration. There is a well-defined hyperechoic lesion in the right hepatic lobe measuring 2.1 x 1.8 cm, consistent with a hemangioma. No focal hepatic masses or intrahepatic biliary dilatation is identified. Portal vein flow is normal on Doppler evaluation. The gallbladder is distended and contains multiple echogenic foci with posterior acoustic shadowing, consistent with cholelithiasis. The largest stone measures approximately 1.5 cm. The gallbladder wall measures 2 mm in thickness, which is within normal limits. No pericholecystic fluid is identified. Common bile duct measures 4 mm, which is normal. The visualized portions of the pancreatic head and body appear normal in echogenicity and size. The pancreatic duct is not dilated. The right kidney measures 10.8 cm and the left kidney measures 11.1 cm. Both kidneys demonstrate normal cortical echogenicity and corticomedullary differentiation. No hydronephrosis, stones, or masses are identified. The spleen is normal in size and echogenicity, measuring 10.2 cm in length.\n\nIMPRESSION:\n1. Cholelithiasis without evidence of acute cholecystitis.\n2. Hepatic steatosis (fatty liver).\n3. 2.1 cm hepatic hemangioma in the right lobe.\n4. Normal kidneys, spleen, and visualized pancreas.\n```\n\n**Expected Output:**\n" + }, + "sample_cervical_spine_mri": { + "segments": [ + { + "type": "prefix", + "label": "Examination", + "content": "MRI Cervical Spine:", + "intervals": [ + { + "startPos": 0, + "endPos": 19 + } + ], + "significance": null + }, + { + "type": "prefix", + "label": "Comparison", + "content": "Comparison: MRI cervical spine dated 6 months ago", + "intervals": [ + { + "startPos": 20, + "endPos": 69 + } + ], + "significance": null + }, + { + "type": "body", + "label": "Cervical Spine", + "content": "The cervical lordosis is maintained. Vertebral body heights and alignment are preserved.", + "intervals": [ + { + "startPos": 71, + "endPos": 159 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Spinal Cord", + "content": "The spinal cord demonstrates normal signal intensity throughout its visualized extent.", + "intervals": [ + { + "startPos": 160, + "endPos": 246 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Cervical Spine Levels: C3-C4", + "content": "At C3-C4, there is mild disc desiccation without significant canal narrowing.", + "intervals": [ + { + "startPos": 247, + "endPos": 324 + } + ], + "significance": "minor" + }, + { + "type": "body", + "label": "Cervical Spine Levels: C4-C5", + "content": "At C4-C5, a small posterior disc osteophyte complex results in mild central canal narrowing. The neural foramina remain patent.", + "intervals": [ + { + "startPos": 325, + "endPos": 452 + } + ], + "significance": "minor" + }, + { + "type": "body", + "label": "Cervical Spine Levels: C5-C6", + "content": "At C5-C6, there is moderate disc space narrowing with a broad-based posterior disc bulge and bilateral uncinate spurring, causing mild to moderate bilateral neural foraminal narrowing.", + "intervals": [ + { + "startPos": 453, + "endPos": 637 + } + ], + "significance": "significant" + }, + { + "type": "body", + "label": "Cervical Spine Levels: C6-C7", + "content": "At C6-C7, mild disc desiccation is present without significant stenosis.", + "intervals": [ + { + "startPos": 638, + "endPos": 710 + } + ], + "significance": "minor" + }, + { + "type": "body", + "label": "Paraspinal Soft Tissues", + "content": "The prevertebral soft tissues are unremarkable.", + "intervals": [ + { + "startPos": 711, + "endPos": 758 + } + ], + "significance": "normal" + }, + { + "type": "suffix", + "label": "suffix", + "content": "1. Multilevel cervical spondylosis, most pronounced at C5-C6.\n2. Mild to moderate bilateral C5-C6 neural foraminal narrowing.\n3. No spinal cord compression or significant central canal stenosis.", + "intervals": [ + { + "startPos": 772, + "endPos": 966 + } + ], + "significance": null + } + ], + "annotated_document_json": { + "extractions": [ + { + "extraction_text": "MRI Cervical Spine:", + "extraction_class": "findings_prefix", + "attributes": { + "section": "Examination" + }, + "char_interval": { + "start_pos": 0, + "end_pos": 19 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "Comparison: MRI cervical spine dated 6 months ago", + "extraction_class": "findings_prefix", + "attributes": { + "section": "Comparison" + }, + "char_interval": { + "start_pos": 20, + "end_pos": 69 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The cervical lordosis is maintained. Vertebral body heights and alignment are preserved.", + "extraction_class": "findings_body", + "attributes": { + "section": "Cervical Spine", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 71, + "end_pos": 159 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The spinal cord demonstrates normal signal intensity throughout its visualized extent.", + "extraction_class": "findings_body", + "attributes": { + "section": "Spinal Cord", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 160, + "end_pos": 246 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "At C3-C4, there is mild disc desiccation without significant canal narrowing.", + "extraction_class": "findings_body", + "attributes": { + "section": "Cervical Spine Levels: C3-C4", + "clinical_significance": "minor" + }, + "char_interval": { + "start_pos": 247, + "end_pos": 324 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "At C4-C5, a small posterior disc osteophyte complex results in mild central canal narrowing. The neural foramina remain patent.", + "extraction_class": "findings_body", + "attributes": { + "section": "Cervical Spine Levels: C4-C5", + "clinical_significance": "minor" + }, + "char_interval": { + "start_pos": 325, + "end_pos": 452 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "At C5-C6, there is moderate disc space narrowing with a broad-based posterior disc bulge and bilateral uncinate spurring, causing mild to moderate bilateral neural foraminal narrowing.", + "extraction_class": "findings_body", + "attributes": { + "section": "Cervical Spine Levels: C5-C6", + "clinical_significance": "significant" + }, + "char_interval": { + "start_pos": 453, + "end_pos": 637 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "At C6-C7, mild disc desiccation is present without significant stenosis.", + "extraction_class": "findings_body", + "attributes": { + "section": "Cervical Spine Levels: C6-C7", + "clinical_significance": "minor" + }, + "char_interval": { + "start_pos": 638, + "end_pos": 710 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "The prevertebral soft tissues are unremarkable.", + "extraction_class": "findings_body", + "attributes": { + "section": "Paraspinal Soft Tissues", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 711, + "end_pos": 758 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "1. Multilevel cervical spondylosis, most pronounced at C5-C6.\n2. Mild to moderate bilateral C5-C6 neural foraminal narrowing.\n3. No spinal cord compression or significant central canal stenosis.", + "extraction_class": "findings_suffix", + "attributes": {}, + "char_interval": { + "start_pos": 772, + "end_pos": 966 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + } + ] + }, + "text": "EXAMINATION:\n\nMRI Cervical Spine:\n\nComparison: MRI cervical spine dated 6 months ago\n\n\nFINDINGS:\n\nCervical Spine: The cervical lordosis is maintained. Vertebral body heights and alignment are preserved.\n\nSpinal Cord: The spinal cord demonstrates normal signal intensity throughout its visualized extent.\n\nCervical Spine Levels: C3-C4: At C3-C4, there is mild disc desiccation without significant canal narrowing.\n\nCervical Spine Levels: C4-C5: At C4-C5, a small posterior disc osteophyte complex results in mild central canal narrowing. The neural foramina remain patent.\n\nCervical Spine Levels: C5-C6: At C5-C6, there is moderate disc space narrowing with a broad-based posterior disc bulge and bilateral uncinate spurring, causing mild to moderate bilateral neural foraminal narrowing.\n\nCervical Spine Levels: C6-C7: At C6-C7, mild disc desiccation is present without significant stenosis.\n\nParaspinal Soft Tissues: The prevertebral soft tissues are unremarkable.\n\nIMPRESSION:\n\n1. Multilevel cervical spondylosis, most pronounced at C5-C6.\n2. Mild to moderate bilateral C5-C6 neural foraminal narrowing.\n3. No spinal cord compression or significant central canal stenosis.", + "raw_prompt": "# RadExtract Prompt\n\n## Task Description\n\nYou are a medical assistant specialized in categorizing radiology text into sections:\n\n- **findings_prefix** -- All text that appears before the actual \"findings\" content.\n- **findings_body** -- The main 'Findings' section. Each finding is classified into a possible section through a list of attributes, some of which may also be assigned to a subheader.\n- **findings_suffix** -- Any text that appears after the \"findings\" portion (such as \"Impression\" or other concluding content).\n\n### Section Categories:\n- **findings_prefix**: Use only for header information before clinical findings (examination details, clinical indication, technique). Never use for actual clinical observations or pathological findings.\n- **findings_body**: Use for all clinical findings, observations, and pathological descriptions.\n- **findings_suffix**: Use only for conclusions, impressions, or recommendations that appear after the main findings.\n\n### Critical Rule:\nIf a report contains only clinical findings without any header information, do not create a findings_prefix extraction. Start directly with findings_body extractions for the clinical content.\n\n**Example of findings-only content (NO prefix needed):**\nInput: \"There is a small joint effusion. The cartilage shows thinning.\"\nCorrect: Create only findings_body extractions for each clinical finding.\nIncorrect: Do not categorize clinical findings as findings_prefix.\n\n### Professional Output Standards:\nAll extracted text must maintain the grammatical correctness and professional coherence expected in radiology reports. Ensure that:\n- All sentences are complete and grammatically correct\n- Medical terminology is used appropriately and consistently\n- The language remains professional and clinical in tone\n- Correct obvious typos (e.g., \"splen\" → \"spleen\", \"kidny\" → \"kidney\")\n- Any modifications to the original text preserve the intended medical meaning\n- Minor typos are corrected and optimal punctuation is used\n\n### Empty prefix or suffix sections:\nOnly create extractions for sections that actually exist in the text. Do not create empty prefix or suffix sections if there is no corresponding content in the source text. If the text is findings-only without any impression/conclusion, do not create a findings_suffix extraction.\n\n### Section Usage Guidelines:\n\n**findings_prefix**: Reserved exclusively for header information that appears before clinical findings, such as:\n- Examination details (type of study, technique)\n- Clinical indication or history\n- Comparison studies referenced\n- Technical parameters\n\n**findings_body**: Contains the actual clinical findings and observations from the imaging study.\n\n**findings_suffix**: Reserved for concluding content that follows the findings, such as impressions or recommendations.\n\n**Critical Rule**: Clinical findings should never be categorized as prefix content. If a report begins directly with clinical observations without any header information, create only findings_body and findings_suffix extractions as appropriate.\n\n### Special guidance for findings_prefix organization:\nWhen the report has detailed prefix information with clear section headers (like EXAMINATION, CLINICAL INDICATION, COMPARISON, TECHNIQUE), create separate extractions for each section rather than one large block. Use the \"section\" attribute to label each part:\n- \"Examination\" for exam type/title\n- \"Clinical Indication\" for clinical history/reason for study \n- \"Comparison\" for prior studies referenced\n- \"Technique\" for imaging parameters and acquisition details\n\n**Important:** Even when examination information appears at the beginning without an explicit \"EXAMINATION:\" header, it should still be labeled with section:\"Examination\". This includes standalone exam descriptions that identify the type of imaging study being performed.\n\nAlways recognize examination-type content and use section:\"Examination\" regardless of whether it has an explicit header.\n\nThis structured approach provides better organization and readability.\n\n### Critical for findings_suffix:\nDo NOT include headers like \"IMPRESSION:\", \"CONCLUSION:\", etc. in the extraction_text. Only extract the actual content that follows these headers. The formatting system will add appropriate headers automatically. \n\n**Example:** If the text contains \"IMPRESSION: 1. Severe arthritis. 2. Labral tear.\", extract only \"1. Severe arthritis. 2. Labral tear.\" as the extraction_text.\n\n### Additional Notes for findings_body:\n- If a single sentence references multiple structures with a shared status (e.g., \"liver, gallbladder, spleen appear unremarkable\"), please split them into separate extraction lines, each referencing the relevant structure.\n- If the text mentions subheaders like \"CT ABDOMEN\" or \"CERVICAL SPINE,\" only create/retain that subheader if it clearly organizes multiple organ-structure findings under it. Do not force subheaders if only 1 or 2 lines belong there. A subheader should ideally group 3+ sections to be meaningful.\n\n### Special guidance for spine reports:\n- For spine imaging (MRI, CT), organize findings by anatomical level using the format: \"Lumbar Spine Levels: L1-L2\", \"Lumbar Spine Levels: L2-L3\", \"Cervical Spine Levels: C5-C6\", etc.\n- Separate general spine findings (alignment, lordosis, vertebral heights) from level-specific findings\n- Use dedicated sections for: \"Spinal Cord\", \"Bones\" (for marrow/vertebral body lesions), \"Paraspinal Soft Tissues\" (for muscle findings)\n- Each spinal level should get its own section when findings are described level-by-level\n- This level-by-level organization is preferred over generic \"Spine\" labeling for clinical utility\n\n### Non-spine skeletal findings:\nFor non-spine skeletal findings, unify them under a single section like \"Bones.\" Only keep laterality (Right/Left) if there is symmetry in the findings.\n\n## Required JSON Format\n\nEach final answer must be valid JSON with an array key \"extractions\". Each \"extraction\" is an object with:\n\n```json\n{\n \"text\": \"...\",\n \"category\": \"findings_prefix\" | \"findings_body\" | \"findings_suffix\",\n \"attributes\": {}\n}\n```\n\nWithin \"attributes\" each attribute should be a key-value pair as shown in the examples below. The attribute **\"clinical_significance\"** MUST be included for findings_body extractions and should be one of: **\"normal\"**, **\"minor\"**, **\"significant\"**, or **\"not_applicable\"** to indicate the importance of the finding.\n\n---\n\n# Few-Shot Examples\n\nThe following examples demonstrate how to properly structure different types of radiology reports:\n\n## Example 1\n\n**Input Text:**\n```\nEXAMINATION: CT ABDOMEN AND PELVIS WITH IV CONTRAST\nCLINICAL INDICATION: Abdominal pain.\nCOMPARISON: None.\nTECHNIQUE: Axial images of the abdomen and pelvis were obtained following the administration of intravenous contrast material. Coronal and sagittal reformations were reviewed.\n\nFINDINGS:\nNo acute abnormality is seen in the visualized lung bases. The liver is normal in size and contour. There is a 1.2 cm simple-appearing low-attenuation lesion in hepatic segment VII, consistent with a cyst. The gallbladder contains numerous calcified gallstones, compatible with cholelithiasis.\n\nIMPRESSION:\n1. Cholelithiasis without evidence of acute cholecystitis.\n2. Hepatic cyst.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION: CT ABDOMEN AND PELVIS WITH IV CONTRAST\",\n \"attributes\": {\n \"section\": \"Examination\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"CLINICAL INDICATION: Abdominal pain.\",\n \"attributes\": {\n \"section\": \"Clinical Indication\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"COMPARISON: None.\",\n \"attributes\": {\n \"section\": \"Comparison\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"TECHNIQUE: Axial images of the abdomen and pelvis were obtained following the administration of intravenous contrast material. Coronal and sagittal reformations were reviewed.\",\n \"attributes\": {\n \"section\": \"Technique\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No acute abnormality is seen in the visualized lung bases.\",\n \"attributes\": {\n \"section\": \"Lungs\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The liver is normal in size and contour.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a 1.2 cm simple-appearing low-attenuation lesion in hepatic segment VII, consistent with a cyst.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The gallbladder contains numerous calcified gallstones, compatible with cholelithiasis.\",\n \"attributes\": {\n \"section\": \"Gallbladder\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Cholelithiasis without evidence of acute cholecystitis.\\n2. Hepatic cyst.\"\n }\n ]\n}\n```\n\n---\n\n## Example 2\n\n**Input Text:**\n```\nCLINICAL HISTORY:\nLow back pain, rule out disc herniation\n\nMRI LUMBAR SPINE WITHOUT CONTRAST:\n\nFINDINGS:\nThe lumbar lordosis is maintained. Vertebral body heights are preserved.\n\nThere is a small hemangioma in the L3 vertebral body.\n\nThe conus medullaris terminates at L1 and appears normal.\n\nAt L2-L3, there is mild disc desiccation without significant stenosis.\n\nAt L3-L4, a small posterior disc bulge causes mild central canal narrowing.\n\nAt L4-L5, there is a large posterior disc herniation with severe central canal stenosis and nerve root impingement.\n\nAt L5-S1, mild disc bulge without significant stenosis.\n\nThe paraspinal musculature appears unremarkable.\n\nIMPRESSION:\nLarge L4-L5 disc herniation with severe stenosis.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"CLINICAL HISTORY:\\nLow back pain, rule out disc herniation\\n\\nMRI LUMBAR SPINE WITHOUT CONTRAST:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lumbar lordosis is maintained. Vertebral body heights are preserved.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a small hemangioma in the L3 vertebral body.\",\n \"attributes\": {\n \"section\": \"Bones\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The conus medullaris terminates at L1 and appears normal.\",\n \"attributes\": {\n \"section\": \"Spinal Cord\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L2-L3, there is mild disc desiccation without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L2-L3\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L3-L4, a small posterior disc bulge causes mild central canal narrowing.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L3-L4\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L4-L5, there is a large posterior disc herniation with severe central canal stenosis and nerve root impingement.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L4-L5\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L5-S1, mild disc bulge without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L5-S1\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The paraspinal musculature appears unremarkable.\",\n \"attributes\": {\n \"section\": \"Paraspinal Soft Tissues\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Large L4-L5 disc herniation with severe stenosis.\"\n }\n ]\n}\n```\n\n---\n\n## Example 3\n\n**Input Text:**\n```\nINDICATION: \nNeck pain, radiculopathy\n\nMRI CERVICAL SPINE:\n\nFINDINGS:\nNormal cervical lordosis is maintained. No vertebral body compression fractures.\n\nThe cervical spinal cord demonstrates normal signal intensity.\n\nAt C3-C4, no significant disc disease or stenosis.\n\nAt C4-C5, mild disc osteophyte complex with mild foraminal narrowing.\n\nAt C5-C6, moderate disc herniation with moderate central canal stenosis.\n\nAt C6-C7, small disc bulge without significant stenosis.\n\nIMPRESSION:\nModerate C5-C6 disc herniation and stenosis.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"INDICATION: \\nNeck pain, radiculopathy\\n\\nMRI CERVICAL SPINE:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Normal cervical lordosis is maintained. No vertebral body compression fractures.\",\n \"attributes\": {\n \"section\": \"Cervical Spine\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The cervical spinal cord demonstrates normal signal intensity.\",\n \"attributes\": {\n \"section\": \"Spinal Cord\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C3-C4, no significant disc disease or stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C3-C4\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C4-C5, mild disc osteophyte complex with mild foraminal narrowing.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C4-C5\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C5-C6, moderate disc herniation with moderate central canal stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C5-C6\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C6-C7, small disc bulge without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C6-C7\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Moderate C5-C6 disc herniation and stenosis.\"\n }\n ]\n}\n```\n\n---\n\n## Example 4\n\n**Input Text:**\n```\nTECHNIQUE: \nMultidetector helical CT from lung bases to adrenals with and without intravenous contrast.\n\nFINDINGS:\nLIVER/GALLBLADDER/SPLEEN: The liver has a normal appearance. Gallbladder wall appears normal. The spleen is normal in size.\n\nPANCREAS/ADRENALS: The pancreas and bilateral adrenal glands appear unremarkable.\n\nRETROPERITONEUM: No lymphadenopathy. No fluid collection.\n\nIMPRESSION:\nNormal abdominal CT.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"TECHNIQUE: \\nMultidetector helical CT from lung bases to adrenals with and without intravenous contrast.\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The liver has a normal appearance.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Gallbladder wall appears normal.\",\n \"attributes\": {\n \"section\": \"Gallbladder\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The spleen is normal in size.\",\n \"attributes\": {\n \"section\": \"Spleen\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The pancreas and bilateral adrenal glands appear unremarkable.\",\n \"attributes\": {\n \"section\": \"Pancreas/Adrenals\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No lymphadenopathy.\",\n \"attributes\": {\n \"section\": \"Retroperitoneum\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No fluid collection.\",\n \"attributes\": {\n \"section\": \"Retroperitoneum\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal abdominal CT.\"\n }\n ]\n}\n```\n\n---\n\n## Example 5\n\n**Input Text:**\n```\nHISTORY: \nLower abdominal pain\n\nCT ABDOMEN/PELVIS WITH CONTRAST:\n\nFINDINGS:\nLIVER: Multiple hepatic metastases are present, measuring up to 3.2 cm.\n\nKIDNEYS: The left kidney shows moderate hydronephrosis. The right kidney appears normal.\n\nLYMPH NODES: Enlarged retroperitoneal lymph nodes, largest measuring 2.1 cm.\n\nIMPRESSION:\n1. Multiple hepatic metastases\n2. Left hydronephrosis \n3. Retroperitoneal lymphadenopathy\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"HISTORY: \\nLower abdominal pain\\n\\nCT ABDOMEN/PELVIS WITH CONTRAST:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Multiple hepatic metastases are present, measuring up to 3.2 cm.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The left kidney shows moderate hydronephrosis.\",\n \"attributes\": {\n \"section\": \"Kidneys\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The right kidney appears normal.\",\n \"attributes\": {\n \"section\": \"Kidneys\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Enlarged retroperitoneal lymph nodes, largest measuring 2.1 cm.\",\n \"attributes\": {\n \"section\": \"Lymph Nodes\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Multiple hepatic metastases\\n2. Left hydronephrosis \\n3. Retroperitoneal lymphadenopathy\"\n }\n ]\n}\n```\n\n---\n\n## Example 6\n\n**Input Text:**\n```\nEXAMINATION:\nMRI brain without contrast\n\nCLINICAL HISTORY:\nHeadaches\n\nFINDINGS:\nThe brain parenchyma demonstrates normal signal intensity. No mass lesions are identified.\n\nThe ventricular system is normal in size and configuration.\n\nNo abnormal enhancement is seen.\n\nIMPRESSION:\nNormal brain MRI.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION:\\nMRI brain without contrast\\n\\nCLINICAL HISTORY:\\nHeadaches\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The brain parenchyma demonstrates normal signal intensity.\",\n \"attributes\": {\n \"section\": \"Brain Parenchyma\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No mass lesions are identified.\",\n \"attributes\": {\n \"section\": \"Brain Parenchyma\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The ventricular system is normal in size and configuration.\",\n \"attributes\": {\n \"section\": \"Ventricular System\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No abnormal enhancement is seen.\",\n \"attributes\": {\n \"section\": \"Enhancement\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal brain MRI.\"\n }\n ]\n}\n```\n\n---\n\n## Example 7\n\n**Input Text:**\n```\nINDICATION:\nRight knee pain\n\nMRI RIGHT KNEE:\n\nFINDINGS:\nMENISCI: There is a complex tear of the medial meniscus. The lateral meniscus appears intact.\n\nLIGAMENTS: The ACL shows complete rupture. The PCL, MCL, and LCL are intact.\n\nBONES: Mild bone marrow edema is present in the medial femoral condyle.\n\nIMPRESSION:\n1. Complex medial meniscal tear\n2. Complete ACL rupture\n3. Bone marrow edema in medial femoral condyle\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"INDICATION:\\nRight knee pain\\n\\nMRI RIGHT KNEE:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a complex tear of the medial meniscus.\",\n \"attributes\": {\n \"section\": \"Menisci\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lateral meniscus appears intact.\",\n \"attributes\": {\n \"section\": \"Menisci\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The ACL shows complete rupture.\",\n \"attributes\": {\n \"section\": \"Ligaments\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The PCL, MCL, and LCL are intact.\",\n \"attributes\": {\n \"section\": \"Ligaments\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Mild bone marrow edema is present in the medial femoral condyle.\",\n \"attributes\": {\n \"section\": \"Bones\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Complex medial meniscal tear\\n2. Complete ACL rupture\\n3. Bone marrow edema in medial femoral condyle\"\n }\n ]\n}\n```\n\n---\n\n## Example 8\n\n**Input Text:**\n```\nEXAMINATION: CT CHEST\n\nFINDINGS:\nThe longs are clear bilaterally. The hart size is normal. No pleural effushion.\n\nIMPRESSION:\nNormal chest CT.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION: CT CHEST\",\n \"attributes\": {\n \"section\": \"Examination\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lungs are clear bilaterally.\",\n \"attributes\": {\n \"section\": \"Lungs\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The heart size is normal.\",\n \"attributes\": {\n \"section\": \"Heart\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No pleural effusion.\",\n \"attributes\": {\n \"section\": \"Pleura\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal chest CT.\"\n }\n ]\n}\n```\n\n\n\n## Inference Example:\n\n**Input Text:**\n```\nMRI Cervical Spine:\nComparison: MRI cervical spine dated 6 months ago\n\nThe cervical lordosis is maintained. Vertebral body heights and alignment are preserved. The spinal cord demonstrates normal signal intensity throughout its visualized extent. At C3-C4, there is mild disc desiccation without significant canal narrowing. At C4-C5, a small posterior disc osteophyte complex results in mild central canal narrowing. The neural foramina remain patent. At C5-C6, there is moderate disc space narrowing with a broad-based posterior disc bulge and bilateral uncinate spurring, causing mild to moderate bilateral neural foraminal narrowing. At C6-C7, mild disc desiccation is present without significant stenosis. The prevertebral soft tissues are unremarkable.\n\nIMPRESSION:\n1. Multilevel cervical spondylosis, most pronounced at C5-C6.\n2. Mild to moderate bilateral C5-C6 neural foraminal narrowing.\n3. No spinal cord compression or significant central canal stenosis.\n```\n\n**Expected Output:**\n" + }, + "sample_whole_body_petct": { + "segments": [ + { + "type": "prefix", + "label": "Examination", + "content": "EXAMINATION: Whole-body fluorodeoxyglucose (FDG) PET/CT", + "intervals": [ + { + "startPos": 0, + "endPos": 55 + } + ], + "significance": null + }, + { + "type": "prefix", + "label": "Clinical Indication", + "content": "CLINICAL INDICATION: Staging of newly diagnosed non-small-cell lung carcinoma (NSCLC)", + "intervals": [ + { + "startPos": 56, + "endPos": 141 + } + ], + "significance": null + }, + { + "type": "prefix", + "label": "Comparison", + "content": "COMPARISON: None available", + "intervals": [ + { + "startPos": 142, + "endPos": 168 + } + ], + "significance": null + }, + { + "type": "prefix", + "label": "Technique", + "content": "TECHNIQUE: Following a 60-minute uptake period after intravenous administration of 12 mCi of FDG, low-dose non-contrast CT images were obtained for attenuation correction and anatomic localization, followed by emission PET images from the skull base to mid-thigh.", + "intervals": [ + { + "startPos": 169, + "endPos": 432 + } + ], + "significance": null + }, + { + "type": "body", + "label": "Lungs", + "content": "A 3.1 cm spiculated mass in the right upper lobe demonstrates intense FDG uptake (SUVmax 12.4).", + "intervals": [ + { + "startPos": 444, + "endPos": 539 + } + ], + "significance": "significant" + }, + { + "type": "body", + "label": "Mediastinum/Hilar", + "content": "Ipsilateral mediastinal (station 4R) lymph node measuring 1.2 cm shows increased activity (SUVmax 6.8).", + "intervals": [ + { + "startPos": 540, + "endPos": 643 + } + ], + "significance": "significant" + }, + { + "type": "body", + "label": "Mediastinum/Hilar", + "content": "No contralateral mediastinal or hilar hypermetabolic nodes.", + "intervals": [ + { + "startPos": 644, + "endPos": 703 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Bones", + "content": "Multiple focal areas of increased FDG uptake are seen in the axial and appendicular skeleton corresponding to sclerotic lesions on CT, compatible with osseous metastases (largest in right iliac bone, SUVmax 9.1).", + "intervals": [ + { + "startPos": 705, + "endPos": 917 + } + ], + "significance": "significant" + }, + { + "type": "body", + "label": "Liver", + "content": "No abnormal activity in the liver.", + "intervals": [ + { + "startPos": 918, + "endPos": 978 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Adrenal Glands", + "content": "No abnormal activity in the adrenal glands.", + "intervals": [ + { + "startPos": 918, + "endPos": 978 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Brain", + "content": "No abnormal activity in the brain.", + "intervals": [ + { + "startPos": 918, + "endPos": 978 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Heart", + "content": "Physiologic tracer distribution in myocardium.", + "intervals": [ + { + "startPos": 979, + "endPos": 1055 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Kidneys", + "content": "Physiologic tracer distribution in kidneys.", + "intervals": [ + { + "startPos": 979, + "endPos": 1055 + } + ], + "significance": "normal" + }, + { + "type": "body", + "label": "Urinary Bladder", + "content": "Physiologic tracer distribution in urinary bladder.", + "intervals": [ + { + "startPos": 979, + "endPos": 1055 + } + ], + "significance": "normal" + }, + { + "type": "suffix", + "label": "suffix", + "content": "1. FDG-avid right upper-lobe primary lung malignancy with hypermetabolic right paratracheal nodal metastasis (consistent with at least N2 disease).\n2. Numerous FDG-avid osseous metastases consistent with Stage IV disease.", + "intervals": [ + { + "startPos": 1069, + "endPos": 1290 + } + ], + "significance": null + } + ], + "annotated_document_json": { + "extractions": [ + { + "extraction_text": "EXAMINATION: Whole-body fluorodeoxyglucose (FDG) PET/CT", + "extraction_class": "findings_prefix", + "attributes": { + "section": "Examination" + }, + "char_interval": { + "start_pos": 0, + "end_pos": 55 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "CLINICAL INDICATION: Staging of newly diagnosed non-small-cell lung carcinoma (NSCLC)", + "extraction_class": "findings_prefix", + "attributes": { + "section": "Clinical Indication" + }, + "char_interval": { + "start_pos": 56, + "end_pos": 141 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "COMPARISON: None available", + "extraction_class": "findings_prefix", + "attributes": { + "section": "Comparison" + }, + "char_interval": { + "start_pos": 142, + "end_pos": 168 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "TECHNIQUE: Following a 60-minute uptake period after intravenous administration of 12 mCi of FDG, low-dose non-contrast CT images were obtained for attenuation correction and anatomic localization, followed by emission PET images from the skull base to mid-thigh.", + "extraction_class": "findings_prefix", + "attributes": { + "section": "Technique" + }, + "char_interval": { + "start_pos": 169, + "end_pos": 432 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "A 3.1 cm spiculated mass in the right upper lobe demonstrates intense FDG uptake (SUVmax 12.4).", + "extraction_class": "findings_body", + "attributes": { + "section": "Lungs", + "clinical_significance": "significant" + }, + "char_interval": { + "start_pos": 444, + "end_pos": 539 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "Ipsilateral mediastinal (station 4R) lymph node measuring 1.2 cm shows increased activity (SUVmax 6.8).", + "extraction_class": "findings_body", + "attributes": { + "section": "Mediastinum/Hilar", + "clinical_significance": "significant" + }, + "char_interval": { + "start_pos": 540, + "end_pos": 643 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "No contralateral mediastinal or hilar hypermetabolic nodes.", + "extraction_class": "findings_body", + "attributes": { + "section": "Mediastinum/Hilar", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 644, + "end_pos": 703 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "Multiple focal areas of increased FDG uptake are seen in the axial and appendicular skeleton corresponding to sclerotic lesions on CT, compatible with osseous metastases (largest in right iliac bone, SUVmax 9.1).", + "extraction_class": "findings_body", + "attributes": { + "section": "Bones", + "clinical_significance": "significant" + }, + "char_interval": { + "start_pos": 705, + "end_pos": 917 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + }, + { + "extraction_text": "No abnormal activity in the liver.", + "extraction_class": "findings_body", + "attributes": { + "section": "Liver", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 918, + "end_pos": 978 + }, + "alignment_status": "AlignmentStatus.MATCH_FUZZY" + }, + { + "extraction_text": "No abnormal activity in the adrenal glands.", + "extraction_class": "findings_body", + "attributes": { + "section": "Adrenal Glands", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 918, + "end_pos": 978 + }, + "alignment_status": "AlignmentStatus.MATCH_FUZZY" + }, + { + "extraction_text": "No abnormal activity in the brain.", + "extraction_class": "findings_body", + "attributes": { + "section": "Brain", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 918, + "end_pos": 978 + }, + "alignment_status": "AlignmentStatus.MATCH_FUZZY" + }, + { + "extraction_text": "Physiologic tracer distribution in myocardium.", + "extraction_class": "findings_body", + "attributes": { + "section": "Heart", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 979, + "end_pos": 1055 + }, + "alignment_status": "AlignmentStatus.MATCH_FUZZY" + }, + { + "extraction_text": "Physiologic tracer distribution in kidneys.", + "extraction_class": "findings_body", + "attributes": { + "section": "Kidneys", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 979, + "end_pos": 1055 + }, + "alignment_status": "AlignmentStatus.MATCH_FUZZY" + }, + { + "extraction_text": "Physiologic tracer distribution in urinary bladder.", + "extraction_class": "findings_body", + "attributes": { + "section": "Urinary Bladder", + "clinical_significance": "normal" + }, + "char_interval": { + "start_pos": 979, + "end_pos": 1055 + }, + "alignment_status": "AlignmentStatus.MATCH_FUZZY" + }, + { + "extraction_text": "1. FDG-avid right upper-lobe primary lung malignancy with hypermetabolic right paratracheal nodal metastasis (consistent with at least N2 disease).\n2. Numerous FDG-avid osseous metastases consistent with Stage IV disease.", + "extraction_class": "findings_suffix", + "attributes": {}, + "char_interval": { + "start_pos": 1069, + "end_pos": 1290 + }, + "alignment_status": "AlignmentStatus.MATCH_EXACT" + } + ] + }, + "text": "EXAMINATION:\n\nWhole-body fluorodeoxyglucose (FDG) PET/CT\n\nCLINICAL INDICATION: Staging of newly diagnosed non-small-cell lung carcinoma (NSCLC)\n\nCOMPARISON: None available\n\nTECHNIQUE: Following a 60-minute uptake period after intravenous administration of 12 mCi of FDG, low-dose non-contrast CT images were obtained for attenuation correction and anatomic localization, followed by emission PET images from the skull base to mid-thigh.\n\n\nFINDINGS:\n\nLungs: A 3.1 cm spiculated mass in the right upper lobe demonstrates intense FDG uptake (SUVmax 12.4).\n\nMediastinum/Hilar: Ipsilateral mediastinal (station 4R) lymph node measuring 1.2 cm shows increased activity (SUVmax 6.8). No contralateral mediastinal or hilar hypermetabolic nodes.\n\nBones: Multiple focal areas of increased FDG uptake are seen in the axial and appendicular skeleton corresponding to sclerotic lesions on CT, compatible with osseous metastases (largest in right iliac bone, SUVmax 9.1).\n\nLiver: No abnormal activity in the liver.\n\nAdrenal Glands: No abnormal activity in the adrenal glands.\n\nBrain: No abnormal activity in the brain.\n\nHeart: Physiologic tracer distribution in myocardium.\n\nKidneys: Physiologic tracer distribution in kidneys.\n\nUrinary Bladder: Physiologic tracer distribution in urinary bladder.\n\nIMPRESSION:\n\n1. FDG-avid right upper-lobe primary lung malignancy with hypermetabolic right paratracheal nodal metastasis (consistent with at least N2 disease).\n2. Numerous FDG-avid osseous metastases consistent with Stage IV disease.", + "raw_prompt": "# RadExtract Prompt\n\n## Task Description\n\nYou are a medical assistant specialized in categorizing radiology text into sections:\n\n- **findings_prefix** -- All text that appears before the actual \"findings\" content.\n- **findings_body** -- The main 'Findings' section. Each finding is classified into a possible section through a list of attributes, some of which may also be assigned to a subheader.\n- **findings_suffix** -- Any text that appears after the \"findings\" portion (such as \"Impression\" or other concluding content).\n\n### Section Categories:\n- **findings_prefix**: Use only for header information before clinical findings (examination details, clinical indication, technique). Never use for actual clinical observations or pathological findings.\n- **findings_body**: Use for all clinical findings, observations, and pathological descriptions.\n- **findings_suffix**: Use only for conclusions, impressions, or recommendations that appear after the main findings.\n\n### Critical Rule:\nIf a report contains only clinical findings without any header information, do not create a findings_prefix extraction. Start directly with findings_body extractions for the clinical content.\n\n**Example of findings-only content (NO prefix needed):**\nInput: \"There is a small joint effusion. The cartilage shows thinning.\"\nCorrect: Create only findings_body extractions for each clinical finding.\nIncorrect: Do not categorize clinical findings as findings_prefix.\n\n### Professional Output Standards:\nAll extracted text must maintain the grammatical correctness and professional coherence expected in radiology reports. Ensure that:\n- All sentences are complete and grammatically correct\n- Medical terminology is used appropriately and consistently\n- The language remains professional and clinical in tone\n- Correct obvious typos (e.g., \"splen\" → \"spleen\", \"kidny\" → \"kidney\")\n- Any modifications to the original text preserve the intended medical meaning\n- Minor typos are corrected and optimal punctuation is used\n\n### Empty prefix or suffix sections:\nOnly create extractions for sections that actually exist in the text. Do not create empty prefix or suffix sections if there is no corresponding content in the source text. If the text is findings-only without any impression/conclusion, do not create a findings_suffix extraction.\n\n### Section Usage Guidelines:\n\n**findings_prefix**: Reserved exclusively for header information that appears before clinical findings, such as:\n- Examination details (type of study, technique)\n- Clinical indication or history\n- Comparison studies referenced\n- Technical parameters\n\n**findings_body**: Contains the actual clinical findings and observations from the imaging study.\n\n**findings_suffix**: Reserved for concluding content that follows the findings, such as impressions or recommendations.\n\n**Critical Rule**: Clinical findings should never be categorized as prefix content. If a report begins directly with clinical observations without any header information, create only findings_body and findings_suffix extractions as appropriate.\n\n### Special guidance for findings_prefix organization:\nWhen the report has detailed prefix information with clear section headers (like EXAMINATION, CLINICAL INDICATION, COMPARISON, TECHNIQUE), create separate extractions for each section rather than one large block. Use the \"section\" attribute to label each part:\n- \"Examination\" for exam type/title\n- \"Clinical Indication\" for clinical history/reason for study \n- \"Comparison\" for prior studies referenced\n- \"Technique\" for imaging parameters and acquisition details\n\n**Important:** Even when examination information appears at the beginning without an explicit \"EXAMINATION:\" header, it should still be labeled with section:\"Examination\". This includes standalone exam descriptions that identify the type of imaging study being performed.\n\nAlways recognize examination-type content and use section:\"Examination\" regardless of whether it has an explicit header.\n\nThis structured approach provides better organization and readability.\n\n### Critical for findings_suffix:\nDo NOT include headers like \"IMPRESSION:\", \"CONCLUSION:\", etc. in the extraction_text. Only extract the actual content that follows these headers. The formatting system will add appropriate headers automatically. \n\n**Example:** If the text contains \"IMPRESSION: 1. Severe arthritis. 2. Labral tear.\", extract only \"1. Severe arthritis. 2. Labral tear.\" as the extraction_text.\n\n### Additional Notes for findings_body:\n- If a single sentence references multiple structures with a shared status (e.g., \"liver, gallbladder, spleen appear unremarkable\"), please split them into separate extraction lines, each referencing the relevant structure.\n- If the text mentions subheaders like \"CT ABDOMEN\" or \"CERVICAL SPINE,\" only create/retain that subheader if it clearly organizes multiple organ-structure findings under it. Do not force subheaders if only 1 or 2 lines belong there. A subheader should ideally group 3+ sections to be meaningful.\n\n### Special guidance for spine reports:\n- For spine imaging (MRI, CT), organize findings by anatomical level using the format: \"Lumbar Spine Levels: L1-L2\", \"Lumbar Spine Levels: L2-L3\", \"Cervical Spine Levels: C5-C6\", etc.\n- Separate general spine findings (alignment, lordosis, vertebral heights) from level-specific findings\n- Use dedicated sections for: \"Spinal Cord\", \"Bones\" (for marrow/vertebral body lesions), \"Paraspinal Soft Tissues\" (for muscle findings)\n- Each spinal level should get its own section when findings are described level-by-level\n- This level-by-level organization is preferred over generic \"Spine\" labeling for clinical utility\n\n### Non-spine skeletal findings:\nFor non-spine skeletal findings, unify them under a single section like \"Bones.\" Only keep laterality (Right/Left) if there is symmetry in the findings.\n\n## Required JSON Format\n\nEach final answer must be valid JSON with an array key \"extractions\". Each \"extraction\" is an object with:\n\n```json\n{\n \"text\": \"...\",\n \"category\": \"findings_prefix\" | \"findings_body\" | \"findings_suffix\",\n \"attributes\": {}\n}\n```\n\nWithin \"attributes\" each attribute should be a key-value pair as shown in the examples below. The attribute **\"clinical_significance\"** MUST be included for findings_body extractions and should be one of: **\"normal\"**, **\"minor\"**, **\"significant\"**, or **\"not_applicable\"** to indicate the importance of the finding.\n\n---\n\n# Few-Shot Examples\n\nThe following examples demonstrate how to properly structure different types of radiology reports:\n\n## Example 1\n\n**Input Text:**\n```\nEXAMINATION: CT ABDOMEN AND PELVIS WITH IV CONTRAST\nCLINICAL INDICATION: Abdominal pain.\nCOMPARISON: None.\nTECHNIQUE: Axial images of the abdomen and pelvis were obtained following the administration of intravenous contrast material. Coronal and sagittal reformations were reviewed.\n\nFINDINGS:\nNo acute abnormality is seen in the visualized lung bases. The liver is normal in size and contour. There is a 1.2 cm simple-appearing low-attenuation lesion in hepatic segment VII, consistent with a cyst. The gallbladder contains numerous calcified gallstones, compatible with cholelithiasis.\n\nIMPRESSION:\n1. Cholelithiasis without evidence of acute cholecystitis.\n2. Hepatic cyst.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION: CT ABDOMEN AND PELVIS WITH IV CONTRAST\",\n \"attributes\": {\n \"section\": \"Examination\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"CLINICAL INDICATION: Abdominal pain.\",\n \"attributes\": {\n \"section\": \"Clinical Indication\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"COMPARISON: None.\",\n \"attributes\": {\n \"section\": \"Comparison\"\n }\n },\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"TECHNIQUE: Axial images of the abdomen and pelvis were obtained following the administration of intravenous contrast material. Coronal and sagittal reformations were reviewed.\",\n \"attributes\": {\n \"section\": \"Technique\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No acute abnormality is seen in the visualized lung bases.\",\n \"attributes\": {\n \"section\": \"Lungs\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The liver is normal in size and contour.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a 1.2 cm simple-appearing low-attenuation lesion in hepatic segment VII, consistent with a cyst.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The gallbladder contains numerous calcified gallstones, compatible with cholelithiasis.\",\n \"attributes\": {\n \"section\": \"Gallbladder\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Cholelithiasis without evidence of acute cholecystitis.\\n2. Hepatic cyst.\"\n }\n ]\n}\n```\n\n---\n\n## Example 2\n\n**Input Text:**\n```\nCLINICAL HISTORY:\nLow back pain, rule out disc herniation\n\nMRI LUMBAR SPINE WITHOUT CONTRAST:\n\nFINDINGS:\nThe lumbar lordosis is maintained. Vertebral body heights are preserved.\n\nThere is a small hemangioma in the L3 vertebral body.\n\nThe conus medullaris terminates at L1 and appears normal.\n\nAt L2-L3, there is mild disc desiccation without significant stenosis.\n\nAt L3-L4, a small posterior disc bulge causes mild central canal narrowing.\n\nAt L4-L5, there is a large posterior disc herniation with severe central canal stenosis and nerve root impingement.\n\nAt L5-S1, mild disc bulge without significant stenosis.\n\nThe paraspinal musculature appears unremarkable.\n\nIMPRESSION:\nLarge L4-L5 disc herniation with severe stenosis.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"CLINICAL HISTORY:\\nLow back pain, rule out disc herniation\\n\\nMRI LUMBAR SPINE WITHOUT CONTRAST:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lumbar lordosis is maintained. Vertebral body heights are preserved.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a small hemangioma in the L3 vertebral body.\",\n \"attributes\": {\n \"section\": \"Bones\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The conus medullaris terminates at L1 and appears normal.\",\n \"attributes\": {\n \"section\": \"Spinal Cord\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L2-L3, there is mild disc desiccation without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L2-L3\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L3-L4, a small posterior disc bulge causes mild central canal narrowing.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L3-L4\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L4-L5, there is a large posterior disc herniation with severe central canal stenosis and nerve root impingement.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L4-L5\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At L5-S1, mild disc bulge without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Lumbar Spine Levels: L5-S1\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The paraspinal musculature appears unremarkable.\",\n \"attributes\": {\n \"section\": \"Paraspinal Soft Tissues\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Large L4-L5 disc herniation with severe stenosis.\"\n }\n ]\n}\n```\n\n---\n\n## Example 3\n\n**Input Text:**\n```\nINDICATION: \nNeck pain, radiculopathy\n\nMRI CERVICAL SPINE:\n\nFINDINGS:\nNormal cervical lordosis is maintained. No vertebral body compression fractures.\n\nThe cervical spinal cord demonstrates normal signal intensity.\n\nAt C3-C4, no significant disc disease or stenosis.\n\nAt C4-C5, mild disc osteophyte complex with mild foraminal narrowing.\n\nAt C5-C6, moderate disc herniation with moderate central canal stenosis.\n\nAt C6-C7, small disc bulge without significant stenosis.\n\nIMPRESSION:\nModerate C5-C6 disc herniation and stenosis.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"INDICATION: \\nNeck pain, radiculopathy\\n\\nMRI CERVICAL SPINE:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Normal cervical lordosis is maintained. No vertebral body compression fractures.\",\n \"attributes\": {\n \"section\": \"Cervical Spine\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The cervical spinal cord demonstrates normal signal intensity.\",\n \"attributes\": {\n \"section\": \"Spinal Cord\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C3-C4, no significant disc disease or stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C3-C4\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C4-C5, mild disc osteophyte complex with mild foraminal narrowing.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C4-C5\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C5-C6, moderate disc herniation with moderate central canal stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C5-C6\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"At C6-C7, small disc bulge without significant stenosis.\",\n \"attributes\": {\n \"section\": \"Cervical Spine Levels: C6-C7\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Moderate C5-C6 disc herniation and stenosis.\"\n }\n ]\n}\n```\n\n---\n\n## Example 4\n\n**Input Text:**\n```\nTECHNIQUE: \nMultidetector helical CT from lung bases to adrenals with and without intravenous contrast.\n\nFINDINGS:\nLIVER/GALLBLADDER/SPLEEN: The liver has a normal appearance. Gallbladder wall appears normal. The spleen is normal in size.\n\nPANCREAS/ADRENALS: The pancreas and bilateral adrenal glands appear unremarkable.\n\nRETROPERITONEUM: No lymphadenopathy. No fluid collection.\n\nIMPRESSION:\nNormal abdominal CT.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"TECHNIQUE: \\nMultidetector helical CT from lung bases to adrenals with and without intravenous contrast.\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The liver has a normal appearance.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Gallbladder wall appears normal.\",\n \"attributes\": {\n \"section\": \"Gallbladder\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The spleen is normal in size.\",\n \"attributes\": {\n \"section\": \"Spleen\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The pancreas and bilateral adrenal glands appear unremarkable.\",\n \"attributes\": {\n \"section\": \"Pancreas/Adrenals\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No lymphadenopathy.\",\n \"attributes\": {\n \"section\": \"Retroperitoneum\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No fluid collection.\",\n \"attributes\": {\n \"section\": \"Retroperitoneum\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal abdominal CT.\"\n }\n ]\n}\n```\n\n---\n\n## Example 5\n\n**Input Text:**\n```\nHISTORY: \nLower abdominal pain\n\nCT ABDOMEN/PELVIS WITH CONTRAST:\n\nFINDINGS:\nLIVER: Multiple hepatic metastases are present, measuring up to 3.2 cm.\n\nKIDNEYS: The left kidney shows moderate hydronephrosis. The right kidney appears normal.\n\nLYMPH NODES: Enlarged retroperitoneal lymph nodes, largest measuring 2.1 cm.\n\nIMPRESSION:\n1. Multiple hepatic metastases\n2. Left hydronephrosis \n3. Retroperitoneal lymphadenopathy\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"HISTORY: \\nLower abdominal pain\\n\\nCT ABDOMEN/PELVIS WITH CONTRAST:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Multiple hepatic metastases are present, measuring up to 3.2 cm.\",\n \"attributes\": {\n \"section\": \"Liver\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The left kidney shows moderate hydronephrosis.\",\n \"attributes\": {\n \"section\": \"Kidneys\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The right kidney appears normal.\",\n \"attributes\": {\n \"section\": \"Kidneys\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Enlarged retroperitoneal lymph nodes, largest measuring 2.1 cm.\",\n \"attributes\": {\n \"section\": \"Lymph Nodes\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Multiple hepatic metastases\\n2. Left hydronephrosis \\n3. Retroperitoneal lymphadenopathy\"\n }\n ]\n}\n```\n\n---\n\n## Example 6\n\n**Input Text:**\n```\nEXAMINATION:\nMRI brain without contrast\n\nCLINICAL HISTORY:\nHeadaches\n\nFINDINGS:\nThe brain parenchyma demonstrates normal signal intensity. No mass lesions are identified.\n\nThe ventricular system is normal in size and configuration.\n\nNo abnormal enhancement is seen.\n\nIMPRESSION:\nNormal brain MRI.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION:\\nMRI brain without contrast\\n\\nCLINICAL HISTORY:\\nHeadaches\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The brain parenchyma demonstrates normal signal intensity.\",\n \"attributes\": {\n \"section\": \"Brain Parenchyma\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No mass lesions are identified.\",\n \"attributes\": {\n \"section\": \"Brain Parenchyma\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The ventricular system is normal in size and configuration.\",\n \"attributes\": {\n \"section\": \"Ventricular System\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No abnormal enhancement is seen.\",\n \"attributes\": {\n \"section\": \"Enhancement\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal brain MRI.\"\n }\n ]\n}\n```\n\n---\n\n## Example 7\n\n**Input Text:**\n```\nINDICATION:\nRight knee pain\n\nMRI RIGHT KNEE:\n\nFINDINGS:\nMENISCI: There is a complex tear of the medial meniscus. The lateral meniscus appears intact.\n\nLIGAMENTS: The ACL shows complete rupture. The PCL, MCL, and LCL are intact.\n\nBONES: Mild bone marrow edema is present in the medial femoral condyle.\n\nIMPRESSION:\n1. Complex medial meniscal tear\n2. Complete ACL rupture\n3. Bone marrow edema in medial femoral condyle\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"INDICATION:\\nRight knee pain\\n\\nMRI RIGHT KNEE:\"\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"There is a complex tear of the medial meniscus.\",\n \"attributes\": {\n \"section\": \"Menisci\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lateral meniscus appears intact.\",\n \"attributes\": {\n \"section\": \"Menisci\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The ACL shows complete rupture.\",\n \"attributes\": {\n \"section\": \"Ligaments\",\n \"clinical_significance\": \"significant\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The PCL, MCL, and LCL are intact.\",\n \"attributes\": {\n \"section\": \"Ligaments\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"Mild bone marrow edema is present in the medial femoral condyle.\",\n \"attributes\": {\n \"section\": \"Bones\",\n \"clinical_significance\": \"minor\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"1. Complex medial meniscal tear\\n2. Complete ACL rupture\\n3. Bone marrow edema in medial femoral condyle\"\n }\n ]\n}\n```\n\n---\n\n## Example 8\n\n**Input Text:**\n```\nEXAMINATION: CT CHEST\n\nFINDINGS:\nThe longs are clear bilaterally. The hart size is normal. No pleural effushion.\n\nIMPRESSION:\nNormal chest CT.\n```\n\n**Expected Output:**\n```json\n{\n \"extractions\": [\n {\n \"extraction_class\": \"findings_prefix\",\n \"extraction_text\": \"EXAMINATION: CT CHEST\",\n \"attributes\": {\n \"section\": \"Examination\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The lungs are clear bilaterally.\",\n \"attributes\": {\n \"section\": \"Lungs\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"The heart size is normal.\",\n \"attributes\": {\n \"section\": \"Heart\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_body\",\n \"extraction_text\": \"No pleural effusion.\",\n \"attributes\": {\n \"section\": \"Pleura\",\n \"clinical_significance\": \"normal\"\n }\n },\n {\n \"extraction_class\": \"findings_suffix\",\n \"extraction_text\": \"Normal chest CT.\"\n }\n ]\n}\n```\n\n\n\n## Inference Example:\n\n**Input Text:**\n```\nEXAMINATION: Whole-body fluorodeoxyglucose (FDG) PET/CT\nCLINICAL INDICATION: Staging of newly diagnosed non-small-cell lung carcinoma (NSCLC)\nCOMPARISON: None available\nTECHNIQUE: Following a 60-minute uptake period after intravenous administration of 12 mCi of FDG, low-dose non-contrast CT images were obtained for attenuation correction and anatomic localization, followed by emission PET images from the skull base to mid-thigh.\n\nFINDINGS:\nA 3.1 cm spiculated mass in the right upper lobe demonstrates intense FDG uptake (SUVmax 12.4). Ipsilateral mediastinal (station 4R) lymph node measuring 1.2 cm shows increased activity (SUVmax 6.8). No contralateral mediastinal or hilar hypermetabolic nodes.\n\nMultiple focal areas of increased FDG uptake are seen in the axial and appendicular skeleton corresponding to sclerotic lesions on CT, compatible with osseous metastases (largest in right iliac bone, SUVmax 9.1). No abnormal activity in the liver, adrenal glands, or brain. Physiologic tracer distribution in myocardium, kidneys, and urinary bladder.\n\nIMPRESSION:\n1. FDG-avid right upper-lobe primary lung malignancy with hypermetabolic right paratracheal nodal metastasis (consistent with at least N2 disease).\n2. Numerous FDG-avid osseous metastases consistent with Stage IV disease.\n```\n\n**Expected Output:**\n" + } +} \ No newline at end of file