Exemple #1
0
        public string addAdherenceHIVStatus(int patientId, int patientMasterVisitId, int createdBy, int AcceptedStatus, int DisclosureComplete)
        {
            IPatientEncounter       patientEncounter        = (IPatientEncounter)ObjectFactory.CreateInstance("BusinessProcess.CCC.BPatientEncounter, BusinessProcess.CCC");
            PatientEncounterManager patientEncounterManager = new PatientEncounterManager();

            encounterTypeId = patientEncounterManager.GetPatientEncounterId("EncounterType", "Adherence-Barriers");
            var foundEncounter = patientEncounterManager.GetEncounterIfExists(Convert.ToInt32(patientId), Convert.ToInt32(patientMasterVisitId), Convert.ToInt32(encounterTypeId));

            if (foundEncounter != null)
            {
                EncounterResult = foundEncounter.Id;
            }
            else
            {
                EncounterResult = patientEncounterManager.AddpatientEncounter(Convert.ToInt32(patientId), Convert.ToInt32(patientMasterVisitId),
                                                                              patientEncounterManager.GetPatientEncounterId("EncounterType", "Adherence-Barriers"), 203, createdBy);
            }
            if (EncounterResult > 0)
            {
                try
                {
                    var AL = new AdherenceLogic();
                    Result = AL.addAdherenceHIVStatus(patientId, patientMasterVisitId, createdBy, AcceptedStatus, DisclosureComplete);
                    if (Result > 0)
                    {
                        Msg = " HIV Status Added Successfully";
                    }
                }
                catch (Exception e)
                {
                    Msg = e.Message;
                }
            }
            return(Msg);
        }
        public int SavePatientPreviousEncounter(int patientID, int patientMasterVisitID, string EncounterType, int ServiceAreaId, int userId, DateTime visitDate)
        {
            int val = 0;
            IPatientEncounter       patientEncounter        = (IPatientEncounter)ObjectFactory.CreateInstance("BusinessProcess.CCC.BPatientEncounter, BusinessProcess.CCC");
            PatientEncounterManager patientEncounterManager = new PatientEncounterManager();

            encounterTypeId = patientEncounterManager.GetPatientEncounterId("EncounterType", EncounterType.ToLower());
            var foundEncounter = patientEncounterManager.GetEncounterIfExists(Convert.ToInt32(patientID), Convert.ToInt32(patientMasterVisitID), Convert.ToInt32(encounterTypeId));

            if (foundEncounter != null)
            {
                result = foundEncounter.Id;
            }
            else
            {
                Entities.CCC.Visit.PatientEncounter patientVisitEncounter = new Entities.CCC.Visit.PatientEncounter()
                {
                    PatientId            = Convert.ToInt32(patientID),
                    EncounterStartTime   = visitDate,
                    EncounterEndTime     = visitDate,
                    ServiceAreaId        = 203,
                    EncounterTypeId      = encounterTypeId,
                    PatientMasterVisitId = Convert.ToInt32(patientMasterVisitID),
                    CreatedBy            = userId
                };

                result = patientEncounterManager.AddPatientEncounter(patientVisitEncounter);
            }
            return((result > 0) ? result : val);
        }
        public int savePatientEncounterPresentingComplaints(string patientMasterVisitID, string patientID, string serviceID, string VisitDate, string VisitScheduled, string VisitBy, string anyComplaints, string Complaints, int TBScreening, int NutritionalStatus, int userId, string adverseEvent, string presentingComplaints)
        {
            IPatientEncounter       patientEncounter        = (IPatientEncounter)ObjectFactory.CreateInstance("BusinessProcess.CCC.BPatientEncounter, BusinessProcess.CCC");
            PatientEncounterManager patientEncounterManager = new PatientEncounterManager();

            JavaScriptSerializer parser = new JavaScriptSerializer();

            var advEvent    = parser.Deserialize <List <AdverseEvents> >(adverseEvent);
            var pComplaints = parser.Deserialize <List <PresentingComplaints> >(presentingComplaints);
            int val         = patientEncounter.savePresentingComplaints(patientMasterVisitID, patientID, serviceID, VisitDate, VisitScheduled, VisitBy, anyComplaints, Complaints, TBScreening, NutritionalStatus, userId, advEvent, pComplaints);

            //Set the Visit Encounter Here
            //TODO: ALWAYS CHECK IF AN ENCOUNTER EXITS BEFRE ADDING:
            encounterTypeId = patientEncounterManager.GetPatientEncounterId("EncounterType", "ccc-encounter".ToLower());
            var foundEncounter = patientEncounterManager.GetEncounterIfExists(Convert.ToInt32(patientID), Convert.ToInt32(patientMasterVisitID), Convert.ToInt32(encounterTypeId));

            if (foundEncounter != null)
            {
                result = foundEncounter.Id;
            }
            else
            {
                if (val > 0)
                {
                    result = patientEncounterManager.AddpatientEncounter(Convert.ToInt32(patientID),
                                                                         Convert.ToInt32(patientMasterVisitID),
                                                                         patientEncounterManager.GetPatientEncounterId("EncounterType", "ccc-encounter".ToLower()), 203,
                                                                         userId);
                }
            }
            return((result > 0) ? val : 0);
        }
        public int savePatientEncounter(int patientID, int patientMasterVisitID, string EncounterType, int ServiceAreaId, int userId)
        {
            int val = 0;
            IPatientEncounter       patientEncounter        = (IPatientEncounter)ObjectFactory.CreateInstance("BusinessProcess.CCC.BPatientEncounter, BusinessProcess.CCC");
            PatientEncounterManager patientEncounterManager = new PatientEncounterManager();

            encounterTypeId = patientEncounterManager.GetPatientEncounterId("EncounterType", EncounterType.ToLower());
            var foundEncounter = patientEncounterManager.GetEncounterIfExists(Convert.ToInt32(patientID), Convert.ToInt32(patientMasterVisitID), Convert.ToInt32(encounterTypeId));

            if (foundEncounter != null)
            {
                result = foundEncounter.Id;
            }
            else
            {
                result = patientEncounterManager.AddpatientEncounter(Convert.ToInt32(patientID), Convert.ToInt32(patientMasterVisitID), encounterTypeId, 203, userId);
            }
            return((result > 0) ? result : val);
        }