protected void btnSave_Click(object sender, EventArgs e)
    {
        if (ValidData())
        {
            HospitalObject hospital = new HospitalObject();
            hospital.Name.Value = tbName.Text;
            hospital.Code.Value = tbCode.Text;
            hospital.Address.Value = tbAddress.Text;
            hospital.City.Value = tbCity.Text;
            hospital.ClientId.Value = ddlClients.SelectedValue;
            hospital.Phone.Value = tbPhone.Text;
            hospital.Fax.Value = tbFax.Text;
            hospital.State.Value = ddlStates.SelectedValue;
            hospital.Zip.Value = tbZip.Text;
            hospital.Save(loggedInUserId);

            UserHospitalObject userHospital = new UserHospitalObject();
            userHospital.HospitalId.Value = hospital.HospitalId.Value;
            userHospital.UserId.Value = loggedInUserId;
            userHospital.Save(loggedInUserId);
        }
    }
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     if (ValidData())
     {
         if (Request["hospitalId"] != null)
         {
             HospitalObject hospital = new HospitalObject();
             hospital.HospitalId.Value = Request["hospitalId"];
             if (hospital.IsLoaded)
             {
                 hospital.Name.Value = tbName.Text;
                 hospital.Code.Value = tbCode.Text;
                 hospital.Address.Value = tbAddress.Text;
                 hospital.City.Value = tbCity.Text;
                 hospital.ClientId.Value = ddlClients.SelectedValue;
                 hospital.Fax.Value = tbFax.Text;
                 hospital.Phone.Value = tbPhone.Text;
                 hospital.State.Value = ddlStates.SelectedValue;
                 hospital.Zip.Value = tbZip.Text;
                 hospital.Save(loggedInUserId);
             }
         }
     }
 }
Example #3
0
    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;
    }
        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;
                        }
                    }

                }
            }
        }
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 = " " ;
                            _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;
    }
 protected override void Page_Load_Extended(object sender, EventArgs e)
 {
     if (Request["hospitalId"] != null)
     {
         if (IsPostBack == false)
         {
             HospitalObject hospital = new HospitalObject();
             hospital.HospitalId.Value = Request["hospitalId"];
             hospital.Load(loggedInUserId);
             if (hospital.IsLoaded)
             {
                 if (hospital.Zip.Value != null )
                 {
                     tbZip.Text = hospital.Zip.Value.ToString();
                 }
                 if (hospital.Phone.Value != null)
                 {
                     tbPhone.Text = hospital.Phone.Value.ToString();
                 }
                 if (hospital.Address.Value != null)
                 {
                     tbAddress.Text = hospital.Address.Value.ToString();
                 }
                 if (hospital.City.Value != null)
                 {
                     tbCity.Text = hospital.City.Value.ToString();
                 }
                 if (hospital.ClientId.Value != null)
                 {
                     ddlClients.SelectedValue = hospital.ClientId.Value.ToString();
                 }
                 if (hospital.Code.Value != null)
                 {
                     tbCode.Text = hospital.Code.Value.ToString();
                 }
                 if (hospital.Fax.Value != null)
                 {
                     tbFax.Text = hospital.Fax.Value.ToString();
                 }
                 if (hospital.Name.Value != null)
                 {
                     tbName.Text = hospital.Name.Value.ToString();
                 }
                 if (hospital.State.Value != null)
                 {
                     ddlStates.SelectedValue = hospital.State.Value.ToString();
                 }
                 btnSave.Visible = false;
                 btnUpdate.Visible = true;
             }
         }
     }
 }
 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;
         }
     }
 }