Пример #1
0
        private void CalculateHematologyTestConducted()
        {
            _hemPatientsRequiringOneSymptomDirectedTest = (HemTestProtocol.SymptomDirectedAmt / 100d);
            _hemRepeatsduetoClinicianRequest = (HemTestProtocol.TestReapeated / 100d);
            _hemAdditionalTestsDuetoWastage = (InvAssumption.Himatology / 100d);

            for (int i = 1; i <= 12; i++)
            {
                MOutputHematology hemout = new MOutputHematology();
                hemout.Month = i;
                foreach (ProtocolPanel panel in HemTestProtocol.ProtocolPanels)
                {

                    hemout.ExistingAdultPatientsinTreatment +=CalculatedPatientNos[i].ArtAdultPreExistingPatients * panel.AdultInTreatmentDistribution;
                    hemout.ExistingPedPatientsinTreatment += CalculatedPatientNos[i].ArtPediatricPreExistingPatients * panel.PediatricInTreatmentDistribution; // ((pediatricsinTreatment / 12)*preExistingPatientsonPanel);
                    hemout.ExistingAdultPatientsinPreArt += CalculatedPatientNos[i].PreArtAdultPreExistingPatients * panel.AdultPreARTDistribution;  // ((adultspreART / 12)*preExistingPatientsonPanel);
                    hemout.ExistingPedPatientsinTreatment += CalculatedPatientNos[i].PreArtPediatricPreExistingPatients * panel.PediatricPreARTDistribution; // ((pediatricspreART / 12)*preExistingPatientsonPanel);

                    for (int x = 1; x <= i; x++)
                    {
                        hemout.NewAdultPatientstoTreatment += CalculatedPatientNos[i].GetArtAdultPatientsEntering(x) * panel.AdultArtTestGivenInMonth((i - x) + 1) * (panel.AITNewPatient/100d);
                        hemout.NewPedPatientstoTreatment += CalculatedPatientNos[i].GetArtPediatricPatientsEntering(x) * panel.PediatricArtTestGivenInMonth((i - x) + 1) * (panel.PITNewPatient/100d);
                        hemout.NewAdultPatientstoPreArt += CalculatedPatientNos[i].GetPreArtAdultPatientsEntering(x) * panel.AdultPreArtTestGivenInMonth((i - x) + 1) * (panel.APARTNewPatient/100d);
                        hemout.NewPedPatientstoPreArt += CalculatedPatientNos[i].GetPreArtPediatricPatientsEntering(x) * panel.PediatricPreArtTestGivenInMonth((i - x) + 1) * (panel.PPARTNewPatient/100d);
                    }
                }
                _hemMonthlyOutputs.Add(i, hemout);
            }
            double patientEnterPerMonth = 0;
            double symptomDirectedTestsAtstartYear = CurrentAdultinTreatment + CurrentPediatricinTreatment + CurrentAdultinPreArt + CurrentPediatricinPreArt;
            symptomDirectedTestsAtstartYear = (symptomDirectedTestsAtstartYear * _hemPatientsRequiringOneSymptomDirectedTest) / 12d;

            int pmonth, buffmonth;
            for (int i = 1; i <= 12; i++)
            {
                patientEnterPerMonth = CalculatedPatientNos[i].GetArtAdultPatientsEntering(i) + CalculatedPatientNos[i].GetArtPediatricPatientsEntering(i);
                patientEnterPerMonth += CalculatedPatientNos[i].GetPreArtAdultPatientsEntering(i) + CalculatedPatientNos[i].GetPreArtPediatricPatientsEntering(i);
                patientEnterPerMonth = (patientEnterPerMonth * _hemPatientsRequiringOneSymptomDirectedTest) / 12d;

                _hemMonthlyOutputs[i].SymptomDirectedTests += symptomDirectedTestsAtstartYear + patientEnterPerMonth;

                for (int x = i + 1; x <= 12; x++)
                {
                    _hemMonthlyOutputs[x].SymptomDirectedTests += patientEnterPerMonth;
                }

                _hemMonthlyOutputs[i].RepeatDuetoClinicianRequest = (_hemMonthlyOutputs[i].TestFromProtocols() * _hemRepeatsduetoClinicianRequest) + (_hemMonthlyOutputs[i].SymptomDirectedTests * _hemRepeatsduetoClinicianRequest);

                pmonth = buffmonth = 0;
                if (i >= PeriodInfo.FirstMonth && i <= PeriodInfo.LastMonth)
                    pmonth = 1;
                if (i >= PeriodInfo.BeginsOnmonth && i <= PeriodInfo.EndOnMonth)
                    buffmonth = 1;

                _hemMonthlyOutputs[i].TestsBasedonProtocols = _hemMonthlyOutputs[i].TotalTestConducted() * pmonth;
                _hemMonthlyOutputs[i].TestsforBufferStock = _hemMonthlyOutputs[i].TotalTestConducted() * buffmonth;

                _hemMonthlyOutputs[i].AdditionalTestsdueToWastage = (_hemMonthlyOutputs[i].TestsBasedonProtocols / (1 - _hemAdditionalTestsDuetoWastage)) - _hemMonthlyOutputs[i].TestsBasedonProtocols;
                _hemMonthlyOutputs[i].AdditionalTestsdueToWastageForBuffer = (_hemMonthlyOutputs[i].TestsforBufferStock / (1 - _hemAdditionalTestsDuetoWastage)) - _hemMonthlyOutputs[i].TestsforBufferStock;
            }
        }
Пример #2
0
        private void CalculateHematologyTestConducted()
        {
            _hemPatientsRequiringOneSymptomDirectedTest = (HemTestProtocol.SymptomDirectedAmt / 100d);
            _hemRepeatsduetoClinicianRequest            = (HemTestProtocol.TestReapeated / 100d);
            _hemAdditionalTestsDuetoWastage             = (InvAssumption.Himatology / 100d);

            for (int i = 1; i <= 12; i++)
            {
                MOutputHematology hemout = new MOutputHematology();
                hemout.Month = i;
                foreach (ProtocolPanel panel in HemTestProtocol.ProtocolPanels)
                {
                    hemout.ExistingAdultPatientsinTreatment += CalculatedPatientNos[i].ArtAdultPreExistingPatients * panel.AdultInTreatmentDistribution;
                    hemout.ExistingPedPatientsinTreatment   += CalculatedPatientNos[i].ArtPediatricPreExistingPatients * panel.PediatricInTreatmentDistribution; // ((pediatricsinTreatment / 12)*preExistingPatientsonPanel);
                    hemout.ExistingAdultPatientsinPreArt    += CalculatedPatientNos[i].PreArtAdultPreExistingPatients * panel.AdultPreARTDistribution;           // ((adultspreART / 12)*preExistingPatientsonPanel);
                    hemout.ExistingPedPatientsinTreatment   += CalculatedPatientNos[i].PreArtPediatricPreExistingPatients * panel.PediatricPreARTDistribution;   // ((pediatricspreART / 12)*preExistingPatientsonPanel);

                    for (int x = 1; x <= i; x++)
                    {
                        hemout.NewAdultPatientstoTreatment += CalculatedPatientNos[i].GetArtAdultPatientsEntering(x) * panel.AdultArtTestGivenInMonth((i - x) + 1) * (panel.AITNewPatient / 100d);
                        hemout.NewPedPatientstoTreatment   += CalculatedPatientNos[i].GetArtPediatricPatientsEntering(x) * panel.PediatricArtTestGivenInMonth((i - x) + 1) * (panel.PITNewPatient / 100d);
                        hemout.NewAdultPatientstoPreArt    += CalculatedPatientNos[i].GetPreArtAdultPatientsEntering(x) * panel.AdultPreArtTestGivenInMonth((i - x) + 1) * (panel.APARTNewPatient / 100d);
                        hemout.NewPedPatientstoPreArt      += CalculatedPatientNos[i].GetPreArtPediatricPatientsEntering(x) * panel.PediatricPreArtTestGivenInMonth((i - x) + 1) * (panel.PPARTNewPatient / 100d);
                    }
                }
                _hemMonthlyOutputs.Add(i, hemout);
            }
            double patientEnterPerMonth            = 0;
            double symptomDirectedTestsAtstartYear = CurrentAdultinTreatment + CurrentPediatricinTreatment + CurrentAdultinPreArt + CurrentPediatricinPreArt;

            symptomDirectedTestsAtstartYear = (symptomDirectedTestsAtstartYear * _hemPatientsRequiringOneSymptomDirectedTest) / 12d;

            int pmonth, buffmonth;

            for (int i = 1; i <= 12; i++)
            {
                patientEnterPerMonth  = CalculatedPatientNos[i].GetArtAdultPatientsEntering(i) + CalculatedPatientNos[i].GetArtPediatricPatientsEntering(i);
                patientEnterPerMonth += CalculatedPatientNos[i].GetPreArtAdultPatientsEntering(i) + CalculatedPatientNos[i].GetPreArtPediatricPatientsEntering(i);
                patientEnterPerMonth  = (patientEnterPerMonth * _hemPatientsRequiringOneSymptomDirectedTest) / 12d;

                _hemMonthlyOutputs[i].SymptomDirectedTests += symptomDirectedTestsAtstartYear + patientEnterPerMonth;

                for (int x = i + 1; x <= 12; x++)
                {
                    _hemMonthlyOutputs[x].SymptomDirectedTests += patientEnterPerMonth;
                }

                _hemMonthlyOutputs[i].RepeatDuetoClinicianRequest = (_hemMonthlyOutputs[i].TestFromProtocols() * _hemRepeatsduetoClinicianRequest) + (_hemMonthlyOutputs[i].SymptomDirectedTests * _hemRepeatsduetoClinicianRequest);

                pmonth = buffmonth = 0;
                if (i >= PeriodInfo.FirstMonth && i <= PeriodInfo.LastMonth)
                {
                    pmonth = 1;
                }
                if (i >= PeriodInfo.BeginsOnmonth && i <= PeriodInfo.EndOnMonth)
                {
                    buffmonth = 1;
                }

                _hemMonthlyOutputs[i].TestsBasedonProtocols = _hemMonthlyOutputs[i].TotalTestConducted() * pmonth;
                _hemMonthlyOutputs[i].TestsforBufferStock   = _hemMonthlyOutputs[i].TotalTestConducted() * buffmonth;

                _hemMonthlyOutputs[i].AdditionalTestsdueToWastage          = (_hemMonthlyOutputs[i].TestsBasedonProtocols / (1 - _hemAdditionalTestsDuetoWastage)) - _hemMonthlyOutputs[i].TestsBasedonProtocols;
                _hemMonthlyOutputs[i].AdditionalTestsdueToWastageForBuffer = (_hemMonthlyOutputs[i].TestsforBufferStock / (1 - _hemAdditionalTestsDuetoWastage)) - _hemMonthlyOutputs[i].TestsforBufferStock;
            }
        }