//private Message message; //private String name; /// <summary> Calls the abstract init() method to create the fields in this segment. /// /// </summary> /// <param name="parent">parent group /// </param> /// <param name="factory">all implementors need a model class factory to find datatype classes, so we /// include it as an arg here to emphasize that fact ... AbstractSegment doesn't actually /// use it though /// </param> public AbstractSegment(Group parent, ModelClassFactory factory) { this.parent = parent; this.fields = new System.Collections.ArrayList(); this.types = new System.Collections.ArrayList(); this.required = new System.Collections.ArrayList(); this.length = new System.Collections.ArrayList(); this.args = new System.Collections.ArrayList(); this.maxReps = new System.Collections.ArrayList(); this.fieldDescriptions = new System.Collections.ArrayList(); }
//private Message message; //private String name; /// <summary> Calls the abstract init() method to create the fields in this segment. /// /// </summary> /// <param name="parent">parent group /// </param> /// <param name="factory">all implementors need a model class factory to find datatype classes, so we /// include it as an arg here to emphasize that fact ... AbstractSegment doesn't actually /// use it though /// </param> public AbstractSegment(Group parent, ModelClassFactory factory) { this.parent = parent; this.fields = new System.Collections.ArrayList(); this.types = new System.Collections.ArrayList(); this.required = new System.Collections.ArrayList(); this.length = new System.Collections.ArrayList(); this.args = new System.Collections.ArrayList(); this.maxReps = new System.Collections.ArrayList(); this.fieldDescriptions = new System.Collections.ArrayList(); }
/// <summary> Creates a new instance of GenericMessage. /// /// </summary> /// <param name="factory">class factory for contained structures /// </param> public GenericMessage(ModelClassFactory factory) : base(factory) { try { this.addNonstandardSegment("MSH"); } catch (HL7Exception e) { System.String message = "Unexpected error adding GenericSegment to GenericMessage."; HapiLogFactory.getHapiLog(this.GetType()).error(message, e); throw new System.ApplicationException(message); } }
/// <summary> Creates a new instance of GenericMessage. /// /// </summary> /// <param name="factory">class factory for contained structures /// </param> public GenericMessage(ModelClassFactory factory) : base(factory) { try { this.addNonstandardSegment("MSH"); } catch (HL7Exception e) { System.String message = "Unexpected error adding GenericSegment to GenericMessage."; HapiLogFactory.getHapiLog(this.GetType()).error(message, e); throw new System.ApplicationException(message); } }
/// <summary> Sets the data type of field 5 in the given OBX segment to the value of OBX-2. The argument /// is a Segment as opposed to a particular OBX because it is meant to work with any version. /// </summary> public static void fixOBX5(Segment segment, ModelClassFactory factory) { try { //get unqualified class name Primitive obx2 = (Primitive)segment.getField(2, 0); Varies v = (Varies)segment.getField(5, 0); if (obx2.Value == null) { if (v.Data != null) { if (!(v.Data is Primitive) || ((Primitive)v.Data).Value != null) { throw new HL7Exception("OBX-5 is valued, but OBX-2 is not. A datatype for OBX-5 must be specified using OBX-2.", HL7Exception.REQUIRED_FIELD_MISSING); } } } else { //set class System.Type c = factory.getTypeClass(obx2.Value, segment.Message.Version); // Class c = ca.uhn.hl7v2.parser.Parser.findClass(obx2.getValue(), // segment.getMessage().getVersion(), // "datatype"); v.Data = (Type)c.GetConstructor(new System.Type[] { typeof(Message) }).Invoke(new System.Object[] { v.Message }); } } catch (HL7Exception e) { throw e; } catch (System.Exception e) { //UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Class.getName' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'" throw new HL7Exception(e.GetType().FullName + " trying to set data type of OBX-5", HL7Exception.APPLICATION_INTERNAL_ERROR, e); } }
/// <param name="theFactory">factory for model classes (e.g. group, segment) for this message /// </param> public AbstractMessage(ModelClassFactory theFactory) : base(theFactory) { }
public V21(ModelClassFactory factory) : base(factory) { }
/// <summary> This constructor should only be used by classes that implement Message directly. /// /// </summary> /// <param name="factory">the factory for classes of segments, groups, and datatypes under this group /// </param> protected internal AbstractGroup(ModelClassFactory factory) { this.myFactory = factory; init(); }
/// <summary> This constructor should be used by implementing classes that do not /// also implement Message. /// /// </summary> /// <param name="parent">the group to which this Group belongs. /// </param> /// <param name="factory">the factory for classes of segments, groups, and datatypes under this group /// </param> protected internal AbstractGroup(Group parent, ModelClassFactory factory) { this.parent = parent; this.myFactory = factory; init(); }
/// <param name="theFactory">factory for model classes (e.g. group, segment) for this message /// </param> public AbstractMessage(ModelClassFactory theFactory) : base(theFactory) { }
/// <summary> Sets the data type of field 5 in the given OBX segment to the value of OBX-2. The argument /// is a Segment as opposed to a particular OBX because it is meant to work with any version. /// </summary> public static void fixOBX5(Segment segment, ModelClassFactory factory) { try { //get unqualified class name Primitive obx2 = (Primitive) segment.getField(2, 0); Varies v = (Varies) segment.getField(5, 0); if (obx2.Value == null) { if (v.Data != null) { if (!(v.Data is Primitive) || ((Primitive) v.Data).Value != null) { throw new HL7Exception("OBX-5 is valued, but OBX-2 is not. A datatype for OBX-5 must be specified using OBX-2.", HL7Exception.REQUIRED_FIELD_MISSING); } } } else { //set class System.Type c = factory.getTypeClass(obx2.Value, segment.Message.Version); // Class c = ca.uhn.hl7v2.parser.Parser.findClass(obx2.getValue(), // segment.getMessage().getVersion(), // "datatype"); v.Data = (Type) c.GetConstructor(new System.Type[]{typeof(Message)}).Invoke(new System.Object[]{v.Message}); } } catch (HL7Exception e) { throw e; } catch (System.Exception e) { //UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Class.getName' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'" throw new HL7Exception(e.GetType().FullName + " trying to set data type of OBX-5", HL7Exception.APPLICATION_INTERNAL_ERROR, e); } }
public V22(ModelClassFactory factory) : base(factory) { }
/// <summary>Creates a new instance of GenericGroup </summary> public GenericGroup(Group parent, System.String name, ModelClassFactory factory) : base(parent, factory) { this.name = name; }
/// <summary> This constructor should only be used by classes that implement Message directly. /// /// </summary> /// <param name="factory">the factory for classes of segments, groups, and datatypes under this group /// </param> protected internal AbstractGroup(ModelClassFactory factory) { this.myFactory = factory; init(); }
/// <summary> This constructor should be used by implementing classes that do not /// also implement Message. /// /// </summary> /// <param name="parent">the group to which this Group belongs. /// </param> /// <param name="factory">the factory for classes of segments, groups, and datatypes under this group /// </param> protected internal AbstractGroup(Group parent, ModelClassFactory factory) { this.parent = parent; this.myFactory = factory; init(); }
/// <summary>Creates a new instance of GenericGroup </summary> public GenericGroup(Group parent, System.String name, ModelClassFactory factory) : base(parent, factory) { this.name = name; }