Esempio n. 1
0
        public List <PatientConsentDisplay> GetpatientConsent(string patientId)
        {
            List <PatientConsentDisplay> consentDisplays = new List <PatientConsentDisplay>();
            List <PatientConsent>        consents        = new List <PatientConsent>();

            try
            {
                var patientConsent = new PatientConsentManager();
                int id             = Convert.ToInt32(patientId);
                consents = patientConsent.GetByPatientId(id);
                foreach (var consent in consents)
                {
                    PatientConsentDisplay consentDisplay = MapConsent(consent);
                    consentDisplays.Add(consentDisplay);
                }
            }
            catch (Exception e)
            {
                Msg = e.Message;
            }
            return(consentDisplays);
        }
Esempio n. 2
0
        public string AddPatientConsent(int patientId, int patientMasterVisitId, int consentType, DateTime consentDate)
        {
            // Todo properly save service area. Remove hack
            ILookupManager        mgr         = (ILookupManager)ObjectFactory.CreateInstance("BusinessProcess.CCC.BLookupManager, BusinessProcess.CCC");
            int                   serviceArea = 0;
            List <LookupItemView> areas       = mgr.GetLookItemByGroup("ServiceArea");
            var                   sa          = areas.FirstOrDefault();

            if (sa != null)
            {
                serviceArea = sa.ItemId;
            }

            PatientConsent patientConsent = new PatientConsent()
            {
                PatientId            = patientId,
                PatientMasterVisitId = patientMasterVisitId,
                ServiceAreaId        = serviceArea,
                ConsentType          = consentType,
                ConsentDate          = consentDate
            };

            try
            {
                var consent = new PatientConsentManager();
                Result = consent.AddPatientConsents(patientConsent);
                if (Result > 0)
                {
                    Msg = "Patient consent added successfully!";
                }
            }
            catch (Exception e)
            {
                Msg = e.Message;
            }
            return(Msg);
        }