nHapi GT1 段,用于返回空集合DFT_P03

本文关键字:集合 DFT P03 空集 返回 GT1 用于 nHapi | 更新日期: 2023-09-27 17:56:26

我在下面被难住了

示例消息:

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 集合中没有任何内容。

我加载错了吗?

nHapi GT1 段,用于返回空集合DFT_P03

示例消息的句段顺序错误。GT1段位于事务组和过程组之后。