Esempio n. 1
0
        public void ConceptUrn_TryParse_From_Concept_Urn_Ok()
        {
            var urn = "urn:leaf:concept:diag:codeset=ICD9+code=123.42";

            var ok = ConceptUrn.TryParse(urn, out var _);

            Assert.True(ok);
        }
Esempio n. 2
0
 public ConceptPreflightCheckResult ConceptPreflightCheckResult()
 {
     ConceptUrn.TryParse(UniversalId, out var urn);
     return(new ConceptPreflightCheckResult
     {
         Id = Id,
         UniversalId = urn,
         IsPresent = IsPresent,
         IsAuthorized = IsAuthorized
     });
 }
Esempio n. 3
0
 public ConceptRef(string identifier)
 {
     if (Guid.TryParse(identifier, out var guid))
     {
         Id = guid;
     }
     else if (ConceptUrn.TryParse(identifier, out var urn))
     {
         UniversalId = urn;
     }
     else
     {
         throw new FormatException($"Concept identifier {identifier} is not a valid Guid or Urn");
     }
 }
Esempio n. 4
0
 public ConceptRef(ResourceRef res)
 {
     if (res.UseUniversalId() && ConceptUrn.TryParse(res.UniversalId.ToString(), out var urn))
     {
         UniversalId = urn;
     }
     else if (Guid.TryParse(res.Id.ToString(), out var guid))
     {
         Id = guid;
     }
     else
     {
         throw new FormatException($"Resouce reference {res} is not a valid Guid or Urn");
     }
 }
Esempio n. 5
0
        public void ConceptUrn_TryParse_NonConceptUrn_False()
        {
            var urn = $"urn:leaf:query:{Guid.NewGuid()}:12318742";

            Assert.False(ConceptUrn.TryParse(urn, out var _));
        }
Esempio n. 6
0
 public void ConceptUrn_TryParse_EmptyWS_False()
 {
     Assert.False(ConceptUrn.TryParse("", out var _));
 }
Esempio n. 7
0
 public void ConceptUrn_TryParse_Null_False()
 {
     Assert.False(ConceptUrn.TryParse(null, out var _));
 }