Пример #1
0
        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 ContentData GetContentData(DataItem request)
        {
            var contentData = new ContentData();

            PatientChain patientChain = new PatientChain();
            var          response     = patientChain.GetChainData(new PatientChain.ParameterClass
            {
                Streamname  = request.StreamName,
                PhysicianId = request.ContentId,
                Signature   = request.Signature,
                Address     = request.Address,
                PatientId   = request.PatientId
            });

            foreach (var item in response)
            {
                var transaction = new Transaction
                {
                    //TransactionId =
                    Data = item
                };

                contentData.Content.Add(transaction);
            }

            return(contentData);
        }
Пример #3
0
        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);
            }
        }