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); }
public ConceptPreflightCheckResult ConceptPreflightCheckResult() { ConceptUrn.TryParse(UniversalId, out var urn); return(new ConceptPreflightCheckResult { Id = Id, UniversalId = urn, IsPresent = IsPresent, IsAuthorized = IsAuthorized }); }
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"); } }
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"); } }
public void ConceptUrn_TryParse_NonConceptUrn_False() { var urn = $"urn:leaf:query:{Guid.NewGuid()}:12318742"; Assert.False(ConceptUrn.TryParse(urn, out var _)); }
public void ConceptUrn_TryParse_EmptyWS_False() { Assert.False(ConceptUrn.TryParse("", out var _)); }
public void ConceptUrn_TryParse_Null_False() { Assert.False(ConceptUrn.TryParse(null, out var _)); }