///<summary></summary> public static long Insert(PatientLink patientLink) { if (RemotingClient.RemotingRole == RemotingRole.ClientWeb) { patientLink.PatientLinkNum = Meth.GetLong(MethodBase.GetCurrentMethod(), patientLink); return(patientLink.PatientLinkNum); } return(Crud.PatientLinkCrud.Insert(patientLink)); }
///<summary>Returns true if this patient has been merged into another patient, and no other patient has merged into this patient after the ///original merge.</summary> public static bool WasPatientMerged(long patNum, List <PatientLink> listMergeLinks = null) { //No need to check RemotingRole; no call to db. listMergeLinks = listMergeLinks ?? GetLinks(patNum, PatientLinkType.Merge); PatientLink mergeLink = listMergeLinks.OrderBy(x => x.DateTimeLink).LastOrDefault(x => x.PatNumFrom == patNum); if (mergeLink == null) { return(false); //This patient has never been merged into another patient. } if (listMergeLinks.Any(x => x.PatNumTo == patNum && x.DateTimeLink > mergeLink.DateTimeLink)) { return(false); //After our patient was merged into another patient, a different patient was merged into our patient. Our patient is no longer //considered a "merged" patient. } return(true); //This patient has been merged into another patient. }