Ejemplo n.º 1
0
        private static void FindConceptById()
        {
            Console.WriteLine("\nFinding concept by SCT ID...");
            Console.WriteLine("\nEnter SCT ID of concept:");

            try
            {
                long sctId = long.Parse(ReadLineFromConsole());

                DataSource.PrintDatabaseDetails();
                Concept concept = ConceptFinder.FindById(sctId);
                if (concept != null)
                {
                    Console.WriteLine(concept);
                }
                else
                {
                    Console.WriteLine("No concept found with SCT ID " + sctId.ToString());
                }
            }
            catch
            {
                Console.WriteLine("Invalid SCT ID!");
            }
        }
Ejemplo n.º 2
0
        private static void FindConceptByTerm()
        {
            Console.WriteLine("\nFinding concept by term...");
            Console.WriteLine("\nEnter partial term:");

            string term = ReadLineFromConsole();

            DataSource.PrintDatabaseDetails();
            List <Concept> concepts = ConceptFinder.FindByTerm(term);

            PrintConcepts(concepts);
        }
Ejemplo n.º 3
0
 private static void ListAllRefsetMembers()
 {
     Console.WriteLine("\nListing all members of a refset...");
     Console.WriteLine("\nEnter SCT ID of refset:");
     try
     {
         long sctId = long.Parse(ReadLineFromConsole());
         DataSource.PrintDatabaseDetails();
         List <Concept> concepts = ConceptFinder.FindRefsetMembers(sctId);
         PrintConcepts(concepts);
     }
     catch
     {
         Console.WriteLine("Invalid SCT ID!");
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Add a new refset membership for this concept.
        /// This is not persisted to the database.
        ///<param name="refsetSctId">The SCTID of the reference set this concept belongs to</param>
        /// <throws>RuntimeException if the parameters are not valid (existing) concept ids (SCTIDs).</throws>
        /// </summary>
        public void AddRefsetMembership(long refsetSctId)
        {
            Concept refsetConcept = ConceptFinder.FindById(refsetSctId);

            if (refsetConcept == null)
            {
                throw new Exception(
                          "Invalid refset membership. Unknown or inactive refset concept: " + refsetSctId);
            }

            RefsetMember member = new RefsetMember();

            member.SetReferencedConcept(this);
            member.SetRefsetConcept(refsetConcept);
            refsetMemberships.Add(member);
        }