v7

latestOpenAPI 3.1.0raw.githubusercontent.com2025-06-30132748.5 KB
Macros

Detect and expand text macros

Detects macros in text and provides expanded text with the macros replaced by their expansions

post/v1/macros/detect

Request body

textstring required

The text to analyze for macros

Example request

{
  "text": "The patient is a 54-year-old male here for a routine follow-up. Reports feeling well overall. Quickcheck. Denies any new symptoms. Medications reviewed and no changes needed. No signs of infection. Standard plan applies. Discussed flu vaccine and colonoscopy timeline. Return visit scheduled in six months.",
  "macros": [
    {
      "id": "brief_exam_note",
      "examples": [
        "quickcheck",
        "quick check",
        "quick-check"
      ],
      "expansion_text": "General: Patient appears well-nourished and in no acute distress. HEENT: Normocephalic, atraumatic. Heart: Regular rate and rhythm. Lungs: Clear to auscultation bilaterally."
    }
  ]
}

Response

Macro detection result

Example response

{
  "data": {
    "detections": [
      {
        "macro_id": "brief_exam_note",
        "text_span": {
          "start_char": 94,
          "end_char": 104,
          "text": "Quickcheck"
        },
        "confidence": 0.98
      }
    ],
    "expanded_text": "The patient is a 54-year-old male here for a routine follow-up. Reports feeling well overall. General: Patient appears well-nourished and in no acute distress. HEENT: Normocephalic, atraumatic. Heart: Regular rate and rhythm. Lungs: Clear to auscultation bilaterally.. Denies any new symptoms. Medications reviewed and no changes needed. No signs of infection. Plan: Continue current medications. Reassess in 6 months or as needed. Patient advised to follow up for any new or worsening symptoms. applies. Discussed flu vaccine and colonoscopy timeline. Return visit scheduled in six months."
  }
}