CCDA – USCDI Data Elements – Gender Identity
From EHR Certification stand point, there are multiple elements that are expected from interoperability perspective. One of the major item is exporting a Patient’s complete profile as a Transfer of Care CCDA. CDA stands for Clincial Document Architecture model. Consolidated CDA is what is expected to be exported from the EHR system for certification criteria.
When a CCDA is exported from the EHR It is expected to have multiple sections. One of the most important section that it requires to have is Social History.
There are several entries of the patient that are covered in social history section. One of the most important one is Gender Identity.
Gender Identity
One of the important information that USCDI-V3 CCDA validation expects is to provide the Gender Identity as a part of the generated CCDA.
The first doubt that comes to mind is where to place this value?. Although it looks like a patient demographics on the plain sight. From a CCDA stand point – this data is a part of Social History of a patient.
Let’s look at the values that can appear on this section.
- Identifies as male gender – 446151000124109
- Identifies as female gender – 446141000124107
- Identifies as nonbinary gender – 33791000087105
- Male-to-female transsexual – 407376001
- Female-to-male transsexual – 407377005
- Genderqueer, neither exclusively male nor female – 446131000124102
- Male to female transsexual person on hormone therapy – 714186001
- Female to male transsexual person on hormone therapy – 714189008
The C-CDA would also expect the SNOMED CT Codes to come along with these values.
But what is the source of truth of these values?. How do I know the above mentioned 8 values are the one’s we would need in the Gender Identity values?.
If you’re a subject matter expert then you need to have these sources handy to help your clients to build a better certified EHR systems. But, unfortunately by the time of writing this blog I don’t find a way to get a proper online source to get these values.
The above mentioned values are extracted from multiple certified EHR systems and consolidated here for your reference – so thank me later or feel free to buy me a coffee from this website here.
C-CDA <entry> section
How does the CCDA entry section would look like?
<entry typeCode="DRIV"> <observation classCode="OBS" moodCode="EVN"> <!-- ** Gender Identity** --> <templateId root="2.16.840.1.113883.10.20.22.4.38"/> <templateId root="2.16.840.1.113883.10.20.34.3.45" extension="2022-06-01" /> <id root="45efb604-7049-4a2e-ad33-d38556c7636c"/> <code code="76691-5" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Gender Identity"/> <statusCode code="completed"/> <effectiveTime nullFlavor="NI"> </effectiveTime> <value xsi:type="CD" nullFlavor="ASKU"/> </observation> </entry>
Develop the code in Mirth
Function to create genderIdentity XML
function genderIdentityXmlStructure(gender_identity){
var val;
switch (gender_identity) {
case "Identifies as male gender":
val = new XML('<value type="CD" code="446151000124109" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Identifies as male gender"/>');
break;
case "Identifies as female gender":
val = new XML('<value type="CD" code="446141000124107" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Identifies as female gender"/>');
break;
case "Identifies as nonbinary gender":
val = new XML('<value type="CD" code="33791000087105" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Identifies as nonbinary gender"/>');
break;
case "Male-to-female transsexual":
val = new XML('<value type="CD" code="407376001" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Male-to-female transsexual"/>');
break;
case "Female-to-male transsexual":
val = new XML('<value type="CD" code="407377005" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Female-to-male transsexual"/>');
break;
case "Genderqueer, neither exclusively male nor female":
val = new XML('<value type="CD" code="446131000124102" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Genderqueer, neither exclusively male nor female"/>');
break;
case "Male to female transsexual person on hormone therapy":
val = new XML('<value type="CD" code="714186001" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Male to female transsexual person on hormone therapy"/>');
break;
case "Female to male transsexual person on hormone therapy":
val = new XML('<value type="CD" code="714189008" codeSystem="2.16.840.1.113883.6.96" codeSystemName="SNOMED CT" displayName="Female to male transsexual person on hormone therapy"/>');
break;
case "Other":
val = new XML('<value type="CD" nullFlavor="OTH"/>');
break;
case "Unknown":
val = new XML('<value type="CD" nullFlavor="ASKU"/>');
break;
case "Not Applicable":
val = new XML('<value type="CD" nullFlavor="NA"/>');
break;
default:
val = new XML('<value type="CD" nullFlavor="UNK"/>');
}
return val;
}
Generating XML of the C-CDA
Below is the code for creating the <entry> section with in the social History Component section of a CCDA.
if (gender_identity) {
var entry = new XML('<entry typeCode="DRIV"></entry>');
var obs = new XML('<observation classCode="OBS" moodCode="EVN"></observation>');
obs.appendChild(new XML('<templateId root="2.16.840.1.113883.10.20.22.4.38"/>'));
obs.appendChild(new XML('<templateId root="2.16.840.1.113883.10.20.34.3.45" extension="2022-06-01" />'));
obs.appendChild(new XML('<id root="' + UUIDGenerator.getUUID() + '"/>'));
obs.appendChild(new XML('<code code="76691-5" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Gender Identity"/>'));
obs.appendChild(new XML('<statusCode code="completed"/>'));
obs.appendChild(new XML('<effectiveTime nullFlavor="NI"></effectiveTime>'));
var val = genderIdentityXmlStructure(gender_identity);
obs.appendChild(val);
entry.appendChild(obs);
}
Social History Section with Gender Identity
Imagine your building Social History CCDA section from scratch in Mirth then you need to use the code like below.
Parameters for function
Assuming there is a JSON data that comes to you from your EHR application as “msg” parameter. This msg parameter can have multiple values that corresponds to social history not just gender_identity.
But, generally gender_identity, sexual_orientation parameters are the stand-alone parameter covered in the demographics of a patient.
You can use these parameters as separate value in a function. Here is how I would generate a Social History Section in CCDA using Mirth’s E4XJS
function createSocialHistorySectionCCDA(msg,gender_identity,sexual_orientation,gender) {
var newSocialHistoryData = new XML("<component></component>");
var sectionData = new XML("<section></section>");
// Template ID for Social History Section
sectionData.appendChild(new XML("<templateId root='2.16.840.1.113883.10.20.22.2.17'/>"));
sectionData.appendChild(new XML("<templateId root='2.16.840.1.113883.10.20.22.2.17' extension='2015-08-01'/>"));
// Section code
sectionData.appendChild(new XML("<code code='29762-2' codeSystem='2.16.840.1.113883.6.1' displayName='Social History'/>"));
sectionData.appendChild(new XML("<title>Social History</title>"));
// Create <text> and <table>
var text = new XML("<text></text>");
var table = new XML("<table border='1' width='100%'><thead><tr><th>Aspect</th><th>Value</th></tr></thead><tbody></tbody></table>");
var tbody = table.elements("tbody")[0];
if (gender_identity) {
tbody.appendChild(new XML("<tr><td>Gender Identity</td><td>"+gender_identity+"</td></tr>"));
var entry = new XML('<entry typeCode="DRIV"></entry>');
var obs = new XML('<observation classCode="OBS" moodCode="EVN"></observation>');
obs.appendChild(new XML('<templateId root="2.16.840.1.113883.10.20.22.4.38"/>'));
obs.appendChild(new XML('<templateId root="2.16.840.1.113883.10.20.34.3.45" extension="2022-06-01" />'));
obs.appendChild(new XML('<id root="' + UUIDGenerator.getUUID() + '"/>'));
obs.appendChild(new XML('<code code="76691-5" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Gender Identity"/>'));
obs.appendChild(new XML('<statusCode code="completed"/>'));
obs.appendChild(new XML('<effectiveTime nullFlavor="NI"></effectiveTime>'));
var val = genderIdentityXmlStructure(gender_identity);
obs.appendChild(val);
entry.appendChild(obs);
sectionData.appendChild(entry);
}
// Append table into <text>, and <text> before <entry>s
text.appendChild(table);
sectionData.insertChildBefore(sectionData.children()[4], text); // ⬅ insert <text> as first child
newSocialHistoryData.appendChild(sectionData);
return newSocialHistoryData;
}