예제 #1
0
        public void ChangeDetails(DateTime testDate, string testResult, LabTestUnit testUnit, string labValue, string referenceLower, string referenceUpper)
        {
            TestDate   = testDate;
            TestResult = testResult;

            if (testUnit != null)
            {
                TestUnitId = testUnit.Id;
                TestUnit   = testUnit;
            }

            LabValue       = labValue;
            ReferenceLower = referenceLower;
            ReferenceUpper = referenceUpper;
        }
예제 #2
0
        public PatientLabTest(DateTime testDate, string testResult, LabTest labTest, LabTestUnit testUnit, string labValue, string referenceLower, string referenceUpper, string labTestSource)
        {
            PatientLabTestGuid = Guid.NewGuid();
            Archived           = false;

            TestDate   = testDate;
            TestResult = testResult;
            LabTestId  = labTest.Id;
            LabTest    = labTest;

            if (testUnit != null)
            {
                TestUnitId = testUnit.Id;
                TestUnit   = testUnit;
            }

            LabValue       = labValue;
            ReferenceLower = referenceLower;
            ReferenceUpper = referenceUpper;
            LabTestSource  = labTestSource;
        }
예제 #3
0
파일: Patient.cs 프로젝트: MSH/PViMS-2
        public void ChangeLabTestDetails(int patientLabTestId, DateTime testDate, string testResult, LabTestUnit testUnit, string labValue, string referenceLower, string referenceUpper)
        {
            var patientLabTest = PatientLabTests.SingleOrDefault(t => t.Id == patientLabTestId);

            if (patientLabTest == null)
            {
                throw new KeyNotFoundException($"Unable to locate lab test {patientLabTestId} on patient {Id}");
            }

            if (DateOfBirth.HasValue)
            {
                if (testDate.Date < DateOfBirth.Value.Date)
                {
                    throw new DomainException("Test Date should be after patient Date Of Birth");
                }
            }

            patientLabTest.ChangeDetails(testDate, testResult, testUnit, labValue, referenceLower, referenceUpper);
        }
예제 #4
0
파일: Patient.cs 프로젝트: MSH/PViMS-2
        public PatientLabTest AddLabTest(DateTime testDate, string testResult, LabTest labTest, LabTestUnit testUnit, string labValue, string referenceLower, string referenceUpper)
        {
            if (DateOfBirth.HasValue)
            {
                if (testDate.Date < DateOfBirth.Value.Date)
                {
                    throw new DomainException("Test Date should be after patient Date Of Birth");
                }
            }

            var newPatientLabTest = new PatientLabTest(testDate, testResult, labTest, testUnit, labValue, referenceLower, referenceUpper, labTest.Description);

            PatientLabTests.Add(newPatientLabTest);
            return(newPatientLabTest);
        }