DFT_P03 的 nHapi GT1 段返回空集合

nHapi GT1 segment for DFT_P03 returning empty collection

我对以下问题感到困惑

示例消息:

MSH|^~\&|CWM|MySender|UNKNOWN|UNKNOWN|20160711080000||DFT^P03|976503|P|2.5|
EVN|P03|20160711080000
PID||12345^^^RIS|||Test^Patient||192532325445|F|||27 Lotus street ^^Morningside^^2121|||m7715050|3|S|||23377|||||||||||N
PV1||I||||||999^Ref Doctor^||||||||N||A|160998675|||||||||||||||||||||||||20160701130000
GT1|1||EVERYMAN^ADAM^A||2222 HOME STREET^^ISHPEMING^MI^49849^""^|444-33 3333|555-555-2004||||SEL^SELF|444-33 3333||||AUTO CLINIC|2222 HOME STREET^^ISHPEMING^MI^49849^""|555-555-2004|
OBR|1||2015021000043|20310^CT of the soft tissues of the neck, with contrast^CT^4^CT Scan Machine|0|201502101124|201502101124|||||||||^MIKE^SMITH||||||||IMIL
FT1|1|E292252||201502101124||CG|00279519|F||1|||IMIL|PRIVATE^||||A1|||^MIKE^SMITH^^^||2015021000043^IMIL||20310^CT of the soft tissues of the neck, with contrast^CT^4^CT Scan Machine|CT
PR1|1|AQ|20310^CT of the soft tissues of the neck, with contrast^CT^4^CT Scan Machine||201502101124|D||||||||||CT|

我可以解析消息,我可以使用 PID 没问题,但 GT1 就是不被接受。 DFT 确实支持 GT1 段(可选)但它总是返回一个空列表

PipeParser parser = new PipeParser();
IMessage m = parser.Parse(msg);
DFT_P03 dft = m as DFT_P03;
GT1 gt1 = dft.GetGT1();
var memName = gt1.GetGuarantorName()[0];

然后最后一行爆炸说我的索引超出范围,即我的 gt1 集合中没有任何内容。

我是不是加载错了?

您的示例消息的片段顺序有误。 GT1 段位于 TransactionGroups 和 ProcedureGroups 之后。