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;
    }
    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();
        }
    }