Esempio n. 1
0
        public void SetPatientStatus(PatientStatus patientStatus)
        {
            var patientStatusHistory = new PatientStatusHistory()
            {
                Patient       = this,
                EffectiveDate = DateTime.Today,
                Comments      = "New Patient",
                PatientStatus = patientStatus
            };

            this.PatientStatusHistories.Add(patientStatusHistory);
        }
Esempio n. 2
0
        public PatientStatusHistory(PatientStatus patientStatus, DateTime effectiveDate, string comments)
        {
            if (patientStatus == null)
            {
                throw new ArgumentNullException(nameof(patientStatus));
            }

            PatientStatus   = patientStatus;
            PatientStatusId = patientStatus.Id;

            EffectiveDate = effectiveDate;

            Archived = false;
        }
Esempio n. 3
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. 4
0
        public void ChangePatientStatus(PatientStatus patientStatus, DateTime effectiveDate, string comments)
        {
            var newPatientStatusHistory = new PatientStatusHistory(patientStatus, effectiveDate, comments);

            PatientStatusHistories.Add(newPatientStatusHistory);
        }