我已经使用hl7 2.5.1的NHapi计算出了PID和RAX的大部分(我认为)值。
我遇到困难的是(我假设)使用rxa.AdministeredCode.Components5等组件的那些。
如何设置该值?
我假设rxa.GetSubstanceManufacturerName(0).Components?也是如此。和rxa.GetAdministrationNotes(0)。
吉娜
发布于 2018-05-21 21:49:54
尝尝这个
class Program
{
static void Main(string[] args)
{
EncodingCharacters enchars = new EncodingCharacters('|', "^~\\&");
IModelClassFactory theFactory = new DefaultModelClassFactory();
NHapi.Model.V251.Segment.RXA rxa = new NHapi.Model.V251.Segment.RXA(new VXU_V04(theFactory), theFactory);
IType[] t = rxa.GetSubstanceManufacturerName(0).Components;
SetRXA(t);
Debug.Print(PipeParser.Encode(rxa, enchars));
Console.Read();
}
public static void SetRXA(IType[] components)
{
for (int i = 0; i < components.Length; i++)
{
if (components[i] is IPrimitive)
{
IPrimitive prim = (IPrimitive)components[i];
prim.Value = "Component"+i;
}
else if (components[i] is IComposite)
SetRXA(((IComposite)components[i]).Components);
//if Varies do something else
}
}
}https://stackoverflow.com/questions/48960016
复制相似问题