示例#1
0
        protected virtual object Visit(openehr.openehr.am.openehr_profile.data_types.text.Impl.C_CODE_PHRASE o, int depth)
        {
            C_CODE_PHRASE result = new C_CODE_PHRASE();

            CloneC_Object(result, o);

            if (o.terminology_id() != null)
            {
                TERMINOLOGY_ID terminologyId = new TERMINOLOGY_ID();
                terminologyId.value   = o.terminology_id().value().ToString();
                result.terminology_id = terminologyId;
            }

            if (o.code_list() != null)
            {
                result.code_list = new string[o.code_list().count()];

                for (int i = 1; i <= result.code_list.Length; i++)
                {
                    result.code_list[i - 1] = o.code_list().i_th(i).ToString();
                }
            }

            if (o.has_assumed_value())
            {
                result.assumed_value = CloneCodePhrase((openehr.openehr.rm.data_types.text.Impl.CODE_PHRASE)o.assumed_value());
            }

            return(result);
        }
示例#2
0
        protected virtual CODE_PHRASE CloneCodePhrase(openehr.openehr.rm.data_types.text.CODE_PHRASE o)
        {
            CODE_PHRASE result = null;

            if (o != null)
            {
                result = new CODE_PHRASE();

                if (o.code_string() != null)
                {
                    result.code_string = o.code_string().ToString();
                }
                else
                {
                    result.code_string = "";
                }

                if (o.terminology_id() != null)
                {
                    TERMINOLOGY_ID terminologyId = new TERMINOLOGY_ID();
                    terminologyId.value   = o.terminology_id().value().ToString();
                    result.terminology_id = terminologyId;
                }
            }

            return(result);
        }
示例#3
0
        protected virtual TermBindingSet[] CloneTermBindingSet(EiffelStructures.table.HASH_TABLE_REFERENCE_REFERENCE o)
        {
            TermBindingSet[] result = null;

            if (o != null && o.count() > 0)
            {
                result = new TermBindingSet[o.count()];
                o.start();

                for (int i = 1; i <= o.count(); i++)
                {
                    TermBindingSet termBindingSet = new TermBindingSet();
                    termBindingSet.terminology = o.key_for_iteration().ToString();

                    EiffelStructures.table.Impl.HASH_TABLE_REFERENCE_REFERENCE adlTerms = o.item_for_iteration() as EiffelStructures.table.Impl.HASH_TABLE_REFERENCE_REFERENCE;
                    SortedList <string, TERM_BINDING_ITEM> localTerms = new SortedList <string, TERM_BINDING_ITEM>();
                    adlTerms.start();

                    for (int j = 1; j <= adlTerms.count(); j++)
                    {
                        openehr.openehr.rm.data_types.text.CODE_PHRASE term = adlTerms.item_for_iteration() as openehr.openehr.rm.data_types.text.CODE_PHRASE;

                        if (term != null)
                        {
                            TERM_BINDING_ITEM localTerm = new TERM_BINDING_ITEM();
                            localTerm.code = adlTerms.key_for_iteration().ToString();
                            CODE_PHRASE codePhrase = new CODE_PHRASE();
                            codePhrase.code_string = term.code_string().ToString();

                            if (term.code_string() != null)
                            {
                                TERMINOLOGY_ID terminologyId = new TERMINOLOGY_ID();
                                terminologyId.value       = term.terminology_id().value().ToString();
                                codePhrase.terminology_id = terminologyId;
                            }

                            localTerm.value = codePhrase;
                            localTerms.Add(localTerm.code, localTerm);
                        }

                        adlTerms.forth();
                    }

                    termBindingSet.items = new TERM_BINDING_ITEM[localTerms.Count];
                    localTerms.Values.CopyTo(termBindingSet.items, 0);
                    result[i - 1] = termBindingSet;
                    o.forth();
                }
            }

            return(result);
        }
 private void ontology_LanguageAdded(object sender, string language, string defaultLanguageCodeSet)
 {
     CODE_PHRASE cp = new CODE_PHRASE();
     cp.code_string = language;
     
     if (defaultLanguageCodeSet != "")
     {                
         TERMINOLOGY_ID terminologyId = new TERMINOLOGY_ID();
         terminologyId.value = defaultLanguageCodeSet;
         cp.terminology_id = terminologyId;                
     }
     
     AddDescriptionItem(cp);
 }
示例#5
0
        private void ontology_LanguageAdded(object sender, string language, string defaultLanguageCodeSet)
        {
            CODE_PHRASE cp = new CODE_PHRASE();

            cp.code_string = language;

            if (defaultLanguageCodeSet != "")
            {
                TERMINOLOGY_ID terminologyId = new TERMINOLOGY_ID();
                terminologyId.value = defaultLanguageCodeSet;
                cp.terminology_id   = terminologyId;
            }

            AddDescriptionItem(cp);
        }
示例#6
0
        public void NewArchetype(string an_archetypeID, string a_languageCode, string defaultLanguageCodeSet)
        {
            _archetype = new ARCHETYPE();
            _ontology  = null;

            ARCHETYPE_ID archetypeId = new ARCHETYPE_ID();

            archetypeId.value                        = an_archetypeID;
            _archetype.archetype_id                  = archetypeId;
            _archetype.description                   = new RESOURCE_DESCRIPTION();
            _archetype.original_language             = new CODE_PHRASE();
            _archetype.original_language.code_string = a_languageCode;

            if (defaultLanguageCodeSet != "")
            {
                TERMINOLOGY_ID terminologyId = new TERMINOLOGY_ID();
                terminologyId.value = defaultLanguageCodeSet;
                _archetype.original_language.terminology_id = terminologyId;
            }

            _archetype.description.lifecycle_state = "AuthorDraft";
            _archetype.concept            = "at0000";
            _archetype.definition         = new C_COMPLEX_OBJECT();
            _archetype.definition.node_id = _archetype.concept;
            string[] y = an_archetypeID.Split(".-".ToCharArray());
            _archetype.definition.rm_type_name = y[2];
            _archetype.ontology = new ARCHETYPE_ONTOLOGY();
            _archetype.ontology.term_definitions                            = Array.CreateInstance(typeof(CodeDefinitionSet), 1) as CodeDefinitionSet[];
            _archetype.ontology.term_definitions[0]                         = new CodeDefinitionSet();
            _archetype.ontology.term_definitions[0].language                = a_languageCode;
            _archetype.ontology.term_definitions[0].items                   = Array.CreateInstance(typeof(ARCHETYPE_TERM), 1) as ARCHETYPE_TERM[];
            _archetype.ontology.term_definitions[0].items[0]                = new ARCHETYPE_TERM();
            _archetype.ontology.term_definitions[0].items[0].code           = "at0000";
            _archetype.ontology.term_definitions[0].items[0].items          = Array.CreateInstance(typeof(StringDictionaryItem), 2) as StringDictionaryItem[];
            _archetype.ontology.term_definitions[0].items[0].items[0]       = new StringDictionaryItem();
            _archetype.ontology.term_definitions[0].items[0].items[0].id    = "text";
            _archetype.ontology.term_definitions[0].items[0].items[0].Value = "?";
            _archetype.ontology.term_definitions[0].items[0].items[1]       = new StringDictionaryItem();
            _archetype.ontology.term_definitions[0].items[0].items[1].id    = "description";
            _archetype.ontology.term_definitions[0].items[0].items[1].Value = "*";

            AddDescriptionItem(_archetype.original_language);
        }
        protected override TermBindingSet[] CloneTermBindingSet(EiffelSoftware.Library.Base.structures.table.HASH_TABLE_REFERENCE_REFERENCE currentObject)
        {
            List<TermBindingSet> termBindingSets = new List<TermBindingSet>();

            if (currentObject != null)
            {
                if (currentObject.count() > 0)
                {
                    currentObject.start();

                    // 0..* items TERM_BINDING_ITEM                    
                    for (int i = 1; i <= currentObject.count(); i++)
                    {
                        TermBindingSet termBindingSet = new TermBindingSet();

                        //1 terminology string
                        termBindingSet.terminology = currentObject.key_for_iteration().ToString();

                        //terms HASH table
                        EiffelStructures.table.Impl.HASH_TABLE_REFERENCE_REFERENCE adlTerms;
                        adlTerms = currentObject.item_for_iteration() as EiffelStructures.table.Impl.HASH_TABLE_REFERENCE_REFERENCE;
                        SortedList<string, TERM_BINDING_ITEM> localTerms = new SortedList<string, TERM_BINDING_ITEM>();

                        adlTerms.start();

                        if (adlTerms.count() > 0)
                        {
                            for (int j = 1; j <= adlTerms.count(); j++)
                            {
                                openehr.openehr.rm.data_types.text.CODE_PHRASE term = adlTerms.item_for_iteration() as openehr.openehr.rm.data_types.text.CODE_PHRASE;

                                if (term != null)
                                {
                                    TERM_BINDING_ITEM localTerm = new TERM_BINDING_ITEM();

                                    // 1 code string
                                    localTerm.code = adlTerms.key_for_iteration().ToString();

                                    // 1 value CODE_PHRASE (CODE_PHRASE to HASH TABLE)                                
                                    CODE_PHRASE codePhrase = new CODE_PHRASE();

                                    // 1 code_string string
                                    codePhrase.code_string = term.code_string().ToString();

                                    // 1 terminology_id TERMINOLOGY_ID                                
                                    if (term.code_string() != null)
                                    {
                                        TERMINOLOGY_ID terminologyId = new TERMINOLOGY_ID();
                                        terminologyId.value = term.terminology_id().value().ToString();
                                        codePhrase.terminology_id = terminologyId;
                                    }

                                    localTerm.value = codePhrase;
                                    localTerms.Add(localTerm.code, localTerm);
                                }

                                adlTerms.forth();
                            }

                            termBindingSet.items = new TERM_BINDING_ITEM[localTerms.Count];
                            localTerms.Values.CopyTo(termBindingSet.items, 0);
                        }

                        if (termBindingSet.items != null)
                        {
                            termBindingSets.Add(termBindingSet);
                        }

                        currentObject.forth();
                    }
                }
            }

            if (termBindingSets.Count > 0)
            {
                TermBindingSet[] termBindingSetArray = new TermBindingSet[termBindingSets.Count];
                termBindingSets.CopyTo(termBindingSetArray);
                return termBindingSetArray;
            }
            else
            {
                return null;
            }
        }
        protected virtual TermBindingSet[] CloneTermBindingSet(EiffelStructures.table.HASH_TABLE_REFERENCE_REFERENCE o)
        {
            TermBindingSet[] result = null;

            if (o != null && o.count() > 0)
            {
                result = new TermBindingSet[o.count()];
                o.start();

                for (int i = 1; i <= o.count(); i++)
                {
                    TermBindingSet termBindingSet = new TermBindingSet();
                    termBindingSet.terminology = o.key_for_iteration().ToString();

                    EiffelStructures.table.Impl.HASH_TABLE_REFERENCE_REFERENCE adlTerms = o.item_for_iteration() as EiffelStructures.table.Impl.HASH_TABLE_REFERENCE_REFERENCE;
                    SortedList<string, TERM_BINDING_ITEM> localTerms = new SortedList<string, TERM_BINDING_ITEM>();
                    adlTerms.start();

                    for (int j = 1; j <= adlTerms.count(); j++)
                    {
                        openehr.openehr.rm.data_types.text.CODE_PHRASE term = adlTerms.item_for_iteration() as openehr.openehr.rm.data_types.text.CODE_PHRASE;

                        if (term != null)
                        {
                            TERM_BINDING_ITEM localTerm = new TERM_BINDING_ITEM();
                            localTerm.code = adlTerms.key_for_iteration().ToString();
                            CODE_PHRASE codePhrase = new CODE_PHRASE();
                            codePhrase.code_string = term.code_string().ToString();

                            if (term.code_string() != null)
                            {
                                TERMINOLOGY_ID terminologyId = new TERMINOLOGY_ID();
                                terminologyId.value = term.terminology_id().value().ToString();
                                codePhrase.terminology_id = terminologyId;
                            }

                            localTerm.value = codePhrase;
                            localTerms.Add(localTerm.code, localTerm);
                        }

                        adlTerms.forth();
                    }

                    termBindingSet.items = new TERM_BINDING_ITEM[localTerms.Count];
                    localTerms.Values.CopyTo(termBindingSet.items, 0);
                    result[i - 1] = termBindingSet;
                    o.forth();
                }
            }

            return result;
        }
        protected virtual CODE_PHRASE CloneCodePhrase(openehr.openehr.rm.data_types.text.CODE_PHRASE o)
        {
            CODE_PHRASE result = null;

            if (o != null)
            {
                result = new CODE_PHRASE();

                if (o.code_string() != null)
                    result.code_string = o.code_string().ToString();
                else
                    result.code_string = "";

                if (o.terminology_id() != null)
                {
                    TERMINOLOGY_ID terminologyId = new TERMINOLOGY_ID();
                    terminologyId.value = o.terminology_id().value().ToString();
                    result.terminology_id = terminologyId;
                }
            }

            return result;
        }
        protected virtual object Visit(openehr.openehr.am.openehr_profile.data_types.text.Impl.C_CODE_PHRASE o, int depth)
        {
            C_CODE_PHRASE result = new C_CODE_PHRASE();
            CloneC_Object(result, o);

            if (o.terminology_id() != null)
            {
                TERMINOLOGY_ID terminologyId = new TERMINOLOGY_ID();
                terminologyId.value = o.terminology_id().value().ToString();
                result.terminology_id = terminologyId;
            }

            if (o.code_list() != null)
            {
                result.code_list = new string[o.code_list().count()];

                for (int i = 1; i <= result.code_list.Length; i++)
                    result.code_list[i - 1] = o.code_list().i_th(i).ToString();
            }

            if (o.has_assumed_value())
                result.assumed_value = CloneCodePhrase((openehr.openehr.rm.data_types.text.Impl.CODE_PHRASE)o.assumed_value());

            return result;
        }
        public void NewArchetype(string an_archetypeID, string a_languageCode, string defaultLanguageCodeSet)
        {
            _archetype = new ARCHETYPE();
            _ontology = null;
            
            ARCHETYPE_ID archetypeId = new ARCHETYPE_ID();
            archetypeId.value = an_archetypeID;
            _archetype.archetype_id = archetypeId;            
            _archetype.description = new RESOURCE_DESCRIPTION();
            _archetype.original_language = new CODE_PHRASE();
            _archetype.original_language.code_string = a_languageCode;
            
            if (defaultLanguageCodeSet != "")
            {
                TERMINOLOGY_ID terminologyId = new TERMINOLOGY_ID();
                terminologyId.value = defaultLanguageCodeSet;
                _archetype.original_language.terminology_id = terminologyId;
            }
            
            _archetype.description.lifecycle_state = "AuthorDraft";
            _archetype.concept = "at0000";
            _archetype.definition = new C_COMPLEX_OBJECT();
            _archetype.definition.node_id = _archetype.concept;
            string[] y = an_archetypeID.Split(".-".ToCharArray());
            _archetype.definition.rm_type_name = y[2];
            _archetype.ontology = new ARCHETYPE_ONTOLOGY();
            _archetype.ontology.term_definitions = Array.CreateInstance(typeof(CodeDefinitionSet), 1) as CodeDefinitionSet[];
            _archetype.ontology.term_definitions[0] = new CodeDefinitionSet();
            _archetype.ontology.term_definitions[0].language = a_languageCode;
            _archetype.ontology.term_definitions[0].items = Array.CreateInstance(typeof(ARCHETYPE_TERM), 1) as ARCHETYPE_TERM[];
            _archetype.ontology.term_definitions[0].items[0] = new ARCHETYPE_TERM();
            _archetype.ontology.term_definitions[0].items[0].code = "at0000";
            _archetype.ontology.term_definitions[0].items[0].items = Array.CreateInstance(typeof(StringDictionaryItem), 2) as StringDictionaryItem[];
            _archetype.ontology.term_definitions[0].items[0].items[0] = new StringDictionaryItem();
            _archetype.ontology.term_definitions[0].items[0].items[0].id = "text";
            _archetype.ontology.term_definitions[0].items[0].items[0].Value = "?";
            _archetype.ontology.term_definitions[0].items[0].items[1] = new StringDictionaryItem();
            _archetype.ontology.term_definitions[0].items[0].items[1].id = "description";
            _archetype.ontology.term_definitions[0].items[0].items[1].Value = "*";

            AddDescriptionItem(_archetype.original_language);
        }
        protected override TermBindingSet[] CloneTermBindingSet(EiffelSoftware.Library.Base.structures.table.HASH_TABLE_REFERENCE_REFERENCE currentObject)
        {
            List <TermBindingSet> termBindingSets = new List <TermBindingSet>();

            if (currentObject != null)
            {
                if (currentObject.count() > 0)
                {
                    currentObject.start();

                    // 0..* items TERM_BINDING_ITEM
                    for (int i = 1; i <= currentObject.count(); i++)
                    {
                        TermBindingSet termBindingSet = new TermBindingSet();

                        //1 terminology string
                        termBindingSet.terminology = currentObject.key_for_iteration().ToString();

                        //terms HASH table
                        EiffelStructures.table.Impl.HASH_TABLE_REFERENCE_REFERENCE adlTerms;
                        adlTerms = currentObject.item_for_iteration() as EiffelStructures.table.Impl.HASH_TABLE_REFERENCE_REFERENCE;
                        SortedList <string, TERM_BINDING_ITEM> localTerms = new SortedList <string, TERM_BINDING_ITEM>();

                        adlTerms.start();

                        if (adlTerms.count() > 0)
                        {
                            for (int j = 1; j <= adlTerms.count(); j++)
                            {
                                openehr.openehr.rm.data_types.text.CODE_PHRASE term = adlTerms.item_for_iteration() as openehr.openehr.rm.data_types.text.CODE_PHRASE;

                                if (term != null)
                                {
                                    TERM_BINDING_ITEM localTerm = new TERM_BINDING_ITEM();

                                    // 1 code string
                                    localTerm.code = adlTerms.key_for_iteration().ToString();

                                    // 1 value CODE_PHRASE (CODE_PHRASE to HASH TABLE)
                                    CODE_PHRASE codePhrase = new CODE_PHRASE();

                                    // 1 code_string string
                                    codePhrase.code_string = term.code_string().ToString();

                                    // 1 terminology_id TERMINOLOGY_ID
                                    if (term.code_string() != null)
                                    {
                                        TERMINOLOGY_ID terminologyId = new TERMINOLOGY_ID();
                                        terminologyId.value       = term.terminology_id().value().ToString();
                                        codePhrase.terminology_id = terminologyId;
                                    }

                                    localTerm.value = codePhrase;
                                    localTerms.Add(localTerm.code, localTerm);
                                }

                                adlTerms.forth();
                            }

                            termBindingSet.items = new TERM_BINDING_ITEM[localTerms.Count];
                            localTerms.Values.CopyTo(termBindingSet.items, 0);
                        }

                        if (termBindingSet.items != null)
                        {
                            termBindingSets.Add(termBindingSet);
                        }

                        currentObject.forth();
                    }
                }
            }

            if (termBindingSets.Count > 0)
            {
                TermBindingSet[] termBindingSetArray = new TermBindingSet[termBindingSets.Count];
                termBindingSets.CopyTo(termBindingSetArray);
                return(termBindingSetArray);
            }
            else
            {
                return(null);
            }
        }