Esempio n. 1
0
 public PatientStatusHistory GetCurrentStatus()
 {
     if (PatientStatusHistories.Count == 0)
     {
         return(null);
     }
     else
     {
         return(PatientStatusHistories.OrderByDescending(psh => psh.EffectiveDate).ThenByDescending(psh => psh.Id).First());
     }
 }
Esempio n. 2
0
        public PatientCondition AddOrUpdatePatientCondition(long id,
                                                            TerminologyMedDra sourceTerm,
                                                            DateTime onsetDate,
                                                            DateTime?outComeDate,
                                                            Outcome outcome,
                                                            TreatmentOutcome treatmentOutcome,
                                                            string caseNumber,
                                                            string comments,
                                                            string conditionSource,
                                                            PatientStatus deceasedStatus)
        {
            PatientCondition patientCondition = null;

            if (id == 0)
            {
                patientCondition = new PatientCondition
                {
                    ConditionSource   = conditionSource,
                    TerminologyMedDra = sourceTerm,
                    OnsetDate         = onsetDate,
                    OutcomeDate       = outComeDate,
                    Outcome           = outcome,
                    TreatmentOutcome  = treatmentOutcome,
                    CaseNumber        = caseNumber,
                    Comments          = comments
                };

                PatientConditions.Add(patientCondition);
            }

            // Has person died
            if (outcome?.Description == "Fatal" && GetCurrentStatus()?.PatientStatus.Description != "Died")
            {
                // set patient status to deceased in patient history
                PatientStatusHistories.Add(new PatientStatusHistory()
                {
                    EffectiveDate = outComeDate ?? DateTime.Now,   //set effective date to  outcome date have set it to  use todays day if null but this will not happen as  autosetToDeceased will only become true when an end date is supplied first
                    Comments      = $"Marked as deceased through Patient Condition ({sourceTerm.DisplayName})",
                    PatientStatus = deceasedStatus
                });
            }

            return(patientCondition);
        }
Esempio n. 3
0
        public void ChangePatientStatus(PatientStatus patientStatus, DateTime effectiveDate, string comments)
        {
            var newPatientStatusHistory = new PatientStatusHistory(patientStatus, effectiveDate, comments);

            PatientStatusHistories.Add(newPatientStatusHistory);
        }