コード例 #1
0
 protected void btnUnrelease_Click(object sender, EventArgs e)
 {
     StudyObject study = new StudyObject();
     study.StudyId.Value = Request["studyId"];
     study.Load();
     if (study.IsLoaded)
     {
         study.StudyStatusId.Value = Constants.StudyStatusTypes.PreRelease;
         study.Save();
     }
     ClientScript.RegisterStartupScript(this.GetType(), "Close", "parent.closeStudyEditWindow();parent.aspnetForm.submit();", true);
 }
コード例 #2
0
 protected void Log(int studyId)
 {
     StudyObject study = new StudyObject();
     study.StudyId.Value = studyId;
     study.Load();
     if (study.IsLoaded)
     {
         LogObject log = new LogObject();
         log.Action.Value = Constants.LogActions.ViewedExam;
         log.ActionTime.Value = DateTime.Now;
         log.PatientId.Value = study.PatientId.Value;
         log.StudyId.Value = studyId;
         log.UserId.Value = loggedInUserId;
         log.Save();
     }
 }
コード例 #3
0
 public void ApproveStudy(int studyId, int findingId, int userId, string heading, string description, string impression)
 {
     StudyObject study = new StudyObject();
     study.StudyId.Value = studyId;
     study.Load(userId);
     if (study.IsLoaded)
     {
         UpdateStudy(studyId, findingId, userId, heading, description, impression, Constants.StudyStatusTypes.Verified, true);
         LogObject log = new LogObject();
         log.Action.Value = Constants.LogActions.VerifiedStudy;
         log.ActionTime.Value = DateTime.Now;
         log.PatientId.Value = study.PatientId.Value;
         log.StudyId.Value = study.StudyId.Value;
         log.UserId.Value = userId;
         log.Save();
     }
 }
コード例 #4
0
 protected override void Page_Load_Extended(object sender, EventArgs e)
 {
     if (Request[ParameterNames.Request.StudyId] == null)
     {
         PagesFactory.Transfer(PagesFactory.Pages.ErrorPage);
     }
     else
     {
         study = new StudyObject();
         study.StudyId.Value = Request[ParameterNames.Request.StudyId];
         study.Load();
         hlAddAttachment1.Visible = CanUpdate();
         hlAddAttachment2.Visible = CanUpdate();
     }
     if (IsPostBack == false)
     {
         hlAddAttachment1.NavigateUrl = GetAddURL();
         hlAddAttachment2.NavigateUrl = GetAddURL();
     }
 }
コード例 #5
0
 protected override void Page_Load_Extended(object sender, EventArgs e)
 {
     if (Request[ParameterNames.Request.StudyId] == null)
     {
         PagesFactory.Transfer(PagesFactory.Pages.ErrorPage);
     }
     else
     {
         StudyObject study = new StudyObject();
         study.StudyId.Value = Request[ParameterNames.Request.StudyId];
         study.Load();
         if (study == null || study.IsLoaded == false || (int)study.StudyStatusId.Value == Constants.StudyStatusTypes.Verified)
         {
             Response.Redirect("~/WebScan/AttachmentsList.aspx?" + ParameterNames.Request.StudyId + "=" + Request[ParameterNames.Request.StudyId]);
         }
     }
     if (IsPostBack == false)
     {
         hlAddAttachment1.NavigateUrl = GetListURL();
         hlAddAttachment2.NavigateUrl = GetListURL();
     }
 }
コード例 #6
0
    protected void UpdateStudyStatus(int statusId)
    {
        StudyObject study = new StudyObject();
        study.StudyId.Value = int.Parse(lblStudyId.Value);
        study.Load(Constants.Database.NullUserId);
        if (study.IsLoaded == true)
        {
            study.StudyStatusId.Value = statusId;
            study.Save(loggedInUserId);

            LogObject log = new LogObject();
            log.UserId.Value = loggedInUserId;
            log.StudyId.Value = study.StudyId.Value;
            log.PatientId.Value = study.PatientId.Value;
            log.ActionTime.Value = DateTime.Now;

            if (statusId == Constants.StudyStatusTypes.PendingVerification)
                log.Action.Value = Constants.LogActions.MarkedStudyForVerification;
            else if (statusId == Constants.StudyStatusTypes.Verified)
                log.Action.Value = Constants.LogActions.VerifiedStudy;
            log.Save();
        }
    }
コード例 #7
0
    protected void ShowButtons()
    {
        StudyObject study = new StudyObject();
        study.GetPrimaryKey().Value = int.Parse(lblStudyId.Value);
        study.Load(loggedInUserId);
        int studyStatusId = (int)study.StudyStatusId.Value;
        btnApprove.Visible = false;
        btnMarkForApproval.Visible = false;
        tbTrancription.Enabled = false;
        rfvTbTranscription.Enabled = false;
        if(studyStatusId == Constants.StudyStatusTypes.Verified)
            return;

        if (loggedInUserRoleId == Constants.Roles.Radiologist)
        {
            //(study.IsManual.Value == null || study.IsManual.Value.ToString().Length == 0 || study.IsManual.Value.Equals("N")) &&
            if ( studyStatusId == Constants.StudyStatusTypes.PendingVerification)
            {
                btnApprove.Visible = true;
                tbTrancription.Enabled = true;
                rfvTbTranscription.Enabled = true;
            }
            else
            {
                tbTrancription.Enabled = false;
                rfvTbTranscription.Enabled = false;
            }
        }
        else if (loggedInUserRoleId == Constants.Roles.Transcriptionist)
        {
            if (studyStatusId != Constants.StudyStatusTypes.New)
            {
                btnMarkForApproval.Visible = true;
                tbTrancription.Enabled = true;
                rfvTbTranscription.Enabled = true;
            }
        }
        else if (loggedInUserRoleId == Constants.Roles.ChiefTechnologist)
        {
            if (study.IsManual.Value.Equals("Y") && studyStatusId == Constants.StudyStatusTypes.PendingVerification)
            {
                btnApprove.Visible = true;
                tbTrancription.Enabled = true;
                rfvTbTranscription.Enabled = true;
            }
        }
    }
コード例 #8
0
    protected override void Page_Load_Extended(object sender, EventArgs e)
    {
        if (IsPostBack == false)
        {
            lblStudyId.Value = Request[ParameterNames.Request.StudyId];
            if (IsFindingInRequest)
                lblFindingId.Value = Request[ParameterNames.Request.FindingId];
            ShowButtons();

            StudyObject study = new StudyObject();
            study.StudyId.Value = int.Parse(Request[ParameterNames.Request.StudyId]);
            study.Load(loggedInUserId);
            lblExamDate.Text = study.StudyDate.Value.ToString();
            PatientObject patient = new PatientObject();
            patient.PatientId.Value = study.PatientId.Value;
            patient.Load(loggedInUserId);
            lblPatientId.Text = (string)patient.ExternalPatientId.Value;
            lblPatientName.Text = (string)patient.Name.Value;
            StudyStatusTypeObject studyStatusType = new StudyStatusTypeObject();
            studyStatusType.StudyStatusTypeId.Value = study.StudyStatusId.Value;
            studyStatusType.Load(loggedInUserId);
            lblStatus.Text = (string)studyStatusType.Status.Value;
            ProcedureObject procedure = new ProcedureObject();
            procedure.ProcedureId.Value = study.ProcedureId.Value;
            procedure.Load(loggedInUserId);
            if (procedure.IsLoaded)
            {
                lblProcedure.Text = (string)procedure.Name.Value;
            }
            ModalityObject modality = new ModalityObject();
            modality.ModalityId.Value = procedure.ModalityId.Value;
            modality.Load(loggedInUserId);
            lblModality.Text = (string)modality.Name.Value;
            if (study.ReferringPhysicianId.Value != null)
            {
                UserObject referringPhysician = new UserObject();
                referringPhysician.UserId.Value = study.ReferringPhysicianId.Value;
                referringPhysician.Load(loggedInUserId);
                lblPhysician.Text = (string)referringPhysician.Name.Value;
            }
            FindingObject finding = new FindingObject();
            if (IsFindingInRequest)
            {
                finding.GetPrimaryKey().Value = int.Parse(Request[ParameterNames.Request.FindingId]);
                finding.Load(loggedInUserId);
            }
            else if (study.LatestFindingId.Value != null)
            {
                finding.FindingId.Value = study.LatestFindingId.Value;
                finding.Load(loggedInUserId);
            }
            if (finding.IsLoaded)
            {
                tbTrancription.Text = (string)finding.TextualTranscript.Value;
                if (finding.AudioUserId.Value != null)
                {
                    UserObject radiologist = new UserObject();
                    radiologist.UserId.Value = finding.AudioUserId.Value;
                    radiologist.Load(loggedInUserId);
                    lblRadiologist.Text = (string)radiologist.Name.Value;
                }
            }
            int studyStatusId = (int)study.StudyStatusId.Value;

            LogObject log = new LogObject();
            log.UserId.Value = loggedInUserId;
            log.StudyId.Value = study.StudyId.Value;
            log.PatientId.Value = study.PatientId.Value;
            log.Action.Value = Constants.LogActions.ViewedStudy;
            log.ActionTime.Value = DateTime.Now;
            log.Save();
        }
    }
コード例 #9
0
    protected override void Page_Load_Extended(object sender, EventArgs e)
    {
        startPage = int.Parse(intStartPage.Value);
        endPage = startPage + WebConstants.Pages -1;
        if (IsPostBack == false)
        {
            FillDDL();
            if (loggedInUserRoleId == Constants.Roles.Radiologist)
            {
                lblClient.Visible = true;
                ddlClient.Visible = true;
                //ddlClient.DataSource
                RISDatabaseAccessLayer db = new RISDatabaseAccessLayer();
                string query = "select ClientId,Name from tClients";
                SqlConnection con = (SqlConnection)db.GetConnection();
                SqlCommand cmd = new SqlCommand(query, con);
                SqlDataAdapter da = new SqlDataAdapter();
                DataTable dt = new DataTable();
                da.SelectCommand = cmd;
                da.Fill(dt);

                //Populating Drop down list of templates
                if (dt.Rows.Count > 0)
                {
                    ddlClient.DataSource = dt;
                    ddlClient.DataTextField = "Name";
                    ddlClient.DataValueField = "ClientId";
                    ddlClient.DataBind();
                }
            }
        }
        /*
        if (hfCarryStatus.Value.ToString() != "x")
        {
            string labels = hfCarryStatus.Value.ToString();
            string[] labelsArray = labels.Split(',');
            foreach (string label in labelsArray)
            {
                    cblStatus.Items.FindByText(label).Selected = true;
            }
        }
        else
        {
            cblStatus.Items.FindByText("[All]").Selected = true;
            statusText.Text = "[All]";

        }
        if (hfCarryModality.Value.ToString() != "x")
        {
            string labels = hfCarryModality.Value.ToString();
            string[] labelsArray = labels.Split(',');
            foreach (string label in labelsArray)
            {
                    cblModality.Items.FindByText(label).Selected = true;
            }
        }
        else
        {
            cblModality.Items.FindByText("[All]").Selected = true;
            modalityText.Text = "[All]";

        }
         */
        if (Request["hfAction"] != null)
        {
            if (Request["hfAction"] == "release")
            {
                if (Request["releaseToRad"] != null)
                {
                    string[] studyIds = Request["releaseToRad"].Split(',');
                    foreach (string studyId in studyIds)
                    {
                        StudyObject study = new StudyObject();
                        study.StudyId.Value = studyId;
                        study.Load(loggedInUserId);
                        if (study.IsLoaded)
                        {
                            if (study.HospitalId.Value != null && study.ReferringPhysicianId.Value != null)
                            {
                                study.StudyStatusId.Value = Constants.StudyStatusTypes.New;
                                study.Save(loggedInUserId);
                            }
                            else
                            {
                                SetErrorMessage("One or more exams could not be released to Radiologists as they have missing data");
                            }
                        }
                    }
                }
            }
        }
        ExecuteProcedure();
        ClearData();
        StringBuilder url = new StringBuilder();
        url.Append("http://").Append(Request.Url.Authority);
        if(Request.ApplicationPath.Length > 0)
            url.Append(Request.ApplicationPath).Append("/");
        url.Append("WebServices/");
        hfWebServicesHomeURL.Value = url.ToString();
        url.Append("FindingService.asmx");
        hfSURL.Value = url.ToString();
        hfLoggedInUserId.Value = loggedInUserId.ToString();
        hfLoggedInUserName.Value = loggedInUser.Name.Value.ToString();
        hfLoggedInUserRoleId.Value = loggedInUserRoleId.ToString();
    }
コード例 #10
0
 //not using this funciton. for the latest client hospital code will be passed on instead of ref phy
 private bool SetReferringPhysician(DICOMStudyObject dicomStudy,StudyObject risStudy)
 {
     //As our system is not being used to entrer work lists we can not pick up Referrring Physicians from our own worklist
     //therrefore the worklist code has been commented for now and we just create a user
     bool isSet = false;
     /*WorkListObject workList = new WorkListObject();
     workList.WorkListId.Value = dicomStudy.AccessionNumber.Value;
     workList.Load(GenericDataMigrator.AdminUserId);
     if (workList.IsLoaded)
     {
         risStudy.ReferringPhysicianId.Value = workList.RequestingPhysicianId.Value;
         isSet = true;
     }
     else*/
     if(dicomStudy.ReferringPhysician.Value != null)
     {
         UserObject user = new UserObject();
         user.Name.Value = dicomStudy.ReferringPhysician.Value;
         user.Load();
         if (!user.IsLoaded)
         {
             user = DatabaseUtility.CreateUser((string)dicomStudy.ReferringPhysician.Value);
             UserRoleObject userRole = new UserRoleObject();
             userRole.UserId.Value = user.GetPrimaryKey().Value;
             userRole.RoleId.Value = Constants.Roles.ReferringPhysician;
             userRole.Save();
         }
         risStudy.ReferringPhysicianId.Value = user.UserId.Value;
         //risStudy.ReferringPhysician.Value = dicomStudy.ReferringPhysician.Value;
         isSet = true;
     }
     return isSet;
 }
コード例 #11
0
        private void AssignHospital(DICOMStudyObject dicomStudy, StudyObject risStudy)
        {
            if (dicomStudy.ReferringPhysician.Value != null)
            {
                string referringPhysician = "";
                string hospitalCode = "";
                foreach (char ch in dicomStudy.ReferringPhysician.Value.ToString().Replace("^", " ").ToCharArray())
                {
                    if (Char.IsDigit(ch))
                    {
                        hospitalCode += ch;
                    }
                    else
                    {
                        referringPhysician += ch;
                    }
                }
                if (hospitalCode.Length > 0)
                {
                    HospitalObject hospital = new HospitalObject();
                    hospital.Code.Value = hospitalCode;
                    hospital.Load();
                    if (hospital.IsLoaded)
                    {
                        risStudy.HospitalId.Value = hospital.HospitalId.Value;
                        risStudy.ClientId.Value = hospital.ClientId.Value;
                    }
                    if (referringPhysician.Length > 0)
                    {
                        UserObject user = new UserObject();
                        user.Name.Value = referringPhysician;
                        user.Load();
                        if (user.IsLoaded)
                        {
                            risStudy.ReferringPhysicianId.Value = user.UserId.Value;
                        }
                    }

                }
            }
        }
コード例 #12
0
    public bool Load()
    {
        StudyObject study = new StudyObject();
        study.StudyId.Value = studyId;
        study.Load();
        if (study.IsLoaded)
        {
            if (study.ClientId.Value != null)
            {
                ClientObject client = new ClientObject();
                client.ClientId.Value = study.ClientId.Value;
                client.Load();
                if (client.IsLoaded)
                {
                    _clientName = client.Name.Value.ToString();
                    if (client.Address.Value != null)
                        _clientAddress = client.Address.Value.ToString() + ", ";
                    if (client.City.Value != null)
                        _clientAddress += client.City.Value.ToString() + ", ";
                    if (client.State.Value != null)
                        _clientAddress += client.State.Value.ToString() + " ";
                    if (client.Zip.Value != null)
                        _clientAddress += client.Zip.Value.ToString();
                }
            }
            ModalityObject modality = new ModalityObject();
            modality.ModalityId.Value = study.ModalityId.Value;
            modality.Load();
            if (modality.IsLoaded)
            {
                _modality = modality.Name.Value.ToString();
            }
            if (study.IsManual.Value != null && study.IsManual.Value.ToString().Equals("Y"))
            {
                _manualStatus = "This report was imported from another system.";
            }
            PatientObject patient = new PatientObject();
            patient.GetPrimaryKey().Value = study.PatientId.Value;
            patient.Load();
            if (patient.IsLoaded)
            {
                _patientId = (int)patient.PatientId.Value;
                _patientName = (string)patient.Name.Value;
                if (patient.DateOfBirth.Value != null)
                {
                    _dateOfBirth = ((DateTime)patient.DateOfBirth.Value).ToShortDateString();
                }
            }
            if (study.ReferringPhysicianId != null && study.ReferringPhysicianId.Value != null)
            {
                UserObject user = new UserObject();
                user.UserId.Value = study.ReferringPhysicianId.Value;
                user.Load();
                _referringPhysician = user.Name.Value.ToString();

            }
            else
            {
                _referringPhysician = "(N/A)";
            }
            _studyDate = ((DateTime)study.StudyDate.Value).ToShortDateString();

            FindingObject finding = new FindingObject();
            finding.FindingId.Value = (int)study.LatestFindingId.Value;
            finding.Load();
            if (finding.IsLoaded)
            {
                _transcription = GetTrascription((string)finding.TextualTranscript.Value);
                if (finding.AudioDate.Value != null)
                {
                    _reportDateTime = ((DateTime)finding.AudioDate.Value).ToString();
                    _reportDate = ((DateTime)finding.AudioDate.Value).ToShortDateString();
                }

                if (finding.AudioUserId.Value != null)
                {
                    UserObject radiologist = new UserObject();
                    radiologist.UserId.Value = finding.AudioUserId.Value;
                    radiologist.Load();
                    if (radiologist.IsLoaded)
                    {
                        string[] names = radiologist.Name.Value.ToString().Split(',');
                        if (names != null && names.Length == 2)
                        {
                            string space = " ";
                            if (isHTML) space = " " ;
                            _radiologist = names[1] + space + names[0] + "," + space + "M.D.";
                        }
                        else
                        {
                            _radiologist = radiologist.Name.Value.ToString();
                        }
                    }
                }
            }
            StudyStatusTypeObject studyStatus = new StudyStatusTypeObject();
            studyStatus.StudyStatusTypeId.Value = study.StudyStatusId.Value;
            studyStatus.Load();
            if (studyStatus.IsLoaded)
            {
                _status = (string)studyStatus.Status.Value;
            }

            HospitalObject hospital = new HospitalObject();
            hospital.HospitalId.Value = study.HospitalId.Value;
            hospital.Load();
            if (hospital.IsLoaded)
            {
                _hospitalName = hospital.Name.Value.ToString();
                if (hospital.Fax.Value != null)
                {
                    _fax = (string)hospital.Fax.Value;
                }
            }
            return true;
        }
        return false;
    }
コード例 #13
0
        protected override RISObject GetRISObject(DICOMObject dicomObject)
        {
            SeriesObject risSeries = new SeriesObject();
            DICOMSeriesObject dicomSeries = (DICOMSeriesObject)dicomObject;
            risSeries.SeriesInstance.Value = dicomSeries.SeriesInstance.Value;
            risSeries.SeriesNumber.Value = dicomSeries.SeriesNumber.Value;
            risSeries.SeriesDate.Value = DatabaseUtility.GetDateTime(dicomSeries.SeriesDate.Value, dicomSeries.SeriesTime.Value);
            risSeries.Description.Value = dicomSeries.Description.Value;
            risSeries.PatientPosition.Value = dicomSeries.PatientPosition.Value;
            risSeries.Contrast.Value = dicomSeries.ContrastBo.Value;
            risSeries.ProtocolName.Value = dicomSeries.ProtocolNa.Value;
            risSeries.FrameOfReference.Value = dicomSeries.FrameOfRef.Value;
            risSeries.BodyPartExamined.Value = dicomSeries.BodyPartEx.Value;

            ModalityObject risModality = new ModalityObject();
            risModality.Name.Value = dicomSeries.Modality.Value;
            risModality.Load();
            if (!risModality.IsLoaded)
            {
                risModality.Save();
            }
            ModalityDetailObject modalityDetail = new ModalityDetailObject();
            modalityDetail.ModalityId.Value = risModality.GetPrimaryKey().Value;
            modalityDetail.Manufacturer.Value = dicomSeries.Manufactur.Value;
            modalityDetail.ModelName.Value = dicomSeries.ModelName.Value;
            modalityDetail.Load();
            if (!modalityDetail.IsLoaded)
            {
                modalityDetail.Save();
            }

            risSeries.ModalityDetailId.Value = modalityDetail.GetPrimaryKey().Value;

            risStudy = new StudyObject();
            risStudy.StudyInstance.Value = dicomSeries.StudyInsta.Value;
            risStudy.Load();
            if (risStudy.IsLoaded)
            {
                risSeries.StudyId.Value = risStudy.StudyId.Value;
                if (dicomSeries.StationName.Value != null)
                {
                    StationObject station = new StationObject();
                    station.ModalityId.Value = risModality.GetPrimaryKey().Value;
                    station.StationName.Value = dicomSeries.StationName.Value;
                    station.Instituition.Value = dicomSeries.Instituition.Value;
                    station.Load();
                    if (!station.IsLoaded)
                    {
                        station.Save();
                    }
                    risStudy.StationId.Value = station.GetPrimaryKey().Value;
                    if (station.HospitalId.Value != null)
                    {
                        risStudy.HospitalId.Value = station.HospitalId.Value;
                    }
                    if (station.ClientId.Value != null)
                    {
                        risStudy.ClientId.Value = station.ClientId.Value;
                    }
                    risStudy.Save();
                }
            }
            else
            {
                risSeries = null;
            }
            return risSeries;
        }
コード例 #14
0
    private object SaveFinding(bool removeAudioData)
    {
        FindingObject finding = new FindingObject();
        int studyId = int.Parse(lblStudyId.Value);
        if (lblFindingId.Value != null && lblFindingId.Value.Length > 0)
        {
            finding.GetPrimaryKey().Value = int.Parse(lblFindingId.Value);
            finding.Load(loggedInUserId);
            if (finding.IsLoaded)
            {
                if (removeAudioData)
                {
                    //byte[] temp = new byte[1];
                    finding.AudioData.Value = null;
                }
                else if (tbTrancription.Text.Equals(finding.TextualTranscript.Value)) // no need to update in case the text is same and not to remove audio data
                    return 0;
            }
        }

        finding.StudyId.Value = studyId;
        finding.TextualTranscript.Value = tbTrancription.Text;
        if (loggedInUserRoleId == Constants.Roles.Transcriptionist)
        {
            finding.TranscriptUserId.Value = loggedInUserId;
        }
        finding.TranscriptionDate.Value = DateTime.Now;
        finding.Save(loggedInUserId);

        StudyObject study = new StudyObject();
        study.StudyId.Value = studyId;
        study.Load(loggedInUserId);
        if (study.IsLoaded == true && study.LatestFindingId.Value == null)
        {
            study.LatestFindingId.Value = finding.FindingId.Value;
            study.Save(loggedInUserId);
        }
        return finding.FindingId.Value;
    }
コード例 #15
0
        protected override RISObject GetRISObject(DICOMObject dicomObject)
        {
            StudyObject risStudy = new StudyObject();
            DICOMStudyObject dicomStudy = (DICOMStudyObject)dicomObject;
            risStudy.StudyStatusId.Value = Constants.StudyStatusTypes.PreRelease;
            risStudy.StudyInstance.Value = dicomStudy.StudyInstance.Value;
            risStudy.AccessionNumber.Value = dicomStudy.AccessionNumber.Value;
            if (((string)dicomStudy.StudyInstance.Value).Equals("1.2.840.113619.2.115.6319156.1266579799.0.2"))
            {
                int debug = 0;
            }
            risStudy.StudyDate.Value = DatabaseUtility.GetDateTime(dicomStudy.StudyDate.Value,dicomStudy.StudyTime.Value);

            //risStudy.Description.Value = dicomStudy.StudyDescription.Value;
            //SetReferringPhysician(dicomStudy, risStudy);
            AssignHospital(dicomStudy, risStudy);

            risStudy.PatientWeight.Value = dicomStudy.PatientsWeight.Value;

            ModalityObject modality = new ModalityObject();
            modality.Name.Value = dicomStudy.StudyModal.Value;
            modality.Load();
            if (!modality.IsLoaded)
            {
                modality.Save();
            }
            risStudy.ModalityId.Value = modality.ModalityId.Value;

            /*if (dicomStudy.StationName.Value != null)
            {
                StationObject station = new StationObject();
                station.ModalityId.Value = modality.GetPrimaryKey().Value;
                station.StationName.Value = dicomStudy.StationName.Value;
                station.Instituition.Value = dicomStudy.Instituition.Value;
                station.Load();
                if (!station.IsLoaded)
                {
                    station.Save();
                }
                risStudy.StationId.Value = station.GetPrimaryKey().Value;
            }*/

            if (dicomStudy.StudyDescription.Value != null)
            {
                ProcedureObject procedure = new ProcedureObject();
                procedure.Name.Value = dicomStudy.StudyDescription.Value;
                procedure.ModalityId.Value = modality.ModalityId.Value;
                procedure.Load();
                if (procedure.IsLoaded == false)
                {
                    procedure.Save();
                }
                risStudy.ProcedureId.Value = procedure.ProcedureId.Value;
            }

            PatientObject patient = new PatientObject();
            patient.ExternalPatientId.Value = dicomStudy.PatientID.Value;
            patient.Load();
            if (patient.IsLoaded)
            {
                risStudy.PatientId.Value = patient.GetPrimaryKey().Value;
            }
            else
            {
                patient.Name.Value = dicomStudy.PatientName.Value;
                patient.DateOfBirth.Value = dicomStudy.PatientDateOfBirth.Value;
                patient.Gender.Value = dicomStudy.PatientSex.Value;
                patient.Save();
                risStudy.PatientId.Value = patient.GetPrimaryKey().Value;
            }
            return risStudy;
        }
コード例 #16
0
    protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
    {
        string status = hfStatus.Value;

        PatientObject patient = new PatientObject();
        patient.ExternalPatientId.Value = tbPatId.Text;
        patient.Load(loggedInUserId);
        patient.DateOfBirth.Value = dcDOB.Date;
        patient.Name.Value = RISUtility.GetFullName(tbPatFName.Text, tbPatLName.Text);
        patient.Gender.Value = rblGender.SelectedValue;
        patient.Save(loggedInUserId);
        StudyObject study = new StudyObject();
        study.PatientId.Value = patient.PatientId.Value;
        Random rand = new Random();
        study.StudyInstance.Value = rand.Next().ToString();
        DateTime dateTime = new DateTime(dcExamDate.Year, dcExamDate.Month, dcExamDate.Day);
        study.StudyDate.Value = dateTime;
        study.ReferringPhysicianId.Value = ddlRef.SelectedValue;
        study.IsManual.Value = "Y";
        study.StudyStatusId.Value = hfStatus.Value;
        study.ModalityId.Value = ddlModality.SelectedValue;
        study.ProcedureId.Value = ddlProcedures.SelectedValue;
        if (ddlClient.SelectedIndex > 0)
        {
            study.ClientId.Value = ddlClient.SelectedValue;
        }
        if (ddlHospital.SelectedIndex > 0)
        {
            study.HospitalId.Value = ddlHospital.SelectedValue;
        }
        study.Save(loggedInUserId);

        study.TechComments.Value = tbTechComments.Text;
        study.Save(loggedInUserId);
        //code for logging
        LogObject log = new LogObject();
        log.UserId.Value = loggedInUserId;
        log.Action.Value = Constants.LogActions.MarkedStudyForVerification;
        log.ActionTime.Value = DateTime.Now;
        log.Save();
        /////
        /// Get User Groups
        //DataTable userGroups = new DataTable();
        //userGroups = RISProcedureCaller.GetUserGroupsWithDefaults(loggedInUserId);
        //if (userGroups.Rows.Count > 0)
        //{
        //    for (int RowCounter = 0; RowCounter <= userGroups.Rows.Count - 1; RowCounter++)
        //    {
        //        StudyGroupObject studygroup = new StudyGroupObject();
        //        studygroup.GroupId.Value  = userGroups.Rows[RowCounter][0];
        //        studygroup.StudyId.Value  = study.StudyId.Value;
        //        studygroup.Save(loggedInUserId);
        //    }
        //}
        StringBuilder args = new StringBuilder();
        args.Append(ParameterNames.Request.ExternalPatientId);
        args.Append("=");
        args.Append(patient.ExternalPatientId.Value);
        args.Append("&");
        args.Append(ParameterNames.Request.PatientName);
        args.Append("=");
        args.Append(patient.Name.Value);
        args.Append("&");
        args.Append(ParameterNames.Request.ReturnPage);
        args.Append("=");
        args.Append(PagesFactory.Pages.AddStudyPage);
        PagesFactory.Transfer(PagesFactory.Pages.DataSavedPage,args.ToString());
    }
コード例 #17
0
    protected override void Page_Load_Extended(object sender, EventArgs e)
    {
        if (Request["studyId"] != null)
        {
            if (IsPostBack == false)
            {
                hlAddAttachment1.NavigateUrl = GetAddURL();
                //hlAddAttachment2.NavigateUrl = GetAddURL();
                if (loggedInUserRoleId == Constants.Roles.Admin)
                {
                    rfv1.Enabled = false;
                    rfv2.Enabled = false;
                    rfv3.Enabled = false;
                    RequiredFieldValidator1.Enabled = false;
                }
                study = new StudyObject();
                study.StudyId.Value = Request["studyId"];
                study.Load();
                if (study.IsLoaded)
                {
                    BindBodyPart((int)study.ModalityId.Value);
                    if (study.RejectionReason.Value != null)
                    {
                        tbRejectionReason.Text = study.RejectionReason.Value.ToString();
                    }
                    if (study.TechComments != null && study.TechComments.Value != null)
                    {
                        tbTechComments.Text = study.TechComments.Value.ToString();
                    }
                    if (study.BodyPartExamined != null && study.BodyPartExamined.Value != null)
                    {
                        ddlBodyParts.SelectedValue = (string)study.BodyPartExamined.Value;
                    }
                    if ((int)study.StudyStatusId.Value == Constants.StudyStatusTypes.New)
                    {
                        btnUnrelease.Visible = true;
                    }
                    if ((int)study.StudyStatusId.Value == Constants.StudyStatusTypes.PreRelease
                        || (int)study.StudyStatusId.Value == Constants.StudyStatusTypes.Qaed
                        || (int)study.StudyStatusId.Value == Constants.StudyStatusTypes.Rejected)
                    {
                        btnSave.Visible = true;
                        btnRelease.Visible = true;
                        if (loggedInUserRoleId == Constants.Roles.ClientAdmin)
                        {
                            btnHospital.Visible = true;
                        }
                        if (loggedInUserRoleId == Constants.Roles.Admin)
                        {
                            btnRelease.Visible = false;
                        }
                    }

                }
            }
        }
    }
コード例 #18
0
 private int UpdateStudy(int studyId, int findingId, int userId, string heading, string description, string impression, int status, bool removeAudioData)
 {
     StudyObject study = new StudyObject();
     study.StudyId.Value = studyId;
     study.Load();
     if (study.IsLoaded)
     {
         findingId = UpdateFinding(studyId, findingId, userId, heading, description, impression, false, removeAudioData);
         study.LatestFindingId.Value = findingId;
         study.StudyStatusId.Value = status;
         study.Save(userId);
         return findingId;
     }
     return findingId;
 }
コード例 #19
0
 private void UpdateStudy(Nullable<int> studyStatusId)
 {
     StudyObject study = new StudyObject();
     study.StudyId.Value = Request["studyId"];
     study.Load();
     if (study.IsLoaded)
     {
         if (ddlClient.SelectedIndex > 0)
         {
             study.ClientId.Value = ddlClient.SelectedValue;
             if (ddlHospitals.SelectedIndex > 0)
             {
                 study.HospitalId.Value = ddlHospitals.SelectedValue;
                 if (ddlRefPhy.SelectedIndex > 0)
                 {
                     study.ReferringPhysicianId.Value = ddlRefPhy.SelectedValue;
                 }
                 else
                 {
                     study.ReferringPhysicianId.Value = null;
                 }
             }
             else
             {
                 study.HospitalId.Value = null;
             }
         }
         else
         {
             study.ClientId.Value = null;
             study.HospitalId.Value = null;
             study.ReferringPhysicianId.Value = null;
         }
         if (ddlBodyParts.SelectedIndex > 0)
         {
             study.BodyPartExamined.Value = ddlBodyParts.SelectedValue;
         }
         else
         {
             study.BodyPartExamined.Value = null;
         }
         study.TechComments.Value = tbTechComments.Text;
         if (studyStatusId != null)
         {
             study.StudyStatusId.Value = studyStatusId.Value;
         }
         study.Update(loggedInUserId);
         /*RISDatabaseAccessLayer databaseAccessLayer = new RISDatabaseAccessLayer();
         SqlConnection connection = (SqlConnection)databaseAccessLayer.GetConnection();
         connection.Open();
         SqlCommand command = new SqlCommand("sp_insert_study_group", connection);
         command.Parameters.AddWithValue("@studyId", Request["studyId"]);
         command.Parameters.AddWithValue("@hospitalId", ddlHospitals.SelectedValue);
         command.Parameters.AddWithValue("@adminUserId", loggedInUserId);
         command.CommandType = CommandType.StoredProcedure;
         command.ExecuteNonQuery();
         connection.Close();*/
     }
     ClientScript.RegisterStartupScript(this.GetType(), "Close", "parent.closeStudyEditWindow();parent.aspnetForm.submit();", true);
 }
コード例 #20
0
ファイル: FaxSender.cs プロジェクト: alibinjamil/datamedris
    public string SendFax(int studyId)
    {
        try
        {

            StudyObject study = new StudyObject();
            study.StudyId.Value = studyId;
            study.Load();
            if (study.IsLoaded && study.HospitalId.Value != null)
            {
                HospitalObject hospital = new HospitalObject();
                hospital.HospitalId.Value = study.HospitalId.Value;
                hospital.Load();
                if (hospital.IsLoaded && hospital.Fax.Value != null)
                {
                    string reportPath = ReportGenerator.Instance.Generate(studyId);
                    string name = (hospital.Name.Value != null)? (string)hospital.Name.Value:"";
                    if (SendFax(name, name, (string)hospital.Fax.Value, reportPath))
                    {
                        return (string)hospital.Fax.Value;
                    }
                }
            }
        }
        catch { }
        return null;
    }
コード例 #21
0
 private void AssignHospital(DICOMStudyObject dicomStudy, StudyObject risStudy)
 {
     if (dicomStudy.ReferringPhysician.Value != null)
     {
         hospital = new HospitalObject();
         hospital.Code.Value = dicomStudy.ReferringPhysician.Value;
         hospital.Load();
         if (hospital.IsLoaded == false)
         {
             hospital = null;
         }
     }
 }