[英]Can not run the macro xx. may not be available in this workbook or all macros are disabled
[英]NHAPI 2.5.1 xx.(0).Components values, how to use
我已经为hl7 2.5.1使用NHapi找出了大部分(我认为)PID和RAX的值。
我遇到的困难是(假设)使用rxa.AdministeredCode.Components [5]之类的组件。
如何设置该值?
我为rxa.GetSubstanceManufacturerName(0).Components假定相同的东西吗? 和rxa.GetAdministrationNotes(0)。
吉娜
尝试这个
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
}
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.