/// <summary> /// Convert <paramref name="data"/> to a FHIR resource /// </summary> /// <typeparam name="TModel">The type of model</typeparam> /// <param name="data">The data to be converted</param> /// <returns>The converted resource</returns> private Resource ConvertToResource <TModel>(TModel data) { var mapper = FhirResourceHandlerUtil.GetMapperForInstance(data); if (mapper == null) { throw new InvalidOperationException("Cannot determine how to convert resource for notification"); } return(mapper.MapToFhir(data as IdentifiedData)); }