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; } } } } }
//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; }
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; } } }