ICD-10 variants differ by country (e.g., ICD-10-CM, ICD-10-ES/CIE-10). Ensure you select the correct code set and version for validation.
Inputs and outputs
- Input: ICD-10/CIE-10 code and description (e.g., from HL7 DG1 or free text)
- Output: FHIR Condition resource with coding for the correct ICD-10 system, plus optional SNOMED CT coding
- Errors: invalid code, deprecated code, ambiguous description
Validation and normalization
Validation steps we recommend in a pipeline:
- Detect country/variant (e.g., ICD-10-CM vs CIE-10-ES) from site configuration, MRN region, or message metadata.
- Normalize code format (strip punctuation/whitespace; uppercase; insert dot if needed by the variant).
- Validate against the reference code list/version; mark as deprecated, inactive, or expanded if applicable.
- If description present, verify it matches the reference; flag mismatches for review.
- For free-text diagnoses, use AI suggestion to propose candidate codes with confidence for human approval.
HL7 v2 DG1 to FHIR Condition
When processing HL7 v2, diagnosis often comes in DG1 segments. Example mapping:
# Pseudocode transform
Condition.code = {
"coding": [
{
"system": "http://hl7.org/fhir/sid/icd-10",
"code": DG1-3.1, // diagnosis code
"display": DG1-3.2 // diagnosis description
}
],
"text": DG1-3.2
}
Condition.category = [{
"coding": [{"system":"http://terminology.hl7.org/CodeSystem/condition-category","code":"encounter-diagnosis"}]
}]
Condition.subject = { "reference": "Patient/{pid}" }
Condition.encounter = { "reference": "Encounter/{encId}" }
Condition.onsetDateTime = admitDateTime
Optional SNOMED CT crosswalk
If your deployment includes SNOMED CT, add a parallel coding for SNOMED. Use a maintained mapping table or an AI-assisted candidate list with human approval.
// Add a SNOMED coding alongside ICD-10
Condition.code.coding.push({
system: "http://snomed.info/sct",
code: snomedCode,
display: snomedDisplay
});
Quality checks and governance
- Reject or queue for review if code is invalid/deprecated for the target version.
- Log all AI suggestions and human approvals for audit.
- Keep per-tenant configuration for variants and versions.
Example pipeline steps
- Extract DG1 from HL7 v2 (or parse diagnosis from source)
- Normalize and validate code against the configured ICD-10 variant/version
- Optional: suggest SNOMED CT codes; require human approval
- Emit FHIR Condition resource with correct codings
- Persist, notify, and audit