Beispiel #1
0
        /// <summary>
        /// <ul>Creates a formatted string containing all the details of the concept, namely:</ul>
        /// <li>The SCT ID</li>
        /// <li>Each of the descriptions (should only be active)</li>
        /// <li>For each description, identifies the ADRS Preferred and Acceptable terms</li>
        /// <li>Each refset membership this concept participates in </li>
        /// </summary>
        public override string ToString()
        {
            var result = new StringBuilder();

            result.Append("SCT ID ").Append(sctId).Append("\n");

            foreach (KeyValuePair <string, Metadata.LanguageAcceptability> kvp in descriptions)
            {
                result.Append("\t").Append(kvp.Key);
                Metadata.LanguageAcceptability acceptability = descriptions[kvp.Key];
                if (!acceptability.Equals(Metadata.LanguageAcceptability.NONE))
                {
                    result.Append(" [EN-AU ").Append(acceptability).Append(" TERM]");
                }
                result.Append("\n");
            }

            foreach (RefsetMember membership in refsetMemberships)
            {
                result.Append("\t\t Is member of refset '").Append(membership.GetRefsetConcept().GetPreferredTerm());
                result.Append("'\n");
            }
            result.Append("\n");
            return(result.ToString());
        }
Beispiel #2
0
 /// <summary>
 /// <returns>The most preferable description for this concept. This is defined by the Australia Dialect Reference Set (ADRS).</returns>
 /// </summary>
 public string GetPreferredTerm()
 {
     foreach (KeyValuePair <string, Metadata.LanguageAcceptability> kvp in descriptions)
     {
         Metadata.LanguageAcceptability acceptability = descriptions[kvp.Key];
         if (acceptability.Equals(Metadata.LanguageAcceptability.PREFERRED))
         {
             return(kvp.Key);
         }
     }
     // If term with preferred acceptability not found then just return the first description
     // which by the ordering in the db query should give us the latest term
     // (alternatively we could have continued looking for an ACCEPTABLE term)
     return(descriptions.First().Key);
 }