-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need help to define repetition of data elements within a segment in an edifact? #105
Comments
yes, List DOQ is a property. |
I don't see how a segment class could contain an element list. Keep in mind this is a model first approach. Am I missing something? |
Hi @cleftheris I have a DRU segment in the message, below is the example
Inside DRU segment the 4th element(or group of components) is being repeated, so the elements are of same type(have the same path, definition) and are separated by an asterisk as a separator, unlike the other elements of segments which are separated by + and can be of different types.
I have defined a class to parse the content of DRU segment and another list of class DateOrQuanitity to deserialize the more than one elements of the same type separated by I am not sure how to define Repetition Separator, I assume once I can define this separator, I can parse the element repetition as a list of objects of class Below is the class definition for DRU segment [EdiSegment]
[EdiPath("DRU")]
public class DrugDetails
{
[EdiValue("X(1)", Path = "DRU/0/0")]
public string ItemDescriptionIdentification { get; set; }
[EdiValue("X(35)", Path = "DRU/0/1")]
public string DrugName { get; set; }
[EdiValue("X(35)", Path = "DRU/0/2")]
public string DrugNumber { get; set; }
[EdiValue("X(3)", Path = "DRU/0/3")]
public string CodeListResponsibility { get; set; }
[EdiValue("X(35)", Path = "DRU/0/9")]
public string FullDrugNumber { get; set; }
[EdiValue("X(35)", Path = "DRU/0/10")]
public string DrugStrength { get; set; }
[EdiValue("X(35)", Path = "DRU/0/11")]
public string DrugForm { get; set; }
[EdiValue("X(3)", Path = "DRU/1/0")]
public string QuantityQualifier { get; set; }
[EdiValue("X(35)", Path = "DRU/1/1")]
public string Quantity { get; set; }
[EdiValue("X(3)", Path = "DRU/1/2")]
public string CodeListQualifier { get; set; }
[EdiValue("X(3)", Path = "DRU/1/3")]
public string UnitSourceCode { get; set; }
[EdiValue("X(15)", Path = "DRU/1/4")]
public string PotencyUnitCode { get; set; }
[EdiValue("X(70)", Path = "DRU/2/1")]
public string SIGInstructions1 { get; set; }
public List<DateOrQuanitity> DateTimePeriod { get; set; }
[EdiValue("X(3)", Path = "DRU/5/0")]
public string RefillQualifier { get; set; }
[EdiValue("X(35)", Path = "DRU/5/1")]
public string RefillQuantity { get; set; }
} And this the class to define the element which is being repeated
[EdiElement]
[EdiPath("DRU/3")]
public class DateOrQuanitity
{
[EdiValue("X(35)", Path = "DRU/3/1")]
public string DateOrQuantity { get; set; }
[EdiValue("X(100)", Path = "DRU/3/2")]
public string FormatQualifier { get; set; }
} please let me know if i am not clear enough. |
Hi again, someone recently brought to my attention a case in I did not know that, so my reply above is not accurate at all. This is not supported at the moment but I believe that I can make something work is an upcoming release. Thanks for poining this out |
As of v1.9.4 this is fully supported using wildcard paths like so. In this version the following will work fine both serializing and deserializing. [EdiSegment]
[EdiPath("DRU")]
public class DrugDetails
{
[EdiPath("DRU/*")]
public List<DateOrQuantity> DOQ
}
[EdiElement]
public class DateOrQuanitity
{
[EdiValue("X(35)", Path = "*/*/1")]
public string DateOrQuantity { get; set; }
[EdiValue("X(100)", Path = "*/*/2")]
public string FormatQualifier { get; set; }
} |
I am not sure how to add definition in case of repetitive data elements inside a segment.
below is an example of DRU segment where the 4th data element is repeated and the repetition delimiter is asterisk
*
.I want to parse the values into DOQ class.
Below is the definition of DOQ class type
Is there a recommended way of accomplishing this
or any way to define Repetition Separator?
The text was updated successfully, but these errors were encountered: