public static List<TopicalApplicationModel> GetTopicalApplicationModel() { List<TopicalApplicationModel> topicalApplicationCollection = new List<TopicalApplicationModel>(); try { IConnection connection = new Connection(); string sqlConnection = connection.GetDataSourceValue("BH.Application.RouteConfirmation.config", "DataSource", "InitialCatalog", "UserID", "Password", "BH.Application.RouteConfirmation"); IDataHandler dataHandler = new DataHandler(); List<StoredProcedureParameter> storedProcedureParameters = new List<StoredProcedureParameter>(); storedProcedureParameters.Add(new StoredProcedureParameter("@DataItemCode", SqlDbType.VarChar, "GEN_BodySite_SUG")); storedProcedureParameters.Add(new StoredProcedureParameter("@FormName", SqlDbType.VarChar, "PRX_Topicals")); DataTable dataTable = dataHandler.GetStoredProcedureResults(sqlConnection, "BH_MLM_ObsValueListing_Sp", storedProcedureParameters); foreach (DataRow dataRow in dataTable.Rows) topicalApplicationCollection.Add(new TopicalApplicationModel(dataRow["Value"].ToString(), dataRow["Value"].ToString())); dataTable.Dispose(); } catch { throw; } return topicalApplicationCollection; }
public static RxWriterModel GetRxWriterModel(int prescriptionID) { RxWriterModel rxWriterModel = new RxWriterModel(); try { IDataHandler dataHandler = new DataHandler(); List<StoredProcedureParameter> parameters = new List<StoredProcedureParameter>(); parameters.Add(new StoredProcedureParameter("@PrescriptionID", SqlDbType.Int, prescriptionID)); DataTable dataTable = dataHandler.GetStoredProcedureResults(DataConnection.GetConnectionString(), "BH_OPlus_HomeMedSummaryRxWriterItems_Sp", parameters); foreach (DataRow dataRow in dataTable.Rows) { rxWriterModel.GenericName = dataRow["GenericName"].ToString(); rxWriterModel.RxNormCode = dataRow["RxNormCode"].ToString(); rxWriterModel.NDCCode = dataRow["NDCCode"].ToString(); } dataTable.Dispose(); } catch { throw; } return rxWriterModel; }
public static Int64 GetOrderGUID(int prescriptionID, Int64 orderReconcileGUID) { Int64 orderGUID = 0; try { IDataHandler dataHandler = new DataHandler(); List<StoredProcedureParameter> parameters = new List<StoredProcedureParameter>(); parameters.Add(new StoredProcedureParameter("@PrescriptionID", SqlDbType.Int, prescriptionID)); parameters.Add(new StoredProcedureParameter("@OrderReconcileGUID", SqlDbType.BigInt, orderReconcileGUID)); DataTable dataTable = dataHandler.GetStoredProcedureResults(DataConnection.GetConnectionString(), "BH_OPlus_HomeMedSummaryOrderGUID_Sp", parameters); foreach (DataRow dataRow in dataTable.Rows) orderGUID = Convert.ToInt64(dataRow["OrderGUID"]); dataTable.Dispose(); } catch { throw; } return orderGUID; }
public static PatientHeaderModel GetPatientHeaderModel(Int64 clientVisitGUID, Int64 clientGUID, Int64 chartGUID) { PatientHeaderModel patientHeaderModel = new PatientHeaderModel(); try { IDataHandler dataHandler = new DataHandler(); List<StoredProcedureParameter> parameters = new List<StoredProcedureParameter>(); parameters.Add(new StoredProcedureParameter("@ClientVisitGUID", SqlDbType.BigInt, clientVisitGUID)); parameters.Add(new StoredProcedureParameter("@ClientGUID", SqlDbType.BigInt, clientGUID)); parameters.Add(new StoredProcedureParameter("@ChartGUID", SqlDbType.BigInt, chartGUID)); DataTable dataTable = dataHandler.GetStoredProcedureResults(DataConnection.GetConnectionString(), "BH_OPlus_PatientHeaderInformation_Sp", parameters); foreach (DataRow dataRow in dataTable.Rows) { patientHeaderModel.PatientName = dataRow["ClientDisplayName"].ToString(); patientHeaderModel.CurrentLocation = dataRow["CurrentLocation"].ToString(); patientHeaderModel.HeightWeight = dataRow["Height"].ToString(); patientHeaderModel.AdmissionDateTime = dataRow["AdmitDtm"].ToString(); patientHeaderModel.ProviderName = dataRow["ProviderDisplayName"].ToString(); patientHeaderModel.MedicalRecordNumber = dataRow["MRN"].ToString(); patientHeaderModel.PatientAge = dataRow["Age"].ToString(); patientHeaderModel.Gender = dataRow["GenderCode"].ToString(); } dataTable.Dispose(); } catch { throw; } return patientHeaderModel; }
public static BindingList<PatientMedicationModel> GetPatientMedicationCollection(string type, Int64 clientVisitGUID, Int64 clientGUID, Int64 chartGUID) { BindingList<PatientMedicationModel> patientMedicationCollection = new BindingList<PatientMedicationModel>(); try { IDataHandler dataHandler = new DataHandler(); List<StoredProcedureParameter> parameters = new List<StoredProcedureParameter>(); parameters.Add(new StoredProcedureParameter("@PopulateType", SqlDbType.BigInt, type)); parameters.Add(new StoredProcedureParameter("@ClientVisitGUID", SqlDbType.BigInt, clientVisitGUID)); parameters.Add(new StoredProcedureParameter("@ClientGUID", SqlDbType.BigInt, clientGUID)); parameters.Add(new StoredProcedureParameter("@ChartGUID", SqlDbType.BigInt, chartGUID)); DataTable dataTable = dataHandler.GetStoredProcedureResults(DataConnection.GetConnectionString(), "BH_OPlus_HomeMedSummaryPopulate_Sp", parameters); foreach (DataRow dataRow in dataTable.Rows) { PatientMedicationModel model = new PatientMedicationModel() { IsNewRecord = Convert.ToBoolean(dataRow["IsNewRecord"]), HomeMedicationSummaryID = (dataRow["HomeMedSummaryID"] != DBNull.Value ? Convert.ToInt32(dataRow["HomeMedSummaryID"]) : 0), OrderReconcileGUID = Convert.ToInt64(dataRow["OrderReconcileGUID"]), OrderReconcileDetailGUID = Convert.ToInt64(dataRow["OrderReconcileDtlGUID"]), PrescriptionStatus = dataRow["PrescriptionStatus"].ToString(), PrescriptionID = Convert.ToInt32(dataRow["PrescriptionID"]), DrugName = dataRow["DrugName"].ToString(), Instructions = dataRow["Instructions"].ToString(), AlsoKnownAs = dataRow["AlsoKnownAs"].ToString(), Medication = dataRow["Medication"].ToString(), ReasonForTaking = dataRow["ReasonForTaking"].ToString(), DosesTakenToday = dataRow["DosesTakenToday"].ToString(), NextDose = dataRow["NextDose"].ToString(), Comments = dataRow["Comments"].ToString() }; patientMedicationCollection.Add(model); } dataTable.Dispose(); } catch { throw; } return patientMedicationCollection; }
public static void SetPatientMedicationCollection(BindingList<PatientMedicationModel> patientMedicationCollection, Int64 clientVisitGUID, Int64 clientGUID, Int64 chartGUID, Int64 userGUID) { try { IDataHandler dataHandler = new DataHandler(); List<StoredProcedureParameter> parameters = new List<StoredProcedureParameter>(); foreach (PatientMedicationModel patientMedicationModel in patientMedicationCollection) { parameters = new List<StoredProcedureParameter>(); parameters.Add(new StoredProcedureParameter("@SaveDtm", SqlDbType.DateTime, DateTime.Now)); parameters.Add(new StoredProcedureParameter("@HomeMedSummaryID", SqlDbType.Int, patientMedicationModel.HomeMedicationSummaryID)); parameters.Add(new StoredProcedureParameter("@UserGUID", SqlDbType.Decimal, userGUID)); parameters.Add(new StoredProcedureParameter("@ClientVisitGUID", SqlDbType.Decimal, clientVisitGUID)); parameters.Add(new StoredProcedureParameter("@ClientGUID", SqlDbType.Decimal, clientGUID)); parameters.Add(new StoredProcedureParameter("@ChartGUID", SqlDbType.Decimal, chartGUID)); parameters.Add(new StoredProcedureParameter("@OrderReconcileGUID", SqlDbType.Decimal, patientMedicationModel.OrderReconcileGUID)); parameters.Add(new StoredProcedureParameter("@OrderReconcileDtlGUID", SqlDbType.Decimal, patientMedicationModel.OrderReconcileDetailGUID)); parameters.Add(new StoredProcedureParameter("@PrescriptionStatus", SqlDbType.VarChar, patientMedicationModel.PrescriptionStatus)); parameters.Add(new StoredProcedureParameter("@PrescriptionID", SqlDbType.Int, patientMedicationModel.PrescriptionID)); parameters.Add(new StoredProcedureParameter("@DrugName", SqlDbType.VarChar, patientMedicationModel.DrugName)); parameters.Add(new StoredProcedureParameter("@Instructions", SqlDbType.VarChar, patientMedicationModel.Instructions)); parameters.Add(new StoredProcedureParameter("@AlsoKnownAs", SqlDbType.VarChar, patientMedicationModel.AlsoKnownAs)); parameters.Add(new StoredProcedureParameter("@Medication", SqlDbType.VarChar, patientMedicationModel.Medication)); parameters.Add(new StoredProcedureParameter("@ReasonForTaking", SqlDbType.VarChar, patientMedicationModel.ReasonForTaking)); parameters.Add(new StoredProcedureParameter("@DosesTakenToday", SqlDbType.VarChar, patientMedicationModel.DosesTakenToday)); parameters.Add(new StoredProcedureParameter("@NextDose", SqlDbType.VarChar, patientMedicationModel.NextDose)); parameters.Add(new StoredProcedureParameter("@Comments", SqlDbType.VarChar, patientMedicationModel.Comments)); DataTable dataTable = dataHandler.GetStoredProcedureResults(DataConnection.GetConnectionString(), "BH_OPlus_HomeMedSummarySave_Sp", parameters); dataTable.Dispose(); } parameters = new List<StoredProcedureParameter>(); parameters.Add(new StoredProcedureParameter("@SaveDtm", SqlDbType.DateTime, DateTime.Now)); parameters.Add(new StoredProcedureParameter("@UserGUID", SqlDbType.Decimal, userGUID)); parameters.Add(new StoredProcedureParameter("@ClientVisitGUID", SqlDbType.Decimal, clientVisitGUID)); parameters.Add(new StoredProcedureParameter("@ClientGUID", SqlDbType.Decimal, clientGUID)); parameters.Add(new StoredProcedureParameter("@ChartGUID", SqlDbType.Decimal, chartGUID)); DataTable dummyTable = dataHandler.GetStoredProcedureResults(DataConnection.GetConnectionString(), "BH_OPlus_HomeMedSummaryInactivate_Sp", parameters); dummyTable.Dispose(); } catch { throw; } }
private void ValidateHomeMedication() { try { IDataHandler dataHandler = new DataHandler(); List<StoredProcedureParameter> parameters = new List<StoredProcedureParameter>(); parameters.Add(new StoredProcedureParameter("@ClientVisitGUID", SqlDbType.BigInt, this._ClientVisitGUID)); parameters.Add(new StoredProcedureParameter("@ClientGUID", SqlDbType.BigInt, this._ClientGUID)); string omrStatus = string.Empty; DataTable dataTable = dataHandler.GetStoredProcedureResults(this._ConnectionString, "BH_OPlus_HomeMedicationStatus_Sp", parameters); foreach (DataRow dataRow in dataTable.Rows) omrStatus = dataRow["OMRStatus"].ToString(); if (omrStatus != "Complete") this.Show(); else { OrderReconciliationManager orderReconciliationManager = new OrderReconciliationManager() { ClientVisitPrimaryKey = Convert.ToInt64(this._ClientVisitGUID) }; orderReconciliationManager.ShowDialog(); this.Close(); } } catch (Exception ex) { HandleExceptions(ex); } }