private void type_SelectedIndexChanged(object sender, EventArgs e) { if (patientView.SelectedItems.Count == 0 || Streams.SelectedItems.Count == 0) { return; } content.Items.Clear(); PatientChain patientChain = new PatientChain(); var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); var privatekey = config.AppSettings.Settings["privkey"].Value; var result = patientChain.GetChainData(new PatientChain.ParameterClass { DataToStore = ToevoegingInStream.Text, Streamname = Streams.SelectedItems[0].SubItems[1].Text.Replace("-items", string.Empty) + "-" + type.Text, PhysicianId = docId.Text, Signature = patientChain.SignMessage(privatekey, docId.Text), Address = config.AppSettings.Settings["address"].Value, PatientId = patientView.SelectedItems[0].SubItems[2].Text, StreamType = type.Text == @"Items" ? PatientChain.ParameterClass.type.Items : PatientChain.ParameterClass.type.Log }); content.Items.Clear(); foreach (var i in result) { var lv = new ListViewItem("-"); lv.SubItems.Add("-"); lv.SubItems.Add(i); content.Items.Add(lv); } }
public string SignPhysician(SignRequest request) { PatientChain patientChain = new PatientChain(); var Signature = patientChain.SignMessage(request.HashPrivateKey, request.PhysicianId); return("{ \"Signature\" : \"" + Signature + "\" }"); }
private void button4_Click_1(object sender, EventArgs e) { PatientChain patientChain = new PatientChain(); var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); var privatekey = config.AppSettings.Settings["privkey"].Value; patientChain.AddPhysicianRights(patientView.SelectedItems[0].SubItems[2].Text, docId.Text, patientChain.SignMessage(privatekey, docId.Text)); }
private void Streams_SelectedIndexChanged(object sender, EventArgs e) { if (patientView.SelectedItems.Count == 0 || Streams.SelectedItems.Count == 0) { return; } PatientChain patientChain = new PatientChain(); var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); var privatekey = config.AppSettings.Settings["privkey"].Value; var result = patientChain.GetChainData(new PatientChain.ParameterClass { DataToStore = ToevoegingInStream.Text, Streamname = Streams.SelectedItems[0].SubItems[1].Text, PhysicianId = docId.Text, Signature = patientChain.SignMessage(privatekey, docId.Text), Address = config.AppSettings.Settings["address"].Value, PatientId = patientView.SelectedItems[0].SubItems[2].Text }); content.Items.Clear(); if (result != null) { foreach (var i in result) { var lv = new ListViewItem("-"); lv.SubItems.Add("-"); lv.SubItems.Add(i); content.Items.Add(lv); } } else { MessageBox.Show( "Er is voor deze patient geen medische informatie of u bent niet geautoriseerd om medische stromen te zien voor deze patient.", "Medical streams", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void button3_Click(object sender, EventArgs e) { if (patientView.SelectedItems.Count == 0 || Streams.SelectedItems.Count == 0) { return; } PatientChain patientChain = new PatientChain(); var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); var privatekey = config.AppSettings.Settings["privkey"].Value; patientChain.SetChainData(new PatientChain.ParameterClass { DataToStore = ToevoegingInStream.Text, Streamname = Streams.SelectedItems[0].SubItems[1].Text.Replace("-items", string.Empty) + "-" + type.Text, PhysicianId = docId.Text, Signature = patientChain.SignMessage(privatekey, docId.Text), Address = config.AppSettings.Settings["address"].Value, PatientId = patientView.SelectedItems[0].SubItems[2].Text }); }