// looks for a matching relationship within "supertype"/abstract message parts private Relationship GetNestedRelationship(MessagePart part, string name) { Relationship relationship = part.GetRelationship(name, null, this.hl7InteractionSource.GetInteraction()); if (relationship == null) { foreach (SpecializationChild childType in part.SpecializationChilds) { if (TypeIsAssignable(childType.Name)) { MessagePart childPart = GetService().GetMessagePart(GetVersion(), childType.Name); relationship = GetNestedRelationship(childPart, name); if (relationship != null) { break; } } } } return(relationship); }