/**
* Gets a default MSH value.
*/
protected Object getDefaultMSHValue(MessagePart part)
{
Primitive primitive = null;
TransferObject tobj;
if (part instanceof PrimitiveMessagePart)
{
primitive = ((PrimitiveMessagePart)part).getType();
}
switch (((HL7MessagePartMapping)part.getMapping()).getSeq())
{
case 7: // Message time
if (primitive != null)
{
return primitive.convert(new Timestamp(System.currentTimeMillis()));
}
break;
case 9: // Message type
String sType = ((HL7MessagePartMapping)m_message.getRoot().getMapping()).getName();
String sEvent = null;
int i = sType.indexOf('^');
if (i >= 0)
{
sEvent = sType.substring(i + 1);
sType = sType.substring(0, i);
}
if (primitive != null)
{
return sType;
}
tobj = new TransferObject(2);
setValue(tobj, (CompositeMessagePart)part, 1, sType);
setValue(tobj, (CompositeMessagePart)part, 2, sEvent);
return tobj;
case 10: // Control Id
if (primitive != null)
{
return primitive.convert(getControlId());
}
break;
case 11: // Processing Id