private static TypedLoopNM1 AddClmProvider(TypedLoopCLM clm, int providerID, string entityIdentifier, string providerCode, List <ProviderInfo> provList, string providerCodeQualifier = "ZZ") { var prov = provList.FirstOrDefault(a => a.ProviderId == providerID); if (prov == null) { return(null); } var loop = clm.AddLoop(new TypedLoopNM1(entityIdentifier)); loop.NM102_EntityTypeQualifier = EntityTypeQualifier.Person; if (prov.ProviderTypeId == 1) { loop.NM102_EntityTypeQualifier = EntityTypeQualifier.NonPersonEntity; loop.NM103_NameLastOrOrganizationName = TypeEx.Clean(prov.FullName, 35); } else { loop.NM103_NameLastOrOrganizationName = TypeEx.Clean(prov.LastName); loop.NM104_NameFirst = TypeEx.Clean(prov.FirstName); } loop.NM108_IdCodeQualifier = "XX"; loop.NM109_IdCode = prov.ProviderNPI.ToString(); if (!string.IsNullOrWhiteSpace(prov.SpecialtyCode)) { var clmProvPrv = loop.AddSegment(new TypedSegmentPRV()); //Some business rules wont allow this segment for certain identifiers, hence null check. if (clmProvPrv != null) { clmProvPrv.PRV01_ProviderCode = providerCode; clmProvPrv.PRV02_ReferenceIdQualifier = providerCodeQualifier; clmProvPrv.PRV03_ProviderTaxonomyCode = prov.SpecialtyCode;//system specialty taxonomy code } } return(loop); }
private static TypedLoopNM1 AddClmProvider(TypedLoopCLM clm, ClaimLine claim, string entityIdentifier, string providerCode, string providerCodeQualifier = "ZZ") { var loop = clm.AddLoop(new TypedLoopNM1(entityIdentifier)); loop.NM102_EntityTypeQualifier = EntityTypeQualifier.Person; //if (prov.ProviderTypeId == 1) //{ // loop.NM102_EntityTypeQualifier = EntityTypeQualifier.NonPersonEntity; // loop.NM103_NameLastOrOrganizationName = TypeEx.Clean(prov.FullName, 35); //} //else //{ loop.NM103_NameLastOrOrganizationName = TypeEx.Clean(claim.RenderProvider); loop.NM104_NameFirst = TypeEx.Clean(claim.RenderProvider); //} loop.NM108_IdCodeQualifier = "XX"; loop.NM109_IdCode = claim.RenderNPI.Clean(); return(loop); }