예제 #1
0
        private YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLog AddMaterialTrackingLogScan(string materialId, string materialType, string materialTrackingBatchId)
        {
            YellowstonePathology.Business.Facility.Model.FacilityCollection facilityCollection = Business.Facility.Model.FacilityCollection.GetAllFacilities();
            YellowstonePathology.Business.Facility.Model.LocationCollection locationCollection = Business.Facility.Model.LocationCollection.GetAllLocations();

            YellowstonePathology.Business.Facility.Model.Facility thisFacility = facilityCollection.GetByFacilityId(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.FacilityId);
            YellowstonePathology.Business.Facility.Model.Location thisLocation = locationCollection.GetLocation(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.LocationId);

            string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString();

            YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLog materialTrackingLog = new Business.MaterialTracking.Model.MaterialTrackingLog(objectId, materialId, materialTrackingBatchId, thisFacility.FacilityId, thisFacility.FacilityName, thisLocation.LocationId, thisLocation.Description, materialType);
            YellowstonePathology.Business.Persistence.DocumentGateway.Instance.InsertDocument(materialTrackingLog, this.m_PageNavigator.PrimaryMonitorWindow);
            this.m_MaterialTrackingLogCollection.Add(materialTrackingLog);
            return(materialTrackingLog);
        }
        private void HyperlinkReceiveMaterial_Click(object sender, RoutedEventArgs e)
        {
            YellowstonePathology.Business.Facility.Model.FacilityCollection facilityCollection = Business.Facility.Model.FacilityCollection.GetAllFacilities();

            YellowstonePathology.Business.Facility.Model.Facility fromFacility = new YellowstonePathology.Business.Facility.Model.NullFacility();
            YellowstonePathology.Business.Facility.Model.Location fromLocation = new YellowstonePathology.Business.Facility.Model.LocationDefinitions.NullLocation();

            YellowstonePathology.Business.Facility.Model.Facility toFacility = facilityCollection.GetByFacilityId(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.FacilityId);
            YellowstonePathology.Business.Facility.Model.Location toLocation = toFacility.Locations.GetLocation(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.LocationId);

            string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString();

            YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch materialTrackingBatch = new YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingBatch(objectId, null, fromFacility, fromLocation, toFacility, toLocation, this.m_MasterAccessionNo);

            YellowstonePathology.Business.Persistence.DocumentGateway.Instance.InsertDocument(materialTrackingBatch, Window.GetWindow(this));
            YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLogCollection materialTrackingLogCollection = new Business.MaterialTracking.Model.MaterialTrackingLogCollection();
            this.ViewBatch(this, new YellowstonePathology.UI.CustomEventArgs.MaterialTrackingBatchEventArgs(materialTrackingBatch, materialTrackingLogCollection));
        }
        private void BarcodeScanPort_AliquotOrderIdReceived(string scanData)
        {
            this.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal,
                                   new Action(
                                       delegate()
            {
                if (this.m_SpecimenOrder.AliquotOrderCollection.Exists(scanData) == true)
                {
                    YellowstonePathology.Business.Facility.Model.FacilityCollection facilityCollection = Business.Facility.Model.FacilityCollection.GetAllFacilities();
                    YellowstonePathology.Business.Facility.Model.LocationCollection locationCollection = YellowstonePathology.Business.Facility.Model.LocationCollection.GetAllLocations();
                    YellowstonePathology.Business.Facility.Model.Facility thisFacility = facilityCollection.GetByFacilityId(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.FacilityId);
                    YellowstonePathology.Business.Facility.Model.Location thisLocation = locationCollection.GetLocation(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.LocationId);

                    YellowstonePathology.Business.Test.AliquotOrder aliquotOrder = this.m_SpecimenOrder.AliquotOrderCollection.GetByAliquotOrderId(scanData);
                    aliquotOrder.Validate();

                    string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString();
                    YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLog materialTrackingLog = new Business.MaterialTracking.Model.MaterialTrackingLog(objectId, scanData, null, thisFacility.FacilityId, thisFacility.FacilityName,
                                                                                                                                                                           thisLocation.LocationId, thisLocation.Description, "Panther Aliquot Scanned", "Panther aliquot scanned at cytology aliquoting", "Aliquot", this.m_AccessionOrder.MasterAccessionNo, aliquotOrder.Label, aliquotOrder.ClientAccessioned);
                    YellowstonePathology.Business.Persistence.DocumentGateway.Instance.InsertDocument(materialTrackingLog, Window.GetWindow(this));

                    if (this.m_SpecimenOrder.AliquotOrderCollection.HasUnvalidatedItems() == false)
                    {
                        this.Finished(this, new EventArgs());
                    }
                }
                else
                {
                    System.Windows.MessageBox.Show("The aliquot scanned does not appear to belong to this specimen.");
                }
            }));
        }
예제 #4
0
        public SlideLabel(YellowstonePathology.Business.Test.AliquotOrder aliquotOrder, YellowstonePathology.Business.Test.AccessionOrder accessionOrder)
        {
            this.m_AliquotOrder   = aliquotOrder;
            this.m_AccessionOrder = accessionOrder;

            this.m_MasterAccessionNo = accessionOrder.MasterAccessionNo;
            YellowstonePathology.Business.Patient.Model.Patient patient = new YellowstonePathology.Business.Patient.Model.Patient(accessionOrder.PFirstName, accessionOrder.PLastName);
            this.m_TruncatedFirstName = patient.GetTruncatedFirstName(12);
            this.m_TruncatedLastName  = patient.GetTruncatedLastName(12);
            this.m_SlideId            = aliquotOrder.Label;

            YellowstonePathology.Business.Facility.Model.FacilityCollection facilityCollection = YellowstonePathology.Business.Facility.Model.FacilityCollection.GetAllFacilities();
            YellowstonePathology.Business.Facility.Model.Facility           facility           = facilityCollection.GetByFacilityId(accessionOrder.AccessioningFacilityId);

            this.m_LocationDescription = facility.LocationAbbreviation;
        }
예제 #5
0
        private void AddMaterialTrackingLog(YellowstonePathology.Business.Test.AliquotOrder aliquotOrder)
        {
            YellowstonePathology.Business.Facility.Model.FacilityCollection facilityCollection = Business.Facility.Model.FacilityCollection.GetAllFacilities();
            YellowstonePathology.Business.Facility.Model.LocationCollection locationCollection = YellowstonePathology.Business.Facility.Model.LocationCollection.GetAllLocations();
            YellowstonePathology.Business.Facility.Model.Facility           thisFacility       = facilityCollection.GetByFacilityId(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.FacilityId);
            YellowstonePathology.Business.Facility.Model.Location           thisLocation       = locationCollection.GetLocation(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.LocationId);

            string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString();

            YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLog materialTrackingLog = new Business.MaterialTracking.Model.MaterialTrackingLog(objectId, aliquotOrder.AliquotOrderId, null, thisFacility.FacilityId, thisFacility.FacilityName,
                                                                                                                                                                   thisLocation.LocationId, thisLocation.Description, "Block Scanned", "Block Scanned At Cutting", "Aliquot", this.m_AccessionOrder.MasterAccessionNo, aliquotOrder.Label, aliquotOrder.ClientAccessioned);

            YellowstonePathology.Business.Persistence.DocumentGateway.Instance.InsertDocument(materialTrackingLog, Window.GetWindow(this));
        }
예제 #6
0
        public void CreateReport(DateTime reportDate)
        {
            Business.Surgical.SurgicalMasterLogList surgicalMasterLogList = new Business.Surgical.SurgicalMasterLogList();
            surgicalMasterLogList.FillByReportDateAndLocation(reportDate);

            this.m_ReportTemplate = @"\\CFileServer\documents\Reports\Templates\SurgicalMasterLog.5.xml";

            this.m_ReportXml = new XmlDocument();
            this.m_ReportXml.Load(this.m_ReportTemplate);

            this.m_NameSpaceManager = new XmlNamespaceManager(this.m_ReportXml.NameTable);
            this.m_NameSpaceManager.AddNamespace("w", "http://schemas.microsoft.com/office/word/2003/wordml");
            this.m_NameSpaceManager.AddNamespace("wx", "http://schemas.microsoft.com/office/word/2003/auxHint");
            this.m_ReportSaveFileName = @"\\CFileServer\documents\Reports\Surgical\MasterLog\YEAR\MONTH\SurgicalMasterLog.FILEDATE.v1.xml";

            this.ReportBaseXml = new XmlDocument();
            this.ReportBaseXml.Load(ReportBaseFileName);

            this.NameSpaceManagerBase = new XmlNamespaceManager(ReportBaseXml.NameTable);
            this.NameSpaceManagerBase.AddNamespace("w", "http://schemas.microsoft.com/office/word/2003/wordml");
            this.NameSpaceManagerBase.AddNamespace("wx", "http://schemas.microsoft.com/office/word/2003/auxHint");

            string reportTitle = "Surgical Master Log - " + reportDate.ToLongDateString();

            this.m_ReportXml.SelectSingleNode("//w:r[w:t='report_title_first_page']/w:t", this.NameSpaceManagerBase).InnerText = reportTitle;

            XmlNode nodeTable            = this.FindXmlTableInDetail("accession_no");
            XmlNode nodeTemplateFacility = this.FindXmlTableRowInDetail("accessioning_location", nodeTable);
            XmlNode nodeTemplateR1       = this.FindXmlTableRowInDetail("accession_no", nodeTable);
            XmlNode nodeTemplateR2       = this.FindXmlTableRowInDetail("specimen", nodeTable);
            XmlNode nodeTemplateR3       = this.FindXmlTableRowInDetail("blank_row", nodeTable);

            List <string> accessioningLocations = new List <string>();

            accessioningLocations.Add("Billings");
            accessioningLocations.Add("Cody");

            YellowstonePathology.Business.Facility.Model.FacilityCollection facilityCollection = YellowstonePathology.Business.Facility.Model.FacilityCollection.GetAllFacilities();

            foreach (string location in accessioningLocations)
            {
                XmlNode nodeNewLocation = nodeTemplateFacility.Clone();
                this.ReplaceTextInRowNode(nodeNewLocation, "accessioning_location", "Accessioning Location: " + location);
                nodeTable.AppendChild(nodeNewLocation);

                foreach (Business.Surgical.SurgicalMasterLogItem surgicalMasterLogItem in surgicalMasterLogList)
                {
                    YellowstonePathology.Business.Facility.Model.Facility accessioningFacility = facilityCollection.GetByFacilityId(surgicalMasterLogItem.AccessioningFacilityId);
                    if (accessioningFacility.AccessioningLocation == location)
                    {
                        string reportNo    = surgicalMasterLogItem.ReportNo;
                        string patientName = surgicalMasterLogItem.PFirstName + " " + surgicalMasterLogItem.PLastName;
                        if (surgicalMasterLogItem.PBirthdate.HasValue)
                        {
                            patientName += " - " + surgicalMasterLogItem.PBirthdate.Value.ToShortDateString();
                        }
                        string physicianClient = surgicalMasterLogItem.PhysicianName + " - " + surgicalMasterLogItem.ClientName;
                        string aliquotCount    = surgicalMasterLogItem.AliquotCount.ToString();

                        XmlNode nodeNewR1 = nodeTemplateR1.Clone();
                        this.ReplaceTextInRowNode(nodeNewR1, "accession_no", reportNo);
                        this.ReplaceTextInRowNode(nodeNewR1, "patient_name", patientName);
                        this.ReplaceTextInRowNode(nodeNewR1, "physician_client", physicianClient);
                        this.ReplaceTextInRowNode(nodeNewR1, "alq_cnt", aliquotCount);

                        nodeTable.AppendChild(nodeNewR1);
                        foreach (Business.Surgical.MasterLogItem masterLogItem in surgicalMasterLogItem.MasterLogList)
                        {
                            XmlNode nodeNewR2 = nodeTemplateR2.Clone();
                            string  specimen  = masterLogItem.DiagnosisId.ToString() + ". " + masterLogItem.Description;
                            this.ReplaceTextInRowNode(nodeNewR2, "specimen", specimen);
                            nodeTable.AppendChild(nodeNewR2);
                        }

                        XmlNode nodeNewR3 = nodeTemplateR3.Clone();
                        this.ReplaceTextInRowNode(nodeNewR3, "blank_row", "");
                        nodeTable.AppendChild(nodeNewR3);
                    }
                }
            }

            nodeTable.RemoveChild(nodeTemplateFacility);
            nodeTable.RemoveChild(nodeTemplateR1);
            nodeTable.RemoveChild(nodeTemplateR2);
            nodeTable.RemoveChild(nodeTemplateR3);
            SetReportBody(nodeTable);
            SaveReport(reportDate.ToString());
        }
예제 #7
0
        private bool IsProfessionalBillingFacilityValid()
        {
            bool result = true;

            YellowstonePathology.Business.Facility.Model.FacilityCollection facilityCollection            = YellowstonePathology.Business.Facility.Model.FacilityCollection.GetAllFacilities();
            YellowstonePathology.Business.Facility.Model.Facility           professionalComponentFacility = facilityCollection.GetByFacilityId(this.m_PanelSetOrder.ProfessionalComponentFacilityId);

            YellowstonePathology.Business.Facility.Model.ClientBillingFacilityCollection clientBillingFacilityCollection = new YellowstonePathology.Business.Facility.Model.ClientBillingFacilityCollection();
            YellowstonePathology.Business.Rules.MethodResult professionalResult = clientBillingFacilityCollection.FindMatch(this.m_PanelSetOrder.ProfessionalComponentFacilityId, this.m_PanelSetOrder.ProfessionalComponentBillingFacilityId, this.m_AccessionOrder.ClientId, "Professional");

            if (professionalResult.Success == false)
            {
                MessageBoxResult messageBoxResult = MessageBox.Show(professionalResult.Message, "Are you sure you want to continue?", MessageBoxButton.YesNo);
                if (messageBoxResult == MessageBoxResult.No)
                {
                    result = false;
                }
            }

            return(result);
        }
예제 #8
0
        public static BillingComponent GetBillingComponent(YellowstonePathology.Business.Test.PanelSetOrder panelSetOrder)
        {
            BillingComponent result = null;

            YellowstonePathology.Business.Facility.Model.FacilityCollection facilityCollection = YellowstonePathology.Business.Facility.Model.FacilityCollection.GetAllFacilities();
            YellowstonePathology.Business.Facility.Model.Facility           technicalComponentBillingFacility    = facilityCollection.GetByFacilityId(panelSetOrder.TechnicalComponentBillingFacilityId);
            YellowstonePathology.Business.Facility.Model.Facility           professionalComponentBillingFacility = facilityCollection.GetByFacilityId(panelSetOrder.ProfessionalComponentBillingFacilityId);

            if (panelSetOrder.HasTechnicalComponent == true && panelSetOrder.HasProfessionalComponent == true)
            {
                if (YellowstonePathology.Business.Facility.Model.FacilityCollection.IsAYellowstonePathologyFacility(technicalComponentBillingFacility) &&
                    YellowstonePathology.Business.Facility.Model.FacilityCollection.IsAYellowstonePathologyFacility(professionalComponentBillingFacility) == true)
                {
                    result = new BillingComponentGlobal(panelSetOrder);
                }
                else if (technicalComponentBillingFacility.IsReferenceLab == true && professionalComponentBillingFacility.IsReferenceLab == true)
                {
                    result = new BillingComponentNoBilling(panelSetOrder);
                }
                else if (YellowstonePathology.Business.Facility.Model.FacilityCollection.IsAYellowstonePathologyFacility(technicalComponentBillingFacility) == true)
                {
                    result = new BillingComponentTechnicalOnly(panelSetOrder);
                }
                else if (YellowstonePathology.Business.Facility.Model.FacilityCollection.IsAYellowstonePathologyFacility(professionalComponentBillingFacility) == true)
                {
                    result = new BillingComponentProfessionalOnly(panelSetOrder);
                }
            }
            else if (panelSetOrder.HasTechnicalComponent == true && panelSetOrder.HasProfessionalComponent == false)
            {
                if (technicalComponentBillingFacility.IsReferenceLab == false)
                {
                    result = new BillingComponentTechnicalOnly(panelSetOrder);
                }
                else
                {
                    result = new BillingComponentNoBilling(panelSetOrder);
                }
            }
            else if (panelSetOrder.HasTechnicalComponent == false && panelSetOrder.HasProfessionalComponent == true)
            {
                if (professionalComponentBillingFacility.IsReferenceLab == false)
                {
                    result = new BillingComponentProfessionalOnly(panelSetOrder);
                }
                else
                {
                    result = new BillingComponentNoBilling(panelSetOrder);
                }
            }
            else if (panelSetOrder.HasTechnicalComponent == false && panelSetOrder.HasProfessionalComponent == false)
            {
                result = new BillingComponentNoBilling(panelSetOrder);
            }

            return(result);
        }
예제 #9
0
        private void AddMaterialTrackingLog(YellowstonePathology.Business.Slide.Model.SlideOrder slideOrder)
        {
            YellowstonePathology.Business.Facility.Model.FacilityCollection facilityCollection = Business.Facility.Model.FacilityCollection.GetAllFacilities();
            YellowstonePathology.Business.Facility.Model.LocationCollection locationCollection = YellowstonePathology.Business.Facility.Model.LocationCollection.GetAllLocations();
            YellowstonePathology.Business.Facility.Model.Facility           thisFacility       = facilityCollection.GetByFacilityId(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.FacilityId);
            YellowstonePathology.Business.Facility.Model.Location           thisLocation       = locationCollection.GetLocation(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.LocationId);
            string scanLocation = "Slide Scanned At " + YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.HostName;

            string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString();

            YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLog materialTrackingLog = new Business.MaterialTracking.Model.MaterialTrackingLog(objectId, slideOrder.SlideOrderId, null, thisFacility.FacilityId, thisFacility.FacilityName,
                                                                                                                                                                   thisLocation.LocationId, thisLocation.Description, "Slide Scan", scanLocation, "SlideOrder", this.m_AccessionOrder.MasterAccessionNo, slideOrder.Label, slideOrder.ClientAccessioned);

            YellowstonePathology.Business.Persistence.DocumentGateway.Instance.InsertDocument(materialTrackingLog, Window.GetWindow(this));
            this.m_MaterialTrackingLogCollection.Insert(0, materialTrackingLog);
        }
        private void AddMaterialTrackingLog(YellowstonePathology.Business.Specimen.Model.SpecimenOrder specimenOrder)
        {
            YellowstonePathology.Business.Facility.Model.FacilityCollection facilityCollection = Business.Facility.Model.FacilityCollection.GetAllFacilities();
            YellowstonePathology.Business.Facility.Model.LocationCollection locationCollection = YellowstonePathology.Business.Facility.Model.LocationCollection.GetAllLocations();
            YellowstonePathology.Business.Facility.Model.Facility           thisFacility       = facilityCollection.GetByFacilityId(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.FacilityId);
            YellowstonePathology.Business.Facility.Model.Location           thisLocation       = locationCollection.GetLocation(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.LocationId);

            string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString();

            YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLog materialTrackingLog = new Business.MaterialTracking.Model.MaterialTrackingLog(objectId, specimenOrder.SpecimenOrderId, null, thisFacility.FacilityId, thisFacility.FacilityName,
                                                                                                                                                                   thisLocation.LocationId, thisLocation.Description, "Container Scan", "Container Scanned At Gross", "Specimen", this.m_AccessionOrder.MasterAccessionNo, specimenOrder.Description, specimenOrder.ClientAccessioned);

            YellowstonePathology.Business.Persistence.DocumentGateway.Instance.InsertDocument(materialTrackingLog, this.m_PrintSlideDialog);
        }
예제 #11
0
        private void HistologyBlockScanReceived(YellowstonePathology.Business.BarcodeScanning.Barcode barcode)
        {
            this.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Input, new System.Threading.ThreadStart(delegate()
            {
                if (this.m_SpecimenOrder.AliquotOrderCollection.Exists(barcode.ID))
                {
                    YellowstonePathology.Business.Facility.Model.FacilityCollection facilityCollection = Business.Facility.Model.FacilityCollection.GetAllFacilities();
                    YellowstonePathology.Business.Facility.Model.LocationCollection locationCollection = YellowstonePathology.Business.Facility.Model.LocationCollection.GetAllLocations();
                    YellowstonePathology.Business.Facility.Model.Facility thisFacility = facilityCollection.GetByFacilityId(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.FacilityId);
                    YellowstonePathology.Business.Facility.Model.Location thisLocation = locationCollection.GetLocation(YellowstonePathology.Business.User.UserPreferenceInstance.Instance.UserPreference.LocationId);

                    YellowstonePathology.Business.Test.AliquotOrder aliquotOrder = this.m_SpecimenOrder.AliquotOrderCollection.GetByAliquotOrderId(barcode.ID);
                    string objectId = MongoDB.Bson.ObjectId.GenerateNewId().ToString();
                    YellowstonePathology.Business.MaterialTracking.Model.MaterialTrackingLog materialTrackingLog = new Business.MaterialTracking.Model.MaterialTrackingLog(objectId, barcode.ID, null, thisFacility.FacilityId, thisFacility.FacilityName,
                                                                                                                                                                           thisLocation.LocationId, thisLocation.Description, "Block Scanned", "Block Scanned At Gross", "Aliquot", this.m_AccessionOrder.MasterAccessionNo, aliquotOrder.Label, aliquotOrder.ClientAccessioned);
                    YellowstonePathology.Business.Persistence.DocumentGateway.Instance.InsertDocument(materialTrackingLog, Window.GetWindow(this));

                    this.m_SpecimenOrder.AliquotOrderCollection.ValidateBlock(barcode.ID, this.m_SystemIdentity.User.UserId);
                    this.GrossBlockManagementView = new Business.View.GrossBlockManagementView(this.m_AccessionOrder, this.m_CaseNotesDocument, this.m_SpecimenOrder);
                    this.SetupSpecimenView();

                    if (this.m_SpecimenOrder.AliquotOrderCollection.HasUnverifiedBlocks() == false)
                    {
                        CustomEventArgs.SpecimenOrderReturnEventArgs specimenOrderReturnEventArgs = new CustomEventArgs.SpecimenOrderReturnEventArgs(this.m_SpecimenOrder);
                        this.Next(this, specimenOrderReturnEventArgs);
                    }
                }
                else
                {
                    MessageBox.Show("The block scanned is not from this specimen.", "Scanned Block Mismatch", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                }
            }
                                                                                                                       ));
        }
예제 #12
0
        protected void SetAccessionNode()
        {
            string assignedTo = YellowstonePathology.Business.User.SystemUserCollectionInstance.Instance.SystemUserCollection.GetSystemUserById(this.m_PanelSetOrder.AssignedToId).DisplayName;

            YellowstonePathology.Business.Facility.Model.FacilityCollection facilityCollection = YellowstonePathology.Business.Facility.Model.FacilityCollection.GetAllFacilities();
            YellowstonePathology.Business.PanelSet.Model.PanelSetCollection panelSetCollection = YellowstonePathology.Business.PanelSet.Model.PanelSetCollection.GetAll();
            YellowstonePathology.Business.PanelSet.Model.PanelSet           panelSet           = panelSetCollection.GetPanelSet(this.m_PanelSetOrder.PanelSetId);

            string professionalComponentFacilityName = string.Empty;
            string professionalComponentFacilityCLIA = string.Empty;
            string technicalComponentFacilityName    = string.Empty;
            string technicalComponentFacilityCLIA    = string.Empty;

            if (panelSet.HasProfessionalComponent == true)
            {
                YellowstonePathology.Business.Facility.Model.Facility professionalComponentFacility = facilityCollection.GetByFacilityId(this.m_PanelSetOrder.ProfessionalComponentFacilityId);
                professionalComponentFacilityName = professionalComponentFacility.FacilityName;
                professionalComponentFacilityCLIA = professionalComponentFacility.CLIALicense.LicenseNumber;
            }

            if (panelSet.HasTechnicalComponent == true)
            {
                YellowstonePathology.Business.Facility.Model.Facility technicalComponentFacility = facilityCollection.GetByFacilityId(this.m_PanelSetOrder.TechnicalComponentFacilityId);
                technicalComponentFacilityName = technicalComponentFacility.FacilityName;
                technicalComponentFacilityCLIA = technicalComponentFacility.CLIALicense.LicenseNumber;
            }

            this.Add(new XElement("MasterAccessionNo", this.m_AccessionOrder.MasterAccessionNo),
                     new XElement("PanelSetName", this.m_PanelSetOrder.PanelSetName),
                     new XElement("ReportNo", this.m_ReportNo),
                     new XElement("PrimaryInsurance", this.m_AccessionOrder.PrimaryInsurance),
                     new XElement("SecondaryInsurance", this.m_AccessionOrder.SecondaryInsurance),
                     new XElement("FeeSchedule", this.m_AccessionOrder.FeeSchedule),
                     new XElement("PatientType", this.m_AccessionOrder.PatientType),
                     new XElement("PatientFirstName", this.m_AccessionOrder.PFirstName),
                     new XElement("PatientLastName", this.m_AccessionOrder.PLastName),
                     new XElement("PatientMiddleInitial", this.m_AccessionOrder.PMiddleInitial),
                     new XElement("PatientSuffix", this.m_AccessionOrder.PSuffix),
                     new XElement("PatientRace", this.m_AccessionOrder.PRace),
                     new XElement("PatientGender", this.m_AccessionOrder.PSex),
                     new XElement("PatientBirthdate", Helper.DateTimeExtensions.DateStringFromNullable(this.m_AccessionOrder.PBirthdate)),
                     new XElement("PatientMaritalStatus", this.m_AccessionOrder.PMaritalStatus),
                     new XElement("PatientPhoneNumberBusiness", this.m_AccessionOrder.PPhoneNumberBusiness),
                     new XElement("PatientPhoneNumberHome", this.m_AccessionOrder.PPhoneNumberHome),
                     new XElement("PatientAddress1", this.m_AccessionOrder.PAddress1),
                     new XElement("PatientAddress2", this.m_AccessionOrder.PAddress2),
                     new XElement("PatientCity", this.m_AccessionOrder.PCity),
                     new XElement("PatientState", this.m_AccessionOrder.PState),
                     new XElement("PatientZip", this.m_AccessionOrder.PZipCode),
                     new XElement("PatientInsurancePlan1", this.m_AccessionOrder.InsurancePlan1),
                     new XElement("PatientInsurancePlan2", this.m_AccessionOrder.InsurancePlan2),
                     new XElement("ClientId", this.m_AccessionOrder.ClientId),
                     new XElement("ClientName", this.m_AccessionOrder.ClientName),
                     new XElement("ProviderName", this.m_AccessionOrder.PhysicianName),
                     new XElement("ProviderNPI", this.m_ProviderNPI),
                     new XElement("AssignedTo", assignedTo),
                     new XElement("DateOfService", Helper.DateTimeExtensions.DateStringFromNullable(this.m_AccessionOrder.CollectionDate)),
                     new XElement("FinalDate", Helper.DateTimeExtensions.DateStringFromNullable(this.m_PanelSetOrder.FinalDate)),
                     new XElement("TechnicalComponentFacilityCLIA", technicalComponentFacilityCLIA),
                     new XElement("TechnicalComponentFacilityName", technicalComponentFacilityName),
                     new XElement("ProfessionalComponentFacilityCLIA", professionalComponentFacilityCLIA),
                     new XElement("ProfessionalComponentFacilityName", professionalComponentFacilityName));
        }
예제 #13
0
        public override void Visit(Test.AccessionOrder accessionOrder)
        {
            YellowstonePathology.Business.Test.PanelSetOrder panelSetOrder = accessionOrder.PanelSetOrderCollection.GetPanelSetOrderByTestOrderId(this.m_TestOrder.TestOrderId);

            YellowstonePathology.Business.Facility.Model.FacilityCollection allFacilities        = YellowstonePathology.Business.Facility.Model.FacilityCollection.GetAllFacilities();
            YellowstonePathology.Business.Facility.Model.Facility           accessioningFacility = allFacilities.GetByFacilityId(accessionOrder.AccessioningFacilityId);

            Slide.Model.Slide slide = Slide.Model.SlideFactory.Get(this.m_TestOrder.TestId);

            int    nextSlideNumber = this.m_AliquotOrder.SlideOrderCollection.Count() + 1; //this.m_AliquotOrder.SlideOrderCollection.GetNextSlideNumber(this.m_AliquotOrder.Label);
            string objectId        = MongoDB.Bson.ObjectId.GenerateNewId().ToString();
            string slideOrderId    = YellowstonePathology.Business.OrderIdParser.GetNextSlideOrderId(this.m_AliquotOrder.SlideOrderCollection, this.m_AliquotOrder.AliquotOrderId);

            YellowstonePathology.Business.Slide.Model.SlideOrder slideOrder = new Business.Slide.Model.SlideOrder();
            slideOrder.ObjectId         = objectId;
            slideOrder.SlideOrderId     = slideOrderId;
            slideOrder.AliquotOrderId   = this.m_AliquotOrder.AliquotOrderId;
            slideOrder.Label            = YellowstonePathology.Business.Slide.Model.SlideOrder.GetSlideLabel(nextSlideNumber, this.m_AliquotOrder.Label, this.m_AliquotOrder.AliquotType);
            slideOrder.TestOrder        = this.m_TestOrder;
            slideOrder.ReportNo         = panelSetOrder.ReportNo;
            slideOrder.TestOrderId      = this.m_TestOrder.TestOrderId;
            slideOrder.TestId           = this.m_TestOrder.TestId;
            slideOrder.TestName         = this.m_TestOrder.TestName;
            slideOrder.TestAbbreviation = this.m_TestOrder.TestAbbreviation;
            slideOrder.PatientLastName  = accessionOrder.PLastName;
            slideOrder.Description      = "Histology Slide";
            slideOrder.AliquotType      = "Slide";
            slideOrder.OrderedById      = this.m_SystemIdentity.User.UserId;
            slideOrder.OrderDate        = DateTime.Now;
            slideOrder.OrderedBy        = this.m_SystemIdentity.User.UserName;
            slideOrder.OrderedFrom      = System.Environment.MachineName;
            slideOrder.Status           = Business.Slide.Model.SlideStatusEnum.Created.ToString();
            slideOrder.Location         = accessioningFacility.LocationAbbreviation;
            slideOrder.LabelType        = slide.LabelType.ToString();

            this.m_TestOrder.SlideOrderCollection.Add(slideOrder);
            this.m_AliquotOrder.SlideOrderCollection.Add(slideOrder);
        }