{
  "slug": "hl7-v2-parse",
  "name": "gizza-ai/hl7-v2-parse",
  "version": "0.1.0",
  "title": "HL7 v2 Parser — Decode HL7 Messages to JSON or CSV — gizza.ai",
  "description": "Parse an HL7 v2.x message into named segments, fields, components and subcomponents in your browser. MSH, PID, OBX and more, as JSON or CSV. No upload, free.",
  "tags": [
    "hl7 parser",
    "hl7 v2 parser",
    "hl7 to json",
    "hl7 to csv",
    "hl7 message viewer"
  ],
  "category": "utilities",
  "urls": {
    "page": "https://gizza.ai/tools/hl7-v2-parse/",
    "markdown": "https://gizza.ai/tools/hl7-v2-parse/index.md",
    "descriptor": "https://gizza.ai/tools/hl7-v2-parse/tool.json",
    "deep_link_example": "https://gizza.ai/tools/hl7-v2-parse/?data=MSH%7C%5E~%5C%26%7CSENDINGAPP%7CSENDINGFAC%7CRECVAPP%7CRECVFAC%7C20240101120000%7C%7CADT%5EA01%7CMSG00001%7CP%7C2.5%0AEVN%7CA01%7C20240101120000%0APID%7C1%7C%7C123456%5E%5E%5EHOSPITAL%5EMR%7C%7CDOE%5EJOHN%5EQ%7C%7C19800101%7CM%7C%7C%7C123%20MAIN%20ST%5E%5EANYTOWN%5ECA%5E90210%0APV1%7C1%7CI%7CICU%5E101%5E1&output=json&include_descriptions=true&unescape=true"
  },
  "cli": "gizza tool hl7-v2-parse 'MSH|^~\\&|SENDINGAPP|SENDINGFAC|RECVAPP|RECVFAC|20240101120000||ADT^A01|MSG00001|P|2.5\nEVN|A01|20240101120000\nPID|1||123456^^^HOSPITAL^MR||DOE^JOHN^Q||19800101|M|||123 MAIN ST^^ANYTOWN^CA^90210\nPV1|1|I|ICU^101^1'",
  "tool": {
    "description": "Parse a pipe-delimited HL7 v2.x message (MSH, PID, OBX, PV1, OBR, EVN, …) into a structured hierarchy of segments, fields, components, subcomponents and repetitions. Reads the field/component/repetition/subcomponent delimiters from the MSH segment (handling the MSH-1 field-separator / MSH-2 encoding-characters offset), decodes HL7 escape sequences (\\F\\ \\S\\ \\T\\ \\R\\ \\E\\ \\Xhh\\ \\.br\\), and attaches human-readable segment/field names for common segments. Output full nested JSON (default) or a flat 'Segment, Location, Value' CSV leaf table. Runs fully locally — no PHI leaves the browser.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "data": {
          "description": "The raw HL7 v2.x message (pipe-delimited segments — MSH, PID, OBX, …). Segments may be separated by carriage returns or newlines; the field/component/repetition/subcomponent delimiters are read from the MSH segment (default '|', '^', '~', '&').",
          "type": "string"
        },
        "include_descriptions": {
          "default": true,
          "description": "When true, attach human-readable names to each segment (e.g. PID → Patient Identification) and to fields of the common segments (MSH, PID, OBX, PV1, OBR, …). Default true.",
          "type": "boolean"
        },
        "output": {
          "default": "json",
          "description": "Output format: 'json' for the full nested hierarchy (segments → fields → components → subcomponents, with repetitions) or 'csv' for a flat 'Segment, Location, Value' leaf table. Default 'json'.",
          "enum": [
            "json",
            "csv"
          ],
          "type": "string"
        },
        "unescape": {
          "default": true,
          "description": "When true, decode HL7 escape sequences (\\F\\ → field sep, \\S\\ → component, \\T\\ → subcomponent, \\R\\ → repetition, \\E\\ → escape, \\Xhh\\ → hex bytes, \\.br\\ → line break) into their literal characters. When false, leaf values are kept verbatim. Default true.",
          "type": "boolean"
        }
      },
      "required": [
        "data"
      ],
      "type": "object"
    }
  }
}