protected void btnSave_Click(object sender, EventArgs e)
        {
            string Createdate = "";
            string ID         = "";

            if (btnSave.Text == "Save")
            {
                if (validate() == false)
                {
                    return;
                }
                IPatientTransfer PatientTransferMgr = (IPatientTransfer)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientTransfer, BusinessProcess.Clinical");
                DataTable        theDT          = PatientTransferMgr.GetSatelliteID(PatientId.ToString());
                string           FromLocationID = theDT.Rows[0]["LocationID"].ToString();
                int retVal = PatientTransferMgr.SaveUpdate(ID, PatientId.ToString(), FromLocationID, ddSatellite.SelectedValue, txtTransferDate.Text, Convert.ToInt32(Session["AppUserId"]), Createdate, 0);
                ViewState["Save"] = "";
                SaveUpdateMsg();
            }


            else if (btnSave.Text == "Update")
            {
                if (validateEdit() == false)
                {
                    return;
                }
                IPatientTransfer PatientTransferMgr = (IPatientTransfer)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientTransfer, BusinessProcess.Clinical");
                int Transfer = (int)PatientTransferMgr.SaveUpdate(TransferId, PatientId.ToString(), ViewState["FromID"].ToString(), ddSatelliteEdit.SelectedValue, TxtTransDateEdit.Text, Convert.ToInt32(Session["AppUserId"]), Createdate, 1);
                SaveUpdateMsg();
            }
            GrdTransfer.Columns.Clear();
            BindGrid();
        }
Пример #2
0
        public override string ToString()
        {
            var str = "";

            str = str + "\n PatientId: " + PatientId.ToString();
            str = str + "\n StartDate: " + StartDate.ToString();
            str = str + "\n EndDate: " + EndDate.ToString();

            return(str);
        }
        private void BindTransferDetail()
        {
            txtLocationName.Text     = Session["AppLocation"].ToString();
            txtLocationName.ReadOnly = true;

            /*Binding Satellite ID*/
            BindFunctions BindManager = new BindFunctions();
            IQCareUtils   theUtils    = new IQCareUtils();
            DataTable     theDT       = new DataTable();

            DataSet          theDS = new DataSet();
            IPatientTransfer PatientTransferMgr = (IPatientTransfer)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientTransfer, BusinessProcess.Clinical");

            if (btnSave.Text == "Save")
            {
                tredit.Visible       = false;
                theDS                = PatientTransferMgr.GetSatelliteLocation(PatientId.ToString(), TransferId, 0, Session["SystemId"].ToString());
                txtLocationName.Text = theDS.Tables[0].Rows[0]["CurrentSatName"].ToString();
                DataView theDV = new DataView(theDS.Tables[1]);
                if (theDV.Table != null)
                {
                    theDT = (DataTable)theUtils.CreateTableFromDataView(theDV);
                    BindManager.BindCombo(ddSatellite, theDT, "Name", "ID");
                    theDV.Dispose();
                    theDT.Clear();
                }
            }


            if (btnSave.Text == "Update")
            {
                tredit.Visible = true;
                theDS          = PatientTransferMgr.GetSatelliteLocation(PatientId.ToString(), TransferId, 1, Session["SystemId"].ToString());

                txtLocationNameEdit.Text    = theDS.Tables[0].Rows[0]["CurrentSatName"].ToString();
                txtLocationNameEdit.Enabled = false;
                txtFromSatellite.Text       = theDS.Tables[2].Rows[0]["TransferfromSatellite"].ToString();
                txtFromSatellite.Enabled    = false;
                ViewState["FromID"]         = theDS.Tables[2].Rows[0]["TransferredfromID"].ToString();
                //ddSatelliteEdit.Enabled = false;
                TxtTransDateEdit.Text     = string.Format("{0:dd-MMM-yyyy}", Convert.ToDateTime(theDS.Tables[2].Rows[0]["TransferredDate"]));
                ViewState["TransferDate"] = TxtTransDateEdit.Text;
                DataView theDV = new DataView(theDS.Tables[1]);
                //theDV.RowFilter = "DeleteFlag=0";
                if (theDV.Table != null)
                {
                    theDT = (DataTable)theUtils.CreateTableFromDataView(theDV);
                    BindManager.BindCombo(ddSatelliteEdit, theDT, "Name", "ID");
                    theDV.Dispose();
                    theDT.Clear();
                }
                ddSatelliteEdit.SelectedValue = theDS.Tables[2].Rows[0][3].ToString();
            }
        }
Пример #4
0
        public override ExtrinsicObject ToRegistryObject()
        {
            var document = new ExtrinsicObject
            {
                Id          = EntryUuid,
                Home        = HomeCommunityId,
                Status      = AvailabilityStatus,
                Description = XmlUtil.LocalString(Comments),
                Name        = XmlUtil.LocalString(Title),
                MimeType    = MimeType,
                ObjectType  = DocumentEntryType
            };

            document.Classifications.Add(new Classification
            {
                ClassificationScheme = XdsClassification.Document,
                ClassifiedObject     = EntryUuid,
            });

            if (Author != null)
            {
                var authorAttribute = Author.ToClassification(XdsClassification.DocumentAuthor, EntryUuid);
                document.Classifications.Add(authorAttribute);
            }
            if (Class != null && !string.IsNullOrEmpty(Class.Value))
            {
                document.Classifications.Add(Class.ToClassification(EntryUuid));
            }

            if (Confidentiality != null && Confidentiality.Any(c => !string.IsNullOrEmpty(c.Value)))
            {
                document.Classifications.AddRange(
                    Confidentiality.Select(c => c.ToClassification(EntryUuid)));
            }
            if (CreationTime != null)
            {
                document.Slots.Add(XmlUtil.SingleSlot("creationTime", _hl7CreationTime.Encode()));
            }

            if (EventCodes != null && EventCodes.Any(fc => !string.IsNullOrEmpty(fc.Value)))
            {
                document.Classifications.AddRange(EventCodes.Select(fc => fc.ToClassification(EntryUuid)));
            }

            if (Format != null && !string.IsNullOrEmpty(Format.Value))
            {
                document.Classifications.Add(Format.ToClassification(EntryUuid));
            }

            if (!string.IsNullOrEmpty(Hash))
            {
                document.Slots.Add(XmlUtil.SingleSlot("hash", Hash));
            }

            if (HealthCareFacilityType != null && !string.IsNullOrEmpty(HealthCareFacilityType.Value))
            {
                document.Classifications.Add(HealthCareFacilityType.ToClassification(EntryUuid));
            }

            if (!string.IsNullOrEmpty(LanguageCode))
            {
                document.Slots.Add(XmlUtil.SingleSlot("languageCode", LanguageCode));
            }

            if (LegalAuthenticator != null)
            {
                document.Slots.Add(XmlUtil.SingleSlot("legalAuthenticator", LegalAuthenticator.Hl7Person.Encode()));
            }

            string patientId = PatientId != null?PatientId.ToString() : "";

            if (!string.IsNullOrEmpty(patientId))
            {
                document.ExternalIdentifiers.Add(new ExternalIdentifier
                {
                    IdentificationScheme = XdsIdentification.DocumentPatientId,
                    RegistryObject       = EntryUuid,
                    Name  = XmlUtil.LocalString("XDSFolder.patientId"),
                    Value = patientId
                });
            }

            if (PracticeSetting != null && !string.IsNullOrEmpty(PracticeSetting.Value))
            {
                document.Classifications.Add(PracticeSetting.ToClassification(EntryUuid));
            }

            if (!string.IsNullOrEmpty(RepositoryUniqueId))
            {
                document.Slots.Add(XmlUtil.SingleSlot("repositoryUniqueId", RepositoryUniqueId));
            }

            if (ServiceStartTime != null)
            {
                document.Slots.Add(XmlUtil.SingleSlot("serviceStartTime", _hl7ServiceStartTime.Encode()));
            }

            if (ServiceStopTime != null)
            {
                document.Slots.Add(XmlUtil.SingleSlot("serviceStopTime", _hl7ServiceStopTime.Encode()));
            }

            if (Size != null)
            {
                document.Slots.Add(XmlUtil.SingleSlot("size", Size.Value.ToString()));
            }

            if (SourcePatientId != null)
            {
                document.Slots.Add(XmlUtil.SingleSlot("sourcePatientId", SourcePatientId.Hl7Identifier.Encode()));
            }

            if (SourcePatientInfo != null && SourcePatientInfo.Any())
            {
                document.Slots.Add(new Slot
                {
                    Name   = "sourcePatientInfo",
                    Values = SourcePatientInfo
                });
            }

            if (Type != null)
            {
                document.Classifications.Add(Type.ToClassification(EntryUuid));
            }

            if (!string.IsNullOrEmpty(Uri))
            {
                document.Slots.Add(XmlUtil.SingleSlot("URI", Uri));
            }

            if (!string.IsNullOrEmpty(UniqueId))
            {
                document.ExternalIdentifiers.Add(new ExternalIdentifier
                {
                    IdentificationScheme = XdsIdentification.DocumentUniqueId,
                    RegistryObject       = EntryUuid,
                    Name  = XmlUtil.LocalString("XDSFolder.uniqueId"),
                    Value = UniqueId
                });
            }
            if (ReferenceIds != null && ReferenceIds.Any())
            {
                document.Slots.Add(new Slot
                {
                    Name   = "urn:ihe:iti:xds:2013:referenceIdList",
                    Values = ReferenceIds.Select(id => id.Hl7Identifier.Encode()).ToList()
                });
            }
            if (LimitedMetadata)
            {
                document.Classifications.Add(new Classification
                {
                    ClassificationScheme = XdsClassification.DocumentLimitedMetadata,
                    ClassifiedObject     = EntryUuid
                });
            }

            return(document);
        }
        /// <summary>
        /// Handles the Click event of the btnClose control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void btnClose_Click(object sender, EventArgs e)
        {
            string theUrl = string.Empty;

            theUrl = string.Format("../ClinicalForms/frmPatient_Home.aspx?PatientId=" + PatientId.ToString());
            Response.Redirect(theUrl);
        }
Пример #6
0
        public override RegistryPackage ToRegistryObject()
        {
            var folder = new RegistryPackage
            {
                Id          = EntryUuid,
                Home        = HomeCommunityId,
                Status      = AvailabilityStatus,
                Description = XmlUtil.LocalString(Comments),
                Name        = XmlUtil.LocalString(Title)
            };

            folder.Classifications.Add(new Classification
            {
                ClassificationScheme = XdsClassification.Folder,
                ClassifiedObject     = EntryUuid,
            });

            if (Codes != null && Codes.Any())
            {
                Codes.ForEach(fc => folder.Classifications.Add(new Classification
                {
                    ClassificationScheme = XdsClassification.FolderCode,
                    ClassifiedObject     = EntryUuid,
                    Name = XmlUtil.LocalString(fc.DisplayName),
                    NodeRepresentation = fc.Value,
                    Slots = new List <Slot>
                    {
                        new Slot
                        {
                            Name   = "codingScheme",
                            Values = new List <string>
                            {
                                fc.CodeSystemId
                            }
                        }
                    }
                }));
            }
            if (!string.IsNullOrEmpty(UniqueId))
            {
                folder.ExternalIdentifiers.Add(new ExternalIdentifier
                {
                    IdentificationScheme = XdsIdentification.FolderUniqueId,
                    RegistryObject       = EntryUuid,
                    Name  = XmlUtil.LocalString("XDSFolder.uniqueId"),
                    Value = UniqueId
                });
            }
            string patientId = PatientId != null?PatientId.ToString() : "";

            if (!string.IsNullOrEmpty(patientId))
            {
                folder.ExternalIdentifiers.Add(new ExternalIdentifier
                {
                    IdentificationScheme = XdsIdentification.FolderPatientId,
                    RegistryObject       = EntryUuid,
                    Name  = XmlUtil.LocalString("XDSFolder.patientId"),
                    Value = patientId
                });
            }
            if (LastUpdateTime != null)
            {
                folder.Slots.Add(new Slot
                {
                    Name   = "lastUpdateTime",
                    Values = new List <string>
                    {
                        _hl7LastUpdateTime.Encode()
                    }
                });
            }
            if (LimitedMetadata)
            {
                folder.Classifications.Add(new Classification
                {
                    ClassificationScheme = XdsClassification.FolderLimitedMetadata,
                    ClassifiedObject     = EntryUuid
                });
            }
            return(folder);
        }
Пример #7
0
        public override RegistryPackage ToRegistryObject()
        {
            var submission = new RegistryPackage
            {
                Id          = EntryUuid,
                Home        = HomeCommunityId,
                Status      = AvailabilityStatus,
                Description = XmlUtil.LocalString(Comments),
                Name        = XmlUtil.LocalString(Title)
            };

            submission.Classifications.Add(new Classification
            {
                ClassificationScheme = XdsClassification.SubmissionSet,
                ClassifiedObject     = EntryUuid,
            });

            if (Author != null)
            {
                var authorAttribute = Author.ToClassification(XdsClassification.SubmissionSetAuthor, EntryUuid);
                submission.Classifications.Add(authorAttribute);
            }

            if (ContentType != null)
            {
                submission.Classifications.Add(ContentType.ToClassification(EntryUuid));
            }

            if (IntendedRecipients != null && IntendedRecipients.Any())
            {
                submission.Slots.Add(new Slot
                {
                    Name   = "intendedRecipient",
                    Values = IntendedRecipients.Select(r => r.Encode()).ToList()
                });
            }

            string patientId = PatientId != null?PatientId.ToString() : "";

            if (!string.IsNullOrEmpty(patientId))
            {
                submission.ExternalIdentifiers.Add(new ExternalIdentifier
                {
                    IdentificationScheme = XdsIdentification.SubmissionSetPatientId,
                    RegistryObject       = EntryUuid,
                    Name  = XmlUtil.LocalString("XDSSubmissionSet.patientId"),
                    Value = patientId
                });
            }

            if (!string.IsNullOrEmpty(SourceId))
            {
                submission.ExternalIdentifiers.Add(new ExternalIdentifier
                {
                    IdentificationScheme = XdsIdentification.SubmissionSetSourceId,
                    RegistryObject       = EntryUuid,
                    Name  = XmlUtil.LocalString("XDSSubmissionSet.sourceId"),
                    Value = SourceId
                });
            }

            if (SubmissionTime != null)
            {
                submission.Slots.Add(XmlUtil.SingleSlot("submissionTime", _hl7SubmissionTime.Encode()));
            }

            if (LimitedMetadata)
            {
                submission.Classifications.Add(new Classification
                {
                    ClassificationScheme = XdsClassification.SubmissionLimitedMetadata,
                    ClassifiedObject     = EntryUuid
                });
            }

            return(submission);
        }
        private bool validateEdit()
        {
            DataSet          theDS = new DataSet();
            IPatientTransfer PatientTransferMgr = (IPatientTransfer)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientTransfer, BusinessProcess.Clinical");

            theDS = PatientTransferMgr.GetDataValidate(PatientId.ToString(), txtTransferDate.Text);

            //Satellite Cannot Be Blank - 0
            if (ddSatelliteEdit.SelectedValue == "0")
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["Control"] = "New Satellite";
                IQCareMsgBox.Show("BlankDropDown", theBuilder, this);
                return(false);
            }
            //Transfer Date cannot be Blank - 1
            if (TxtTransDateEdit.Text == "")
            {
                MsgBuilder theBuilder = new MsgBuilder();
                theBuilder.DataElements["Control"] = "Transfer Date";
                IQCareMsgBox.Show("BlankTextBox", theBuilder, this);
                txtTransferDate.Focus();
                return(false);
            }

            //Transfer Date cannot be greater than Enrolment Registration Date - 2
            if (Convert.ToDateTime(TxtTransDateEdit.Text) < Convert.ToDateTime(theDS.Tables[3].Rows[0]["VisitDate"].ToString()))
            {
                IQCareMsgBox.Show("TransferDate", this);
                txtTransferDate.Focus();
                return(false);
            }

            //Cannot Tranfer a patient more than one satellite on same date - 3
            if (Convert.ToInt32(theDS.Tables[0].Rows[0]["DateExist"]) > 0)
            {
                IQCareMsgBox.Show("TransferDate_2", this);
                TxtTransDateEdit.Focus();
                return(false);
            }

            //Transfer date should be greater than the previous date - 4


            //Transfer Date Cannot Greater than the Current Date - 5
            if (Convert.ToDateTime(TxtTransDateEdit.Text) > Convert.ToDateTime(Application["AppCurrentDate"].ToString()))
            {
                IQCareMsgBox.Show("TransferDate_1", this);
                txtTransferDate.Focus();
                return(false);
            }
            //Validation between two dates
            DataSet theDS1 = new DataSet();

            theDS1 = PatientTransferMgr.GetDateValidateBetween(PatientId.ToString(), ViewState["TransferDate"].ToString());
            if (Convert.ToInt32(theDS1.Tables[1].Rows[0]["ID"]) > Convert.ToInt32(TransferId))
            {
                IQCareMsgBox.Show("TransferDate_3", this);
                TxtTransDateEdit.Focus();
                return(false);
            }

            //Current Satellite and New Satellite cannot be same.
            if (txtFromSatellite.Text == ddSatelliteEdit.SelectedItem.Text)
            {
                IQCareMsgBox.Show("DD_Satellite", this);
                ddSatelliteEdit.SelectedValue = "0";
                return(false);
            }

            return(true);
        }
        private void BindGrid()
        {
            if (ViewState["Sorted"] != null)
            {
                IPatientTransfer PatientTransferMgr = (IPatientTransfer)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientTransfer, BusinessProcess.Clinical");
                DataSet          theDS = PatientTransferMgr.GetSatelliteLocation(PatientId.ToString(), TransferId, 0, Session["SystemId"].ToString());
                txtLocationName.Text = theDS.Tables[0].Rows[0]["CurrentSatName"].ToString();
                BindFunctions BindManager = new BindFunctions();
                IQCareUtils   theUtils    = new IQCareUtils();
                DataView      theDV       = new DataView(theDS.Tables[1]);
                DataTable     theDT       = new DataTable();
                if (theDV.Table != null)
                {
                    theDT = (DataTable)theUtils.CreateTableFromDataView(theDV);
                    BindManager.BindCombo(ddSatellite, theDT, "Name", "ID");
                    theDV.Dispose();
                    theDT.Clear();
                }
                GrdTransfer.DataSource = theDS.Tables[2];
                if (ViewState["grdDataSource"] == null)
                {
                    ViewState["grdDataSource"] = theDS.Tables[2];
                }
            }

            ViewState["Sorted"] = "";
            BoundField theCol0 = new BoundField();

            theCol0.HeaderText           = "ID";
            theCol0.DataField            = "ID";
            theCol0.HeaderStyle.CssClass = "textstylehidden";
            theCol0.ItemStyle.CssClass   = "textstylehidden";
            theCol0.ReadOnly             = true;

            BoundField theCol1 = new BoundField();

            theCol1.HeaderText         = "From Location";
            theCol1.DataField          = "TransferfromSatellite";
            theCol1.ItemStyle.CssClass = "textstyle";
            theCol1.SortExpression     = "TransferfromSatellite";
            theCol1.ReadOnly           = true;

            BoundField theCol2 = new BoundField();

            theCol2.HeaderText         = "To Location";
            theCol2.DataField          = "TransfertoSatellite";
            theCol2.ItemStyle.CssClass = "textstyle";
            theCol2.SortExpression     = "TransfertoSatellite";
            theCol2.ReadOnly           = true;

            BoundField theCol3 = new BoundField();

            theCol3.HeaderText         = "Transferred Date";
            theCol3.DataField          = "TransferredDate";
            theCol3.ItemStyle.CssClass = "textstyle";
            theCol3.SortExpression     = "TransferredDate";
            theCol3.ReadOnly           = true;

            ButtonField theBtn = new ButtonField();

            theBtn.ButtonType           = ButtonType.Link;
            theBtn.CommandName          = "Select";
            theBtn.HeaderStyle.CssClass = "textstylehidden";
            theBtn.ItemStyle.CssClass   = "textstylehidden";

            GrdTransfer.Columns.Add(theCol0);
            GrdTransfer.Columns.Add(theCol1);
            GrdTransfer.Columns.Add(theCol2);
            GrdTransfer.Columns.Add(theCol3);
            GrdTransfer.Columns.Add(theBtn);
            GrdTransfer.DataBind();
        }