예제 #1
0
        private void SaveInfoToDatabase(PDFInfo pdf)
        {
            logger.Info($"Getting req info from the database for {pdf.Barcode}");

            var barcode = int.Parse(pdf.Barcode);
            var req     = RequisitionFactory.CreateRequisition(barcode, new ProlisService());

            if (req != null)
            {
                var doc = new RequisitionDocument()
                {
                    RequisitionId = req.RequisitionNo,
                    Document      = pdf.Pdf,
                    markedDeleted = false
                };

                logger.Info("Req info received.  Saving info.");

                var db = new RequisitionService();
                db.SaveRequisition(req);

                var docService = new LOIS.BLL.services.DocumentService();
                docService.SaveDocument(doc);

                if (req.Patient != null)
                {
                    db.SavePatient(req.Patient);
                }

                logger.Debug("Saved for " + pdf.Barcode);
            }
        }