Exemplo n.º 1
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);
        }
Exemplo n.º 2
0
        public void ChangePatientStatus(PatientStatus patientStatus, DateTime effectiveDate, string comments)
        {
            var newPatientStatusHistory = new PatientStatusHistory(patientStatus, effectiveDate, comments);

            PatientStatusHistories.Add(newPatientStatusHistory);
        }