-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathEDI_X12_835.cs
1692 lines (1547 loc) · 57.5 KB
/
EDI_X12_835.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;
using NFX;
using NFX.Environment;
using NFX.Parsing;
using ProtoBuf;
namespace Serbench.Specimens.Tests
{
[ProtoContract]
[DataContract]
[Serializable]
public abstract class Segment
{
public Segment(string segmentTag)
{ SegmentTag = segmentTag; }
[ProtoMember(1)]
[DataMember]
public string SegmentTag;
}
public class EDI_X12_835 : Test
{
public EDI_X12_835(TestingSystem context, IConfigSectionNode conf)
: base(context, conf)
{
if (m_Count < 1) m_Count = 1;
for (var i = 0; i < m_Count; i++)
m_Data.Add(EDI_X12_835Data.Make());
}
[Config]
private bool m_List;
[Config]
private int m_Count;
private List<EDI_X12_835Data> m_Data = new List<EDI_X12_835Data>();
public override Type GetPayloadRootType()
{
var root = m_List ? (object)m_Data : m_Data[0];
return root.GetType();
}
public override void PerformSerializationTest(Serializer serializer, Stream target)
{
var root = m_List ? (object)m_Data : m_Data[0];
serializer.Serialize(root, target);
}
public override void PerformDeserializationTest(Serializer serializer, Stream target)
{
var deserialized = serializer.Deserialize(target);
var originalRoot = m_List ? (object)m_Data : m_Data[0];
serializer.AssertPayloadEquality(this, originalRoot, deserialized);
}
}
[ProtoContract]
[DataContract]
[Serializable]
public class EDI_X12_835Data
{
public EDI_X12_835Data() { }
[ProtoMember(1)]
[DataMember]
public BPR_FinancialInformation BPR_FinancialInformation;
[ProtoMember(2)]
[DataMember]
public TRN_ReassociationTraceNumber TRN_ReassociationTraceNumber;
[ProtoMember(3)]
[DataMember]
public CUR_ForeignCurrencyInformation CUR_ForeignCurrencyInformation;
[ProtoMember(4)]
[DataMember]
public List<REF_SubLoop> REF_SubLoops;
[ProtoMember(6)]
[DataMember]
public DTM_Date DTM_ProductionDate;
[ProtoMember(7)]
[DataMember]
public N1_SubLoop N1_SubLoop;
[ProtoMember(8)]
[DataMember]
public TS835_2000_Loop TS835_2000_Loop;
[ProtoMember(9)]
[DataMember]
public List<PLB_ProviderAdjustment> PLB_ProviderAdjustmentList;
public static EDI_X12_835Data Make()
{
return new EDI_X12_835Data()
{
BPR_FinancialInformation = BPR_FinancialInformation.Make(),
TRN_ReassociationTraceNumber = TRN_ReassociationTraceNumber.Make(),
CUR_ForeignCurrencyInformation = CUR_ForeignCurrencyInformation.Make(),
REF_SubLoops = new List<REF_SubLoop>() { REF_SubLoop.Make(), REF_SubLoop.Make(), REF_SubLoop.Make(), },
DTM_ProductionDate = DTM_Date.Make(),
N1_SubLoop = N1_SubLoop.Make(),
TS835_2000_Loop = TS835_2000_Loop.Make(),
PLB_ProviderAdjustmentList = new List<PLB_ProviderAdjustment>() { PLB_ProviderAdjustment.Make(),
PLB_ProviderAdjustment.Make(), PLB_ProviderAdjustment.Make(), PLB_ProviderAdjustment.Make(), }
};
}
public static bool AssertPayloadEquality(object original, object deserialized, out string errorString)
{
errorString = null;
if (original is IList<Serbench.Specimens.Tests.EDI_X12_835Data>)
return deserialized!=null && original.GetType()==deserialized.GetType();
var originalTyped = original as Serbench.Specimens.Tests.EDI_X12_835Data;
var deserializedTyped = deserialized as Serbench.Specimens.Tests.EDI_X12_835Data;
if (originalTyped == null || deserializedTyped == null)
errorString = "Error: originalTyped or deserializedType == null";
else if (originalTyped.PLB_ProviderAdjustmentList.Count != deserializedTyped.PLB_ProviderAdjustmentList.Count)
errorString = "Error: originalTyped.PLB_ProviderAdjustmentList.Count == deserializedTyped.PLB_ProviderAdjustmentList.Count ({0} != {1}".Args(
originalTyped.PLB_ProviderAdjustmentList.Count, deserializedTyped.PLB_ProviderAdjustmentList.Count);
else if (originalTyped.PLB_ProviderAdjustmentList[0].Reference_Identification
!= deserializedTyped.PLB_ProviderAdjustmentList[0].Reference_Identification)
errorString = "Error: originalTyped.PLB_ProviderAdjustmentList[0].Reference_Identification != deserializedTyped.PLB_ProviderAdjustmentList[0].Reference_Identification({0} != {1})".Args(
originalTyped.PLB_ProviderAdjustmentList[0].Reference_Identification,
deserializedTyped.PLB_ProviderAdjustmentList[0].Reference_Identification
);
return (errorString == null) ? true : false;
}
}
[ProtoContract]
[DataContract]
[Serializable]
public class AccoungInfo
{
public AccoungInfo() { }
[ProtoMember(1)]
[DataMember]
public string DFI_Number_Qualifier;
[ProtoMember(2)]
[DataMember]
public string DFI_Identification_Number;
[ProtoMember(3)]
[DataMember]
public string Account_Number_Qualifier;
[ProtoMember(4)]
[DataMember]
public string Account_Number;
public static AccoungInfo Make()
{
var result = new AccoungInfo();
result.Account_Number = NaturalTextGenerator.GenerateWord();
result.Account_Number_Qualifier = "Q";
result.DFI_Identification_Number = ExternalRandomGenerator.Instance.NextRandomInteger.ToString();
result.DFI_Number_Qualifier = "Q";
return result;
}
}
[ProtoContract]
[DataContract]
[Serializable]
public class BPR_FinancialInformation : Segment
{
public BPR_FinancialInformation()
: base("BPR") { }
public static BPR_FinancialInformation Make()
{
var result = new BPR_FinancialInformation();
result.TransactionHandlingCode = ExternalRandomGenerator.Instance.NextRandomInteger;
result.CreditDebit_Flag_Code = ExternalRandomGenerator.Instance.NextRandomInteger;
result.CreditDebit_Flag_Code = ExternalRandomGenerator.Instance.AsInt();
result.Payment_Format_Code = "CA";
result.AccoungInfo1 = AccoungInfo.Make();
result.Originating_Company_Identifier =
result.Originating_Company_Supplemental_Code = "CSC";
result.AccoungInfo2 = AccoungInfo.Make();
result.Date = DateTime.Now.ToShortDateString();
result.AccoungInfo3 = AccoungInfo.Make();
return result;
}
[ProtoMember(2)]
[DataMember]
public int TransactionHandlingCode;
[ProtoMember(3)]
[DataMember]
public int CreditDebit_Flag_Code;
[ProtoMember(4)]
[DataMember]
public decimal Payment_Method_Code;
[ProtoMember(5)]
[DataMember]
public string Payment_Format_Code;
[ProtoMember(6)]
[DataMember]
public AccoungInfo AccoungInfo1;
[ProtoMember(7)]
[DataMember]
public string Originating_Company_Identifier;
[ProtoMember(8)]
[DataMember]
public string Originating_Company_Supplemental_Code;
[ProtoMember(9)]
[DataMember]
public AccoungInfo AccoungInfo2;
[ProtoMember(10)]
[DataMember]
public string Date;
[ProtoMember(11)]
[DataMember]
public AccoungInfo AccoungInfo3;
}
[ProtoContract]
[DataContract]
[Serializable]
public class TRN_ReassociationTraceNumber : Segment
{
public TRN_ReassociationTraceNumber()
: base("TRN") { }
[ProtoMember(2)]
[DataMember]
public string Trace_Type_Code;
[ProtoMember(3)]
[DataMember]
public string Reference_Identification;
[ProtoMember(4)]
[DataMember]
public string Originatin_Company_Identifier;
[ProtoMember(5)]
[DataMember]
public string Reference_Identification2;
public static TRN_ReassociationTraceNumber Make()
{
return new TRN_ReassociationTraceNumber()
{
Trace_Type_Code = "TT",
Reference_Identification = NaturalTextGenerator.GenerateWord(),
Originatin_Company_Identifier = NaturalTextGenerator.GenerateWord(),
Reference_Identification2 = NaturalTextGenerator.GenerateWord(),
};
}
}
[ProtoContract]
[DataContract]
[Serializable]
public class CUR_DateTime
{
public CUR_DateTime() { }
[ProtoMember(1)]
[DataMember]
public string Qualifier;
[ProtoMember(2)]
[DataMember]
public string Date;
[ProtoMember(3)]
[DataMember]
public string Time;
public static CUR_DateTime Make()
{
return new CUR_DateTime()
{
Qualifier = "Q",
Date = DateTime.Now.ToShortDateString(),
Time = DateTime.Now.ToShortTimeString()
};
}
}
[ProtoContract]
[DataContract]
[Serializable]
public class CUR_ForeignCurrencyInformation : Segment
{
public CUR_ForeignCurrencyInformation() : base("CUR") { }
[ProtoMember(1)]
[DataMember]
public string Entity_Identifier_Code;
[ProtoMember(2)]
[DataMember]
public string Currency_Code;
[ProtoMember(3)]
[DataMember]
public string Exchange_Rate;
[ProtoMember(4)]
[DataMember]
public string Entity_Identifier_Code2;
[ProtoMember(5)]
[DataMember]
public string Currency_Code2;
[ProtoMember(6)]
[DataMember]
public string Currency_Market_Exchange_Code;
[ProtoMember(7)]
[DataMember]
public List<CUR_DateTime> CUR_DateTimes;
public static CUR_ForeignCurrencyInformation Make()
{
return new CUR_ForeignCurrencyInformation()
{
Entity_Identifier_Code = "CU",
Currency_Code = "CAD",
Exchange_Rate = "1.25",
Entity_Identifier_Code2 = NaturalTextGenerator.Generate(3),
Currency_Code2 = "USD",
Currency_Market_Exchange_Code = "FX",
CUR_DateTimes = new List<CUR_DateTime>() { CUR_DateTime.Make(), CUR_DateTime.Make(),
CUR_DateTime.Make(), CUR_DateTime.Make(), CUR_DateTime.Make(), CUR_DateTime.Make(), CUR_DateTime.Make(), CUR_DateTime.Make(), }
};
}
}
[ProtoContract]
[DataContract]
[Serializable]
public class REF_SubLoop
{
public REF_SubLoop() { }
[ProtoMember(1)]
[DataMember]
public REF_Identification REF_ReceiverIdentification;
[ProtoMember(2)]
[DataMember]
public REF_Identification REF_VersionIdentification;
public static REF_SubLoop Make()
{
return new REF_SubLoop()
{
REF_ReceiverIdentification = REF_Identification.Make(),
REF_VersionIdentification = REF_Identification.Make()
};
}
}
[ProtoContract]
[DataContract]
[Serializable]
public class REF_Identification : Segment
{
public REF_Identification() : base("REF") { }
[ProtoMember(1)]
[DataMember]
public string Reference_Identification_Qualifier;
[ProtoMember(2)]
[DataMember]
public string Reference_Identification;
[ProtoMember(3)]
[DataMember]
public string Description;
[ProtoMember(4)]
[DataMember]
public string Description2;
public static REF_Identification Make()
{
return new REF_Identification()
{
Reference_Identification_Qualifier = "RF",
Reference_Identification = NaturalTextGenerator.GenerateWord(),
Description = NaturalTextGenerator.Generate(50),
Description2 = NaturalTextGenerator.Generate(20)
};
}
}
[ProtoContract]
[DataContract]
[Serializable]
public class DTM_Date : Segment
{
public DTM_Date() : base("DTM") { }
[ProtoMember(1)]
[DataMember]
public string Date_Time_Qualifier;
[ProtoMember(2)]
[DataMember]
public string Date;
[ProtoMember(3)]
[DataMember]
public string Time;
[ProtoMember(4)]
[DataMember]
public string Time_Code;
[ProtoMember(5)]
[DataMember]
public string Date_Time_Period_Format_Qualifier;
[ProtoMember(6)]
[DataMember]
public string Date_Time_Period;
public static DTM_Date Make()
{
return new DTM_Date()
{
Date_Time_Qualifier = "DT",
Date = DateTime.Now.ToShortDateString(),
Time = DateTime.Now.ToShortTimeString(),
Time_Code = "UTC",
Date_Time_Period_Format_Qualifier = "D",
Date_Time_Period = "M"
};
}
}
[ProtoContract]
[DataContract]
[Serializable]
public class N1_SubLoop
{
public N1_SubLoop() { }
[ProtoMember(1)]
[DataMember]
public TS835_1000A_Loop TS835_1000A_Loop;
[ProtoMember(2)]
[DataMember]
public TS835_1000B_Loop TS835_1000B_Loop;
public static N1_SubLoop Make()
{
return new N1_SubLoop()
{
TS835_1000A_Loop = TS835_1000A_Loop.Make(),
TS835_1000B_Loop = TS835_1000B_Loop.Make()
};
}
}
[ProtoContract]
[DataContract]
[Serializable]
public class TS835_1000A_Loop
{
public TS835_1000A_Loop() { }
[ProtoMember(1)]
[DataMember]
public N1_PartyIdentification N1_PayerIdentification;
[ProtoMember(2)]
[DataMember]
public N3_PartyAddress N3_PayerAddress;
[ProtoMember(3)]
[DataMember]
public N4_PartyCity_State_ZIPCode N4_PayerCity_State_ZIPCode;
[ProtoMember(4)]
[DataMember]
public List<REF_AdditionalPartyIdentification> REF_AdditionalPayerIdentification_Loop;
[ProtoMember(5)]
[DataMember]
public PER_SubLoop PER_SubLoop;
public static TS835_1000A_Loop Make()
{
return new TS835_1000A_Loop()
{
N1_PayerIdentification = N1_PartyIdentification.Make(),
N3_PayerAddress = N3_PartyAddress.Make(),
N4_PayerCity_State_ZIPCode = N4_PartyCity_State_ZIPCode.Make(),
REF_AdditionalPayerIdentification_Loop = new List<REF_AdditionalPartyIdentification>() { REF_AdditionalPartyIdentification.Make(),
REF_AdditionalPartyIdentification.Make(), REF_AdditionalPartyIdentification.Make(), },
PER_SubLoop = PER_SubLoop.Make()
};
}
}
[ProtoContract]
[DataContract]
[Serializable]
public class TS835_1000B_Loop
{
public TS835_1000B_Loop() { }
[ProtoMember(1)]
[DataMember]
public N1_PartyIdentification N1_PayeeIdentification;
[ProtoMember(2)]
[DataMember]
public N3_PartyAddress N3_PayeeAddress;
[ProtoMember(3)]
[DataMember]
public N4_PartyCity_State_ZIPCode N4_PayeeCity_State_ZIPCode;
[ProtoMember(4)]
[DataMember]
public List<REF_AdditionalPartyIdentification> REF_PayeeAdditionalIdentification;
[ProtoMember(5)]
[DataMember]
public RDM_RemittanceDeliveryMethod RDM_RemittanceDeliveryMethod;
public static TS835_1000B_Loop Make()
{
return new TS835_1000B_Loop()
{
N1_PayeeIdentification = N1_PartyIdentification.Make(),
N3_PayeeAddress = N3_PartyAddress.Make(),
N4_PayeeCity_State_ZIPCode = N4_PartyCity_State_ZIPCode.Make(),
REF_PayeeAdditionalIdentification = new List<REF_AdditionalPartyIdentification>() { REF_AdditionalPartyIdentification.Make(), REF_AdditionalPartyIdentification.Make(), REF_AdditionalPartyIdentification.Make(), },
RDM_RemittanceDeliveryMethod = RDM_RemittanceDeliveryMethod.Make()
};
}
}
[ProtoContract]
[DataContract]
[Serializable]
public class N1_PartyIdentification : Segment
{
public N1_PartyIdentification() : base("N1") { }
[ProtoMember(1)]
[DataMember]
public string Entity_Identifier_Code;
[ProtoMember(2)]
[DataMember]
public string Name;
[ProtoMember(3)]
[DataMember]
public string Identification_Code_Qualifier;
[ProtoMember(4)]
[DataMember]
public string Identification_Code;
[ProtoMember(5)]
[DataMember]
public string Entity_Relationship_Code;
[ProtoMember(6)]
[DataMember]
public string Entity_Identifier_Code2;
public static N1_PartyIdentification Make()
{
return new N1_PartyIdentification()
{
Entity_Identifier_Code = "TY",
Name = NaturalTextGenerator.GenerateFullName(),
Identification_Code_Qualifier = "CU",
Identification_Code = NaturalTextGenerator.GenerateWord(),
Entity_Relationship_Code = NaturalTextGenerator.GenerateWord(),
Entity_Identifier_Code2 = NaturalTextGenerator.GenerateWord()
};
}
}
[ProtoContract]
[DataContract]
[Serializable]
public class N3_PartyAddress : Segment
{
public N3_PartyAddress() : base("N3") { }
[ProtoMember(1)]
[DataMember]
public string AddressInformation1;
[ProtoMember(2)]
[DataMember]
public string AddressInformation2;
public static N3_PartyAddress Make()
{
return new N3_PartyAddress()
{
AddressInformation1 = NaturalTextGenerator.GenerateAddressLine(),
AddressInformation2 = NaturalTextGenerator.GenerateUSCityStateZip()
};
}
}
[ProtoContract]
[DataContract]
[Serializable]
public class N4_PartyCity_State_ZIPCode : Segment
{
public N4_PartyCity_State_ZIPCode() : base("N4") { }
[ProtoMember(1)]
[DataMember]
public string City_Name;
[ProtoMember(2)]
[DataMember]
public string State_or_Province_Code;
[ProtoMember(3)]
[DataMember]
public string Postal_Code;
[ProtoMember(4)]
[DataMember]
public string Country_Code;
[ProtoMember(5)]
[DataMember]
public string Location_Qualifier;
[ProtoMember(6)]
[DataMember]
public string Location_Identifier;
[ProtoMember(7)]
[DataMember]
public string Country_Subdivision_Code;
public static N4_PartyCity_State_ZIPCode Make()
{
return new N4_PartyCity_State_ZIPCode()
{
City_Name = NaturalTextGenerator.GenerateCityName(),
State_or_Province_Code = "CA",
Postal_Code = "98155",
Country_Code = "USA",
Location_Qualifier = "LA",
Location_Identifier = "1234567.12",
Country_Subdivision_Code = "WW"
};
}
}
[ProtoContract]
[DataContract]
[Serializable]
public class REF_AdditionalPartyIdentification : Segment
{
public REF_AdditionalPartyIdentification() : base("REF") { }
[ProtoMember(1)]
[DataMember]
public string Reference_Identification_Qualifier;
[ProtoMember(2)]
[DataMember]
public string Reference_Identification;
[ProtoMember(3)]
[DataMember]
public string Description;
[ProtoMember(4)]
[DataMember]
public string Description2;
public static REF_AdditionalPartyIdentification Make()
{
return new REF_AdditionalPartyIdentification()
{
Reference_Identification_Qualifier = "QU",
Reference_Identification = NaturalTextGenerator.GenerateWord(),
Description = NaturalTextGenerator.Generate(70),
Description2 = NaturalTextGenerator.Generate(30)
};
}
}
[ProtoContract]
[DataContract]
[Serializable]
public class PER_SubLoop
{
public PER_SubLoop() { }
[ProtoMember(1)]
[DataMember]
public PER_PartyContactInformation PER_PayerBusinessContactInformation;
[ProtoMember(2)]
[DataMember]
public List<PER_PartyContactInformation> PER_PayerTechnicalContactInformation;
[ProtoMember(3)]
[DataMember]
public PER_PartyContactInformation PER_PayerWEBSite;
public static PER_SubLoop Make()
{
return new PER_SubLoop()
{
PER_PayerBusinessContactInformation = PER_PartyContactInformation.Make(),
PER_PayerTechnicalContactInformation = new List<PER_PartyContactInformation>() {
PER_PartyContactInformation.Make(), PER_PartyContactInformation.Make(),
PER_PartyContactInformation.Make(), PER_PartyContactInformation.Make(), PER_PartyContactInformation.Make() },
PER_PayerWEBSite = PER_PartyContactInformation.Make()
};
}
}
[ProtoContract]
[DataContract]
[Serializable]
public class PER_PartyContactInformation : Segment
{
public PER_PartyContactInformation() : base("PER") { }
[ProtoMember(1)]
[DataMember]
public string Contact_Function_Code;
[ProtoMember(2)]
[DataMember]
public string Name;
[ProtoMember(3)]
[DataMember]
public CommunicationNumber CommunicationNumber1;
[ProtoMember(4)]
[DataMember]
public CommunicationNumber CommunicationNumber2;
[ProtoMember(5)]
[DataMember]
public CommunicationNumber CommunicationNumber3;
[ProtoMember(6)]
[DataMember]
public string Contact_Inquiry_Reference;
public static PER_PartyContactInformation Make()
{
return new PER_PartyContactInformation()
{
Contact_Function_Code = "RP",
Name = NaturalTextGenerator.GenerateFirstName(),
CommunicationNumber1 = CommunicationNumber.Make(),
CommunicationNumber2 = CommunicationNumber.Make(),
CommunicationNumber3 = CommunicationNumber.Make(),
Contact_Inquiry_Reference = NaturalTextGenerator.GenerateWord()
};
}
}
[ProtoContract]
[DataContract]
[Serializable]
public class CommunicationNumber
{
public CommunicationNumber() { }
[ProtoMember(1)]
[DataMember]
public string Communication_Number_Qualifier;
[ProtoMember(2)]
[DataMember]
public string Communication_Number;
public static CommunicationNumber Make()
{
return new CommunicationNumber()
{
Communication_Number_Qualifier = "QW",
Communication_Number = NaturalTextGenerator.GenerateEMail()
};
}
}
[ProtoContract]
[DataContract]
[Serializable]
public class RDM_RemittanceDeliveryMethod : Segment
{
public RDM_RemittanceDeliveryMethod() : base("RDM") { }
[ProtoMember(1)]
[DataMember]
public string Report_Transmission_Code;
[ProtoMember(2)]
[DataMember]
public string Name;
[ProtoMember(3)]
[DataMember]
public string Communication_Number;
[ProtoMember(4)]
[DataMember]
public string Info1;
[ProtoMember(5)]
[DataMember]
public string Info2;
public static RDM_RemittanceDeliveryMethod Make()
{
return new RDM_RemittanceDeliveryMethod()
{
Report_Transmission_Code = NaturalTextGenerator.GenerateWord(),
Name = NaturalTextGenerator.GenerateFullName(),
Communication_Number = NaturalTextGenerator.GenerateEMail(),
Info1 = NaturalTextGenerator.Generate(50),
Info2 = NaturalTextGenerator.Generate(20)
};
}
}
[ProtoContract]
[DataContract]
[Serializable]
public class TS835_2000_Loop
{
public TS835_2000_Loop() { }
[ProtoMember(1)]
[DataMember]
public LX_HeaderNumber LX_HeaderNumber;
[ProtoMember(2)]
[DataMember]
public TS3_ProviderSummaryInformation TS3_ProviderSummaryInformation;
[ProtoMember(3)]
[DataMember]
public TS2_ProviderSupplementalSummaryInformation TS2_ProviderSupplementalSummaryInformation;
[ProtoMember(4)]
[DataMember]
public TS835_2100_Loop TS835_2100_Loop;
[ProtoMember(5)]
[DataMember]
public MIA_InpatientAdjudicationInformation MIA_InpatientAdjudicationInformation;
[ProtoMember(6)]
[DataMember]
public MOA_OutpatientAdjudicationInformation MOA_OutpatientAdjudicationInformation;
[ProtoMember(7)]
[DataMember]
public DTM_SubLoop DTM_SubLoop;
[ProtoMember(8)]
[DataMember]
public List<PER_ClaimContactInformation> PER_ClaimContactInformations;
[ProtoMember(9)]
[DataMember]
public List<AMT_ClaimSupplementalInformation> AMT_ClaimSupplementalInformations;
[ProtoMember(10)]
[DataMember]
public List<QTY_ClaimSupplementalInformationQuantity> QTY_ClaimSupplementalInformationQuantities;
[ProtoMember(11)]
[DataMember]
public TS835_2110_Loop TS835_2110_Loop;
public static TS835_2000_Loop Make()
{
return new TS835_2000_Loop()
{
LX_HeaderNumber = LX_HeaderNumber.Make(),
TS3_ProviderSummaryInformation = TS3_ProviderSummaryInformation.Make(),
TS2_ProviderSupplementalSummaryInformation = TS2_ProviderSupplementalSummaryInformation.Make(),
TS835_2100_Loop = TS835_2100_Loop.Make(),
MIA_InpatientAdjudicationInformation = MIA_InpatientAdjudicationInformation.Make(),
MOA_OutpatientAdjudicationInformation = MOA_OutpatientAdjudicationInformation.Make(),
DTM_SubLoop = DTM_SubLoop.Make(),
PER_ClaimContactInformations = new List<PER_ClaimContactInformation>() {
PER_ClaimContactInformation.Make(), PER_ClaimContactInformation.Make(),
PER_ClaimContactInformation.Make(), PER_ClaimContactInformation.Make(), },
AMT_ClaimSupplementalInformations = new List<AMT_ClaimSupplementalInformation>() {
AMT_ClaimSupplementalInformation.Make(), AMT_ClaimSupplementalInformation.Make(), AMT_ClaimSupplementalInformation.Make(), },
QTY_ClaimSupplementalInformationQuantities = new List<QTY_ClaimSupplementalInformationQuantity>() {
QTY_ClaimSupplementalInformationQuantity.Make(), QTY_ClaimSupplementalInformationQuantity.Make(),
QTY_ClaimSupplementalInformationQuantity.Make(), QTY_ClaimSupplementalInformationQuantity.Make(), },
TS835_2110_Loop = TS835_2110_Loop.Make()
};
}
}
[ProtoContract]
[DataContract]
[Serializable]
public class LX_HeaderNumber : Segment
{
public LX_HeaderNumber() : base("LX") { }
[ProtoMember(1)]
[DataMember]
public string Assigned_Number;
public static LX_HeaderNumber Make()
{
return new LX_HeaderNumber()
{
Assigned_Number = ExternalRandomGenerator.Instance.AsDecimal().ToString()
};
}
}
[ProtoContract]
[DataContract]
[Serializable]
public class TS3_ProviderSummaryInformation : Segment
{
public TS3_ProviderSummaryInformation() : base("TS3") { }
[ProtoMember(1)]
[DataMember]
public string Reference_Identification;
[ProtoMember(2)]
[DataMember]
public string Facility_Code_Value;
[ProtoMember(3)]
[DataMember]
public string Date;
[ProtoMember(4)]
[DataMember]
public decimal Quantity;
[ProtoMember(5)]
[DataMember]
public decimal Monetary_Amount;
[ProtoMember(6)]
[DataMember]
public List<decimal> MonetaryAmountList;
[ProtoMember(7)]
[DataMember]
public decimal? Quantity2;
[ProtoMember(8)]
[DataMember]
public decimal? Monetary_Amount2;
public static TS3_ProviderSummaryInformation Make()
{
return new TS3_ProviderSummaryInformation()
{
Reference_Identification = "OR",
Facility_Code_Value = "Factory Code Value",
Date = DateTime.Now.ToShortDateString(),
Quantity = ExternalRandomGenerator.Instance.AsDecimal(),
Monetary_Amount = ExternalRandomGenerator.Instance.AsDecimal(),
MonetaryAmountList = new List<decimal>() { ExternalRandomGenerator.Instance.AsDecimal(),
ExternalRandomGenerator.Instance.AsDecimal(), ExternalRandomGenerator.Instance.AsDecimal(),
ExternalRandomGenerator.Instance.AsDecimal(), ExternalRandomGenerator.Instance.AsDecimal(), ExternalRandomGenerator.Instance.AsDecimal() },
Quantity2 = ExternalRandomGenerator.Instance.AsDecimal(),
Monetary_Amount2 = ExternalRandomGenerator.Instance.AsDecimal(),
};
}
}
[ProtoContract]
[DataContract]
[Serializable]
public class TS2_ProviderSupplementalSummaryInformation : Segment
{
public TS2_ProviderSupplementalSummaryInformation() : base("TS2") { }
[ProtoMember(1)]
[DataMember]
public List<decimal> Monetary_AmountList;
[ProtoMember(2)]
[DataMember]
public decimal Quantity;
[ProtoMember(3)]
[DataMember]
public decimal? Monetary_Amount2;
[ProtoMember(4)]
[DataMember]
public decimal? Monetary_Amount3;
public static TS2_ProviderSupplementalSummaryInformation Make()
{
return new TS2_ProviderSupplementalSummaryInformation()
{
Monetary_AmountList = new List<decimal>() { ExternalRandomGenerator.Instance.AsDecimal(),
ExternalRandomGenerator.Instance.AsDecimal(), ExternalRandomGenerator.Instance.AsDecimal(),
ExternalRandomGenerator.Instance.AsDecimal() },
Quantity = ExternalRandomGenerator.Instance.AsDecimal(),
Monetary_Amount2 = ExternalRandomGenerator.Instance.AsDecimal()
};
}
}
[ProtoContract]
[DataContract]
[Serializable]
public class TS835_2100_Loop
{
public TS835_2100_Loop() { }
[ProtoMember(1)]
[DataMember]
public CLP_ClaimPaymentInformation CLP_ClaimPaymentInformation;
[ProtoMember(2)]
[DataMember]
public CAS_Adjustment CAS_ClaimsAdjustment;
[ProtoMember(3)]
[DataMember]
public NM1_SubLoop NM1_SubLoop;
[ProtoMember(4)]
[DataMember]
public MIA_InpatientAdjudicationInformation MIA_InpatientAdjudicationInformation;
public static TS835_2100_Loop Make()
{
return new TS835_2100_Loop()
{
CLP_ClaimPaymentInformation = CLP_ClaimPaymentInformation.Make(),
CAS_ClaimsAdjustment = CAS_Adjustment.Make(),
NM1_SubLoop = NM1_SubLoop.Make(),
MIA_InpatientAdjudicationInformation = MIA_InpatientAdjudicationInformation.Make(),
};
}
}
[ProtoContract]
[DataContract]