protected async Task <TResource> GetResourceByIdentityAsync <TResource>(Model.Identifier identifier) where TResource : Model.Resource, new() { EnsureArg.IsNotNull(identifier, nameof(identifier)); string fhirTypeName = ModelInfo.GetFhirTypeNameForType(typeof(TResource)); _ = Enum.TryParse(fhirTypeName, out ResourceType resourceType); Model.Bundle result = await FhirService.SearchForResourceAsync(resourceType, identifier.ToSearchQueryParameter()).ConfigureAwait(false); return(await result.ReadOneFromBundleWithContinuationAsync <TResource>(FhirService)); }