Managing loops within segments
I'm specifically working with creating an 837I file from my own POCO classes, and I'm trying to find if there is an easier way to some things. For example, I am adding diagnoses in the 2300 loop and it seems a bit tedious. There is this:
...AllHI.HI_OtherDiagnosisInformation = new List<HI_OtherDiagnosisInformation>();
where each HI_OtherDiagnosisInformation segment can take up to 12 diagnoses. However, each one is a separate property:
...AllHI.HI_OtherDiagnosisInformation.First().HealthCareCodeInformation_01
...AllHI.HI_OtherDiagnosisInformation.First().HealthCareCodeInformation_02
...AllHI.HI_OtherDiagnosisInformation.First().HealthCareCodeInformation_03
etc.
Is there an easier way to handle this other than switch statements or reflection? Perhaps helper methods?
Comments
1 comment
Hello,
I see this more as a 837I question rather than EdiFabric's. The representation of the transaction is driven by the official structure of 837I, hence in this particular case you have:
1. AllHI - which means that there is a collection of HI segments, all being allowed at this same position in any order. They are however different, the context of each being based on the values of the first two data elements.
2. The allowed HI segment HI_OtherDiagnosisInformation is repeatable, and all repeatable EDI items (loops, segments, data elements) are represented as typed lists.
So the implementation of 1) and 2) leads to how the class is designed. Why would you need reflection\helper method\switch to access items in a list ?
Please sign in to leave a comment.