Sub-Composite Level

Post author
Kevin Porter

Segment properties can obviously be Composite elements.
Is there a way to expand ediFrabric to allow for a sub-composite level?

In other words we'd like to create a Composite property as a SubComposite class vs string.
Is it possibly for us to create our own hierarchical attribute?

Sample - Health Care Diagnosis Code
HI*BK:A#1245~
Right now the composite level HI01-2 is just a string.
We'd like to make it a class with two properties.

~Kevin

Comments

7 comments

  • Comment author
    Admin

    Hello Kevin,

    Composite elements are supported from the outset of the framework, not sure why did you assume that this is missing.

    Please take a look at the Templates article, EDI Composite Data Elements. Also, an example of 5010 composite elements, and how they are used within segments. The HI segment is a collection of composite elements only.

     

    0
  • Comment author
    Kevin Porter

    Yes I'm well aware that composite elements are supported.  I was asking if there was a way to build in sub-composite level components.

    0
  • Comment author
    Admin

    Hi Kevin, could you please explain what are sub-composite level components, with a link/definition from the relevant documentation, X12 or EDIFACT?

    Also, your example from above, how do you expect it to be represented, give us a pseudo hierarchy or anything that will help us understand what you mean and why you can't use composite elements with additional elements instead, as prescribed by the EDI standards?.

     

     

    0
  • Comment author
    Admin

    As far as I understand it, you need to customize the class for whatever reason, that is not EDI-related. You can happily do so because the framework deals with EDI messages and discards all non-EDI related properties/classes, something like:

    [Composite("C022")]
    public class C022_Something
    {
    [Pos(1)]
    public string CodeListQualifierCode_01 { get; set; }
    [Pos(2)]
    public string IndustryCode_02
    {
    get
    {
    }
    set
    {
    MyOtherThing = new MyOtherThing();
    var p = value.Split(new[] { '#' });
    MyOtherThing.MyOtherProperty = p[0];
    MyOtherThing.MyOtherSubProperty = new MyOtherSubThing();
    MyOtherThing.MyOtherSubProperty.MyOtherSubProperty = p[1];
    }
    }

    public MyOtherThing MyOtherThing;
    }


    public class MyOtherThing
    {
    public string MyOtherProperty;
    public MyOtherSubThing MyOtherSubProperty;
    }

    public class MyOtherSubThing
    {
    public string MyOtherSubProperty;
    }

    [Segment("HI")]
    public class HI_Patient
    {
    [Pos(1)]
    public virtual C022_Something HealthCareCodeInformation_01 { get; set; }
    [Pos(2)]
    public virtual C022_Something HealthCareCodeInformation_02 { get; set; }

    public MyOtherThing MyUselessProperty;
    }

     

     

    0
  • Comment author
    Kevin Porter

    Sub-Composite level is not something designed by the X12 or EDIFACT standard. 
    We're trying to expand the concept of an ediFabric template and use it for another purpose.

    Real world example is HL7 messages.
    They fit perfectly into the model ediFabric has already built with the exception of sub-components.
    Sub-components have different delimiters just like a composite element within the X12 standard.

    From the example above, the sub-composite would be the Diagnosis Code field.
    We'd like to expand upon the string representation of the diagnosis code field and utilize a multi-field component delimited by "#".
    We can't add additional elements, because they'd all be delimited by the composite separator.
    We can obviously build out the field ourselves and just assign to the diagnosis code field.
    We were just trying to figure out if there was a way to expand ediFabrics hierarchy.

    0
  • Comment author
    Kevin Porter

    You're code example above works but I'm not sure how it will allow us to leverage the ediFabric validation, data attributes, writing engine, etc...

    For example, can you extend to build "MyOtherThing" as...

    [SubComposite("MOT")]
    public class MyOtherThing
    {
    [Pos(1)]
    [Required]
    public string Field1 { get; set; }
    [Pos(2)]
    public string Field2 { get; set; }
    [Pos(3)]
    public string Field3 { get; set; }
    }
    0
  • Comment author
    Admin

    It is not possible to "extend" it with an extra level down at the moment, however, we'll certainly add this once HL7 is supported. 

    0

Please sign in to leave a comment.