public Loop2200D(X12Doc owningDoc, LoopEntity prev, LoopCollection parent):base(owningDoc, prev, parent){ ClaimStatusTrackingNumber = new TrnCollection(this, nameof(ClaimStatusTrackingNumber)); SegmentCollections.Add(ClaimStatusTrackingNumber); ClaimLevelStatusInformation = new StcCollection(this, nameof(ClaimLevelStatusInformation)); SegmentCollections.Add(ClaimLevelStatusInformation); PayerClaimControlNumber = new RefCollection(this, nameof(PayerClaimControlNumber)); SegmentCollections.Add(PayerClaimControlNumber); InstitutionalBillTypeIdentification = new RefCollection(this, nameof(InstitutionalBillTypeIdentification)); SegmentCollections.Add(InstitutionalBillTypeIdentification); PatientControlNumber = new RefCollection(this, nameof(PatientControlNumber)); SegmentCollections.Add(PatientControlNumber); PharmacyPrescriptionNumber = new RefCollection(this, nameof(PharmacyPrescriptionNumber)); SegmentCollections.Add(PharmacyPrescriptionNumber); VoucherIdentifier = new RefCollection(this, nameof(VoucherIdentifier)); SegmentCollections.Add(VoucherIdentifier); ClaimIdentificationNumberForClearinghousesAnd = new RefCollection(this, nameof(ClaimIdentificationNumberForClearinghousesAnd)); SegmentCollections.Add(ClaimIdentificationNumberForClearinghousesAnd); ClaimServiceDate = new DtpCollection(this, nameof(ClaimServiceDate)); SegmentCollections.Add(ClaimServiceDate); ServiceLineInformationLoop = new Loop2220DCollection("Loop2220D", nameof(ServiceLineInformationLoop), OwningDoc, parent, parent); ChildLoopCollections.Add(ServiceLineInformationLoop); DependentLevelLoop = new Loop2000ECollection("Loop2000E", nameof(DependentLevelLoop), OwningDoc, parent, parent); ChildLoopCollections.Add(DependentLevelLoop); DependentNameLoop = new Loop2100ECollection("Loop2100E", nameof(DependentNameLoop), OwningDoc, parent, parent); ChildLoopCollections.Add(DependentNameLoop); ClaimStatusTrackingNumberLoop = new Loop2200ECollection("Loop2200E", nameof(ClaimStatusTrackingNumberLoop), OwningDoc, parent, parent); ChildLoopCollections.Add(ClaimStatusTrackingNumberLoop); }
public Loop2100D(X12Doc owningDoc, LoopEntity prev, LoopCollection parent):base(owningDoc, prev, parent){ SubscriberName = new Nm1Collection(this, nameof(SubscriberName)); SegmentCollections.Add(SubscriberName); ClaimStatusTrackingNumberLoop = new Loop2200DCollection("Loop2200D", nameof(ClaimStatusTrackingNumberLoop), OwningDoc, parent, parent); ChildLoopCollections.Add(ClaimStatusTrackingNumberLoop); }
public Loop2100A(X12Doc owningDoc, LoopEntity prev, LoopCollection parent):base(owningDoc, prev, parent){ PayerName = new Nm1Collection(this, nameof(PayerName)); SegmentCollections.Add(PayerName); PayerContactInformation = new PerCollection(this, nameof(PayerContactInformation)); SegmentCollections.Add(PayerContactInformation); }
public Loop2000D(X12Doc owningDoc, LoopEntity prev, LoopCollection parent) : base(owningDoc, prev, parent) { SubscriberLevel = new HlCollection(this, nameof(SubscriberLevel)); SegmentCollections.Add(SubscriberLevel); SubscriberDemographicInformation = new DmgCollection(this, nameof(SubscriberDemographicInformation)); SegmentCollections.Add(SubscriberDemographicInformation); }
public Loop2200E(X12Doc owningDoc, LoopEntity prev, LoopCollection parent) : base(owningDoc, prev, parent) { ClaimStatusTrackingNumber = new TrnCollection(this, nameof(ClaimStatusTrackingNumber)); SegmentCollections.Add(ClaimStatusTrackingNumber); PayerClaimControlNumber = new RefCollection(this, nameof(PayerClaimControlNumber)); SegmentCollections.Add(PayerClaimControlNumber); InstitutionalBillTypeIdentification = new RefCollection(this, nameof(InstitutionalBillTypeIdentification)); SegmentCollections.Add(InstitutionalBillTypeIdentification); ApplicationOrLocationSystemIdentifier = new RefCollection(this, nameof(ApplicationOrLocationSystemIdentifier)); SegmentCollections.Add(ApplicationOrLocationSystemIdentifier); GroupNumber = new RefCollection(this, nameof(GroupNumber)); SegmentCollections.Add(GroupNumber); PatientControlNumber = new RefCollection(this, nameof(PatientControlNumber)); SegmentCollections.Add(PatientControlNumber); PharmacyPrescriptionNumber = new RefCollection(this, nameof(PharmacyPrescriptionNumber)); SegmentCollections.Add(PharmacyPrescriptionNumber); ClaimIdentificationNumberForClearinghousesAnd = new RefCollection(this, nameof(ClaimIdentificationNumberForClearinghousesAnd)); SegmentCollections.Add(ClaimIdentificationNumberForClearinghousesAnd); ClaimSubmittedCharges = new AmtCollection(this, nameof(ClaimSubmittedCharges)); SegmentCollections.Add(ClaimSubmittedCharges); ClaimServiceDate = new DtpCollection(this, nameof(ClaimServiceDate)); SegmentCollections.Add(ClaimServiceDate); ServiceLineInformationLoop = new Loop2210ECollection("Loop2210E", nameof(ServiceLineInformationLoop), OwningDoc, parent, parent); ChildLoopCollections.Add(ServiceLineInformationLoop); }
public Loop2000E(X12Doc owningDoc, LoopEntity prev, LoopCollection parent) : base(owningDoc, prev, parent) { DependentLevel = new HlCollection(this, nameof(DependentLevel)); SegmentCollections.Add(DependentLevel); DependentDemographicInformation = new DmgCollection(this, nameof(DependentDemographicInformation)); SegmentCollections.Add(DependentDemographicInformation); }
/// <summary> /// 初始化 /// </summary> /// <returns></returns> public IPrint Init() { this.PrintDoc = new PrintDocument(); this.PrintDoc.PrintPage += PrintDocument_PrintPage; float PageHeight = 0; if (this.Page.AutoHeight) { foreach (RowEntity Row in this.Page.Rows) { if (Row.RowType == (int)ERowType.Line) { LineEntity RowItem = Row as LineEntity; PageHeight += RowItem.Height; } else if (Row.RowType == (int)ERowType.Loop) { LoopEntity RowItem = Row as LoopEntity; string Key = RowItem.KeyName; object dataList = this.DataSource.Value <string, object>(Key); if (dataList != null && dataList is List <Dictionary <string, object> > ) { List <Dictionary <string, object> > list = dataList as List <Dictionary <string, object> >; if (!list.IsNullOrEmpty()) { float ItemHeight = RowItem.ListLine.Sum(a => a.Height); PageHeight += ItemHeight * list.Count(); } } } else if (Row.RowType == (int)ERowType.Table) { TableEntity RowItem = Row as TableEntity; if (RowItem.Head != null) { PageHeight += RowItem.Head.Height; } string Key = RowItem.KeyName; object dataList = this.DataSource.Value <string, object>(Key); if (dataList != null && dataList is List <Dictionary <string, object> > ) { List <Dictionary <string, object> > list = dataList as List <Dictionary <string, object> >; if (!list.IsNullOrEmpty()) { float ItemHeight = RowItem.ListTR.Sum(a => a.Height); PageHeight += ItemHeight * list.Count(); } } } this.Page.Heigth = PageHeight; } } this.PrintDoc.DefaultPageSettings.PaperSize = new System.Drawing.Printing.PaperSize(string.Format("{0}*{1}", this.Page.Width, this.Page.Heigth), (int)Math.Ceiling(this.Page.Width), (int)Math.Ceiling(this.Page.Heigth)); this.PrintDoc.PrinterSettings.PrinterName = this.Page.DefaultPrinter; return(this); }
public Loop2210D(X12Doc owningDoc, LoopEntity prev, LoopCollection parent) : base(owningDoc, prev, parent) { ServiceLineInformation = new SvcCollection(this, nameof(ServiceLineInformation)); SegmentCollections.Add(ServiceLineInformation); ServiceLineItemIdentification = new RefCollection(this, nameof(ServiceLineItemIdentification)); SegmentCollections.Add(ServiceLineItemIdentification); ServiceLineDate = new DtpCollection(this, nameof(ServiceLineDate)); SegmentCollections.Add(ServiceLineDate); }
public Loop2100C(X12Doc owningDoc, LoopEntity prev, LoopCollection parent) : base(owningDoc, prev, parent) { ProviderName = new Nm1Collection(this, nameof(ProviderName)); SegmentCollections.Add(ProviderName); SubscriberLevelLoop = new Loop2000DCollection("Loop2000D", nameof(SubscriberLevelLoop), OwningDoc, parent, parent); ChildLoopCollections.Add(SubscriberLevelLoop); SubscriberNameLoop = new Loop2100DCollection("Loop2100D", nameof(SubscriberNameLoop), OwningDoc, parent, parent); ChildLoopCollections.Add(SubscriberNameLoop); }
public Loop2100B(X12Doc owningDoc, LoopEntity prev, LoopCollection parent) : base(owningDoc, prev, parent) { InformationReceiverName = new Nm1Collection(this, nameof(InformationReceiverName)); SegmentCollections.Add(InformationReceiverName); ServiceProviderLevelLoop = new Loop2000CCollection("Loop2000C", nameof(ServiceProviderLevelLoop), OwningDoc, parent, parent); ChildLoopCollections.Add(ServiceProviderLevelLoop); ProviderNameLoop = new Loop2100CCollection("Loop2100C", nameof(ProviderNameLoop), OwningDoc, parent, parent); ChildLoopCollections.Add(ProviderNameLoop); }
public Loop2200C(X12Doc owningDoc, LoopEntity prev, LoopCollection parent):base(owningDoc, prev, parent){ ProviderOfServiceTraceIdentifier = new TrnCollection(this, nameof(ProviderOfServiceTraceIdentifier)); SegmentCollections.Add(ProviderOfServiceTraceIdentifier); ProviderStatusInformation = new StcCollection(this, nameof(ProviderStatusInformation)); SegmentCollections.Add(ProviderStatusInformation); SubscriberLevelLoop = new Loop2000DCollection("Loop2000D", nameof(SubscriberLevelLoop), OwningDoc, parent, parent); ChildLoopCollections.Add(SubscriberLevelLoop); SubscriberNameLoop = new Loop2100DCollection("Loop2100D", nameof(SubscriberNameLoop), OwningDoc, parent, parent); ChildLoopCollections.Add(SubscriberNameLoop); }
/// <summary> /// 打印初始化 /// </summary> /// <returns></returns> public IPrint Init() { float PageHeight = 0; if (this.Page.AutoHeight) { foreach (RowEntity Row in this.Page.Rows) { if (Row.RowType == (int)ERowType.Line) { LineEntity RowItem = Row as LineEntity; PageHeight += RowItem.Height; } else if (Row.RowType == (int)ERowType.Loop) { LoopEntity RowItem = Row as LoopEntity; string Key = RowItem.KeyName; object dataList = this.DataSource.Value <string, object>(Key); if (dataList != null && dataList is List <Dictionary <string, object> > ) { List <Dictionary <string, object> > list = dataList as List <Dictionary <string, object> >; if (!list.IsNullOrEmpty()) { float ItemHeight = RowItem.ListLine.Sum(a => a.Height); PageHeight += ItemHeight * list.Count(); } } } else if (Row.RowType == (int)ERowType.Table) { TableEntity RowItem = Row as TableEntity; if (RowItem.Head != null) { PageHeight += RowItem.Head.Height; } string Key = RowItem.KeyName; object dataList = this.DataSource.Value <string, object>(Key); if (dataList != null && dataList is List <Dictionary <string, object> > ) { List <Dictionary <string, object> > list = dataList as List <Dictionary <string, object> >; if (!list.IsNullOrEmpty()) { float ItemHeight = RowItem.ListTR.Sum(a => a.Height); PageHeight += ItemHeight * list.Count(); } } } this.Page.Heigth = PageHeight; } } return(this); }
public Loop01GE(X12Doc owningDoc, LoopEntity prev, LoopCollection parent):base(owningDoc, prev, parent){ FunctionalGroupHeader = new GsCollection(this, nameof(FunctionalGroupHeader)); SegmentCollections.Add(FunctionalGroupHeader); FunctionalGroupTrailer = new GeCollection(this, nameof(FunctionalGroupTrailer)); SegmentCollections.Add(FunctionalGroupTrailer); TransactionSetHeader = new Collection(this, nameof(TransactionSetHeader)); SegmentCollections.Add(TransactionSetHeader); Empty = new StCollection(this, nameof(Empty)); SegmentCollections.Add(Empty); Empty = new TableCollection(this, nameof(Empty)); SegmentCollections.Add(Empty); }
/// <summary> /// 循环写入 /// </summary> /// <param name="entity"></param> private void WriteLoop(LoopEntity entity, List <Dictionary <string, object> > listSource) { if (!entity.ListLine.IsNullOrEmpty()) { foreach (Dictionary <string, object> ds in listSource) { foreach (LineEntity item in entity.ListLine) { this.WriteLine(item, ds); } } } }
public Loop2220E(X12Doc owningDoc, LoopEntity prev, LoopCollection parent):base(owningDoc, prev, parent){ ServiceLineInformation = new SvcCollection(this, nameof(ServiceLineInformation)); SegmentCollections.Add(ServiceLineInformation); ServiceLineStatusInformation = new StcCollection(this, nameof(ServiceLineStatusInformation)); SegmentCollections.Add(ServiceLineStatusInformation); ServiceLineItemIdentification = new RefCollection(this, nameof(ServiceLineItemIdentification)); SegmentCollections.Add(ServiceLineItemIdentification); ServiceLineDate = new DtpCollection(this, nameof(ServiceLineDate)); SegmentCollections.Add(ServiceLineDate); TransactionSetTrailer = new SeCollection(this, nameof(TransactionSetTrailer)); SegmentCollections.Add(TransactionSetTrailer); }
/// <summary> /// 读取Loop节点 /// </summary> /// <param name="ELoop"></param> /// <returns></returns> private LoopEntity ReadLoop(XElement ELoop) { LoopEntity Result = new LoopEntity(); string Values = ELoop.Value <string>("Values"); Result.Index = RowIndex; Result.KeyName = Values; Result.RowType = (int)ERowType.Loop; Result.ListLine = new List <LineEntity>(); foreach (XElement Node in ELoop.Elements("Line")) { LineEntity LineRow = this.ReadLine(Node); Result.ListLine.Add(LineRow); } return(Result); }
/// <summary> /// 获取文档对象 /// </summary> /// <returns></returns> public PageEntity Read() { PageEntity Result = new PageEntity(); if (!FileManager.FileExists(this.FilePath)) { throw new Exception("打印模板文件不存在"); } this.Root = XDocument.Load(this.FilePath); float Width = this.Root.Element("Page").Value <float>("Width"); float Heigth = this.Root.Element("Page").Value <float>("Heigth"); string DefaultPrinter = this.Root.Element("Page").Value("DefaultPrinter"); bool AutoHeight = this.Root.Element("Page").Value <bool>("AutoHeight"); Result.Width = Width; Result.Heigth = Heigth; Result.DefaultPrinter = DefaultPrinter; Result.AutoHeight = AutoHeight; Result.Rows = new List <RowEntity>(); foreach (XElement item in this.Root.Element("Page").Elements()) { if (item.Name == "Line") { LineEntity LineRow = this.ReadLine(item); Result.Rows.Add(LineRow); } else if (item.Name == "Loop") { LoopEntity LineRow = this.ReadLoop(item); Result.Rows.Add(LineRow); } else if (item.Name == "Table") { TableEntity LineRow = this.ReadTable(item); Result.Rows.Add(LineRow); } } return(Result); }
public Loop2100B(X12Doc owningDoc, LoopEntity prev, LoopCollection parent):base(owningDoc, prev, parent){ InformationReceiverName = new Nm1Collection(this, nameof(InformationReceiverName)); SegmentCollections.Add(InformationReceiverName); }
public Loop2000B(X12Doc owningDoc, LoopEntity prev, LoopCollection parent):base(owningDoc, prev, parent){ InformationReceiverLevel = new HlCollection(this, nameof(InformationReceiverLevel)); SegmentCollections.Add(InformationReceiverLevel); }
public class DtpCollection : SegmentCollection { public DtpCollection(LoopEntity owningLoopEntity, string segDefName) : base(owningLoopEntity, segDefName) { }
/// <summary> /// 打印触发事件 /// </summary> private void PrintEvent() { foreach (RowEntity row in this.Page.Rows.Where(item => item.RowType == (int)ERowType.Table)) { TableEntity RowItem = row as TableEntity; float TabLeft = RowItem.Left; Action <List <TdEntity> > action = (List <TdEntity> listTD) => { float CurrentLeft = TabLeft; foreach (TdEntity Td in listTD) { if (!Td.ListContent.IsNullOrEmpty()) { foreach (ContentEntity item in Td.ListContent) { if (item is StrLineEntity) { } else if (item is TextEntity) { TextEntity Content = item as TextEntity; Content.Left = Content.Left + CurrentLeft; } else if (item is ImageEntity) { ImageEntity Content = item as ImageEntity; Content.Left = Content.Left + CurrentLeft; } else if (item is QRCodeEntity) { QRCodeEntity Content = item as QRCodeEntity; Content.Left = Content.Left + CurrentLeft; } else if (item is BarCodeEntity) { BarCodeEntity Content = item as BarCodeEntity; Content.Left = Content.Left + CurrentLeft; } } } CurrentLeft = CurrentLeft + Td.Width; } }; if (RowItem.Head != null) { action(RowItem.Head.ListTD); } if (!RowItem.ListTR.IsNullOrEmpty()) { foreach (TrEntity td in RowItem.ListTR) { action(td.ListTD); } } } foreach (RowEntity row in this.Page.Rows) { if (row.RowType == (int)ERowType.Line) { LineEntity RowItem = row as LineEntity; this.WriteLine(RowItem, this.DataSource); } else if (row.RowType == (int)ERowType.Loop) { LoopEntity RowItem = row as LoopEntity; string KeyName = RowItem.KeyName; object ds = this.DataSource.Value <string, object>(KeyName); List <Dictionary <string, object> > listSource = ds as List <Dictionary <string, object> >; if (!listSource.IsNullOrEmpty()) { this.WriteLoop(RowItem, listSource); } } else if (row.RowType == (int)ERowType.Table) { TableEntity RowItem = row as TableEntity; string KeyName = RowItem.KeyName; object ds = this.DataSource.Value <string, object>(KeyName); List <Dictionary <string, object> > listSource = ds as List <Dictionary <string, object> >; if (!listSource.IsNullOrEmpty()) { this.WriteTable(RowItem, listSource); } } } }
public Loop2100E(X12Doc owningDoc, LoopEntity prev, LoopCollection parent):base(owningDoc, prev, parent){ DependentName = new Nm1Collection(this, nameof(DependentName)); SegmentCollections.Add(DependentName); }
public Loop2000C(X12Doc owningDoc, LoopEntity prev, LoopCollection parent):base(owningDoc, prev, parent){ ServiceProviderLevel = new HlCollection(this, nameof(ServiceProviderLevel)); SegmentCollections.Add(ServiceProviderLevel); }
/// <summary> /// コンストラクタ /// </summary> /// <param name="inputFileName"></param> /// <param name="config"></param> public InputFileReader(string inputFileName, LoopEntity config) { InputFileName = inputFileName; Config = config; }
public Loop2100C(X12Doc owningDoc, LoopEntity prev, LoopCollection parent):base(owningDoc, prev, parent){ ProviderName = new Nm1Collection(this, nameof(ProviderName)); SegmentCollections.Add(ProviderName); }
public void SetLine(LoopEntity loopEntity) { XmlSerializer se = new XmlSerializer(typeof(LoopEntity)); se.Serialize(writer, loopEntity); }