示例#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());
     }
 }