Skip to content

Commit

Permalink
#464: fix "unknown" gender translation between HL7v2 and HL7v3
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Ohr committed Jan 24, 2025
1 parent 207863b commit fc044e5
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,18 @@ abstract class AbstractHl7TranslatorV2toV3 implements Hl7TranslatorV2toV3 {
translateTelecom(builder, pid[13], homePhoneCode)
translateTelecom(builder, pid[14], workPhoneCode)

String gender = (pid[8].value ?: '').mapReverse('hl7v2v3-bidi-administrativeGender-administrativeGender')
if (pid[8].value == 'U') {
builder.administrativeGenderCode(nullFlavor: 'UNK')
} else {
String gender = (pid[8].value ?: '').mapReverse('hl7v2v3-bidi-administrativeGender-administrativeGender')
if (gender)
builder.administrativeGenderCode(code: gender)
}

String maritalStatus = (pid[16].value ?: '').mapReverse('hl7v2v3-patient-maritalStatus')
String religiousAffiliation = pid[17].value ?: ''

if (gender)
builder.administrativeGenderCode(code: gender)

if (pid[7][1].value)
builder.birthTime(value: pid[7][1].value)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ class PixFeedRequest3to2Translator implements Hl7TranslatorV3toV2 {
grp.PID[7][1].value = dropTimeZone(person.birthTime.@value.text())
if (person.administrativeGenderCode.@code.text()) {
grp.PID[8].value = person.administrativeGenderCode.@code.text().map('hl7v2v3-bidi-administrativeGender-administrativeGender')
} else if (person.administrativeGenderCode.@nullFlavor.text() == "UNK") {
grp.PID[8].value = 'U'
}

if (person.raceCode) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MSH|^~\&|1.2.840.114350.1.13.99998.8734^1.2.840.114350.1.13.99998.8734^ISO|unknown|1.2.840.114350.1.13.99999.4567^1.2.840.114350.1.13.99999.4567^ISO|unknown|20091112115139||ADT^A08|678@21acf7be-007c-41e6-b176-d0969794983b|P^T|2.3.1EVN|A08|20091112115139PID|||PIX10515W3^^^HIMSS2005&1.3.6.1.4.1.21367.2005.1.1&ISO~PIX10515W4^^^&1.2.3.4.5.1000&ISO~PIX10515W5^^^domain2~""^^^&1.12.23.34.45&ISO||WASHINGTON-UPDATE^MARY^ROSE^II^Dr.^^L~^ANNE^^^^^L~DEAN^^^^^^B||19771208|F||1004-1~1004-2|1 UPDATE ADDRESS^^CHICAGO^IL^60523^US~100 JORIE BLVD^^CHICAGO^IL^60555||012-0001^PRN^PH~012-0003^PRN^CP~012-0004^PRN^FX~marywash@gmx.de^NET^Internet|012-0002^WPN^PH|eng|M|1022|100-09-123456^^^&1.2.3&ISO|100-09-1234|||2178-2~2178-3|ChicagoPV1||O
MSH|^~\&|1.2.840.114350.1.13.99998.8734^1.2.840.114350.1.13.99998.8734^ISO|unknown|1.2.840.114350.1.13.99999.4567^1.2.840.114350.1.13.99999.4567^ISO|unknown|20091112115139||ADT^A08|678@21acf7be-007c-41e6-b176-d0969794983b|P^T|2.3.1EVN|A08|20091112115139PID|||PIX10515W3^^^HIMSS2005&1.3.6.1.4.1.21367.2005.1.1&ISO~PIX10515W4^^^&1.2.3.4.5.1000&ISO~PIX10515W5^^^domain2~""^^^&1.12.23.34.45&ISO||WASHINGTON-UPDATE^MARY^ROSE^II^Dr.^^L~^ANNE^^^^^L~DEAN^^^^^^B||19771208|U||1004-1~1004-2|1 UPDATE ADDRESS^^CHICAGO^IL^60523^US~100 JORIE BLVD^^CHICAGO^IL^60555||012-0001^PRN^PH~012-0003^PRN^CP~012-0004^PRN^FX~marywash@gmx.de^NET^Internet|012-0002^WPN^PH|eng|M|1022|100-09-123456^^^&1.2.3&ISO|100-09-1234|||2178-2~2178-3|ChicagoPV1||O
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<telecom use="MC" value="tel:012-0003"/>
<telecom use="H" value="fax:012-0004"/>
<telecom value="mailto:marywash@gmx.de"/>
<administrativeGenderCode code="F"/>
<administrativeGenderCode nullFlavor="UNK"/>
<birthTime value="19771208"/>
<!--deceasedInd/>
<deceasedTime/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MSH|^~\&|ICW_MPI|ICW|PIXV3FeedTransformer|PIXV3FeedTransformer|20071024113127||ADT^A04|205632|P^T|2.3.1
EVN|A04|20071024113127
PID|1||305090^^^MPI&2.16.840.1.113883.3.37.4.1.1.2.1.1&ISO~13278^^^HZLN&2.16.840.1.113883.3.37.4.1.1.2.411.1&ISO~02777^^^XREF2005&1.3.6.1.4.1.21367.2005.1.2&ISO||Hiccock^WildBill^^^^^L||19770114|M|||49 rue des fosses saint jacques^^Walldorf^^69226^DEU^H||||fra|U|||123-4567-890
PID|1||305090^^^MPI&2.16.840.1.113883.3.37.4.1.1.2.1.1&ISO~13278^^^HZLN&2.16.840.1.113883.3.37.4.1.1.2.411.1&ISO~02777^^^XREF2005&1.3.6.1.4.1.21367.2005.1.2&ISO||Hiccock^WildBill^^^^^L||19770114|U|||49 rue des fosses saint jacques^^Walldorf^^69226^DEU^H||||fra|U|||123-4567-890
PV1||O
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<family>Hiccock</family>
<given>WildBill</given>
</name>
<administrativeGenderCode code="M" />
<administrativeGenderCode nullFlavor="UNK" />
<birthTime value="19770114" />
<addr>
<country>DEU</country>
Expand Down
3 changes: 3 additions & 0 deletions src/site/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
</properties>
<body>
<release version="5.0.0" description="" date="">
<action issue="464" dev="ohr" type="fix">
Fix "unknown" gender mapping between HL7v2 and HL7v3
</action>
<action issue="463" dev="unixoid" type="add">
Implement CP-ITI-1301: Support for the option "Target Communities" in XDS metadata queries.
</action>
Expand Down

0 comments on commit fc044e5

Please sign in to comment.