Exemple #1
0
        private void CreateCodedValue(VocabularyDomain vocabularyDomain,
                                      String oid, String code, String parentCode, IList <String> childCodes, String version)
        {
            CodeSystem codeSystem_0   = this.factory.CreateCodeSystem(oid);
            CodedValue codeCodedValue = CreateCodedValue(vocabularyDomain,
                                                         codeSystem_0, code, version);
            CodedValue parentCodeCodedValue = null;

            if (parentCode != null)
            {
                parentCodeCodedValue = CreateCodedValue(vocabularyDomain,
                                                        codeSystem_0, parentCode, version);
            }
            IList <CodedValue> childCodesCodedValues = new List <CodedValue>();

            if (childCodes != null)
            {
                /* foreach */
                foreach (String childCode  in  childCodes)
                {
                    CodedValue childCodedValue = CreateCodedValue(vocabularyDomain,
                                                                  codeSystem_0, childCode, version);
                    ILOG.J2CsMapping.Collections.Generics.Collections.Add(childCodesCodedValues, childCodedValue);
                }
            }
            this.factory.CreateCodedValue(codeCodedValue, parentCodeCodedValue,
                                          childCodesCodedValues);
        }
Exemple #2
0
        private CodedValue CreateCodedValue(VocabularyDomain vocabularyDomain,
                                            CodeSystem codeSystem_0, String code)
        {
            CodedValue codedValue = this.factory.CreateCodedValue(codeSystem_0, code);

            this.factory.CreateValueSet(codedValue, vocabularyDomain);
            return(codedValue);
        }
Exemple #3
0
        private CodedValue CreateCodedValue(VocabularyDomain vocabularyDomain,
                                            String oid, String code, String version)
        {
            CodeSystem codeSystem_0 = this.factory.CreateCodeSystem(oid);
            CodedValue codedValue   = this.factory.CreateCodedValue(codeSystem_0, code);

            this.factory.CreateValueSet(codedValue, version, vocabularyDomain);
            return(codedValue);
        }
Exemple #4
0
        public VocabularyDomain CreateVocabularyDomain(
            Type vocabularyDomainType, String businessName,
            String description)
        {
            VocabularyDomain result = new VocabularyDomain();

            result.Type         = vocabularyDomainType.Name;
            result.BusinessName = businessName;
            result.Description  = description;
            Save(result);
            return(result);
        }
Exemple #5
0
        public void TestFindCodedValueByCodeSystem_ShouldNotFindValuesInOtherCodeSystems()
        {
            VocabularyDomain vocabularyDomain = this.factory
                                                .CreateVocabularyDomain(VOCABULARY_DOMAIN);

            CreateCodedValue(vocabularyDomain, OTHER_OID, CODE);

            ValueSetEntry value_ren = this.dao.FindValueByCodeSystem(VOCABULARY_DOMAIN,
                                                                     CODE, OID);

            NUnit.Framework.Assert.IsNull(value_ren);
        }
Exemple #6
0
        public void TestFindCodedValueByCodeSystem_ShouldFindMatchingCodedValue()
        {
            VocabularyDomain vocabularyDomain = this.factory
                                                .CreateVocabularyDomain(typeof(Confidentiality));

            CreateCodedValue(vocabularyDomain, OID, "N");

            ValueSetEntry value_ren = this.dao.FindValueByCodeSystem(
                typeof(Confidentiality), "N", OID);

            NUnit.Framework.Assert.IsNotNull(value_ren, "coded value");
            NUnit.Framework.Assert.AreEqual("N", value_ren.CodedValue.Code);
            NUnit.Framework.Assert.AreEqual(OID, value_ren.CodedValue.CodeSystem.Oid);
        }
Exemple #7
0
        public void TestFindCodedValueWithChildrenAndParent()
        {
            VocabularyDomain vocabularyDomain = this.factory
                                                .CreateVocabularyDomain(typeof(Confidentiality));

            CreateCodedValue(vocabularyDomain, OID, CODE, "parent", ILOG.J2CsMapping.Collections.Generics.Arrays.AsList("child1", "child2", "child3"));

            Confidentiality code = (Confidentiality)Ca.Infoway.Messagebuilder.Terminology.CodeResolverRegistry.Lookup <Confidentiality>(
                typeof(Confidentiality), CODE, OID);

            CodedValue codedValue = this.dao.FindCodedValue(code);

            NUnit.Framework.Assert.IsNotNull(codedValue);
            NUnit.Framework.Assert.IsFalse((codedValue.Children.Count == 0));
            NUnit.Framework.Assert.AreEqual(3, codedValue.Children.Count);
            NUnit.Framework.Assert.IsFalse((codedValue.Parents.Count == 0));
        }
Exemple #8
0
        private void CreateCodedValue(String code, params Type[] vocabularyDomainType)
        {
            if (this.codeSystem == null)
            {
                this.codeSystem = this.factory.CreateCodeSystem(OID);
            }
            CodedValue codedValue = this.factory.CreateCodedValue(this.codeSystem,
                                                                  code);

            IList <VocabularyDomain> domains_0 = new List <VocabularyDomain>();

            /* foreach */
            foreach (Type domain  in  vocabularyDomainType)
            {
                VocabularyDomain vocabularyDomain = ((Ca.Infoway.Messagebuilder.Terminology.Codeset.Domain.VocabularyDomain)ILOG.J2CsMapping.Collections.Generics.Collections.Get(this.domains, domain));
                if (vocabularyDomain == null)
                {
                    vocabularyDomain = this.factory.CreateVocabularyDomain(domain);
                    ILOG.J2CsMapping.Collections.Generics.Collections.Put(this.domains, (System.Type)(domain), (Ca.Infoway.Messagebuilder.Terminology.Codeset.Domain.VocabularyDomain)(vocabularyDomain));
                }
                ILOG.J2CsMapping.Collections.Generics.Collections.Add(domains_0, vocabularyDomain);
            }
            this.factory.CreateValueSet(codedValue, ILOG.J2CsMapping.Collections.Generics.Collections.ToArray(domains_0, new VocabularyDomain[domains_0.Count]));
        }
Exemple #9
0
 /// <summary>
 /// {@inheritDoc}
 /// </summary>
 ///
 public virtual IList <ValueSetEntry> SelectValueSetsByVocabularyDomain(
     String jurisdiction, VocabularyDomain vocabularyDomain, String version)
 {
     return(SelectValueSetsByVocabularyDomain(vocabularyDomain.Type, version));
 }