示例#1
0
        public void Write(Lib.XmlExporter xml)
        {
            xml.Writer.WriteStartElement("NAZ");
#if FOMS
            xml.Writer.WriteElementString("NAZ_N", Index.ToString());
#else
            // Здесь опечатка? В приказе тут есть пробел: NAZ N
            xml.Writer.WriteElementString("NAZN", Index.ToString());
#endif
            xml.Writer.WriteElementString("NAZ_R", RouteCode.ToString());
            xml.WriteIfValid("NAZ_IDDOKT", DoctorSpeciality);
            xml.WriteIfValid("NAZ_V", StudyKind);

            xml.WriteIfValid("NAZ_USL", ServiceCode);

            if (!string.IsNullOrEmpty(TargetClinic))
            {
                xml.Writer.WriteElementString("NAPR_DATE", DirectionDate.AsXml());
                xml.Writer.WriteElementString("NAPR_MO", TargetClinic);
            }

            xml.WriteIfValid("NAZ_PMP", AidProfile);
            xml.WriteIfValid("NAZ_PK", BedProfile);

            xml.Writer.WriteEndElement();
        }
示例#2
0
文件: Service.cs 项目: sundersb/invox
        public void WriteD4(Lib.XmlExporter xml, Data.IInvoice pool, InvoiceRecord irec, Recourse rec, Event evt)
        {
            xml.Writer.WriteStartElement("USL");

            xml.Writer.WriteElementString("IDSERV", Identity);
            xml.Writer.WriteElementString("LPU", Options.LpuCode);
            xml.WriteIfValid("LPU_1", Unit);
            xml.WriteIfValid("PODR", rec.Department);
            xml.Writer.WriteElementString("PROFIL", rec.Profile);
            xml.WriteIfValid("VID_VME", InterventionKind);
            xml.WriteBool("DET", Child);
            xml.Writer.WriteElementString("DATE_IN", DateFrom.AsXml());
            xml.Writer.WriteElementString("DATE_OUT", DateTill.AsXml());
            xml.Writer.WriteElementString("DS", Diagnosis);
            xml.Writer.WriteElementString("CODE_USL", ServiceCode.ToString("D6"));
            xml.Writer.WriteElementString("KOL_USL", Quantity.ToString("F2", Options.NumberFormat));

            if (Tariff > 0)
            {
                xml.Writer.WriteElementString("TARIF", Tariff.ToString("F2", Options.NumberFormat));
            }

            xml.Writer.WriteElementString("SUMV_USL", Total.ToString("F2", Options.NumberFormat));
            xml.Writer.WriteElementString("PRVS", SpecialityCode);
            xml.Writer.WriteElementString("CODE_MD", DoctorCode);

            if (Incomplete != IncompleteServiceReason.None)
            {
                xml.Writer.WriteElementString("NPL", ((int)Incomplete).ToString());
            }

            xml.WriteIfValid("COMENTU", Comment);

            xml.Writer.WriteEndElement();
        }
示例#3
0
        /// <summary>
        /// Save person data to dispanserisation invoice
        /// </summary>
        /// <param name="xml">XML exporter to use</param>
        public void WriteD3(Lib.XmlExporter xml)
        {
            xml.Writer.WriteStartElement("PACIENT");

            xml.Writer.WriteElementString("ID_PAC", Identity);

            xml.Writer.WriteElementString("VPOLIS", PolicyType.ToString());
            xml.WriteIfValid("SPOLIS", PolicySerial);

            if (PolicyType == 3)
            {
                xml.WriteIfValid("ENP", PolicyNumber);
            }
            else
            {
                xml.WriteIfValid("NPOLIS", PolicyNumber);
            }

            xml.WriteIfValid("ST_OKATO", AssuranceOkato);
            xml.WriteIfValid("SMO", SmoCode);
            xml.WriteIfValid("SMO_OGRN", SmoOgrn);
            xml.WriteIfValid("SMO_OK", SmoOkato);
            xml.WriteIfValid("SMO_NAM", SmoName);
            xml.Writer.WriteElementString("NOVOR", NewbornCode);

            xml.Writer.WriteEndElement();
        }
示例#4
0
        /// <summary>
        /// Save person for onkology bill
        /// </summary>
        /// <param name="xml">XML exporter</param>
        public void WriteD4(Lib.XmlExporter xml)
        {
            xml.Writer.WriteStartElement("PACIENT");

            xml.Writer.WriteElementString("ID_PAC", Identity);

            xml.Writer.WriteElementString("VPOLIS", PolicyType.ToString());
            xml.WriteIfValid("SPOLIS", PolicySerial);
            xml.WriteIfValid("NPOLIS", PolicyNumber);

            xml.WriteIfValid("ST_OKATO", AssuranceOkato);
            xml.WriteIfValid("SMO", SmoCode);
            xml.WriteIfValid("SMO_OGRN", SmoOgrn);
            xml.WriteIfValid("SMO_OK", SmoOkato);
            xml.WriteIfValid("SMO_NAM", SmoName);

            if (Disability != Disability.NA)
            {
                xml.Writer.WriteElementString("INV", ((int)Disability).ToString());
            }

            if (DirectedToSE)
            {
                xml.Writer.WriteElementString("MSE", "1");
            }

            xml.Writer.WriteElementString("NOVOR", NewbornCode);
            if (NewbornCode != "0")
            {
                xml.Writer.WriteElementString("VNOV_D", NewbornWeight.ToString("D4"));
            }

            xml.Writer.WriteEndElement();
        }
示例#5
0
        public void Write(Lib.XmlExporter xml, Data.IInvoice pool, Event evt)
        {
            xml.Writer.WriteStartElement("KSG_KPG");

            xml.WriteIfValid("N_KSG", KsgNumber);
            xml.Writer.WriteElementString("VER_KSG", Version.ToString());
            xml.WriteBool("KSG_PG", SubgroupUsed);
            xml.WriteIfValid("N_KPG", KpgNumber);

            xml.Writer.WriteElementString("KOEF_Z", QuotExpense.ToString("F5", Options.NumberFormat));
            xml.Writer.WriteElementString("KOEF_UP", QuotManagement.ToString("F5", Options.NumberFormat));
            xml.Writer.WriteElementString("BZTSZ", BaseRate.ToString("F2", Options.NumberFormat));
            xml.Writer.WriteElementString("KOEF_D", QuotDifference.ToString("F5", Options.NumberFormat));
            xml.Writer.WriteElementString("KOEF_U", QuotGroupLevel.ToString("F5", Options.NumberFormat));

            // TODO: D4 Multiple
            xml.WriteIfValid("CRIT", AuxCriterion);

            // TODO:
            // D4: SL_K
            xml.WriteBool("SL_K", KslpUsed);

            List <ComplexityQuotient> qs = pool.LoadComplexityQuotients().ToList();

            if (qs.Count() > 0)
            {
                double acc = qs.Select(q => q.Quotient).Aggregate(1.0, (a, b) => { return(a * b); });
                if (acc > 0)
                {
                    xml.Writer.WriteElementString("IT_SL", acc.ToString("F5", Options.NumberFormat));
                    foreach (ComplexityQuotient q in qs)
                    {
                        q.Write(xml, pool);
                    }
                }
            }

            // TODO: D4 SL_KOEF УМ

            xml.Writer.WriteEndElement();
        }
示例#6
0
        public void Write(Lib.XmlExporter xml, Data.IInvoice pool)
        {
            xml.Writer.WriteStartElement("ONK_SL");

            xml.Writer.WriteElementString("DS1_T", ((int)reason).ToString());

            xml.WriteIfValid("STAD", stage);
            xml.WriteIfValid("ONK_T", tumor);
            xml.WriteIfValid("ONK_N", nodus);
            xml.WriteIfValid("ONK_M", mts);

            if (reason == OnkologyReason.Relapse || reason == OnkologyReason.Progression)
            {
                xml.WriteBool("MTSTZ", remoteMts);
            }

            if (beamLoad > 0)
            {
                xml.Writer.WriteElementString("SOD", beamLoad.ToString("F2", Options.NumberFormat));
            }

            foreach (OnkologyDiagnosticType dt in pool.LoadOnkologicalDiagnosticTypes())
            {
                dt.Write(xml);
            }

            foreach (OnkologyRefusal r in pool.LoadOnkologicalRefusal())
            {
                r.Write(xml);
            }

            if (Services != null)
            {
                foreach (OncologyService s in Services)
                {
                    s.Write(xml, pool);
                }
            }

            xml.Writer.WriteEndElement();
        }
示例#7
0
文件: Service.cs 项目: sundersb/invox
        /// <summary>
        /// Save service for a hi-tech case
        /// </summary>
        /// <param name="xml">XML exporter to use</param>
        /// <param name="pool">Datapool</param>
        /// <param name="irec">Invoice record parental to the event</param>
        /// <param name="evt">Event to which this service belongs</param>
        public void WriteD2(Lib.XmlExporter xml, Data.IInvoice pool, InvoiceRecord irec, Recourse rec, Event evt)
        {
            xml.Writer.WriteStartElement("USL");

            xml.Writer.WriteElementString("IDSERV", Identity);
            xml.Writer.WriteElementString("LPU", Options.LpuCode);
            xml.WriteIfValid("LPU_1", Unit);
            xml.WriteIfValid("PODR", rec.Department);
            xml.Writer.WriteElementString("PROFIL", rec.Profile);
            xml.WriteIfValid("VID_VME", InterventionKind);
            xml.WriteBool("DET", Child);
            xml.Writer.WriteElementString("DATE_IN", DateFrom.AsXml());
            xml.Writer.WriteElementString("DATE_OUT", DateTill.AsXml());
            xml.Writer.WriteElementString("DS", Diagnosis);
            xml.Writer.WriteElementString("CODE_USL", ServiceCode.ToString("D6"));
            xml.Writer.WriteElementString("KOL_USL", Quantity.ToString("D2", Options.NumberFormat));

            if (Tariff > 0)
            {
                xml.Writer.WriteElementString("TARIF", Tariff.ToString("F2", Options.NumberFormat));
            }

            xml.Writer.WriteElementString("SUMV_USL", Total.ToString("F2", Options.NumberFormat));
            xml.Writer.WriteElementString("PRVS", SpecialityCode);
            xml.Writer.WriteElementString("CODE_MD", DoctorCode);

            if (rec.SuspectOncology)
            {
                // Направления
                // Заполняется только в случае оформления направления при подозрении на злокачественное новообразование (DS_ONK=1)
                foreach (OncologyDirection d in pool.LoadOncologyDirections(rec, evt))
                {
                    d.Write(xml);
                }
            }

            xml.WriteIfValid("COMENTU", Comment);

            xml.Writer.WriteEndElement();
        }
示例#8
0
文件: Service.cs 项目: sundersb/invox
        /// <summary>
        /// Save service for a dispanserisation case
        /// </summary>
        /// <param name="xml">XML exporter to use</param>
        /// <param name="pool">Datapool</param>
        /// <param name="irec">Invoice record parental to the event</param>
        /// <param name="evt">Event to which this service belongs</param>
        public void WriteD3(Lib.XmlExporter xml, Data.IInvoice pool, InvoiceRecord irec, Recourse rec, Event evt)
        {
            xml.Writer.WriteStartElement("USL");

            xml.Writer.WriteElementString("IDSERV", Identity);
            xml.Writer.WriteElementString("LPU", Options.LpuCode);
            xml.WriteIfValid("LPU_1", Unit);
#if FOMS
            xml.WriteIfValid("PODR", rec.Department);
            // TODO: "20190611 Приказ 124н Диспансеризация и Профосмотры" - профиль каждой услуги отдельно???
            xml.Writer.WriteElementString("PROFIL", rec.Profile);
            xml.WriteBool("DET", Child);
#endif
            xml.Writer.WriteElementString("DATE_IN", DateFrom.AsXml());
            xml.Writer.WriteElementString("DATE_OUT", DateTill.AsXml());
            xml.WriteBool("P_OTK", Refusal);
            xml.Writer.WriteElementString("CODE_USL", ServiceCode.ToString("D6"));
#if FOMS
            xml.Writer.WriteElementString("KOL_USL", Quantity.ToString("F2", Options.NumberFormat));
#endif
            if (Tariff > 0)
            {
                xml.Writer.WriteElementString("TARIF", Tariff.ToString("F2", Options.NumberFormat));
            }

            xml.Writer.WriteElementString("SUMV_USL", Total.ToString("F2", Options.NumberFormat));

            xml.Writer.WriteStartElement("MR_USL_N");
            xml.Writer.WriteElementString("MR_N", "1");
            xml.Writer.WriteElementString("PRVS", SpecialityCode);
            xml.Writer.WriteElementString("CODE_MD", DoctorCode);
            xml.Writer.WriteEndElement();

            xml.WriteIfValid("COMENTU", Comment);
            xml.Writer.WriteEndElement();
        }
示例#9
0
        public void Write(Lib.XmlExporter xml)
        {
            if (kind == OncologyDirectionKind.None || method == OncologyDirectionMethod.None)
            {
                return;
            }

            xml.Writer.WriteStartElement("NAPR");

            xml.Writer.WriteElementString("NAPR_DATE", date.AsXml());
            xml.WriteIfValid("NAPR_MO", TargetClinic);
            xml.Writer.WriteElementString("NAPR_V", ((int)kind).ToString());
            if (method != OncologyDirectionMethod.None)
            {
                xml.Writer.WriteElementString("MET_ISSL", ((int)method).ToString());
                xml.Writer.WriteElementString("NAPR_USL", serviceCode);
            }

            xml.Writer.WriteEndElement();
        }
示例#10
0
文件: Person.cs 项目: sundersb/invox
        public void Write(Lib.XmlExporter xml, Data.IInvoice pool, OrderSection section)
        {
            xml.Writer.WriteStartElement("PERS");

            xml.WriteIfValid("ID_PAC", ID);
            xml.WriteIfValid("FAM", Family);
            xml.WriteIfValid("IM", Name);
            xml.WriteIfValid("OT", Patronymic);
            xml.Writer.WriteElementString("W", Sex.ToString());
            xml.Writer.WriteElementString("DR", BirthDate.AsXml());

            WritePersonIdentityError(xml);

            if (section == OrderSection.D3)
            {
                xml.WriteIfValid("TEL", Phone);
            }

            if (Representative != null)
            {
                Representative.Write(xml, pool);
            }

            // FOMS
            //xml.WriteIfValid("MR", Address);
            xml.WriteIfValid("MR", BirthPlace);

            xml.WriteIfValid("DOCTYPE", DocumentType);

#if FOMS
            xml.WriteIfValid("SOC", SocialPosition);
#endif

            xml.WriteIfValid("DOCSER", DocumentSerial);
            xml.WriteIfValid("DOCNUM", DocumentNumber);
#if FOMS
            if (DocumentDate.HasValue)
            {
                xml.Writer.WriteElementString("DOCDATE", DocumentDate.Value.AsXml());
            }
            xml.WriteIfValid("DOCORG", DocumentOrganization);
#endif

            xml.WriteIfValid("SNILS", Snils);
#if FOMS
            xml.Writer.WriteElementString("OKATOG", ResidenceOkato);
#else
            xml.WriteIfValid("OKATOG", ResidenceOkato);
#endif
            xml.WriteIfValid("OKATOP", PresenceOkato);

#if FOMS
            xml.WriteIfValid("KT", SocialFavour);
#endif

            xml.WriteIfValid("COMENTP", Comment);

            xml.Writer.WriteEndElement();
        }
示例#11
0
        public void WriteD4(Lib.XmlExporter xml, Data.IInvoice pool, InvoiceRecord irec, Recourse rec)
        {
            xml.Writer.WriteStartElement("SL");

            xml.Writer.WriteElementString("SL_ID", Identity);
            xml.WriteIfValid("LPU_1", Unit);
            xml.WriteIfValid("PODR", rec.Department);
            xml.Writer.WriteElementString("PROFIL", rec.Profile);
            xml.WriteIfValid("PROFIL_K", BedProfile);
            xml.WriteBool("DET", Child);
            xml.WriteIfValid("P_CEL", Reason);

#if FOMS
            xml.Writer.WriteElementString("CEL", LocalReason);
#endif
            xml.Writer.WriteElementString("NHISTORY", CardNumber);

            if (Transfer != Model.Transfer.None)
            {
                xml.Writer.WriteElementString("P_PER", ((int)Transfer).ToString());
            }

            xml.Writer.WriteElementString("DATE_1", DateFrom.AsXml());
            xml.Writer.WriteElementString("DATE_2", DateTill.AsXml());
            if (BedDays > 0)
            {
                xml.Writer.WriteElementString("KD", BedDays.ToString());
            }

            xml.WriteIfValid("DS0", PrimaryDiagnosis);
            xml.Writer.WriteElementString("DS1", MainDiagnosis);

            // Диагноз сопутствующего заболевания
            // Код из справочника МКБ-10 до уровня подрубрики, если она предусмотрена МКБ-10 (неуказание подрубрики допускается для случаев оказания скорой медицинской помощи).
            // Указывается в случае установления в соответствии с медицинской документацией.
            if (ConcurrentDiagnoses != null)
            {
                foreach (string ds in ConcurrentDiagnoses)
                {
                    xml.Writer.WriteElementString("DS2", ds);
                }
            }

            // Диагноз осложнения заболевания
            // Код из справочника МКБ-10 до уровня подрубрики, если она предусмотрена МКБ-10 (неуказание подрубрики допускается для случаев оказания скорой медицинской помощи).
            // Указывается в случае установления в соответствии с медицинской документацией.
            if (ComplicationDiagnoses != null)
            {
                foreach (string ds in ComplicationDiagnoses)
                {
                    xml.Writer.WriteElementString("DS3", ds);
                }
            }

            xml.WriteIfValid("C_ZAB", StatisticsCode);

            xml.WriteBool("DS_ONK", rec.SuspectOncology);

            if (DispensarySupervision != Model.DispensarySupervision.None)
            {
                xml.Writer.WriteElementString("DN", ((int)DispensarySupervision).ToString());
            }

            // Код МЭС
            // Классификатор МЭС. Указывается при наличии утвержденного стандарта.
            foreach (string mes in pool.LoadMesCodes(irec, rec, this))
            {
                xml.Writer.WriteElementString("CODE_MES1", mes);
            }

            xml.WriteIfValid("CODE_MES2", ConcurrentMesCode);

            foreach (OncologyDirection dir in pool.LoadOncologyDirections(rec, this))
            {
                dir.Write(xml);
            }

            foreach (OncologyConsilium c in pool.LoadOncologyConsilium(rec, this))
            {
                c.Write(xml);
            }

            // Не на дому, не реабилитация и не подозрение
            if (!Rehabilitation && !rec.SuspectOncology && rec.Conditions != "4")
            {
                OnkologyTreat treat = pool.GetOnkologyTreat(rec, this);

                if (treat != null)
                {
                    if (string.IsNullOrEmpty(treat.Stage))
                    {
                        Console.WriteLine("Пустая стадия для онкологии. Случай " + this.Identity);
                    }
                    treat.Write(xml, pool);
                }
            }

            if (ClinicalGroup != null)
            {
                ClinicalGroup.Write(xml, pool, this);
            }

            if (Rehabilitation)
            {
                xml.Writer.WriteElementString("REAB", "1");
            }

            xml.Writer.WriteElementString("PRVS", SpecialityCode);

            // Код классификатора медицинских специальностей
            // Указывается имя используемого классификатора медицинских специальностей
            xml.Writer.WriteElementString("VERS_SPEC", Options.SpecialityClassifier);

            xml.Writer.WriteElementString("IDDOKT", DoctorCode);

            if (Quantity > 0)
            {
                xml.Writer.WriteElementString("ED_COL", Quantity.ToString("F2", Options.NumberFormat));
            }

            if (Tariff > 0)
            {
                xml.Writer.WriteElementString("TARIF", Tariff.ToString("F2", Options.NumberFormat));
            }

            xml.Writer.WriteElementString("SUM_M", Total.ToString("F2", Options.NumberFormat));

            // Сведения об услуге
            // Описывает услуги, оказанные в рамках данного случая.
            // Допускается указание услуг с нулевой стоимостью.
            // Указание услуг с нулевой стоимостью обязательно, если условие их оказания является тарифообразующим (например, при оплате по КСГ).
            foreach (Service s in Services)
            {
                s.WriteD4(xml, pool, irec, rec, this);
            }

            xml.WriteIfValid("COMENTSL", Comment);
            xml.Writer.WriteEndElement();
        }
示例#12
0
        /// <summary>
        /// Save dispanserisation case to XML
        /// </summary>
        /// <param name="xml">XML exporter to save into</param>
        /// <param name="pool">Datapool</param>
        /// <param name="irec">Invoice record to which this event belongs</param>
        public void WriteD3(Lib.XmlExporter xml, Data.IInvoice pool, InvoiceRecord irec, Recourse rec)
        {
            xml.Writer.WriteStartElement("SL");
            xml.Writer.WriteElementString("SL_ID", Identity);
            xml.WriteIfValid("LPU_1", Unit);

#if FOMS
            xml.WriteIfValid("PODR", rec.Department);
            xml.Writer.WriteElementString("PROFIL", rec.Profile);
            xml.WriteBool("DET", Child);
            xml.Writer.WriteElementString("CEL", LocalReason);
#endif

            xml.Writer.WriteElementString("NHISTORY", CardNumber);
            xml.Writer.WriteElementString("DATE_1", DateFrom.AsXml());
            xml.Writer.WriteElementString("DATE_2", DateTill.AsXml());
            xml.Writer.WriteElementString("DS1", MainDiagnosis);

            if (FirstIdentified)
            {
                xml.Writer.WriteElementString("DS1_PR", "1");
            }

#if FOMS
            // 20190930 C_ZAB не фигурирует в разделе D3, но ФОМС ставит ошибку
            // Исправлено в Барс 20190930
            //xml.WriteIfValid("C_ZAB", StatisticsCode);

            xml.WriteBool("DS_ONK", rec.SuspectOncology);

            if (DispensarySupervision >= DispensarySupervision.Observed &&
                DispensarySupervision <= DispensarySupervision.NotSubject)
            {
                xml.Writer.WriteElementString("PR_D_N", ((int)DispensarySupervision).ToString());
            }
#else
            if (rec.SuspectOncology)
            {
                xml.Writer.WriteElementString("DS_ONK", "1");
            }

            xml.Writer.WriteElementString("PR_D_N", ((int)DispensarySupervision).ToString());
#endif

            foreach (ConcomitantDisease d in pool.GetConcomitantDiseases(irec, this))
            {
                d.Write(xml);
            }

#if FOMS
            xml.Writer.WriteElementString("PRVS", SpecialityCode);
#endif

            foreach (DispAssignment d in pool.GetDispanserisationAssignments(rec, this))
            {
                d.Write(xml);
            }

            if (Quantity > 0)
            {
                xml.Writer.WriteElementString("ED_COL", Quantity.ToString("F2", Options.NumberFormat));
            }

            if (Tariff > 0)
            {
                xml.Writer.WriteElementString("TARIF", Tariff.ToString("F2", Options.NumberFormat));
            }

            xml.Writer.WriteElementString("SUM_M", Total.ToString("F2", Options.NumberFormat));

            // Сведения об услуге
            // Описывает услуги, оказанные в рамках данного случая.
            // Допускается указание услуг с нулевой стоимостью.
            // Указание услуг с нулевой стоимостью обязательно, если условие их оказания является тарифообразующим (например, при оплате по КСГ).
            foreach (Service s in Services)
            {
                s.WriteD3(xml, pool, irec, rec, this);
            }

            xml.WriteIfValid("COMENTSL", Comment);
            xml.Writer.WriteEndElement();
        }
示例#13
0
        /// <summary>
        /// Save hi-tech aid case to XML
        /// </summary>
        /// <param name="xml">XML exporter to save into</param>
        /// <param name="pool">Datapool</param>
        /// <param name="irec">Invoice record to which this event belongs</param>
        public void WriteD2(Lib.XmlExporter xml, Data.IInvoice pool, InvoiceRecord irec, Recourse rec)
        {
            xml.Writer.WriteStartElement("SL");
            xml.Writer.WriteElementString("SL_ID", Identity);
            xml.Writer.WriteElementString("VID_HMP", HiTechKind);
            xml.Writer.WriteElementString("METOD_HMP", HiTechMethod);
            xml.WriteIfValid("LPU_1", Unit);
            xml.WriteIfValid("PODR", rec.Department);
            xml.Writer.WriteElementString("PROFIL", rec.Profile);
            xml.WriteIfValid("PROFIL_K", BedProfile);
            xml.WriteBool("DET", Child);

#if FOMS
            xml.Writer.WriteElementString("CEL", LocalReason);
#endif

            xml.Writer.WriteElementString("TAL_D", HiTechCheckDate.AsXml());
            xml.Writer.WriteElementString("TAL_NUM", HiTechCheckNumber);
            xml.Writer.WriteElementString("TAL_P", HiTechPlannedHospitalizationDate.AsXml());

            xml.Writer.WriteElementString("NHISTORY", CardNumber);
            xml.Writer.WriteElementString("DATE_1", DateFrom.AsXml());
            xml.Writer.WriteElementString("DATE_2", DateTill.AsXml());
            xml.WriteIfValid("DS0", PrimaryDiagnosis);
            xml.Writer.WriteElementString("DS1", MainDiagnosis);

            if (ConcurrentDiagnoses != null)
            {
                foreach (string ds in ConcurrentDiagnoses)
                {
                    xml.Writer.WriteElementString("DS2", ds);
                }
            }

            if (ComplicationDiagnoses != null)
            {
                foreach (string ds in ComplicationDiagnoses)
                {
                    xml.Writer.WriteElementString("DS3", ds);
                }
            }

            if (rec.SuspectOncology)
            {
                xml.Writer.WriteElementString("DS_ONK", "1");
            }

            foreach (string mes in pool.LoadMesCodes(irec, rec, this))
            {
                xml.Writer.WriteElementString("CODE_MES1", mes);
            }

            xml.WriteIfValid("CODE_MES2", ConcurrentMesCode);

            isOncology = OnkologyTreat.IsOnkologyTreat(rec, this, pool);
            if (isOncology)
            {
                OnkologyTreat treat = pool.GetOnkologyTreat(rec, this);
                if (treat != null)
                {
                    if (string.IsNullOrEmpty(treat.Stage))
                    {
                        Console.WriteLine("Пустая стадия для онкологии. Случай " + this.Identity);
                    }
                    treat.Write(xml, pool);
                }
            }

            xml.Writer.WriteElementString("PRVS", SpecialityCode);
            xml.Writer.WriteElementString("VERS_SPEC", Options.SpecialityClassifier);
            xml.Writer.WriteElementString("IDDOKT", DoctorCode);

            if (Quantity > 0)
            {
                xml.Writer.WriteElementString("ED_COL", Quantity.ToString("F2", Options.NumberFormat));
            }

            if (Tariff > 0)
            {
                xml.Writer.WriteElementString("TARIF", Tariff.ToString("F2", Options.NumberFormat));
            }

            xml.Writer.WriteElementString("SUM_M", Total.ToString("F2", Options.NumberFormat));

            // Сведения об услуге
            // Описывает услуги, оказанные в рамках данного случая.
            // Допускается указание услуг с нулевой стоимостью.
            // Указание услуг с нулевой стоимостью обязательно, если условие их оказания является тарифообразующим (например, при оплате по КСГ).
            foreach (Service s in Services)
            {
                s.WriteD2(xml, pool, irec, rec, this);
            }

            xml.WriteIfValid("COMENTSL", Comment);
            xml.Writer.WriteEndElement();
        }
示例#14
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);
        }