private static void TryGetEDIPI(PatientPerson person, Entity ent, Logger Logger) { try { if (person.CorrespondingIdList == null || !person.CorrespondingIdList.Any()) { ent.Attributes.Add("crme_edipi", string.Empty); } else { CorrespondingIDs correspondingIDs = person.CorrespondingIdList.FirstOrDefault((CorrespondingIDs v) => v.AssigningAuthority != null && v.AssigningAuthority.Equals("USDOD", StringComparison.InvariantCultureIgnoreCase) && v.AssigningFacility != null && v.AssigningFacility == "200DOD" && v.IdentifierType != null && v.IdentifierType.Equals("NI", StringComparison.InvariantCultureIgnoreCase)) ?? person.CorrespondingIdList.FirstOrDefault((CorrespondingIDs v) => v.AssigningAuthority != null && v.AssigningAuthority.Equals("USDOD", StringComparison.InvariantCultureIgnoreCase) && v.IdentifierType != null && v.IdentifierType.Equals("NI", StringComparison.InvariantCultureIgnoreCase)); ent.Attributes.Add("crme_edipi", ((correspondingIDs != null) ? correspondingIDs.PatientIdentifier : string.Empty)); } } catch (ArgumentNullException ex) { Logger.WriteToFile("ERROR::Unable to Get EDIPI due to: {0}".Replace("{0}", ex.Message)); throw new InvalidPluginExecutionException("Unable to Get EDIPI due to: {0}".Replace("{0}", ex.Message)); } catch (FaultException <OrganizationServiceFault> ex2) { Logger.WriteToFile("ERROR::Unable to Get EDIPI due to: {0}".Replace("{0}", ex2.Message)); throw new InvalidPluginExecutionException("Unable to Get EDIPI due to: {0}".Replace("{0}", ex2.Message)); } catch (NullReferenceException ex3) { Logger.WriteToFile("ERROR::Unable to Get EDIPI due to: {0}".Replace("{0}", ex3.Message)); throw new InvalidPluginExecutionException("Unable to Get EDIPI due to: {0}".Replace("{0}", ex3.Message)); } catch (Exception ex4) { Logger.WriteToFile("ERROR::Unable to Get EDIPI due to: {0}".Replace("{0}", ex4.Message)); throw new InvalidPluginExecutionException("Unable to Get EDIPI due to: {0}".Replace("{0}", ex4.Message)); } }
public static string TryGetICN(PatientPerson person, Logger Logger) { try { if (person.CorrespondingIdList == null || !person.CorrespondingIdList.Any()) { return(string.Empty); } CorrespondingIDs correspondingIDs = person.CorrespondingIdList.FirstOrDefault((CorrespondingIDs v) => v.AssigningAuthority != null && v.AssigningAuthority.Equals("USVHA", StringComparison.InvariantCultureIgnoreCase) && v.AssigningFacility != null && v.AssigningFacility == "200M" && v.IdentifierType != null && v.IdentifierType.Equals("NI", StringComparison.InvariantCultureIgnoreCase)) ?? person.CorrespondingIdList.FirstOrDefault((CorrespondingIDs v) => v.AssigningAuthority != null && v.AssigningAuthority.Equals("USVHA", StringComparison.InvariantCultureIgnoreCase) && v.IdentifierType != null && v.IdentifierType.Equals("PI", StringComparison.InvariantCultureIgnoreCase)); return((correspondingIDs != null) ? correspondingIDs.PatientIdentifier : string.Empty); } catch (ArgumentNullException ex) { Logger.WriteToFile("ERROR::Unable to Get MVI Query Params due to: {0}".Replace("{0}", ex.Message)); throw new InvalidPluginExecutionException("Unable to Get MVI Query Params due to: {0}".Replace("{0}", ex.Message)); } catch (FaultException <OrganizationServiceFault> ex2) { Logger.WriteToFile("ERROR::Unable to Get MVI Query Params due to: {0}".Replace("{0}", ex2.Message)); throw new InvalidPluginExecutionException("Unable to Get MVI Query Params due to: {0}".Replace("{0}", ex2.Message)); } catch (NullReferenceException ex3) { Logger.WriteToFile("ERROR::Unable to Get MVI Query Params due to: {0}".Replace("{0}", ex3.Message)); throw new InvalidPluginExecutionException("Unable to Get MVI Query Params due to: {0}".Replace("{0}", ex3.Message)); } catch (Exception ex4) { Logger.WriteToFile("ERROR::Unable to Get MVI Query Params due to: {0}".Replace("{0}", ex4.Message)); throw new InvalidPluginExecutionException("Unable to Get MVI Query Params due to: {0}".Replace("{0}", ex4.Message)); } }
private static void getMVICorpPidBIRLSFN(this PatientPerson patient, Logger logger, Entity ent, VeisConfig config) { SelectedPersonRequest selectedPersonRequest = new SelectedPersonRequest(); selectedPersonRequest.OrganizationName = config.OrgName; selectedPersonRequest.UserId = config.UserId; selectedPersonRequest.MessageId = Guid.NewGuid().ToString(); //selectedPersonRequest.Debug = false; selectedPersonRequest.LogSoap = config.LogSoap; selectedPersonRequest.LogTiming = config.LogTimer; //selectedPersonRequest.noAddPerson = false; //selectedPersonRequest.ICN = newPerson.crme_ICN; CorrespondingIdsResponse correspondingIdsResponse = WebApiUtility.SendReceiveVeisRequest <CorrespondingIdsResponse>(config, "SelectedPerson", selectedPersonRequest); if (correspondingIdsResponse.ExceptionOccured) { logger.WriteDebugMessage($"ERROR::VBASensitivityCheck: Search Exception Message: {correspondingIdsResponse.RawMviExceptionMessage}"); } try { if (correspondingIdsResponse.CorrespondingIdList == null || !correspondingIdsResponse.CorrespondingIdList.Any()) { logger.WriteDebugMessage("DEBUG::VBASensitivityCheck: No Correlations Returned in getMVICorpPidBIRLSFN()"); } else { CorrespondingIDs correspondingIDs = correspondingIdsResponse.CorrespondingIdList.FirstOrDefault((CorrespondingIDs v) => v.AssigningAuthority != null && v.AssigningAuthority.Equals("USVBA", StringComparison.InvariantCultureIgnoreCase) && v.AssigningFacility != null && v.AssigningFacility == "200CORP" && v.IdentifierType != null && v.IdentifierType.Equals("PI", StringComparison.InvariantCultureIgnoreCase)) ?? correspondingIdsResponse.CorrespondingIdList.FirstOrDefault((CorrespondingIDs v) => v.AssigningAuthority != null && v.AssigningAuthority.Equals("USVBA", StringComparison.InvariantCultureIgnoreCase) && v.IdentifierType != null && v.IdentifierType.Equals("PI", StringComparison.InvariantCultureIgnoreCase)); ent.Attributes.Add("crme_participantid", ((correspondingIDs != null) ? correspondingIDs.PatientIdentifier : string.Empty)); CorrespondingIDs correspondingIDs2 = correspondingIdsResponse.CorrespondingIdList.FirstOrDefault((CorrespondingIDs v) => v.AssigningAuthority != null && v.AssigningAuthority.Equals("USVBA", StringComparison.InvariantCultureIgnoreCase) && v.AssigningFacility != null && v.AssigningFacility == "200BRLS" && v.IdentifierType != null && v.IdentifierType.Equals("PI", StringComparison.InvariantCultureIgnoreCase)) ?? correspondingIdsResponse.CorrespondingIdList.FirstOrDefault((CorrespondingIDs v) => v.AssigningAuthority != null && v.AssigningAuthority.Equals("USVBA", StringComparison.InvariantCultureIgnoreCase) && v.IdentifierType != null && v.IdentifierType.Equals("PI", StringComparison.InvariantCultureIgnoreCase)); ent.Attributes.Add("crme_filenumber", ((correspondingIDs2 != null) ? correspondingIDs2.PatientIdentifier : string.Empty)); CorrespondingIDs correspondingIDs3 = correspondingIdsResponse.CorrespondingIdList.FirstOrDefault((CorrespondingIDs v) => v.AssigningAuthority != null && v.AssigningAuthority.Equals("USDOD", StringComparison.InvariantCultureIgnoreCase) && v.AssigningFacility != null && v.AssigningFacility == "200DOD" && v.IdentifierType != null && v.IdentifierType.Equals("NI", StringComparison.InvariantCultureIgnoreCase)) ?? correspondingIdsResponse.CorrespondingIdList.FirstOrDefault((CorrespondingIDs v) => v.AssigningAuthority != null && v.AssigningAuthority.Equals("USDOD", StringComparison.InvariantCultureIgnoreCase) && v.IdentifierType != null && v.IdentifierType.Equals("NI", StringComparison.InvariantCultureIgnoreCase)); ent.Attributes.Add("crme_edipi", ((correspondingIDs3 != null) ? correspondingIDs3.PatientIdentifier : string.Empty)); logger.WriteDebugMessage($"DEBUG::VBASensitivityCheck: Response Success for PId: {correspondingIDs.PatientIdentifier}, FileNumber: {correspondingIDs2.PatientIdentifier}, EDIPI: {correspondingIDs3.PatientIdentifier} "); } } catch (Exception) { logger.WriteDebugMessage("ERROR::VBASensitivityCheck: Error in getMVICorpPidBIRLSFN()"); } }