Example #1
0
    public string GetFindingData(int studyId,int findingId)
    {
        //FindingPageObject findingPage = new FindingPageObject();

        StringBuilder text = new StringBuilder();
        FindingObject finding = new FindingObject();
        finding.FindingId.Value = findingId;
        finding.Load();
        if (finding.IsLoaded)
        {
            text.Append(finding.TextualTranscript.Value);
        }
        return text.ToString();
    }
Example #2
0
 private int UpdateFinding(int studyId,int findingId, int userId, string heading,string description,string impression,bool isTran,bool removeAudioData)
 {
     FindingObject finding = new FindingObject();
     if (findingId > 0)
     {
         finding.FindingId.Value = findingId;
         finding.Load();
         if (finding.IsLoaded && removeAudioData)
         {
             //if(finding.TextualTranscript.Value.Equals(findingText) return
             finding.AudioData.Value = null;
         }
     }
     else
     {
         finding.StudyId.Value = studyId;
         //adding this code to put in radiologist is and name.
         finding.AudioDate.Value = DateTime.Now;
         finding.AudioUserId.Value = userId;
         UserObject user = new UserObject();
         user.UserId.Value = userId;
         user.Load(userId);
         if (user.IsLoaded)
         {
             finding.AudioUserName.Value = user.Name.Value;
         }
     }
     if (isTran)
     {
         finding.TranscriptUserId.Value = userId;
         finding.TranscriptionDate.Value = DateTime.Now;
     }
     finding.TextualTranscript.Value = "<data><heading>" + heading + "</heading><description>" + description + "</description><impression>"
         + impression + "</impression></data>";
     finding.Save(userId);
     //very bad programming, but needs to be done for now.
     return int.Parse(finding.FindingId.Value.ToString());
 }
Example #3
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;
    }
Example #4
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();
        }
    }
Example #5
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 = "&nbsp;" ;
                            _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;
    }
 private void LoadFindingForStudy()
 {
     FindingObject finding = new FindingObject();
     finding.FindingId.Value = Request["findingId"];
     finding.Load();
     if (finding.IsLoaded)
     {
         LoadFinding(finding.TextualTranscript.Value.ToString());
     }
     else
     {
         LoadFinding("");
     }
 }