/// <summary> /// Sets consent that was received from the user. /// NOTE THIS SHOULD ONLY BE CALLED if you received the consent status from the user. /// </summary> /// <param name="consentType">Custom consent type</param> /// <see cref="ConsentType"/> public static void CustomConsentSetConsent(ConsentType consentType) { if (Impl != null) { Impl.SetConsent(consentType); } }
/// <inheritdoc/> public string ToDelimitedString() { CultureInfo culture = CultureInfo.CurrentCulture; return(string.Format( culture, StringHelper.StringFormatSequence(0, 26, Configuration.FieldSeparator), Id, SetIdCon.HasValue ? SetIdCon.Value.ToString(culture) : null, ConsentType?.ToDelimitedString(), ConsentFormIdAndVersion, ConsentFormNumber?.ToDelimitedString(), ConsentText != null ? string.Join(Configuration.FieldRepeatSeparator, ConsentText) : null, SubjectSpecificConsentText != null ? string.Join(Configuration.FieldRepeatSeparator, SubjectSpecificConsentText) : null, ConsentBackgroundInformation != null ? string.Join(Configuration.FieldRepeatSeparator, ConsentBackgroundInformation) : null, SubjectSpecificConsentBackgroundText != null ? string.Join(Configuration.FieldRepeatSeparator, SubjectSpecificConsentBackgroundText) : null, ConsenterImposedLimitations != null ? string.Join(Configuration.FieldRepeatSeparator, ConsenterImposedLimitations) : null, ConsentMode?.ToDelimitedString(), ConsentStatus?.ToDelimitedString(), ConsentDiscussionDateTime.HasValue ? ConsentDiscussionDateTime.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null, ConsentDecisionDateTime.HasValue ? ConsentDecisionDateTime.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null, ConsentEffectiveDateTime.HasValue ? ConsentEffectiveDateTime.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null, ConsentEndDateTime.HasValue ? ConsentEndDateTime.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null, SubjectCompetenceIndicator, TranslatorAssistanceIndicator, LanguageTranslatedTo?.ToDelimitedString(), InformationalMaterialSuppliedIndicator, ConsentBypassReason?.ToDelimitedString(), ConsentDisclosureLevel, ConsentNonDisclosureReason?.ToDelimitedString(), NonSubjectConsenterReason?.ToDelimitedString(), ConsenterId != null ? string.Join(Configuration.FieldRepeatSeparator, ConsenterId.Select(x => x.ToDelimitedString())) : null, RelationshipToSubject != null ? string.Join(Configuration.FieldRepeatSeparator, RelationshipToSubject.Select(x => x.ToDelimitedString())) : null ).TrimEnd(Configuration.FieldSeparator.ToCharArray())); }
public EditorImpl() { _consent = StringToConsentType(PlayerPrefs.GetString(PLAYER_PREFS_CONSENT_MODE, "UNKNOWN")); _age = PlayerPrefs.GetInt(PLAYER_PREFS_AGE, -1); #if UNITY_ANDROID //string path = System.IO.Path.Combine("jar:file://" + Application.dataPath + "!", "assets"); //path = System.IO.Path.Combine(path, "ttp"); string path = System.IO.Path.Combine("ttp", "configurations"); path = System.IO.Path.Combine(path, "privacySettings.json"); Debug.Log("shmulik - " + path); string privacySettingsJson = TTPUtils.ReadStreamingAssetsFile(path); #else string path = Application.streamingAssetsPath + "/ttp/configurations/privacySettings.json"; string privacySettingsJson = System.IO.File.ReadAllText(path); #endif //string privacySettingsJson = System.IO.File.ReadAllText(path); if (privacySettingsJson != null) { PrivacySettingsData privacySettingsData = JsonUtilityWrapper.FromJson <PrivacySettingsData>(privacySettingsJson); if (privacySettingsData != null) { _audienceMode = StringToAudienceMode(privacySettingsData.audienceMode); if (privacySettingsData.usePSDKGDPRPopups && _consent == ConsentType.UNKNOWN && _audienceMode != AudienceMode.MIXED_UNKNOWN) { ShowConsent(); } } } }
public void SetConsent(ConsentType consentType) { if (ServiceJavaObject != null) { ServiceJavaObject.Call("setConsent", new object[] { consentType.ToString() }); } }
//#endif //Class methods private static ConsentType StringToConsentType(string consentTypeStr) { ConsentType result = ConsentType.UNKNOWN; if (consentTypeStr != null) { if (consentTypeStr.Equals("pa", System.StringComparison.InvariantCultureIgnoreCase)) { result = ConsentType.PA; } else if (consentTypeStr.Equals("npa", System.StringComparison.InvariantCultureIgnoreCase)) { result = ConsentType.NPA; } else if (consentTypeStr.Equals("ua", System.StringComparison.InvariantCultureIgnoreCase)) { result = ConsentType.UA; } else if (consentTypeStr.Equals("ne", System.StringComparison.InvariantCultureIgnoreCase)) { result = ConsentType.NE; } } return(result); }
public static void GeneratePdfAndUploadToSharePointSite(ConsentFormSvcClient formHandlerServiceClient, ConsentType consentType, string patientId, HttpRequest request, string location) { if (!IsDevelopmentMode) //formHandlerServiceClient.GenerateAndUploadPdFtoSharePoint("http://" + request.Url.Host + ":" + request.Url.Port + "/" + consentType + @"/ConsentPrint.aspx?PatientId=" + patientId + "&Location=" + location, patientId, consentType, location); formHandlerServiceClient.GenerateAndUploadPdFtoSharePoint("http://localhost" + request.Url.Port + @"/" + consentType + @"/ConsentPrint.aspx?PatientId=" + patientId + "&Location=" + location, patientId, consentType, location); }
public static string GetConsentHeader(ConsentType consentType) { switch (consentType) { case ConsentType.Surgical: return("CONSENT TO DIAGNOSTIC PROCEDURE OR OPERATION"); case ConsentType.Cardiovascular: return("CARDIOVASCULAR LABORATORY CONSENT"); case ConsentType.OutsideOR: return("CONSENT FOR PROCEDURES OUTSIDE OF THE OPERATING ROOM"); case ConsentType.Endoscopy: return("CONSENT FOR ENDOSCOPY"); case ConsentType.BloodConsentOrRefusal: return("CONSENT FOR TRANSFUSION OF BLOOD OR BLOOD PRODUCTS"); case ConsentType.PlasmanApheresis: return("CONSENT FOR THERAPEUTIC APHERESIS"); case ConsentType.PICC: return("AUTHORIZATION FOR PERIPHERALLY INSERTED CENTRAL CATHETER (PICC)"); default: return(string.Empty); } }
public void SetConsent(ConsentType consentType) { _consentMgrObject = GetUnityJavaObject(); if (_consentMgrObject != null) { _consentMgrObject.Call("setConsent", consentType.ToString()); } }
public bool ShouldShowPrivacyPolicyOption() { ConsentType currentConsent = GetConsent(); if (currentConsent == ConsentType.NPA || currentConsent == ConsentType.PA) { return(true); } return(false); }
public async Task ChangeConsentAsync(PermissionAction action, ConsentType consent) { var dbConsent = consent switch { ConsentType.All => CommandConsent.BdsmImageCommands, ConsentType.Bdsm => CommandConsent.BdsmImageCommands, _ => CommandConsent.None, }; await UpdateConsentAsync(c => action == PermissionAction.Grant?(c | dbConsent) : (c & ~dbConsent)); }
public ConsentType GetConsent() { string resultStr = psdkGetConsent(); ConsentType result = ConsentType.UNKNOWN; if (resultStr != null) { result = PsdkUtils.StringToConsentType(resultStr); } return(result); }
public static string GetNextFormUrl(ConsentType consentType, HttpSessionState sessionState) { if (consentType == ConsentType.Surgical) { if ((bool)sessionState["Cardiovascular"]) return "/Cardiovascular/ConsentDeclaration.aspx"; if ((bool)sessionState["OutsideORConsent"]) return "/OutsideOR/ConsentDeclaration.aspx"; if ((bool)sessionState["EndoscopyConsent"]) return "/Endoscopy/ConsentDeclaration.aspx"; if ((bool)sessionState["BloodConsentRefusal"]) return "/BloodConsentOrRefusal/ConsentDeclaration.aspx"; if ((bool)sessionState["PICCConsent"]) return "/PICC/ConsentDeclaration.aspx"; //return "/PICC/Consent.aspx"; } else if (consentType == ConsentType.Cardiovascular) { if ((bool)sessionState["OutsideORConsent"]) return "/OutsideOR/ConsentDeclaration.aspx"; if ((bool)sessionState["EndoscopyConsent"]) return "/Endoscopy/ConsentDeclaration.aspx"; if ((bool)sessionState["BloodConsentRefusal"]) return "/BloodConsentOrRefusal/ConsentDeclaration.aspx"; if ((bool)sessionState["PICCConsent"]) return "/PICC/ConsentDeclaration.aspx"; //return "/PICC/Consent.aspx"; } else if (consentType == ConsentType.OutsideOR) { if ((bool)sessionState["EndoscopyConsent"]) return "/Endoscopy/ConsentDeclaration.aspx"; if ((bool)sessionState["BloodConsentRefusal"]) return "/BloodConsentOrRefusal/ConsentDeclaration.aspx"; if ((bool)sessionState["PICCConsent"]) return "/PICC/ConsentDeclaration.aspx"; //return "/PICC/Consent.aspx"; } else if (consentType == ConsentType.Endoscopy) { if ((bool)sessionState["BloodConsentRefusal"]) return "/BloodConsentOrRefusal/ConsentDeclaration.aspx"; if ((bool)sessionState["PICCConsent"]) return "/PICC/ConsentDeclaration.aspx"; //return "/PICC/Consent.aspx"; } else if (consentType == ConsentType.BloodConsentOrRefusal) { if ((bool)sessionState["PICCConsent"]) return "/PICC/ConsentDeclaration.aspx"; //return "/PICC/Consent.aspx"; } return "/PatientConsent.aspx"; }
public ConsentType GetConsent() { _consentMgrObject = GetUnityJavaObject(); ConsentType result = ConsentType.UNKNOWN; string consentStr = null; if (_consentMgrObject != null) { consentStr = _consentMgrObject.Call <string>("getConsentStr"); } if (consentStr != null) { result = PsdkUtils.StringToConsentType(consentStr); } return(result); }
protected void Page_Load(object sender, EventArgs e) { try { string patientId; try { patientId = Request.QueryString["PatientID"]; } catch (Exception) { patientId = string.Empty; } string location; try { location = Request.QueryString["Location"]; } catch (Exception) { location = string.Empty; } if (!string.IsNullOrEmpty(patientId) && !string.IsNullOrEmpty(location)) { var formHandlerServiceClient = Utilities.GetConsentFormSvcClient(); consentType = ConsentType.Cardiovascular; var patientDetails = formHandlerServiceClient.GetPatientDetail(patientId, consentType.ToString(), location); if (patientDetails != null) { ImgSignature1.ImageUrl = "/GetImage.ashx?PatientId=" + patientId + "&Signature=" + SignatureType.DoctorSign1.ToString() + @"&ConsentType=" + consentType.ToString(); ImgSignature2.ImageUrl = "/GetImage.ashx?PatientId=" + patientId + "&Signature=" + SignatureType.DoctorSign2.ToString() + @"&ConsentType=" + consentType.ToString(); ImgSignature3.ImageUrl = "/GetImage.ashx?PatientId=" + patientId + "&Signature=" + SignatureType.DoctorSign3.ToString() + "&ConsentType=" + consentType.ToString(); ImgSignature4.ImageUrl = "/GetImage.ashx?PatientId=" + patientId + "&Signature=" + SignatureType.DoctorSign4.ToString() + "&ConsentType=" + consentType.ToString(); ImgSignature5.ImageUrl = "/GetImage.ashx?PatientId=" + patientId + "&Signature=" + SignatureType.DoctorSign5.ToString() + "&ConsentType=" + consentType.ToString(); } } } catch (Exception ex) { var client = Utilities.GetConsentFormSvcClient(); client.CreateLog(Utilities.GetUsername(Session), LogType.E, GetType().Name + "-" + new StackTrace().GetFrame(0).GetMethod().ToString(), ex.Message + Environment.NewLine + ex.StackTrace); } }
protected void Page_Load(object sender, EventArgs e) { try { string patientId; try { patientId = Request.QueryString["PatientID"]; } catch (Exception) { patientId = string.Empty; } string location; try { location = Request.QueryString["Location"]; } catch (Exception) { location = string.Empty; } if (!string.IsNullOrEmpty(patientId) && !string.IsNullOrEmpty(location)) { consentType = ConsentType.PICC; var formHandlerServiceClient = Utilities.GetConsentFormSvcClient(); var patientDetails = formHandlerServiceClient.GetPatientDetail(patientId, consentType.ToString(), location); if (patientDetails != null) { LblPatientName3.Text = patientDetails.name; LblPICCNurseDate.Text = DateTime.Now.ToString("MMM dd yyyy"); LblPICCNurseTime.Text = DateTime.Now.ToLongTimeString(); ImgPICCNurse.ImageUrl = "/GetImage.ashx?PatientId=" + patientId + "&Signature=" + SignatureType.PICCSignature + "&ConsentType=" + consentType.ToString(); } } } catch (Exception ex) { var client = Utilities.GetConsentFormSvcClient(); client.CreateLog(Utilities.GetUsername(Session), LogType.E, GetType().Name + "-" + new StackTrace().GetFrame(0).GetMethod().ToString(), ex.Message + Environment.NewLine + ex.StackTrace); } }
protected void Page_Load(object sender, EventArgs e) { try { string patientId; try { patientId = Request.QueryString["PatientID"]; } catch (Exception) { patientId = string.Empty; } string location; try { location = Request.QueryString["Location"]; } catch (Exception) { location = string.Empty; } if (!string.IsNullOrEmpty(patientId) && !string.IsNullOrEmpty(location)) { consentType = ConsentType.PICC; var formHandlerServiceClient = Utilities.GetConsentFormSvcClient(); var patientDetails = formHandlerServiceClient.GetPatientDetail(patientId, consentType.ToString(), location); if (patientDetails != null) { LblPatientName3.Text = patientDetails.name; LblPICCNurseDate.Text = DateTime.Now.ToString("MMM dd yyyy"); LblPICCNurseTime.Text = DateTime.Now.ToLongTimeString(); ImgPICCNurse.ImageUrl = "/GetImage.ashx?PatientId=" + patientId + "&Signature=" + SignatureType.PICCSignature + "&ConsentType=" + consentType.ToString(); } } } catch (Exception ex) { var client = Utilities.GetConsentFormSvcClient(); client.CreateLog(Utilities.GetUsername(Session), LogType.E, GetType().Name + "-" + new StackTrace().GetFrame(0).GetMethod().ToString(), ex.Message + Environment.NewLine + ex.StackTrace); } }
public static string GetConsentHeader(ConsentType consentType) { switch (consentType) { case ConsentType.Surgical: return "CONSENT TO DIAGNOSTIC PROCEDURE OR OPERATION"; case ConsentType.Cardiovascular: return "CARDIOVASCULAR LABORATORY CONSENT"; case ConsentType.OutsideOR: return "CONSENT FOR PROCEDURES OUTSIDE OF THE OPERATING ROOM"; case ConsentType.Endoscopy: return "CONSENT FOR ENDOSCOPY"; case ConsentType.BloodConsentOrRefusal: return "CONSENT FOR TRANSFUSION OF BLOOD OR BLOOD PRODUCTS"; case ConsentType.PlasmanApheresis: return "CONSENT FOR THERAPEUTIC APHERESIS"; case ConsentType.PICC: return "AUTHORIZATION FOR PERIPHERALLY INSERTED CENTRAL CATHETER (PICC)"; default: return string.Empty; } }
public void SetConsent(ConsentType consentType) { }
public Treatment GetTreatment(string patientId, ConsentType consentType) { // open connection to sql server Treatment treatment = new Treatment(); try { using (SqlConnection sqlConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["DBConnection"].ToString())) { sqlConnection.Open(); SqlCommand cmdConsentID = new SqlCommand("select ID from ConsentType where [Name]='" + consentType.ToString() + "'", sqlConnection); string consentID = "0"; using (var readId = cmdConsentID.ExecuteReader()) { if (readId.Read()) { consentID = readId["ID"].ToString(); } } // SqlDataAdapter daTreatment = new SqlDataAdapter("select PatentId,ConsentType,IsPatientunabletosign,Unabletosignreason,TrackingID,Signatures,DoctorandProcedure,TransaltedBy,Date from Treatment where PatentId=" + patientId + " and ConsentType=" + consentID + " and date=(select MAX(date) from Treatment where PatentId=" + patientId + " and ConsentType=" + consentID + ")", sqlConnection); SqlDataAdapter daTreatment = new SqlDataAdapter("select PatentId,ConsentType,IsPatientunabletosign,IsStatementOfConsentAccepted,IsAutologousUnits,IsDirectedUnits,Unabletosignreason,TrackingID,Signatures,DoctorandProcedure,TransaltedBy,Date from Treatment where PatentId=" + patientId + " and ConsentType=" + consentID + " and date=(select MAX(date) from Treatment where PatentId=" + patientId + " and ConsentType=" + consentID + ")", sqlConnection); DataSet dsTreatment = new DataSet(); daTreatment.Fill(dsTreatment); if (dsTreatment.Tables[0].Rows.Count > 0) { treatment._patientId = patientId; treatment._consentType = consentType; treatment._isPatientUnableSign = (dsTreatment.Tables[0].Rows[0]["IsPatientunabletosign"].ToString() == "1" ? true : false); treatment._unableToSignReason = dsTreatment.Tables[0].Rows[0]["Unabletosignreason"].ToString(); treatment._translatedBy = dsTreatment.Tables[0].Rows[0]["TransaltedBy"].ToString(); treatment._trackingInformation = GetTrackingInformation(sqlConnection, dsTreatment.Tables[0].Rows[0]["TrackingID"].ToString()); treatment._doctorAndPrcedures = GetDoctorsProceduresInformation(sqlConnection, dsTreatment.Tables[0].Rows[0]["DoctorandProcedure"].ToString()); treatment._signatureses = GetSignaturesInformation(sqlConnection, dsTreatment.Tables[0].Rows[0]["Signatures"].ToString()); } } return treatment; } catch (Exception ex) { throw new Exception(ex.Message); } }
public void SavePdFFolderPath(ConsentType consenttype, string folderPath) { System.Configuration.Configuration config = WebConfigurationManager.OpenWebConfiguration(HttpContext.Current.Request.ApplicationPath); var conStr = config.AppSettings.Settings["DBConnection"].Value; using (var sqlConnection = new SqlConnection(conStr)) { sqlConnection.Open(); using (var sqlDataAdapter = new SqlDataAdapter("select ConsentType.ID as ID from ConsentType where ConsentType.Name ='" + consenttype + "' ", sqlConnection)) { var dataset = new DataSet(); sqlDataAdapter.Fill(dataset); if (dataset.Tables.Count > 0) if (dataset.Tables[0].Rows.Count > 0) { DataRow record = dataset.Tables[0].Rows[0]; var id = record["ID"].ToString(); using (var sqlDataAdapter2 = new SqlDataAdapter("select count(*) from PDFExportPaths where ConsentID='" + id + "' ", sqlConnection)) { dataset = new DataSet(); sqlDataAdapter2.Fill(dataset); if (dataset.Tables.Count > 0) if (dataset.Tables[0].Rows.Count > 0) { int count = Convert.ToInt32(dataset.Tables[0].Rows[0][0]); if (count > 0) { string sql = "Update PDFExportPaths set ConsentID='" + id + "',Path='" + folderPath + "' where ConsentID='" + id + "'"; var command = new SqlCommand(sql, sqlConnection); command.ExecuteNonQuery(); } else { string query = "Insert into PDFExportPaths values('" + id + "','" + folderPath + "')"; var sqlcommand = new SqlCommand(query, sqlConnection); sqlcommand.ExecuteNonQuery(); sqlConnection.Close(); } } } } } } }
public DataTable GetProcedures(ConsentType consentType) { System.Configuration.Configuration config = WebConfigurationManager.OpenWebConfiguration(HttpContext.Current.Request.ApplicationPath); var conStr = config.AppSettings.Settings["DBConnection"].Value; using (var sqlConnection = new SqlConnection(conStr)) { sqlConnection.Open(); using (var sqlDataAdapter = new SqlDataAdapter("GetProcedures", sqlConnection)) { sqlDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure; sqlDataAdapter.SelectCommand.Parameters.Add("@consentType", SqlDbType.VarChar).Value = consentType.ToString(); var dataset = new DataSet(); sqlDataAdapter.Fill(dataset); return dataset.Tables[0]; } } }
public string GetPatientSignature(string patientId, ConsentType consentType, SignatureType signatureType) { System.Configuration.Configuration config = WebConfigurationManager.OpenWebConfiguration(HttpContext.Current.Request.ApplicationPath); var conStr = config.AppSettings.Settings["DBConnection"].Value; using (var sqlConnection = new SqlConnection(conStr)) { sqlConnection.Open(); var cmdSignature = new SqlCommand(@"GetPatientSignature", sqlConnection) { CommandType = CommandType.StoredProcedure }; cmdSignature.Parameters.Add("@patientID", SqlDbType.NVarChar).Value = patientId; cmdSignature.Parameters.Add("@signatureType", SqlDbType.VarChar).Value = signatureType.ToString(); cmdSignature.Parameters.Add("@consentType", SqlDbType.VarChar).Value = consentType.ToString(); using (var sqlDataAdapter = new SqlDataAdapter(cmdSignature)) { var sig = new DataSet(); sqlDataAdapter.Fill(sig); if (sig.Tables.Count > 0 && sig.Tables[0].Rows.Count > 0 && sig.Tables[0].Rows[0][0] != null) return sig.Tables[0].Rows[0][0].ToString(); } } return string.Empty; }
public string GetPdFFolderPath(ConsentType consenttype) { System.Configuration.Configuration config = WebConfigurationManager.OpenWebConfiguration(HttpContext.Current.Request.ApplicationPath); var conStr = config.AppSettings.Settings["DBConnection"].Value; using (var sqlConnection = new SqlConnection(conStr)) { sqlConnection.Open(); using (var sqlDataAdapter = new SqlDataAdapter("GetPdFFolderPath", sqlConnection)) { sqlDataAdapter.SelectCommand.Parameters.Add(new SqlParameter("@consentName", SqlDbType.VarChar)).Value = consenttype.ToString(); sqlDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure; var dataset = new DataSet(); sqlDataAdapter.Fill(dataset); if (dataset.Tables.Count > 0 && dataset.Tables[0].Rows.Count > 0) return dataset.Tables[0].Rows[0][0].ToString(); } } return string.Empty; }
public DataTable GetProcedures(ConsentType consentType) { using (SqlConnection sqlConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["DBConnection"].ToString())) { sqlConnection.Open(); // open adapter and command for select query //using (SqlDataAdapter sqlDataAdapter = new SqlDataAdapter("select Name,ConsentTypeID from CFProcedures order by Name asc", sqlConnection)) using (SqlDataAdapter sqlDataAdapter = new SqlDataAdapter("select CFProcedures.Name as CFName,CFProcedures.ID as ID,ConsentType.Name as CTName from CFProcedures,ConsentType where CFProcedures.ConsentTypeID=ConsentType.ID and ConsentType.Name='" + consentType.ToString() + "'", sqlConnection)) { DataSet dataset = new DataSet(); sqlDataAdapter.Fill(dataset); return dataset.Tables[0]; } } }
protected void BtnCompleted_Click(object sender, EventArgs e) { try { const ConsentType consentType = ConsentType.BloodConsentOrRefusal; //validation var lblError = DeclarationSignatures1.LblError; lblError.Text = string.Empty; DeclarationSignatures1.ValidateForm(); if (!string.IsNullOrEmpty(lblError.Text)) { return; } string patientId; try { patientId = Session["PatientID"].ToString(); } catch (Exception) { if (string.IsNullOrEmpty(HdnPatientId.Value)) { Response.Redirect("/PatientConsent.aspx"); return; } patientId = HdnPatientId.Value; Session["PatientID"] = patientId; } string location; try { location = Session["Location"].ToString(); } catch (Exception) { if (string.IsNullOrEmpty(HdnPatientId.Value)) { Response.Redirect("/PatientConsent.aspx"); return; } location = HdnLocation.Value; Session["Location"] = location; } string ip = Request.ServerVariables["REMOTE_ADDR"]; string device; if (Request.Browser.IsMobileDevice) { device = Request.Browser.Browser + " " + Request.Browser.Version; } else { device = Request.Browser.Browser + " " + Request.Browser.Version; } var signatureses = new List <Signatures>(); signatureses.AddRange(DeclarationSignatures1.GetSignatures()); string empID = string.Empty; if (Session["EmpID"] != null) { empID = Session["EmpID"].ToString(); } var treatment = new Treatment { _patientId = patientId, _consentType = consentType, _signatureses = signatureses.ToArray(), _isPatientUnableSign = DeclarationSignatures1.ChkPatientisUnableToSign.Checked, _unableToSignReason = DeclarationSignatures1.TxtPatientNotSignedBecause.Text, _translatedBy = DeclarationSignatures1.TxtTranslatedBy.Text, _trackingInformation = new TrackingInformation { _device = device, _iP = ip }, _empID = empID }; var consentFormSvcClient = Utilities.GetConsentFormSvcClient(); consentFormSvcClient.AddTreatment(treatment); Utilities.GeneratePdfAndUploadToSharePointSite(consentFormSvcClient, consentType, patientId, Request, location); try { Response.Redirect(Utilities.GetNextFormUrl(consentType, Session)); } catch (Exception) { Response.Redirect("/PatientConsent.aspx"); } } catch (Exception ex) { var client = Utilities.GetConsentFormSvcClient(); client.CreateLog(Utilities.GetUsername(Session), LogType.E, GetType().Name + "-" + new StackTrace().GetFrame(0).GetMethod().ToString(), ex.Message + Environment.NewLine + ex.StackTrace); } }
protected void Page_Load(object sender, EventArgs e) { try { string patientId; try { patientId = Request.QueryString["PatientID"]; } catch (Exception) { patientId = string.Empty; } string location; try { location = Request.QueryString["Location"]; } catch (Exception) { location = string.Empty; } if (!string.IsNullOrEmpty(patientId)) { consentType = ConsentType.BloodConsentOrRefusal; var formHandlerServiceClient = Utilities.GetConsentFormSvcClient(); var patientDetails = formHandlerServiceClient.GetPatientDetail(patientId, consentType.ToString(), location); var treatment = formHandlerServiceClient.GetTreatment(patientId, consentType); if (patientDetails != null) { var primaryDoctor = formHandlerServiceClient.GetDoctorDetail(Convert.ToInt32(patientDetails.PrimaryDoctorId)); if (primaryDoctor != null) { LblAuthoriseDoctors.Text = primaryDoctor.Fname + " " + primaryDoctor.Lname; } foreach (AssociatedDoctorDetails associatedDoctor in formHandlerServiceClient.GetAssociatedDoctors(Convert.ToInt32(patientDetails.PrimaryDoctorId))) { LblAuthoriseDoctors.Text += " , " + associatedDoctor.Lname + " " + associatedDoctor.Fname; } LblPatientName2.Text = patientDetails.name; LblPatientName3.Text = patientDetails.name; LblProcedureName.Text = patientDetails.ProcedureName; if (treatment._IsStatementOfConsentAccepted) { IsStatementOfConsent = true; ChkAutologousUnits.Checked = treatment._IsAutologousUnits; ChkDirectedUnits.Checked = treatment._IsDirectedUnits; } else IsStatementOfConsent = false; } } } catch (Exception ex) { var client = Utilities.GetConsentFormSvcClient(); client.CreateLog(Utilities.GetUsername(Session), LogType.E, GetType().Name + "-" + new StackTrace().GetFrame(0).GetMethod().ToString(), ex.Message + Environment.NewLine + ex.StackTrace); } }
public ConsentInformation(ConsentStatus consentStatus, ConsentType consentType, FormStatus formStatus) { ConsentStatus = consentStatus; ConsentType = consentType; FormStatus = formStatus; }
public void SetConsent(ConsentType consentType) { psdkSetConsent(consentType.ToString()); }
public static void GeneratePdfAndUploadToSharePointSite(ConsentFormSvcClient formHandlerServiceClient, ConsentType consentType, string patientId, HttpRequest request, string location) { if (!IsDevelopmentMode) { //formHandlerServiceClient.GenerateAndUploadPdFtoSharePoint("http://" + request.Url.Host + ":" + request.Url.Port + "/" + consentType + @"/ConsentPrint.aspx?PatientId=" + patientId + "&Location=" + location, patientId, consentType, location); formHandlerServiceClient.GenerateAndUploadPdFtoSharePoint("http://localhost" + request.Url.Port + @"/" + consentType + @"/ConsentPrint.aspx?PatientId=" + patientId + "&Location=" + location, patientId, consentType, location); } }
public static string GetNextFormUrl(ConsentType consentType, HttpSessionState sessionState) { if (consentType == ConsentType.Surgical) { if ((bool)sessionState["Cardiovascular"]) { return("/Cardiovascular/ConsentDeclaration.aspx"); } if ((bool)sessionState["OutsideORConsent"]) { return("/OutsideOR/ConsentDeclaration.aspx"); } if ((bool)sessionState["EndoscopyConsent"]) { return("/Endoscopy/ConsentDeclaration.aspx"); } if ((bool)sessionState["BloodConsentRefusal"]) { return("/BloodConsentOrRefusal/ConsentDeclaration.aspx"); } if ((bool)sessionState["PICCConsent"]) { return("/PICC/ConsentDeclaration.aspx"); //return "/PICC/Consent.aspx"; } } else if (consentType == ConsentType.Cardiovascular) { if ((bool)sessionState["OutsideORConsent"]) { return("/OutsideOR/ConsentDeclaration.aspx"); } if ((bool)sessionState["EndoscopyConsent"]) { return("/Endoscopy/ConsentDeclaration.aspx"); } if ((bool)sessionState["BloodConsentRefusal"]) { return("/BloodConsentOrRefusal/ConsentDeclaration.aspx"); } if ((bool)sessionState["PICCConsent"]) { return("/PICC/ConsentDeclaration.aspx"); //return "/PICC/Consent.aspx"; } } else if (consentType == ConsentType.OutsideOR) { if ((bool)sessionState["EndoscopyConsent"]) { return("/Endoscopy/ConsentDeclaration.aspx"); } if ((bool)sessionState["BloodConsentRefusal"]) { return("/BloodConsentOrRefusal/ConsentDeclaration.aspx"); } if ((bool)sessionState["PICCConsent"]) { return("/PICC/ConsentDeclaration.aspx"); //return "/PICC/Consent.aspx"; } } else if (consentType == ConsentType.Endoscopy) { if ((bool)sessionState["BloodConsentRefusal"]) { return("/BloodConsentOrRefusal/ConsentDeclaration.aspx"); } if ((bool)sessionState["PICCConsent"]) { return("/PICC/ConsentDeclaration.aspx"); //return "/PICC/Consent.aspx"; } } else if (consentType == ConsentType.BloodConsentOrRefusal) { if ((bool)sessionState["PICCConsent"]) { return("/PICC/ConsentDeclaration.aspx"); //return "/PICC/Consent.aspx"; } } return("/PatientConsent.aspx"); }
public DataTable GetPdFFolderPath(ConsentType consenttype) { using (SqlConnection sqlConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["DBConnection"].ToString())) { sqlConnection.Open(); using (SqlDataAdapter sqlDataAdapter = new SqlDataAdapter("select ConsentType.ID as ID from ConsentType where ConsentType.Name ='" + consenttype + "' ", sqlConnection)) { DataSet dataset = new DataSet(); sqlDataAdapter.Fill(dataset); if (dataset.Tables.Count > 0) if (dataset.Tables[0].Rows.Count > 0) { DataRow record = dataset.Tables[0].Rows[0]; var id = record["ID"].ToString(); using (SqlDataAdapter sqlDataAdapter2 = new SqlDataAdapter("select count(*) from PDFExportPaths where ConsentID='" + id + "' ", sqlConnection)) { dataset = new DataSet(); sqlDataAdapter2.Fill(dataset); if (dataset.Tables.Count > 0) if (dataset.Tables[0].Rows.Count > 0) { int count = Convert.ToInt32(dataset.Tables[0].Rows[0][0]); if (count > 0) { using (SqlDataAdapter sqlDataAdapter3 = new SqlDataAdapter("select PDFExportPaths.Path as Path from PDFExportPaths where PDFExportPaths.ConsentID ='" + id + "' ", sqlConnection)) { dataset = new DataSet(); sqlDataAdapter3.Fill(dataset); return dataset.Tables[0]; } } } } } } } return null; }
public Treatment GetTreatment(string patientId, ConsentType consentType) { // open connection to sql server var treatment = new Treatment(); try { System.Configuration.Configuration config = WebConfigurationManager.OpenWebConfiguration(HttpContext.Current.Request.ApplicationPath); var conStr = config.AppSettings.Settings["DBConnection"].Value; using (var sqlConnection = new SqlConnection(conStr)) { sqlConnection.Open(); var daTreatment = new SqlDataAdapter(@"GetTreatment", sqlConnection) { SelectCommand = { CommandType = CommandType.StoredProcedure } }; daTreatment.SelectCommand.Parameters.Add("@consentType", SqlDbType.VarChar).Value = consentType.ToString(); var dsTreatment = new DataSet(); daTreatment.Fill(dsTreatment); if (dsTreatment.Tables[0].Rows.Count > 0) { treatment._patientId = patientId; treatment._consentType = consentType; treatment._isPatientUnableSign = (dsTreatment.Tables[0].Rows[0]["IsPatientunabletosign"].ToString() == "True"); treatment._unableToSignReason = dsTreatment.Tables[0].Rows[0]["Unabletosignreason"].ToString(); treatment._translatedBy = dsTreatment.Tables[0].Rows[0]["TransaltedBy"].ToString(); treatment._trackingInformation = GetTrackingInformation(sqlConnection, dsTreatment.Tables[0].Rows[0]["TrackingID"].ToString()); treatment._doctorAndPrcedures = GetDoctorsProceduresInformation(sqlConnection, dsTreatment.Tables[0].Rows[0]["DoctorandProcedure"].ToString()); treatment._signatureses = GetSignaturesInformation(sqlConnection, dsTreatment.Tables[0].Rows[0]["Signatures"].ToString()); treatment._empID = dsTreatment.Tables[0].Rows[0]["EmpID"].ToString(); } } return treatment; } catch (Exception ex) { throw new Exception(ex.Message); } }
public void GenerateAndUploadPDFtoSharePoint(string RelativeUrl, string PatientId, ConsentType ConsentFormType) { DocumentConverterServiceClient client = null; try { string sourceFileName = null; byte[] sourceFile = null; client = OpenService("http://localhost:41734/Muhimbi.DocumentConverter.WebService/"); OpenOptions openOptions = new OpenOptions(); //** Specify optional authentication settings for the web page openOptions.UserName = ""; openOptions.Password = ""; // ** Specify the URL to convert openOptions.OriginalFileName = RelativeUrl; openOptions.FileExtension = "html"; //** Generate a temp file name that is later used to write the PDF to sourceFileName = Path.GetTempFileName(); File.Delete(sourceFileName); // ** Enable JavaScript on the page to convert. openOptions.AllowMacros = MacroSecurityOption.All; // ** Set the various conversion settings ConversionSettings conversionSettings = new ConversionSettings(); conversionSettings.Fidelity = ConversionFidelities.Full; conversionSettings.PDFProfile = PDFProfile.PDF_1_5; conversionSettings.Quality = ConversionQuality.OptimizeForOnScreen; // ** Carry out the actual conversion byte[] convertedFile = client.Convert(sourceFile, openOptions, conversionSettings); //try //{ SPSecurity.RunWithElevatedPrivileges(delegate() { using (var site = new SPSite(SiteUrl)) { using (var web = site.OpenWeb()) { web.AllowUnsafeUpdates = true; var list = web.Lists.TryGetList(DocumentLibary); if (list != null) { var libFolder = list.RootFolder; var patientDetails = GetPatientDetail(PatientId, ConsentFormType.ToString()); if (patientDetails != null) { string fileName = ConsentFormType + patientDetails.MRHash + patientDetails.name + DateTime.Now.ToString("MMddyyyyHHmmss") + ".pdf"; switch (ConsentFormType) { case ConsentType.Surgical: { fileName = "SUR_CONSENT_" + patientDetails.MRHash + DateTime.Now.ToString("MMddyyyyHHmmss") + ".pdf"; break; } case ConsentType.BloodConsentOrRefusal: { fileName = "BLOOD_FEFUSAL_CONSENT_" + patientDetails.MRHash + DateTime.Now.ToString("MMddyyyyHHmmss") + ".pdf"; break; } case ConsentType.Cardiovascular: { fileName = "CARDIAC_CATH_CONSENT_" + patientDetails.MRHash + DateTime.Now.ToString("MMddyyyyHHmmss") + ".pdf"; break; } case ConsentType.Endoscopy: { fileName = "ENDO_CONSENT_" + patientDetails.MRHash + DateTime.Now.ToString("MMddyyyyHHmmss") + ".pdf"; break; } case ConsentType.OutsideOR: { fileName = "OUTSDE_OR_" + patientDetails.MRHash + DateTime.Now.ToString("MMddyyyyHHmmss") + ".pdf"; break; } case ConsentType.PICC: { fileName = "PICC_CONSENT_" + patientDetails.MRHash + DateTime.Now.ToString("MMddyyyyHHmmss") + ".pdf"; break; } case ConsentType.PlasmanApheresis: { fileName = "PLASMA_APHERESIS_CONSENT_" + patientDetails.MRHash + DateTime.Now.ToString("MMddyyyyHHmmss") + ".pdf"; break; } } if (libFolder.RequiresCheckout) { try { SPFile fileOld = libFolder.Files[fileName]; fileOld.CheckOut(); } catch { } } var spFileProperty = new Hashtable(); spFileProperty.Add("MR#", patientDetails.MRHash); spFileProperty.Add("Patient#", PatientId); spFileProperty.Add("Patient Name", patientDetails.name); spFileProperty.Add("DOB#", Microsoft.SharePoint.Utilities.SPUtility.CreateISO8601DateTimeFromSystemDateTime(patientDetails.DOB)); spFileProperty.Add("Procedure Type", patientDetails.ProcedureName); spFileProperty.Add("Patient Information", patientDetails.name + " " + DateTime.Now.ToShortDateString()); SPFile spfile = libFolder.Files.Add(fileName, convertedFile, spFileProperty, true); list.Update(); if (libFolder.RequiresCheckout) { spfile.CheckIn("Upload Comment", SPCheckinType.MajorCheckIn); spfile.Publish("Publish Comment"); } } } web.AllowUnsafeUpdates = false; } } }); } finally { CloseService(client); } }
public void GenerateAndUploadPdFtoSharePoint(string relativeUrl, string patientId, ConsentType consentFormType, string location) { DocumentConverterServiceClient client = null; try { // creating the folder if it is not exits in the drive. var folderPath = GetPdFFolderPath(consentFormType); if (!string.IsNullOrEmpty(folderPath)) { byte[] sourceFile = null; client = OpenService("http://localhost:41734/Muhimbi.DocumentConverter.WebService/"); var openOptions = new OpenOptions { UserName = "", Password = "", OriginalFileName = relativeUrl, FileExtension = "html", AllowMacros = MacroSecurityOption.All }; // ** Set the various conversion settings var conversionSettings = new ConversionSettings { Fidelity = ConversionFidelities.Full, PDFProfile = PDFProfile.PDF_1_5, Quality = ConversionQuality.OptimizeForOnScreen }; // ** Carry out the actual conversion byte[] convertedFile = client.Convert(sourceFile, openOptions, conversionSettings); var patientDetails = GetPatientDetail(patientId, consentFormType.ToString(), location); string fileName = consentFormType + patientDetails.MRHash + patientDetails.name + DateTime.Now.ToString("MMddyyyyHHmmss") + ".pdf"; switch (consentFormType) { case ConsentType.Surgical: { fileName = "SUR_CONSENT_" + patientDetails.MRHash + DateTime.Now.ToString("MMddyyyyHHmmss") + ".pdf"; break; } case ConsentType.BloodConsentOrRefusal: { fileName = "BLOOD_FEFUSAL_CONSENT_" + patientDetails.MRHash + DateTime.Now.ToString("MMddyyyyHHmmss") + ".pdf"; break; } case ConsentType.Cardiovascular: { fileName = "CARDIAC_CATH_CONSENT_" + patientDetails.MRHash + DateTime.Now.ToString("MMddyyyyHHmmss") + ".pdf"; break; } case ConsentType.Endoscopy: { fileName = "ENDO_CONSENT_" + patientDetails.MRHash + DateTime.Now.ToString("MMddyyyyHHmmss") + ".pdf"; break; } case ConsentType.OutsideOR: { fileName = "OUTSDE_OR_" + patientDetails.MRHash + DateTime.Now.ToString("MMddyyyyHHmmss") + ".pdf"; break; } case ConsentType.PICC: { fileName = "PICC_CONSENT_" + patientDetails.MRHash + DateTime.Now.ToString("MMddyyyyHHmmss") + ".pdf"; break; } case ConsentType.PlasmanApheresis: { fileName = "PLASMA_APHERESIS_CONSENT_" + patientDetails.MRHash + DateTime.Now.ToString("MMddyyyyHHmmss") + ".pdf"; break; } } if (!new Uri(folderPath).IsUnc) { CreateLog("unKnown", LogType.E, "GenerateAndUploadPdFtoSharePoint", "Generating in local folder"); if (!Directory.Exists(folderPath)) Directory.CreateDirectory(folderPath); fileName = Path.Combine(folderPath, fileName); File.WriteAllBytes(fileName, convertedFile); } else { var credentials = GetPdFPathCredentials(); if (credentials != null) { using (var unc = new UNCAccessWithCredentials()) { unc.NetUseDelete(); if (unc.NetUseWithCredentials(folderPath, credentials.Username.Trim(), credentials.Domain.Trim(), credentials.Password.Trim())) { if (!Directory.Exists(folderPath)) Directory.CreateDirectory(folderPath); fileName = Path.Combine(folderPath, fileName); File.WriteAllBytes(fileName, convertedFile); } else { CreateLog("unKnown", LogType.E, "GenerateAndUploadPdFtoSharePoint", "Not able to connect the UNC path with the given credentials using [" + folderPath + "],[" + credentials.Domain.Trim() + "],[" + credentials.Username.Trim() + "],[" + credentials.Password.Trim() + "]"); } } } else { CreateLog("unKnown", LogType.E, "GenerateAndUploadPdFtoSharePoint", "The export credentials not found."); } } /* //try //{ SPSecurity.RunWithElevatedPrivileges(delegate() { using (var site = new SPSite(SiteUrl)) { using (var web = site.OpenWeb()) { web.AllowUnsafeUpdates = true; var list = web.Lists.TryGetList(DocumentLibary); if (list != null) { var libFolder = list.RootFolder; var patientDetails = GetPatientDetail(PatientId, ConsentFormType.ToString()); if (patientDetails != null) { string fileName = ConsentFormType + patientDetails.MRHash + patientDetails.name + DateTime.Now.ToString("MMddyyyyHHmmss") + ".pdf"; switch (ConsentFormType) { case ConsentType.Surgical: { fileName = "SUR_CONSENT_" + patientDetails.MRHash + DateTime.Now.ToString("MMddyyyyHHmmss") + ".pdf"; break; } case ConsentType.BloodConsentOrRefusal: { fileName = "BLOOD_FEFUSAL_CONSENT_" + patientDetails.MRHash + DateTime.Now.ToString("MMddyyyyHHmmss") + ".pdf"; break; } case ConsentType.Cardiovascular: { fileName = "CARDIAC_CATH_CONSENT_" + patientDetails.MRHash + DateTime.Now.ToString("MMddyyyyHHmmss") + ".pdf"; break; } case ConsentType.Endoscopy: { fileName = "ENDO_CONSENT_" + patientDetails.MRHash + DateTime.Now.ToString("MMddyyyyHHmmss") + ".pdf"; break; } case ConsentType.OutsideOR: { fileName = "OUTSDE_OR_" + patientDetails.MRHash + DateTime.Now.ToString("MMddyyyyHHmmss") + ".pdf"; break; } case ConsentType.PICC: { fileName = "PICC_CONSENT_" + patientDetails.MRHash + DateTime.Now.ToString("MMddyyyyHHmmss") + ".pdf"; break; } case ConsentType.PlasmanApheresis: { fileName = "PLASMA_APHERESIS_CONSENT_" + patientDetails.MRHash + DateTime.Now.ToString("MMddyyyyHHmmss") + ".pdf"; break; } } if (libFolder.RequiresCheckout) { try { SPFile fileOld = libFolder.Files[fileName]; fileOld.CheckOut(); } catch { } } var spFileProperty = new Hashtable(); spFileProperty.Add("MR#", patientDetails.MRHash); spFileProperty.Add("Patient#", PatientId); spFileProperty.Add("Patient Name", patientDetails.name); spFileProperty.Add("DOB#", Microsoft.SharePoint.Utilities.SPUtility.CreateISO8601DateTimeFromSystemDateTime(patientDetails.DOB)); spFileProperty.Add("Procedure Type", patientDetails.ProcedureName); spFileProperty.Add("Patient Information", patientDetails.name + " " + DateTime.Now.ToShortDateString()); SPFile spfile = libFolder.Files.Add(fileName, convertedFile, spFileProperty, true); list.Update(); if (libFolder.RequiresCheckout) { spfile.CheckIn("Upload Comment", SPCheckinType.MajorCheckIn); spfile.Publish("Publish Comment"); } } } web.AllowUnsafeUpdates = false; } } }); */ } else { CreateLog("unKnown", LogType.E, "GenerateAndUploadPdFtoSharePoint", "The folder path not found."); } } catch (Exception ex) { CreateLog("unKnown", LogType.E, "GenerateAndUploadPdFtoSharePoint", ex.Message + "," + ex.StackTrace); } finally { CloseService(client); } }
public void SetConsent(ConsentType consentType) { _consent = consentType; PlayerPrefs.SetString(PLAYER_PREFS_CONSENT_MODE, consentType.ToString()); }
public List<DoctorDetails> BmhConsentGetPhysicianList(ConsentType consentType) { var output = new List<DoctorDetails>(); System.Configuration.Configuration config = WebConfigurationManager.OpenWebConfiguration(HttpContext.Current.Request.ApplicationPath); var conStr = config.AppSettings.Settings["BethesdaDBConnection"].Value; using (var sqlConnection = new SqlConnection(conStr)) { using (var sqlDataAdapter = new SqlDataAdapter("BMH_Consent_GetPhysicianList", sqlConnection)) { sqlDataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure; var dataset = new DataSet(); sqlDataAdapter.Fill(dataset); if (dataset.Tables.Count > 0) { output.AddRange(from DataRow row in dataset.Tables[0].Rows select new DoctorDetails { ID = Convert.ToInt32(row[0].ToString()), Fname = row[1].ToString(), Lname = row[2].ToString() }); } } } return output; }
public void ForgetUser() { _consent = ConsentType.NPA; }
protected void BtnCompleted_Click(object sender, EventArgs e) { try { const ConsentType consentType = ConsentType.Surgical; //validation var lblError = DeclarationSignatures.LblError; lblError.Text = string.Empty; var doctorsAndProcedures = DoctorsAndProcedures1.GetDoctorsAndProcedures().ToArray(); if (doctorsAndProcedures.Length == 0) { lblError.Text += "<br /> Please select physicians and procedures."; } DeclarationSignatures.ValidateForm(); if (string.IsNullOrEmpty(Request.Form[SignatureType.DoctorSign1.ToString()]) || string.IsNullOrEmpty(Request.Form[SignatureType.DoctorSign2.ToString()]) || string.IsNullOrEmpty(Request.Form[SignatureType.DoctorSign3.ToString()]) || string.IsNullOrEmpty(Request.Form[SignatureType.DoctorSign4.ToString()]) || string.IsNullOrEmpty(Request.Form[SignatureType.DoctorSign5.ToString()])) { lblError.Text += "<br /> Please input signatures."; } if (!string.IsNullOrEmpty(lblError.Text)) { return; } string patientId; try { patientId = Session["PatientID"].ToString(); } catch (Exception) { if (string.IsNullOrEmpty(HdnPatientId.Value)) { Response.Redirect("/PatientConsent.aspx"); return; } patientId = HdnPatientId.Value; Session["PatientID"] = patientId; } string location; try { location = Session["Location"].ToString(); } catch (Exception) { if (string.IsNullOrEmpty(HdnPatientId.Value)) { Response.Redirect("/PatientConsent.aspx"); return; } location = HdnLocation.Value; Session["Location"] = location; } string ip = Request.ServerVariables["REMOTE_ADDR"]; string device; if (Request.Browser.IsMobileDevice) { device = Request.Browser.Browser + " " + Request.Browser.Version; } else { device = Request.Browser.Browser + " " + Request.Browser.Version; } var signatureses = new List <Signatures>(); if (Request.Form[SignatureType.DoctorSign1.ToString()] != null) { var bytes = Encoding.ASCII.GetBytes(Request.Form[SignatureType.DoctorSign1.ToString()]); signatureses.Add(new Signatures { _name = string.Empty, _signatureContent = Encoding.ASCII.GetString(bytes), _signatureType = SignatureType.DoctorSign1 }); } if (Request.Form[SignatureType.DoctorSign2.ToString()] != null) { var bytes = Encoding.ASCII.GetBytes(Request.Form[SignatureType.DoctorSign2.ToString()]); signatureses.Add(new Signatures { _name = string.Empty, _signatureContent = Encoding.ASCII.GetString(bytes), _signatureType = SignatureType.DoctorSign2 }); } if (Request.Form[SignatureType.DoctorSign3.ToString()] != null) { var bytes = Encoding.ASCII.GetBytes(Request.Form[SignatureType.DoctorSign3.ToString()]); signatureses.Add(new Signatures { _name = string.Empty, _signatureContent = Encoding.ASCII.GetString(bytes), _signatureType = SignatureType.DoctorSign3 }); } if (Request.Form[SignatureType.DoctorSign4.ToString()] != null) { var bytes = Encoding.ASCII.GetBytes(Request.Form[SignatureType.DoctorSign4.ToString()]); signatureses.Add(new Signatures { _name = string.Empty, _signatureContent = Encoding.ASCII.GetString(bytes), _signatureType = SignatureType.DoctorSign4 }); } if (Request.Form[SignatureType.DoctorSign5.ToString()] != null) { var bytes = Encoding.ASCII.GetBytes(Request.Form[SignatureType.DoctorSign5.ToString()]); signatureses.Add(new Signatures { _name = string.Empty, _signatureContent = Encoding.ASCII.GetString(bytes), _signatureType = SignatureType.DoctorSign5 }); } signatureses.AddRange(DeclarationSignatures.GetSignatures()); string empID = string.Empty; if (Session["EmpID"] != null) { empID = Session["EmpID"].ToString(); } var treatment = new Treatment { _patientId = patientId, _consentType = consentType, _signatureses = signatureses.ToArray(), _isPatientUnableSign = DeclarationSignatures.ChkPatientisUnableToSign.Checked, _unableToSignReason = DeclarationSignatures.TxtPatientNotSignedBecause.Text, _translatedBy = DeclarationSignatures.TxtTranslatedBy.Text, _trackingInformation = new TrackingInformation { _device = device, _iP = ip }, _doctorAndPrcedures = doctorsAndProcedures, _empID = empID }; if (treatment._doctorAndPrcedures.GetUpperBound(0) < 0) { lblError.Text += "Please input procedure."; return; } var formHandlerServiceClient = Utilities.GetConsentFormSvcClient(); formHandlerServiceClient.AddTreatment(treatment); Utilities.GeneratePdfAndUploadToSharePointSite(formHandlerServiceClient, consentType, patientId, Request, location); try { Response.Redirect(Utilities.GetNextFormUrl(consentType, Session)); } catch (Exception) { Response.Redirect("/PatientConsent.aspx"); } } catch (Exception ex) { var client = Utilities.GetConsentFormSvcClient(); client.CreateLog(Utilities.GetUsername(Session), LogType.E, GetType().Name + "-" + new StackTrace().GetFrame(0).GetMethod().ToString(), ex.Message + Environment.NewLine + ex.StackTrace); LblError.Text = ex.Message; } }
protected void Page_Load(object sender, EventArgs e) { try { string patientId; try { patientId = Request.QueryString["PatientID"]; } catch (Exception) { patientId = string.Empty; } string location; try { location = Request.QueryString["Location"]; } catch (Exception) { location = string.Empty; } if (!string.IsNullOrEmpty(patientId)) { consentType = ConsentType.BloodConsentOrRefusal; var formHandlerServiceClient = Utilities.GetConsentFormSvcClient(); var patientDetails = formHandlerServiceClient.GetPatientDetail(patientId, consentType.ToString(), location); var treatment = formHandlerServiceClient.GetTreatment(patientId, consentType); if (patientDetails != null) { var primaryDoctor = formHandlerServiceClient.GetDoctorDetail(Convert.ToInt32(patientDetails.PrimaryDoctorId)); if (primaryDoctor != null) { LblAuthoriseDoctors.Text = primaryDoctor.Fname + " " + primaryDoctor.Lname; } foreach (AssociatedDoctorDetails associatedDoctor in formHandlerServiceClient.GetAssociatedDoctors(Convert.ToInt32(patientDetails.PrimaryDoctorId))) { LblAuthoriseDoctors.Text += " , " + associatedDoctor.Lname + " " + associatedDoctor.Fname; } LblPatientName2.Text = patientDetails.name; LblPatientName3.Text = patientDetails.name; LblProcedureName.Text = patientDetails.ProcedureName; if (treatment._IsStatementOfConsentAccepted) { IsStatementOfConsent = true; ChkAutologousUnits.Checked = treatment._IsAutologousUnits; ChkDirectedUnits.Checked = treatment._IsDirectedUnits; } else { IsStatementOfConsent = false; } } } } catch (Exception ex) { var client = Utilities.GetConsentFormSvcClient(); client.CreateLog(Utilities.GetUsername(Session), LogType.E, GetType().Name + "-" + new StackTrace().GetFrame(0).GetMethod().ToString(), ex.Message + Environment.NewLine + ex.StackTrace); } }
public void SetConsent(ConsentType consentType) { ttpPrivacySettingsSetConsent(consentType.ToString()); }
public void SetConsent(ConsentType consentType) { _impl.SetConsent(consentType); }