Exemple #1
0
        private void CalculateCD4TestConducted()
        {
            _cd4AdultToFollowUpAfterDiagnosis     = 1 - (ArtSite.AdultDepartWoutFollowup / 100d);
            _cd4PediatricToFollowUpAfterDiagnosis = 1 - (ArtSite.PediatricDepartWoutFollowup / 100d);
            _cd4ThoseFollowUpToReciveCD4          = (ArtSite.DiagnosesReceiveCD4 / 100d);

            _patientsRequiringOneSymptomDirectedTest = (CD4TestProtocol.SymptomDirectedAmt / 100d);
            _cd4RepeatsduetoClinicianRequest         = (CD4TestProtocol.TestReapeated / 100d);
            _cdAdditionalTestsDuetoWastage           = (InvAssumption.CD4 / 100d);

            if (CD4TestProtocol.ProtocolPanels.Count > 0)
            {
                _cd4Panel = (ProtocolPanel)CD4TestProtocol.ProtocolPanels[0];
            }
            else
            {
                _cd4Panel = new ProtocolPanel();
            }

            for (int i = 1; i <= 12; i++)
            {
                MOutputCD4 cd4out = new MOutputCD4();
                cd4out.Month = i;
                cd4out.AdultReceivingCD4Test = RapidTestOutputs[i].AdultsPositiveDiagnoses * _cd4AdultToFollowUpAfterDiagnosis * _cd4ThoseFollowUpToReciveCD4;
                cd4out.PedReceivingCD4Test   = RapidTestOutputs[i].PediatricsPositiveDiagnoses * _cd4PediatricToFollowUpAfterDiagnosis * _cd4ThoseFollowUpToReciveCD4;

                cd4out.ExistingAdultPatientsinTreatment = CalculatedPatientNos[i].ArtAdultPreExistingPatients * (_cd4Panel.AITTestperYear / 12d);
                cd4out.ExistingPedPatientsinTreatment   = CalculatedPatientNos[i].ArtPediatricPreExistingPatients * (_cd4Panel.PITTestperYear / 12d);
                cd4out.ExistingAdultPatientsinPreArt    = CalculatedPatientNos[i].PreArtAdultPreExistingPatients * (_cd4Panel.APARTestperYear / 12d);
                cd4out.ExistingPedPatientsinPreArt      = CalculatedPatientNos[i].PreArtPediatricPreExistingPatients * (_cd4Panel.PPARTTestperYear / 12d);

                for (int x = 1, y = i; x <= i; x++, y--)
                {
                    cd4out.NewAdultPatientstoTreatment += CalculatedPatientNos[i].GetArtAdultPatientsEntering(x) * _cd4Panel.AdultArtTestGivenInMonth(y);
                    cd4out.NewPedPatientstoTreatment   += CalculatedPatientNos[i].GetArtPediatricPatientsEntering(x) * _cd4Panel.PediatricArtTestGivenInMonth(y);
                    cd4out.NewAdultPatientstoPreArt    += CalculatedPatientNos[i].GetPreArtAdultPatientsEntering(x) * _cd4Panel.AdultPreArtTestGivenInMonth(y);
                    cd4out.NewPedPatientstoPreArt      += CalculatedPatientNos[i].GetPreArtPediatricPatientsEntering(x) * _cd4Panel.PediatricPreArtTestGivenInMonth(y);
                }

                _cd4MonthlyOutputs.Add(i, cd4out);
            }

            double patientEnterPerMonth            = 0;
            double symptomDirectedTestsAtstartYear = CurrentAdultinTreatment + CurrentPediatricinTreatment + CurrentAdultinPreArt + CurrentPediatricinPreArt;

            symptomDirectedTestsAtstartYear = (symptomDirectedTestsAtstartYear * _patientsRequiringOneSymptomDirectedTest) / 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 * _patientsRequiringOneSymptomDirectedTest) / 12d;

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

                for (int x = i + 1; x <= 12; x++)
                {
                    _cd4MonthlyOutputs[x].SymptomDirectedTests += patientEnterPerMonth;
                }
                double v1, v2;
                v1 = _cd4MonthlyOutputs[i].TotalReceivingCD4Test();
                v2 = _cd4MonthlyOutputs[i].TestFromProtocols();

                _cd4MonthlyOutputs[i].RepeatDuetoClinicianRequest = (_cd4MonthlyOutputs[i].TotalReceivingCD4Test() + _cd4MonthlyOutputs[i].TestFromProtocols() + _cd4MonthlyOutputs[i].SymptomDirectedTests) * _cd4RepeatsduetoClinicianRequest;

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

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

                _cd4MonthlyOutputs[i].AdditionalTestsdueToWastage          = (_cd4MonthlyOutputs[i].TestsBasedonProtocols / (1 - _cdAdditionalTestsDuetoWastage)) - _cd4MonthlyOutputs[i].TestsBasedonProtocols;
                _cd4MonthlyOutputs[i].AdditionalTestsdueToWastageForBuffer = (_cd4MonthlyOutputs[i].TestsforBufferStock / (1 - _cdAdditionalTestsDuetoWastage)) - _cd4MonthlyOutputs[i].TestsforBufferStock;
            }
        }
Exemple #2
0
        private void BindBloodSample()
        {
            InitListView();
            for (int i = 1; i <= 4; i++)
            {
                EXListViewItem li = new EXListViewItem(GetRowTitle(i))
                {
                    Tag = i
                };

                if (i == 1)
                {
                    li.SubItems.Add(new EXListViewSubItem(_panel.AITNewPatient.ToString(), 0));
                }
                else if (i == 2)
                {
                    li.SubItems.Add(new EXListViewSubItem(_panel.PITNewPatient.ToString(), 0));
                }
                else if (i == 3)
                {
                    li.SubItems.Add(new EXListViewSubItem(_panel.APARTNewPatient.ToString(), 0));
                }
                else if (i == 4)
                {
                    li.SubItems.Add(new EXListViewSubItem(_panel.PPARTNewPatient.ToString(), 0));
                }

                for (int m = 1; m <= 12; m++)
                {
                    if (i == 1)
                    {
                        li.SubItems.Add(new EXListViewSubItem(_panel.AdultArtTestGivenInMonth(m).ToString(), m));
                    }
                    else if (i == 2)
                    {
                        li.SubItems.Add(new EXListViewSubItem(_panel.PediatricArtTestGivenInMonth(m).ToString(), m));
                    }
                    else if (i == 3)
                    {
                        li.SubItems.Add(new EXListViewSubItem(_panel.AdultPreArtTestGivenInMonth(m).ToString(), m));
                    }
                    else
                    {
                        li.SubItems.Add(new EXListViewSubItem(_panel.PediatricPreArtTestGivenInMonth(m).ToString(), m));
                    }
                }

                if (i == 1)
                {
                    li.SubItems.Add(new EXListViewSubItem(_panel.AITPreExisting.ToString(), 13));
                    li.SubItems.Add(new EXListViewSubItem(_panel.AITTestperYear.ToString(), 14));
                }
                else if (i == 2)
                {
                    li.SubItems.Add(new EXListViewSubItem(_panel.PITPreExisting.ToString(), 13));
                    li.SubItems.Add(new EXListViewSubItem(_panel.PITTestperYear.ToString(), 14));
                }
                else if (i == 3)
                {
                    li.SubItems.Add(new EXListViewSubItem(_panel.APARTPreExisting.ToString(), 13));
                    li.SubItems.Add(new EXListViewSubItem(_panel.APARTestperYear.ToString(), 14));
                }
                else if (i == 4)
                {
                    li.SubItems.Add(new EXListViewSubItem(_panel.PPARTPreExisting.ToString(), 13));
                    li.SubItems.Add(new EXListViewSubItem(_panel.PPARTTestperYear.ToString(), 14));
                }

                _cd4ListView.Items.Add(li);
            }
        }