HL7 / CDA-core-xsl

Informative stylesheet based on XSLT 1.0 to render all CDA documents
35 stars 20 forks source link

Add sdtc:raceCode and sdtc:ethnicGroupCode support #8

Closed mjszczep closed 3 years ago

mjszczep commented 3 years ago

Sample CCD, along with before and after renders, available here. (The only difference is in the Race and Ethnicity cells in the patient demographic info at the bottom of the document.)

ahenket commented 3 years ago

I'd probably solve this issue with a for-each, rather than an if to avoid all these multiple points of maintenance, but solution looks good otherwise.

One point of critique maybe: you are now saying (hl7:path | sdtc:path), which means that whichever comes first in the instance, is rendered first. I think (hl7:path, sdtc:path) would be more preferable? This fixes the rendering order to have the HL7 code first.

mjszczep commented 3 years ago
  1. I don't think I follow how a for-each would help anything here. For instance, when we're building the code set to pass to show-code-set, we want to pass a single set of codes to it and call it once, rather than call it twice (once with the hl7 codes and once with the sdtc codes). If your concern is that we have to write out the ancestry (e.g. hl7:subject/hl7:relatedSubject) multiple times, then we could instead write hl7:subject/hl7:relatedSubject/*[self::hl7:raceCode | self::sdtc:raceCode] but I'm not sure it's all that much cleaner. Or maybe you have something different in mind?

  2. I don't think the comma operator exists in XPath 1.0, so we're stuck with (hl7:path | sdtc:path). It shouldn't really be that big a deal, though, since the schema already says that the hl7 codes should come before the sdtc ones and even if a document sends them out of order for some reason, I don't think it's too much of a problem if we consequently show them in the order the document has them in.

benjaminflessner commented 3 years ago

Approved in Structured Docs Aug 5, 2021 - Matt Szczepankiewicz / Second Gay Dolin -  Approve this pull request for the stylesheet adding support for these fields - Motion Passes 19-0-0