예제 #1
0
파일: Patient.cs 프로젝트: MSH/PViMS-2
 private Boolean CheckMedicationStartDateWithNoEndDateBeforeStart(int conceptId, DateTime startDate, long patientMedicationId)
 {
     if (patientMedicationId > 0)
     {
         return(PatientMedications
                .OrderBy(pc => pc.StartDate)
                .Where(pc => pc.Id != patientMedicationId &&
                       pc.Concept?.Id == conceptId &&
                       startDate < pc.StartDate &&
                       pc.Archived == false)
                .Any());
     }
     else
     {
         return(PatientMedications
                .OrderBy(pc => pc.StartDate)
                .Where(pc => pc.Concept?.Id == conceptId &&
                       startDate < pc.StartDate &&
                       pc.Archived == false)
                .Any());
     }
 }
예제 #2
0
파일: Patient.cs 프로젝트: MSH/PViMS-2
 private Boolean CheckMedicationEndDateWithinRange(int conceptId, DateTime endDate, long patientMedicationId)
 {
     if (patientMedicationId > 0)
     {
         return(PatientMedications
                .OrderBy(pc => pc.StartDate)
                .Where(pc => pc.Id != patientMedicationId &&
                       pc.Concept?.Id == conceptId &&
                       endDate >= pc.StartDate &&
                       endDate <= pc.EndDate &&
                       pc.Archived == false)
                .Any());
     }
     else
     {
         return(PatientMedications
                .OrderBy(pc => pc.StartDate)
                .Where(pc => pc.Concept?.Id == conceptId &&
                       endDate >= pc.StartDate &&
                       endDate <= pc.EndDate &&
                       pc.Archived == false)
                .Any());
     }
 }