public SimpleQuestionControl(
     string label,
     StandardValidTerm questionType,
     string description,
     List <StandardValidTerm> answers,
     List <StandardCodeSequence> nonQuantifableAnswers,
     List <StandardValidTerm> initialSelection,
     int minCardinality, int maxCardinality,
     int questionNumber, bool hasConfidence,
     bool addFirstDefaultItem,
     bool shouldDisplay) :
     this(
         label,
         questionType,
         description,
         answers,
         nonQuantifableAnswers,
         initialSelection,
         minCardinality,
         maxCardinality,
         questionNumber,
         hasConfidence,
         addFirstDefaultItem,
         shouldDisplay,
         null)
 {
 }
        public SimpleQuestionControl(
            string label,
            StandardValidTerm questionType,
            string description,
            List<StandardValidTerm> answers,
            List<StandardCodeSequence> nonQuantifableAnswers,
            List<StandardValidTerm> initialSelection,
            int minCardinality, int maxCardinality,
            int questionNumber, bool hasConfidence,
            bool addFirstDefaultItem,
            bool shouldDisplay)
            : this(label,
				questionType,
				description,
				answers,
				nonQuantifableAnswers,
				initialSelection,
				minCardinality,
				maxCardinality,
				questionNumber,
				hasConfidence,
				addFirstDefaultItem,
				shouldDisplay,
				null)
        {
        }
Exemple #3
0
        private StandardValidTerm ValidTermFromXsdValidTerm(ValidTerm validTerm)
        {
            if (validTerm == null)
            {
                return(null);
            }

            var validTerms = new List <StandardValidTerm>();

            if (validTerm.ValidTerm1 != null)
            {
                foreach (var childValidTerm in validTerm.ValidTerm1)
                {
                    var childTerm = ValidTermFromXsdValidTerm(childValidTerm);
                    if (childTerm != null)
                    {
                        validTerms.Add(childTerm);
                    }
                }
            }

            var term = new StandardValidTerm(new StandardCodeSequence(
                                                 validTerm.codeValue,
                                                 validTerm.codeMeaning,
                                                 validTerm.codingSchemeDesignator,
                                                 validTerm.codingSchemeVersion),
                                             validTerms);



            return(term);
        }
Exemple #4
0
        public static List <StandardValidTerm> AllowedTermsToValidTermList(List <AllowedTerm> allowedTerms1)
        {
            var validTerms = new List <StandardValidTerm>();

            allowedTerms1.ForEach(
                delegate(AllowedTerm term)
            {
                if (term.NonQuantifiable != null)
                {
                    term.NonQuantifiable.ForEach(
                        delegate(NonQuantifiable nonQuantifiable)
                    {
                        var quantifiableValidTerm = new StandardValidTerm(
                            new StandardCodeSequence(
                                nonQuantifiable.CodeValue,
                                nonQuantifiable.CodeMeaning,
                                nonQuantifiable.CodingSchemeDesignator,
                                nonQuantifiable.CodingSchemeVersion));
                        validTerms.Add(quantifiableValidTerm);
                    });
                }

                var standardValidTerm = new StandardValidTerm(
                    new StandardCodeSequence(term.CodeValue, term.CodeMeaning, term.CodingSchemeDesignator, term.CodingSchemeVersion)
                    );
                foreach (var validTerm in term.ValidTerms)
                {
                    standardValidTerm.StandardValidTerms.Add(ValidTermToStandardValidTerm(validTerm));
                }
                validTerms.Add(standardValidTerm);
            });
            return(validTerms);
        }
 public static List<StandardValidTerm> AllowedTerms1ToValidTermList(List<AllowedTerm1> allowedTerms1)
 {
     var validTerms = new List<StandardValidTerm>();
     allowedTerms1.ForEach(
         delegate(AllowedTerm1 term)
         {
             var standardValidTerm = new StandardValidTerm(
                 new StandardCodeSequence(term.CodeValue, term.CodeMeaning, term.CodingSchemeDesignator, term.CodingSchemeVersion)
                 );
             foreach (var validTerm in term.ValidTerms)
                 standardValidTerm.StandardValidTerms.Add(ValidTermToStandardValidTerm(validTerm));
             validTerms.Add(standardValidTerm);
         });
     return validTerms;
 }
Exemple #6
0
        public static List <StandardValidTerm> AllowedTerms1ToValidTermList(List <AllowedTerm1> allowedTerms1)
        {
            var validTerms = new List <StandardValidTerm>();

            allowedTerms1.ForEach(
                delegate(AllowedTerm1 term)
            {
                var standardValidTerm = new StandardValidTerm(
                    new StandardCodeSequence(term.CodeValue, term.CodeMeaning, term.CodingSchemeDesignator, term.CodingSchemeVersion)
                    );
                foreach (var validTerm in term.ValidTerms)
                {
                    standardValidTerm.StandardValidTerms.Add(ValidTermToStandardValidTerm(validTerm));
                }
                validTerms.Add(standardValidTerm);
            });
            return(validTerms);
        }
Exemple #7
0
        public static StandardValidTerm ValidTermToStandardValidTerm(ValidTerm validTerm)
        {
            if (validTerm == null)
            {
                return(null);
            }

            var standardValidTerm =
                new StandardValidTerm(
                    new StandardCodeSequence(
                        validTerm.CodeValue,
                        validTerm.CodeMeaning,
                        validTerm.CodingSchemeDesignator,
                        validTerm.CodingSchemeVersion));

            foreach (var childValidTerm in validTerm.ValidTerms)
            {
                standardValidTerm.StandardValidTerms.Add(ValidTermToStandardValidTerm(childValidTerm));
            }

            return(standardValidTerm);
        }
        public CharacteristicQuantificationDetailsControl(StandardValidTerm characteristicCode, CharacteristicQuantification characteristicQuantification)
        {
            InitializeComponent();

            _characteristicCode = characteristicCode;
            _txtName.Text = string.IsNullOrEmpty(characteristicQuantification.Name) ? @"Name is missing" : characteristicQuantification.Name;
            _quantificationType = IdentifyCharQuantificationType(characteristicQuantification);

            SuspendLayout();

            InitializeCharQuantificationControls(characteristicQuantification);

            if (characteristicQuantification.AnnotatorConfidence)
            {
                _confidenceControl = InitializeConfidenceControl();
                Controls.Add(_confidenceControl);
                Height += _confidenceControl.Height;
            }

            ResumeLayout(false);
            PerformLayout();
        }
Exemple #9
0
        public CharacteristicQuantificationDetailsControl(StandardValidTerm characteristicCode, CharacteristicQuantification characteristicQuantification)
        {
            InitializeComponent();

            _characteristicCode = characteristicCode;
            _txtName.Text       = string.IsNullOrEmpty(characteristicQuantification.Name) ? @"Name is missing" : characteristicQuantification.Name;
            _quantificationType = IdentifyCharQuantificationType(characteristicQuantification);

            SuspendLayout();

            InitializeCharQuantificationControls(characteristicQuantification);

            if (characteristicQuantification.AnnotatorConfidence)
            {
                _confidenceControl = InitializeConfidenceControl();
                Controls.Add(_confidenceControl);
                Height += _confidenceControl.Height;
            }

            ResumeLayout(false);
            PerformLayout();
        }
 public ValidTermListItem(StandardValidTerm newValue)
 {
     _value = newValue;
 }
        public SimpleQuestionControl(
            string label,
            StandardValidTerm questionType,
            string description,
            List<StandardValidTerm> answers,
            List<StandardCodeSequence> nonQuantifableAnswers,
            List<StandardValidTerm> initialSelection,
            int minCardinality, int maxCardinality,
            int questionNumber, bool hasConfidence,
            bool addFirstDefaultItem,
            bool shouldDisplay,
            List<string> staticDisplayItems)
        {
            Platform.CheckForNullReference(answers, "answers");

            InitializeComponent();

            _questionType = questionType;
            _lblEntity.Text = _questionType == null
                                ? label
                                : CodeUtils.ToStringBuilder(_questionType, new StringBuilder()).ToString();
            _lblEntity.ToolTipText = SplitIntoLines(description);
            _lblEntity.ShowToolTipChanged += OnLabelShowToolTipChanged;
            _lblEntity.TabStop = false;

            _questionNumber = questionNumber;

            Debug.Assert(maxCardinality - minCardinality >= 0, "MinCardinality must be less or equal to MaxCardinality in a question");
            _maxNumberOfAnswers = Math.Max(1, Math.Min(answers.Count, maxCardinality));

            var availableAnswers = new List<StandardValidTerm>(answers);
            if (nonQuantifableAnswers != null)
            {
                Debug.Assert(false, "Non-quantifieables should not really be here");
                availableAnswers.InsertRange(0, ComponentUtilities.ToStandardValidTermList(nonQuantifableAnswers));
            }

            _selectedAnswers = initialSelection;
            _staticDisplayItems = staticDisplayItems;

            if (shouldDisplay)
            {
                SuspendLayout();

                _questionControl = InitializeResponseControl(availableAnswers, initialSelection, addFirstDefaultItem);
                Controls.Add(_questionControl);
                Height += _questionControl.Height + 3;

                if (hasConfidence)
                {
                    _confidenceControl = InitializeConfidenceControl();
                    Controls.Add(_confidenceControl);
                    Height += _confidenceControl.Height + 3;
                }

                ResumeLayout(false);
                PerformLayout();
            }
            else
            {
                if (initialSelection == null || initialSelection.Count == 0)
                    Platform.Log(LogLevel.Error,
                                 "Template data error: no default values are provided for questions that are not going to be displayed. Template answers are never going to be valid");
            }
        }
        private StandardValidTerm ValidTermFromXsdValidTerm(ValidTerm validTerm)
        {
            if (validTerm == null)
                return null;

            var validTerms = new List<StandardValidTerm>();
            if (validTerm.ValidTerm1 != null)
            {
                foreach (var childValidTerm in validTerm.ValidTerm1)
                {
                    var childTerm = ValidTermFromXsdValidTerm(childValidTerm);
                    if (childTerm != null)
                        validTerms.Add(childTerm);
                }
            }

            var term = new StandardValidTerm(new StandardCodeSequence(
                                                 validTerm.codeValue,
                                                 validTerm.codeMeaning,
                                                 validTerm.codingSchemeDesignator,
                                                 validTerm.codingSchemeVersion),
                                                 validTerms);

            return term;
        }
        public SimpleQuestionControl(
            string label,
            StandardValidTerm questionType,
            string description,
            List <StandardValidTerm> answers,
            List <StandardCodeSequence> nonQuantifableAnswers,
            List <StandardValidTerm> initialSelection,
            int minCardinality, int maxCardinality,
            int questionNumber, bool hasConfidence,
            bool addFirstDefaultItem,
            bool shouldDisplay,
            List <string> staticDisplayItems)
        {
            Platform.CheckForNullReference(answers, "answers");

            InitializeComponent();

            _questionType   = questionType;
            _lblEntity.Text = _questionType == null
                                                                ? label
                                                                : CodeUtils.ToStringBuilder(_questionType, new StringBuilder()).ToString();
            _lblEntity.ToolTipText         = SplitIntoLines(description);
            _lblEntity.ShowToolTipChanged += OnLabelShowToolTipChanged;
            _lblEntity.TabStop             = false;

            _questionNumber = questionNumber;

            Debug.Assert(maxCardinality - minCardinality >= 0, "MinCardinality must be less or equal to MaxCardinality in a question");
            _maxNumberOfAnswers = Math.Max(1, Math.Min(answers.Count, maxCardinality));

            var availableAnswers = new List <StandardValidTerm>(answers);

            if (nonQuantifableAnswers != null)
            {
                Debug.Assert(false, "Non-quantifieables should not really be here");
                availableAnswers.InsertRange(0, ComponentUtilities.ToStandardValidTermList(nonQuantifableAnswers));
            }

            _selectedAnswers    = initialSelection;
            _staticDisplayItems = staticDisplayItems;

            if (shouldDisplay)
            {
                SuspendLayout();

                _questionControl = InitializeResponseControl(availableAnswers, initialSelection, addFirstDefaultItem);
                Controls.Add(_questionControl);
                Height += _questionControl.Height + 3;

                if (hasConfidence)
                {
                    _confidenceControl = InitializeConfidenceControl();
                    Controls.Add(_confidenceControl);
                    Height += _confidenceControl.Height + 3;
                }

                ResumeLayout(false);
                PerformLayout();
            }
            else
            {
                if (initialSelection == null || initialSelection.Count == 0)
                {
                    Platform.Log(LogLevel.Error,
                                 "Template data error: no default values are provided for questions that are not going to be displayed. Template answers are never going to be valid");
                }
            }
        }
 internal CharacteristicQuantificationChangedEventArgs(StandardValidTerm characteristicCode, List<aim_dotnet.ICharacteristicQuantification> characteristicQuantifications)
 {
     ParentCharacteristicCode = characteristicCode;
     CharacteristicQuantifications = characteristicQuantifications;
 }
 public ValidTermListItem(StandardValidTerm newValue)
 {
     _value = newValue;
 }
        public static List<StandardValidTerm> AllowedTermsToValidTermList(List<AllowedTerm> allowedTerms1)
        {
            var validTerms = new List<StandardValidTerm>();
            allowedTerms1.ForEach(
                delegate(AllowedTerm term)
                {
                    if (term.NonQuantifiable != null)
                        term.NonQuantifiable.ForEach(
                            delegate(NonQuantifiable nonQuantifiable)
                                {
                                    var quantifiableValidTerm = new StandardValidTerm(
                                        new StandardCodeSequence(
                                            nonQuantifiable.CodeValue,
                                            nonQuantifiable.CodeMeaning,
                                            nonQuantifiable.CodingSchemeDesignator,
                                            nonQuantifiable.CodingSchemeVersion));
                                    validTerms.Add(quantifiableValidTerm);
                                });

                    var standardValidTerm = new StandardValidTerm(
                        new StandardCodeSequence(term.CodeValue, term.CodeMeaning, term.CodingSchemeDesignator, term.CodingSchemeVersion)
                        );
                    foreach (var validTerm in term.ValidTerms)
                        standardValidTerm.StandardValidTerms.Add(ValidTermToStandardValidTerm(validTerm));
                    validTerms.Add(standardValidTerm);
                });
            return validTerms;
        }
        public static StandardValidTerm ValidTermToStandardValidTerm(ValidTerm validTerm)
        {
            if (validTerm == null)
                return null;

            var standardValidTerm =
                new StandardValidTerm(
                    new StandardCodeSequence(
                        validTerm.CodeValue,
                        validTerm.CodeMeaning,
                        validTerm.CodingSchemeDesignator,
                        validTerm.CodingSchemeVersion));

            foreach (var childValidTerm in validTerm.ValidTerms)
                standardValidTerm.StandardValidTerms.Add(ValidTermToStandardValidTerm(childValidTerm));

            return standardValidTerm;
        }
Exemple #18
0
 internal CharacteristicQuantificationChangedEventArgs(StandardValidTerm characteristicCode, List <aim_dotnet.ICharacteristicQuantification> characteristicQuantifications)
 {
     ParentCharacteristicCode      = characteristicCode;
     CharacteristicQuantifications = characteristicQuantifications;
 }