I'm trying to encode maiden name and I'm not sure I'm doing it right. Surprisingly Mother's Maiden Name seems to be a standard field but Maiden Name isn't.
My thought is that you would make a 2nd XPN for Patient Name then add the maiden name as the family name and finally set the Name Code to 'M' for Maiden.
I can't find an example online so I just want to know if this is the right way to do it or if I'm off the mark.
ADT_A01 adt = new ADT_A01();
adt.initQuickstart("ADT", "A01", "P");
PID pid = adt.getPID();
pid.getPatientName(0).getFamilyName().getSurname().setValue("Doe");
pid.getPatientName(0).getGivenName().setValue("Jane");
pid.getPatientIdentifierList(0).getIDNumber().setValue("123456");
// now make a 2nd name to handle the maiden name
pid.getPatientName(1).getFamilyName().getSurname().setValue("Smith");
pid.getPatientName(1).getNameTypeCode().setValue( "M" );
HapiContext context = new DefaultHapiContext();
Parser parser = context.getPipeParser();
String encodedMessage = parser.encode(adt);
System.out.println("Printing ER7 Encoded Message:");
System.out.println(encodedMessage);
Output
PID|||123456||Doe^Jane~Smith^^^^^^M
In context of HL7 v2.5, PID.5.1 - Family Name
is used to provide name of the person.
There is separate segment PID.6 - Mother's Maiden Name
to mention Maiden name. Yes, this is second instance of name; I was wrong while discussing in comments.
Following is the quote from here:
PID.6 - Mother's Maiden Name
This field contains the family name under which the mother was born (i.e., before marriage). It is used to distinguish between patients with the same last name.
Also, some details from here:
PID.6.1 - Family Name
This component allows full specification of the surname of a person. Where appropriate, it differentiates the person's own surname from that of the person's partner or spouse, in cases where the person's name may contain elements from either name. It also permits messages to distinguish the surname prefix (such as "van" or "de") from the surname root. See section 2.A.30, "FN - family name".
So, you can use the same syntax to create Maiden Name. I never used the toolkit, so I may not help you with the code.