public QueryPreflightCheckDTO(PreflightQueries queries) { Ok = queries.Ok; Results = queries.Results.Select(r => new QueryPreflightCheckResultDTO(r)); }
public void DirectQueries_Should_Return_MatchingSet() { var first = new QueryRef { UniversalId = QueryUrn.From("urn:leaf:query:d7359679-df0d-4604-a2d9-1d3d04417dc2:123456") }; var second = new QueryRef { UniversalId = QueryUrn.From("urn:leaf:query:d7359668-df0d-4604-a2d9-1d3d04417dc2:563423") }; var direct = new QueryRef[] { first, second }; var qpc = new PreflightQueries { Results = new QueryPreflightCheckResult[] { new QueryPreflightCheckResult { QueryRef = first, IsPresent = true, IsAuthorized = true, ConceptCheck = new ConceptPreflightCheck { Results = new ConceptPreflightCheckResult[] { new ConceptPreflightCheckResult { Id = Guid.NewGuid(), UniversalId = ConceptUrn.From("urn:leaf:concept:diag:codeset=ICD9+code=123.42"), IsPresent = true, IsAuthorized = true }, new ConceptPreflightCheckResult { Id = Guid.NewGuid(), UniversalId = ConceptUrn.From("urn:leaf:concept:diag:codeset=ICD9+code=123.45"), IsPresent = true, IsAuthorized = true } } } }, new QueryPreflightCheckResult { QueryRef = second, IsPresent = true, IsAuthorized = true, ConceptCheck = new ConceptPreflightCheck { Results = new ConceptPreflightCheckResult[] { new ConceptPreflightCheckResult { Id = Guid.NewGuid(), UniversalId = ConceptUrn.From("urn:leaf:concept:diag:codeset=ICD9+code=123.41"), IsPresent = true, IsAuthorized = true }, new ConceptPreflightCheckResult { Id = Guid.NewGuid(), UniversalId = ConceptUrn.From("urn:leaf:concept:diag:codeset=ICD9+code=123.50"), IsPresent = true, IsAuthorized = true } } } } } }; var results = qpc.DirectQueries(direct); Assert.True(results.Count() == 2); Assert.Equal(direct, results, new QueryRefEqualityComparer()); }