public void InsertData(string currUser, PhysicianModel oClass) { strSql = strSql + "INSERT INTO " + TABLE_NAME + " (" + COLUMN_NAME_TITLE + ", " + COLUMN_LASTNAME + ", " + COLUMN_FIRSTNAME + ", " + COLUMN_SUFFIX + ", " + COLUMN_SPECIALTY + ", " + COLUMN_LICENSE_NO + ", " + COLUMN_ADDRESS + ", " + COLUMN_EMAIL + ", " + COLUMN_PHONE + ", " + COLUMN_HOSPITAL + ", " + COLUMN_RATE + ", " + "created_by, created_date, updated_by, updated_date) "; strSql = strSql + "values ('" + oClass.Title + "', '" + oClass.LastName + "', '" + oClass.FirstName + "', '" + oClass.Suffix + "', '" + oClass.Specialty.Replace("'", "") + "', '" + oClass.LicenseNo + "', '" + oClass.Address.Replace("'", "") + "', '" + oClass.Email.Replace("'", "") + "', '" + oClass.Phone + "', '" + oClass.HospitalID + "', '" + oClass.Rate + "', '" + currUser + "', " + "CurDate(), '" + currUser + "', " + "CurDate() " + ") "; SaveData(strSql); }
/// <summary> /// Takes an EF Core Entity and maps the model to it /// </summary> /// <param name="model"></param> /// <param name="entity"></param> /// <returns></returns> public static void MapFromModel(this Physician entity, PhysicianModel model) { // userAccountId primary key not mapped entity.FirstName = model.FirstName; entity.LastName = model.LastName; entity.PhoneNumber = model.PhoneNumber; entity.FaxNumber = model.FaxNumber; entity.NPI = model.NPI; entity.DEA = model.DEA; entity.CreatedOn = model.CreatedOn; entity.ModifiedOn = model.ModifiedOn; if (entity.Address == null) { entity.Address = new Address(); } entity.Address.MapFromModel(model.Address); if (entity.UserAccount == null) { entity.UserAccount = new UserAccount(); } entity.UserAccount.MapFromModel(model.UserAccount); }
private void LoadPhyscianData(int id) { PhysicianDAL physicianDAL = new PhysicianDAL(); PhysicianModel physicianClass = new PhysicianModel(); oDs = new DataSet(); physicianClass.ID = id; oDs = physicianDAL.SelectByID(physicianClass); //PhysicianID.Value = oDs.Tables[0].Rows[0][0].ToString(); LastName.Value = oDs.Tables[0].Rows[0]["LastName"].ToString(); FirstName.Value = oDs.Tables[0].Rows[0]["FirstName"].ToString(); // Specialty.Value = oDs.Tables[0].Rows[0][3].ToString(); // ddlHospitalName.SelectedValue = oDs.Tables[0].Rows[0][4].ToString(); txtAddress.Value = oDs.Tables[0].Rows[0]["address"].ToString(); txtEmail.Value = oDs.Tables[0].Rows[0]["email"].ToString(); txtContact.Value = oDs.Tables[0].Rows[0]["phone"].ToString(); if (oDs.Tables[0].Rows[0]["UserID"].ToString() != "") { var userid = oDs.Tables[0].Rows[0]["UserID"].ToString(); PopulateData(Convert.ToInt16(userid)); } }
public void Create_Physican() { var physModel = new PhysicianModel { FirstName = "Mantis", LastName = "Toaboggan", FaxNumber = "1234567890", PhoneNumber = "1234567890", DEA = "dea000513", NPI = "npi008481", UserAccount = new UserAccountModel { Type = Constants.Enums.AccountType.Physician, EmailAddress = "*****@*****.**", UserName = "******", Password = "******", ConfirmationPassword = "******", Active = true }, Address = new AddressModel { AddressLineOne = "234 ads", AddressLineTwo = "", City = "Denver", State = "co", ZipCode = "1123" } }; var phys = physBiz.Create(physModel); var accountId = phys.UserAccount?.UserAccountId ?? 0; Assert.IsTrue(accountId > 0); }
private void PopulateProfile(int id) { var oDAL = new PhysicianDAL(); var oClass = new PhysicianModel(); var oDs = new DataSet(); oClass.UserID = id; oDs = oDAL.SelectByUserID(oClass); var fullname = oDs.Tables[0].Rows[0][3].ToString() + " " + oDs.Tables[0].Rows[0][2].ToString() + ", " + oDs.Tables[0].Rows[0][4].ToString(); UserFullName.Text = fullname; UserFullNameMain.Text = fullname; UserFullNameSide.Text = fullname; UserSpecialty.Text = oDs.Tables[0].Rows[0][5].ToString(); PhysicianID.Value = oDs.Tables[0].Rows[0][0].ToString(); //PhysicianID.Value = oDs.Tables[0].Rows[0][0].ToString(); //LastName.Value = oDs.Tables[0].Rows[0][1].ToString(); //FirstName.Value = oDs.Tables[0].Rows[0][2].ToString(); //Specialty.Value = oDs.Tables[0].Rows[0][3].ToString(); //txtAddress.Value = oDs.Tables[0].Rows[0][5].ToString(); //txtEmail.Value = oDs.Tables[0].Rows[0][6].ToString(); //txtContact.Value = oDs.Tables[0].Rows[0][7].ToString(); }
public DataSet SelectByUserID(PhysicianModel oClass) { strSql = "SELECT * " + "FROM " + TABLE_NAME + " " + "WHERE " + COLUMN_USER_ID + " = '" + oClass.UserID + "' "; return(Select(strSql)); }
private void PopulatePhysicianFacility(int id) { oDAL = new PhysicianDAL(); oClass = new PhysicianModel(); oClass.ID = id; gvFacility.DataSource = oDAL.SelectPhysicianFacilityByID(oClass); gvFacility.DataBind(); }
public DataSet SelectPhysicianFacilityByID(PhysicianModel oClass) { strSql = "SELECT A.id, C.id as FacilityID, C.FacilityName " + "FROM " + TABLE_PHYSICIAN_FACILITY + " A Left Outer Join " + TABLE_NAME + " B ON A.PhysicianID = B.ID " + " INNER JOIN " + TABLE_FACILITY_NAME + " C ON C.ID = A.FacilityID " + "WHERE B." + COLUMN_ID + " = '" + oClass.ID + "' and A.IsDeleted = 0 "; return(Select(strSql)); }
public ReviewInvalidity() { PeriodeHospitalise = new PeriodModel(DateModel.CreateNeighboringDateModel(), DateModel.CreateNeighboringDateModel()); PeriodeHospitalise.DeleteRequired = false; DatePrevue_Chirurgie = DateModel.CreateNeighboringDateModel(); NewMedications = new List <MedicationModel> { new MedicationModel() }; NewMedications[0].Index = 0; ChangeMedications = new List <MedicationModel> { new MedicationModel() }; ChangeMedications[0].Index = 0; StopMedications = new List <MedicationModel> { new MedicationModel() }; StopMedications[0].Index = 0; List <SliderBracket> brackets = new List <SliderBracket>() { new SliderBracket() { BracketResourceManager = UIAccident.ResourceManager, BracketNameResource = nameof(UIAccident.IU39_3_1), MinValue = 0, MaxValue = 4 }, new SliderBracket() { BracketResourceManager = UIAccident.ResourceManager, BracketNameResource = nameof(UIAccident.IU39_3_2), MinValue = 5, MaxValue = 7 }, new SliderBracket() { BracketResourceManager = UIAccident.ResourceManager, BracketNameResource = nameof(UIAccident.IU39_3_3), MinValue = 8, MaxValue = 10 } }; IntensiteSymptomes = new SliderModel() { Name = nameof(IntensiteSymptomes), MaxValue = 10, MinValue = 0, StepValue = 1, Value = "0", BracketResourceManager = UIAccident.ResourceManager, BracketTitleResource = nameof(UIAccident.IU39_3), Brackets = brackets }; InfosNouveauMedecin = new PhysicianModel(true); InfosMedecinSpecialiste = new SpecialistPhysicianModel(); }
public PhysicianModel Create(PhysicianModel physicianModel) { var physician = new Physician(); physician.MapFromModel(physicianModel); _context.Physician.Add(physician); _context.SaveChanges(); return(physician.ToModel()); }
public void DeleteData(string user, PhysicianModel oClass) { strSql = "UPDATE " + TABLE_NAME + " SET " + " isDeleted = 1, " + " ReasonDelete = '" + oClass.ReasonDelete.Replace("'", "''") + "', " + " updated_by = '" + user + "', " + " updated_date = '" + DateTime.Now.ToString("yyyy-MM-d HH:MM:ss") + "' " + " WHERE " + COLUMN_ID + " = '" + oClass.ID + "' "; SaveData(strSql); }
/// <summary> /// The field values in the word doc need to be update in the property settings object of the word doc. The questions /// have 'keys' which we are using with MappingsEnum to know how update with the value from the IntakeForms. Then we /// explicitly ask the user to verify the fields are to be updated when opening the word doc. /// </summary> /// <param name="intakeForms"></param> /// <param name="doc"></param> private void UpdateValuesInWordDocsCustomProperties( WordprocessingDocument doc, IntakeFormModel intakeForm, PatientModel patient, PhysicianModel physician, ICollection <SignatureModel> signatures) { // Get all question's with a key, then gather the value as all answers comma delimited var intakeFromKeys = intakeForm.Questions .Where(r => !string.IsNullOrEmpty(r.Key)) .Select(y => new KeyValuePair <string, string>(y.Key.ToUpper(), y.Answers.Select(z => z.Text) .Aggregate((c, n) => $"{c},{n}"))).ToList(); intakeFromKeys.AddRange(GetPatientKeys(patient)); intakeFromKeys.AddRange(GetAllCodes(intakeForm)); intakeFromKeys.AddRange(GetPhysicanKeys(physician)); intakeFromKeys.AddRange(GetSignature(signatures.First())); // just use the first signature for now since IP/Creation should be identicalish intakeFromKeys.AddRange(GetDrNotes(intakeForm.PhysicianNotes ?? "")); //This will update all of the custom properties that are used in the word doc. //Again, the fields are update in the document settings, but the downloading user //will need to approve the update for any fields. //https://docs.microsoft.com/en-us/office/open-xml/how-to-set-a-custom-property-in-a-word-processing-document Properties properties = doc.CustomFilePropertiesPart.Properties; foreach (MappingEnums propertyEnum in Enum.GetValues(typeof(MappingEnums))) { var item = (CustomDocumentProperty)properties .FirstOrDefault(x => ((CustomDocumentProperty)x).Name.Value.Equals(propertyEnum.ToString())); if (item != null) { //If a key doesn't exist, you could see an empty value stuffed into the word doc var val = intakeFromKeys.FirstOrDefault(x => x.Key == propertyEnum.ToString().ToUpper()).Value ?? "N/A"; item.VTLPWSTR = new VTLPWSTR(val); } } properties.Save(); //The docx is using Custom Properties and above we are updating the custom property values, //however there is no way (that I have found) to programatically updated all of the fields //that are using the custom properties without requiring the downloader to DocumentSettingsPart settingsPart = doc.MainDocumentPart.GetPartsOfType <DocumentSettingsPart>().First(); var updateFields = new UpdateFieldsOnOpen { Val = new OnOffValue(true) }; settingsPart.Settings.PrependChild(updateFields); settingsPart.Settings.Save(); doc.Save(); }
public AboutBenefitModel() { RequestedAmount = new MoneyModel() { Min = 1, Max = 100000, MaxLength = 6, AcceptDecimals = false }; Diagnosis = ""; PhysicianInfo = new PhysicianModel(); }
public ActionResult <PhysicianModel> Post([FromBody] PhysicianModel physician) { try { physician.UserAccount.Type = AccountType.Physician; return(_business.Create(physician)); } catch (Exception ex) { _logging.Log(LogSeverity.Error, ex.ToString()); throw; } }
private double GetRate() { double result = 0; PhysicianDAL physician = new PhysicianDAL(); PhysicianModel physicianModel = new PhysicianModel(); DataSet physicianData = new DataSet(); physicianModel.ID = Convert.ToInt16(ddlPhysician.SelectedValue); physicianData = physician.SelectByID(physicianModel); result = Convert.ToDouble(physicianData.Tables[0].Rows[0]["Rate"]); return(result); }
public InsuredDisease() { MaladieSimilaire_Annee = new YearModel(); ListeMedecin = new List <PhysicianModel> { new PhysicianModel { DisplayFirstConsultationDate = true, IsListItem = true } }; PeriodeHospitalise = new PeriodModel(DateModel.CreateLastFiveYearsDateModel(), DateModel.CreateLastFiveYearsDateModel()); PeriodeHospitalise.DeleteRequired = false; DatePremierSymptomes = DateModel.CreatePastDateModel(); List <SliderBracket> brackets = new List <SliderBracket>() { new SliderBracket() { BracketResourceManager = UIAccident.ResourceManager, BracketNameResource = nameof(UIAccident.IU39_3_1), MinValue = 0, MaxValue = 4 }, new SliderBracket() { BracketResourceManager = UIAccident.ResourceManager, BracketNameResource = nameof(UIAccident.IU39_3_2), MinValue = 5, MaxValue = 7 }, new SliderBracket() { BracketResourceManager = UIAccident.ResourceManager, BracketNameResource = nameof(UIAccident.IU39_3_3), MinValue = 8, MaxValue = 10 } }; IntensiteSymptomes = new SliderModel() { Name = nameof(IntensiteSymptomes), MaxValue = 10, MinValue = 0, StepValue = 1, Value = "0", BracketResourceManager = UIAccident.ResourceManager, BracketTitleResource = nameof(UIAccident.IU39_3), Brackets = brackets }; InfosMedecinSpecialiste = new SpecialistPhysicianModel(true); InfosMedecinMaladieSimilaire = new PhysicianModel(); MedicalConsultations = new List <MedicalConsultationModel> { new MedicalConsultationModel(true) }; }
private List <KeyValuePair <string, string> > GetPhysicanKeys(PhysicianModel physician) { var kvps = new List <KeyValuePair <string, string> > { new KeyValuePair <string, string>(MappingEnums.PhyName.ToString().ToUpper(), $"Dr {physician?.FirstName} {physician?.LastName}"), new KeyValuePair <string, string>(MappingEnums.PhyNameNoDr.ToString().ToUpper(), $"{physician?.FirstName} {physician?.LastName}"), new KeyValuePair <string, string>(MappingEnums.PhyNpi.ToString().ToUpper(), physician?.NPI ?? "N/A"), new KeyValuePair <string, string>(MappingEnums.PhyDea.ToString().ToUpper(), physician?.DEA ?? "N/A"), new KeyValuePair <string, string>(MappingEnums.PhyAddress.ToString().ToUpper(), physician?.Address?.ToString() ?? "N/A"), new KeyValuePair <string, string>(MappingEnums.PhyPhone.ToString().ToUpper(), physician?.PhoneNumber ?? "N/A"), new KeyValuePair <string, string>(MappingEnums.PhyFax.ToString().ToUpper(), physician?.FaxNumber ?? "N/A") }; return(kvps); }
public PhysicianModel Update(PhysicianModel physicianModel) { Physician physician = _context.Physician .Include(p => p.UserAccount) .Include(p => p.Address) .FirstOrDefault(u => u.UserAccountId == physicianModel.UserAccount.UserAccountId); physician.MapFromModel(physicianModel); physician.UserAccount.ModifiedOn = DateTime.Now; physician.ModifiedOn = DateTime.Now; physician.Address.ModifiedOn = DateTime.Now; _context.SaveChanges(); return(physician.ToModel()); }
private void SaveData() { string sUserName = Session["User"].ToString(); oDAL = new PhysicianDAL(); oClass = new PhysicianModel(); oClass.LastName = LastName.Value; oClass.FirstName = FirstName.Value; oClass.Specialty = Specialty.Value; // oClass.HospitalID = Convert.ToInt32(ddlHospitalName.SelectedValue); oClass.Address = txtAddress.InnerText; oClass.Phone = txtContact.Value; oClass.Email = txtEmail.Value; oClass.ID = Convert.ToInt16(PhysicianID.Value); oDAL.UpdateData(sUserName, oClass); }
protected void Ok_ServerClick(object sender, EventArgs e) { string UserName = Session["User"].ToString(); int ID = Convert.ToInt32(HiddenFieldPatient.Value); oDAL = new PhysicianDAL(); oClass = new PhysicianModel(); oDs = new DataSet(); oClass.IsDeleted = true; oClass.ReasonDelete = itemname.InnerText; string lbl = lblSelectedItem.Text; oClass.ID = ID; oDAL.DeleteData(UserName, oClass); PopulateGrid(); }
public static PhysicianModel ToModel(this Physician entity) { var model = new PhysicianModel { FirstName = entity.FirstName, LastName = entity.LastName, PhoneNumber = entity.PhoneNumber, FaxNumber = entity.FaxNumber, NPI = entity.NPI, DEA = entity.DEA, CreatedOn = entity.CreatedOn, ModifiedOn = entity.ModifiedOn, UserAccount = entity.UserAccount?.ToModel(), Address = entity.Address.ToModel() }; return(model); }
private void PopulateData(int id) { oDAL = new PhysicianDAL(); oClass = new PhysicianModel(); oDs = new DataSet(); oClass.UserID = id; oDs = oDAL.SelectByUserID(oClass); PhysicianID.Value = oDs.Tables[0].Rows[0][0].ToString(); LastName.Value = oDs.Tables[0].Rows[0][1].ToString(); FirstName.Value = oDs.Tables[0].Rows[0][2].ToString(); Specialty.Value = oDs.Tables[0].Rows[0][3].ToString(); // ddlHospitalName.SelectedValue = oDs.Tables[0].Rows[0][4].ToString(); txtAddress.Value = oDs.Tables[0].Rows[0][5].ToString(); txtEmail.Value = oDs.Tables[0].Rows[0][6].ToString(); txtContact.Value = oDs.Tables[0].Rows[0][7].ToString(); }
private void SaveData() { string sUserName = Session["User"].ToString(); oDAL = new PhysicianDAL(); oClass = new PhysicianModel(); oClass.Title = "Dr"; oClass.LastName = LastName.Value; oClass.FirstName = FirstName.Value; oClass.Suffix = Suffix.Value; oClass.Specialty = Specialty.Value; oClass.LicenseNo = LicenseNo.Value; oClass.Address = txtAddress.InnerText; oClass.Phone = txtContact.Value; oClass.Email = txtEmail.Value; oClass.ID = Convert.ToInt16(PhysicianID.Value); oDAL.UpdateData(sUserName, oClass); }
public void UpdateData(string user, PhysicianModel oClass) { strSql = "UPDATE " + TABLE_NAME + " SET " + COLUMN_NAME_TITLE + " = '" + oClass.Title + "', " + COLUMN_LASTNAME + " = '" + oClass.LastName + "', " + COLUMN_FIRSTNAME + " = '" + oClass.FirstName + "', " + COLUMN_SUFFIX + " = '" + oClass.Suffix + "', " + COLUMN_SPECIALTY + " = '" + oClass.Specialty.Replace("'", "") + "', " + COLUMN_LICENSE_NO + " = '" + oClass.LicenseNo.Replace("'", "") + "', " + COLUMN_ADDRESS + " = '" + oClass.Address.Replace("'", "") + "', " + COLUMN_EMAIL + " = '" + oClass.Email.Replace("'", "") + "', " + COLUMN_PHONE + " = '" + oClass.Phone + "', " + COLUMN_HOSPITAL + " = '" + oClass.HospitalID + "', " + COLUMN_RATE + " = '" + oClass.Rate + "', " + " updated_by = '" + user + "', " + " updated_date = '" + DateTime.Now.ToString("yyyy-MM-d HH:MM:ss") + "' " + " WHERE " + COLUMN_ID + " = '" + oClass.ID + "' "; SaveData(strSql); }
/// <summary> /// Take all of the intake forms and replace the properties on the word doc, then append all of the /// intake forms /// </summary> /// <param name="intakeForms"></param> /// <returns></returns> public byte[] GenerateIntakeDocuments( IntakeFormModel intakeForm, PatientModel patient, PhysicianModel physician, ICollection <SignatureModel> signatures) { MemoryStream examNoteMemoryStream = LoadMemoryStream(); using (var doc = WordprocessingDocument.Open(examNoteMemoryStream, true)) { Body docBody = doc.MainDocumentPart.Document.Body; // create and add the character style with the style id, style name, and // aliases specified. var answerFormatStyleId = CreateIntakeFormAnswersCharStyle(doc); SetSignatures(doc, signatures); // Create title and add the subsequent question answers for the questionaire AppendTitleForIntakeForm(doc, docBody, intakeForm); var questionCount = 1; foreach (QuestionModel question in intakeForm.Questions) { questionCount = AppendQuestionAnswerPair(docBody, answerFormatStyleId, questionCount, question); } docBody.AppendChild(new Paragraph()); // Manual mapping bits UpdateValuesInWordDocsCustomProperties(doc, intakeForm, patient, physician, signatures); } var result = examNoteMemoryStream.ToArray(); examNoteMemoryStream.Flush(); examNoteMemoryStream.Close(); return(result); }
private void PopulateData(int id) { oDAL = new PhysicianDAL(); oClass = new PhysicianModel(); oDs = new DataSet(); oClass.ID = id; oDs = oDAL.SelectByID(oClass); PhysicianID.Value = oDs.Tables[0].Rows[0][0].ToString(); NameTitle.Value = oDs.Tables[0].Rows[0][1].ToString(); LastName.Value = oDs.Tables[0].Rows[0][2].ToString(); FirstName.Value = oDs.Tables[0].Rows[0][3].ToString(); SuffixName.Value = oDs.Tables[0].Rows[0][4].ToString(); PhysicianSpecialty.Value = oDs.Tables[0].Rows[0][5].ToString(); LicenseNo.Value = oDs.Tables[0].Rows[0][7].ToString(); // ddlHospitalName.SelectedValue = oDs.Tables[0].Rows[0][4].ToString(); txtAddress.Value = oDs.Tables[0].Rows[0][9].ToString(); txtEmail.Value = oDs.Tables[0].Rows[0][8].ToString(); txtContact.Value = oDs.Tables[0].Rows[0][10].ToString(); txtRate.Value = oDs.Tables[0].Rows[0][12].ToString(); }
public int Create(DocumentModel documentModel) { IntakeForm intakeForm = _context.IntakeForm .Include("Questions.Answers") .Include(i => i.ICD10Codes) .Include(i => i.Physician.Address) .Include(i => i.Signatures) .First(i => i.IntakeFormId == documentModel.IntakeFormId); Patient patient = _context.Patient .Include(p => p.Address) .Include(p => p.PrivateInsurance) .Include(p => p.Medicare) .First(p => p.PatientId == intakeForm.PatientId); IntakeFormModel intakeFormModel = intakeForm.ToModel(); PatientModel patientModel = patient.ToModel(); PhysicianModel physicianModel = intakeForm.Physician.ToModel(); ICollection <SignatureModel> signatureModels = intakeForm.Signatures.Select(s => s.ToModel()).ToList(); var documentContent = _exporter.GenerateIntakeDocuments( intakeFormModel, patientModel, physicianModel, signatureModels); var document = new Document { IntakeFormId = documentModel.IntakeFormId, Content = documentContent }; intakeForm.Document = document; _context.SaveChanges(); return(document.DocumentId); }
private void SaveData() { string sUserName = Session["User"].ToString(); oDAL = new PhysicianDAL(); oClass = new PhysicianModel(); oClass.Title = NameTitle.Value; oClass.LastName = LastName.Value; oClass.FirstName = FirstName.Value; oClass.Suffix = SuffixName.Value; oClass.Specialty = PhysicianSpecialty.Value; oClass.LicenseNo = LicenseNo.Value; // oClass.HospitalID = Convert.ToInt32(ddlHospitalName.SelectedValue); oClass.Address = txtAddress.InnerText; oClass.Phone = txtContact.Value; oClass.Email = txtEmail.Value; if (txtRate.Value == "") { txtRate.Value = "0"; } oClass.Rate = Convert.ToDouble(txtRate.Value); string id = PhysicianID.Value; if (id == "") { oDAL.InsertData(sUserName, oClass); //lblMsg.Text = "New Record has been saved"; } else { oClass.ID = Convert.ToInt16(id); oDAL.UpdateData(sUserName, oClass); // lblMsg.Text = "Record has been updated"; } }