示例#1
0
        private void bttonagregarevidence_Click(object sender, EventArgs e)
        {
            if (flowChartViewer1.Charts.Count > 0)
            {
                Evidence.Add(new Evidence(flowChartViewer1.Charts.Cast <BayesianNodeChartElement>().Select(x => x.States.Count).ToArray(), flowChartViewer1.Charts.Cast <BayesianNodeChartElement>().Select(x => x.Name).ToArray()));
                EvidenceIndex = Evidence.Count - 1;

                UpdateLabelEvidence();
                LoadEvidence();
                Refresh();
            }
        }
示例#2
0
        /// <inheritdoc />
        public ConsentIdentity AddConsent(Common.Consent.Consent consent)
        {
            var subject = StudySubjects.FindStudySubjectForPerson(consent.StudySubject.StudyId, consent.StudySubject.PersonId).FirstOrDefault();

            if (subject == null)
            {
                throw new NotImplementedException($"StudySubject#{consent.StudySubject} not found");
            }

            PersonEntity givenBy = null;

            if (consent.GivenByPersonId != null)
            {
                givenBy = People.Get(consent.GivenByPersonId.Value);
                if (givenBy == null)
                {
                    throw new NotImplementedException($"Person#{consent.GivenByPersonId} not found");
                }
            }

            var saved = Consents.Add(
                new ConsentEntity {
                DateProvided = consent.DateGiven, GivenBy = givenBy, StudySubject = subject
            });

            foreach (var evidence in consent.GivenEvidence)
            {
                Evidence.Add(
                    new GivenEvidenceEntity
                {
                    Value   = EvidenceRegistry.MarshallToXml(evidence).ToString(SaveOptions.DisableFormatting),
                    Type    = evidence.Definition.SystemName,
                    Consent = saved
                });
            }

            return(new ConsentIdentity(saved.Id));
        }
 public void AddEvidence(IEvidence evidence)
 {
     evidence.CanBeInspected        = false;
     evidence.PlaySoundPlayerNearby = false;
     Evidence.Add(evidence);
 }