-
Validate the source encoding FIRST (critical root cause):
-
Check MSH-18 (HL7 character set): Use
ISO-8859-1 (LATIN-1)(native for Spanish characters ñ/á) orUTF-8; never leave it blank. -
Check XML prolog:
<?xml version="1.0" encoding="UTF-8"?> -
Check SOAP/REST headers:
Content-Type: text/xml; charset=UTF-8
-
-
Enforce explicit encoding (disable auto-detection):
-
HL7 TCP Services/Operations: Set
CharSet=UTF-8in the config. -
XML transformations: Use
%XML.Reader/WriterwithOutputEncoding=UTF-8in DTL/data conversions.
-
-
Debug natively in HealthShare (fastest tool):
-
Use the Message Viewer to inspect raw message bytes.
-
Test encoding with IRIS terminal:
WRITE $ZCONVERT("ñá","O","UTF8")/$ZCONVERT("ñá","O","LATIN1")
-
-
Fix 2020.1 pitfall:
- Do NOT mix encodings; standardize on UTF-8 end-to-end for all interfaces (HL7/SOAP/REST/TCP).
This workflow instantly resolves corrupted special characters in HL7↔XML transformations.
- Log in to post comments