protected void Page_Load(object sender, EventArgs e)
        {
            ILookupManager mgr = (ILookupManager)ObjectFactory.CreateInstance("BusinessProcess.CCC.BLookupManager, BusinessProcess.CCC");

            GetSessionDetails();
            userId = Convert.ToInt32(Session["AppUserId"]);

            PatientMasterVisitManager VisitManager            = new PatientMasterVisitManager();
            List <PatientMasterVisit> visitPatientMasterVisit = new List <PatientMasterVisit>();

            visitPatientMasterVisit = VisitManager.GetVisitDateByMasterVisitId(PatientId, PatientMasterVisitId);
            VisitDate = visitPatientMasterVisit[0].VisitDate;
            pregnancySection.Visible = Gender != "Male";
            List <LookupItemView> areas           = mgr.GetLookItemByGroup("PregnancyStatus");
            List <LookupItemView> artRefillModels = mgr.GetLookItemByGroup("ARTRefillModel");

            serviceAreaId = 203;

            if (areas != null && areas.Count > 0)
            {
                pregnancyStatus.Items.Add(new ListItem("select", "0"));
                foreach (var k in areas)
                {
                    pregnancyStatus.Items.Add(new ListItem(k.ItemDisplayName, k.ItemId.ToString()));
                }
            }

            if (artRefillModels != null && artRefillModels.Count > 0)
            {
                ArtRefill.Items.Add(new ListItem("select", ""));
                foreach (var item in artRefillModels)
                {
                    ArtRefill.Items.Add(new ListItem(item.ItemDisplayName, item.ItemId.ToString()));
                }
            }


            PatientArtDistributionManager artDistributionManager = new PatientArtDistributionManager();
            PatientArtDistribution        artDistribution        = artDistributionManager.GetPatientArtDistributionByPatientIdAndVisitId(PatientId, PatientMasterVisitId);

            if (artDistribution != null)
            {
                IsPatientArtDistributionDone = 1;
            }
        }
Example #2
0
        public string GetArtDistributionForVisit()
        {
            AutoMapper.Mapper.Initialize(cfg =>
            {
                cfg.CreateMap <PatientArtDistribution, ArtDistributionDeTails>();
            });

            int patientId            = Convert.ToInt32(HttpContext.Current.Session["PatientPK"]);
            int patientMasterVisitId = Convert.ToInt32(HttpContext.Current.Session["PatientMasterVisitId"]);

            PatientArtDistributionManager artDistributionManager = new PatientArtDistributionManager();

            PatientArtDistribution artDistribution = artDistributionManager.GetPatientArtDistributionByPatientIdAndVisitId(patientId, patientMasterVisitId);
            var results = Mapper.Map <ArtDistributionDeTails>(artDistribution);

            if (results != null)
            {
                results.DateReferedToClinic = String.Format("{0:dd-MMM-yyyy}", results.ReferedToClinicDate);
            }
            return(new JavaScriptSerializer().Serialize(results));
        }
Example #3
0
        public string AddArtDistribution(int patientId, int patientMasterVisitId, string artRefillModel, bool missedArvDoses,
                                         int missedDosesCount, bool fatigue, bool fever, bool nausea, bool diarrhea, bool cough, bool rash,
                                         bool genitalSore, string otherSymptom, bool newMedication, string newMedicineText, bool familyPlanning,
                                         string fpmethod, bool referredToClinic, DateTime?appointmentDate, int pregnancyStatus, int IsPatientArtDistributionDone)
        {
            try
            {
                var artDistribution = new PatientArtDistributionManager();

                if (IsPatientArtDistributionDone == 1)
                {
                    PatientArtDistribution patientArtDistribution = artDistribution.GetPatientArtDistributionByPatientIdAndVisitId(patientId, patientMasterVisitId);
                    patientArtDistribution.ArtRefillModel       = artRefillModel;
                    patientArtDistribution.Cough                = cough;
                    patientArtDistribution.Diarrhea             = diarrhea;
                    patientArtDistribution.FamilyPlanning       = familyPlanning;
                    patientArtDistribution.FamilyPlanningMethod = fpmethod;
                    patientArtDistribution.Fatigue              = fatigue;
                    patientArtDistribution.Fever                = fever;
                    patientArtDistribution.MissedArvDoses       = missedArvDoses;
                    patientArtDistribution.GenitalSore          = genitalSore;
                    patientArtDistribution.MissedArvDosesCount  = missedDosesCount;
                    patientArtDistribution.Nausea               = nausea;
                    patientArtDistribution.NewMedication        = newMedication;
                    patientArtDistribution.NewMedicationText    = newMedicineText;
                    patientArtDistribution.OtherSymptom         = otherSymptom;
                    patientArtDistribution.PregnancyStatus      = pregnancyStatus;
                    patientArtDistribution.Rash                = rash;
                    patientArtDistribution.ReferedToClinic     = referredToClinic;
                    patientArtDistribution.ReferedToClinicDate = appointmentDate;

                    Result = artDistribution.UpdatePatientArtDistribution(patientArtDistribution);
                }
                else
                {
                    var patientArvDistribution = new PatientArtDistribution()
                    {
                        PatientId            = patientId,
                        PatientMasterVisitId = patientMasterVisitId,
                        ArtRefillModel       = artRefillModel,
                        Cough                = cough,
                        Diarrhea             = diarrhea,
                        FamilyPlanning       = familyPlanning,
                        FamilyPlanningMethod = fpmethod,
                        Fatigue              = fatigue,
                        Fever                = fever,
                        MissedArvDoses       = missedArvDoses,
                        GenitalSore          = genitalSore,
                        MissedArvDosesCount  = missedDosesCount,
                        Nausea               = nausea,
                        NewMedication        = newMedication,
                        NewMedicationText    = newMedicineText,
                        OtherSymptom         = otherSymptom,
                        PregnancyStatus      = pregnancyStatus,
                        Rash                = rash,
                        ReferedToClinic     = referredToClinic,
                        ReferedToClinicDate = appointmentDate,
                    };

                    Result = artDistribution.AddPatientArtDistribution(patientArvDistribution);
                }

                if (Result > 0)
                {
                    Msg = "Patient ART Distribution Added Successfully!";
                }
            }
            catch (Exception e)
            {
                Msg = e.Message;
            }
            return(Msg);
        }