예제 #1
0
        void WriteSectionTitle(OrderSection section)
        {
            ConsoleColor fg = Console.ForegroundColor;

            Console.ForegroundColor = COLOR_TITLE;

            switch (section)
            {
            case OrderSection.D1:
                WriteCenter("Случаи обращения с лечебной целью");
                break;

            case OrderSection.D2:
                WriteCenter("Случаи ВМП");
                break;

            case OrderSection.D3:
                WriteCenter("Профосмотры и диспансеризация ("
                            + ProphSubsectionHelper.AsString(invoiceFilename.Subsection)
                            + ")");
                break;

            case OrderSection.D4:
                WriteCenter("Онкология");
                break;
            }
            Console.ForegroundColor = fg;
        }
예제 #2
0
        public static string AsString(OrderSection section, ProphSubsection subsection)
        {
            switch (section)
            {
            case OrderSection.D1:
                return("с лечебной целью");

            case OrderSection.D2:
                return("ВМП");

            case OrderSection.D3:
                return("профилактики и диспансеризации ("
                       + ProphSubsectionHelper.AsString(subsection) + ")");

            case OrderSection.D4:
                return("онкологии");
            }
            return(string.Empty);
        }
예제 #3
0
        bool ExportInvoice(Lib.XmlExporter xml, Data.IInvoice pool)
        {
            if (!xml.OK)
            {
                return(false);
            }
            xml.Writer.WriteStartElement("ZL_LIST");

            xml.Writer.WriteStartElement("ZGLV");
            xml.Writer.WriteElementString("VERSION", VERSION_INVOICES);
            xml.Writer.WriteElementString("DATA", DateTime.Today.AsXml());
            xml.Writer.WriteElementString("FILENAME", invoiceFilename.InvoiceFile);

            // TODO: Invoices count, not people
            int count = pool.GetInvoiceRecordsCount(invoiceFilename.Section, invoiceFilename.Subsection);

#if DEBUG
            count = Math.Min(Properties.Settings.Default.DebugSelectionLimit, count);
#endif
            xml.Writer.WriteElementString("SD_Z", count.ToString());
            xml.Writer.WriteEndElement();


            xml.Writer.WriteStartElement("SCHET");
            xml.Writer.WriteElementString("CODE", invoiceFilename.Code.ToString());
            xml.Writer.WriteElementString("CODE_MO", invoiceFilename.ClinicCode);
            xml.Writer.WriteElementString("YEAR", invoiceFilename.Year.ToString());
            xml.Writer.WriteElementString("MONTH", invoiceFilename.Month.ToString());
            xml.Writer.WriteElementString("NSCHET", invox.Options.InvoiceNumber);
            xml.Writer.WriteElementString("DSCHET", invox.Options.InvoiceDate.AsXml());
            xml.WriteIfValid("PLAT", invoiceFilename.CompanyCode);
            xml.Writer.WriteElementString("SUMMAV", pool.Total(invoiceFilename.Section, invoiceFilename.Subsection).ToString("F2", Options.NumberFormat));

            // 20191028
            if (invoiceFilename.Section == OrderSection.D3)
            {
                xml.Writer.WriteElementString("DISP", ProphSubsectionHelper.GetCodeV016(invoiceFilename.Subsection));
            }

            xml.Writer.WriteEndElement();

            Lib.Progress progress = new Progress("Случаи обращения", count);
            int          number   = 0;
            foreach (InvoiceRecord irec in pool.LoadInvoiceRecords(invoiceFilename.Section, invoiceFilename.Subsection))
            {
                irec.Identity = number;
                irec.Write(xml, () => progress.Step(), pool, invoiceFilename.Section, invoiceFilename.Subsection);
                number = irec.Identity;
#if DEBUG
                if (--count <= 0)
                {
                    break;
                }
#endif
            }

            progress.Close();

            xml.Writer.WriteEndElement();
            return(true);
        }