public DtoShr LoadFromEmr(string CARD_SERIAL_NO)
        {
            PsmartShrCardSerialManager psmartShrCardSerialManager = new PsmartShrCardSerialManager();
            DtoShr NewSHR = new DtoShr();

            try
            {
                NewSHR = psmartShrCardSerialManager.GenerateShrForEmr(CARD_SERIAL_NO);
                return(NewSHR);
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
        public DtoShr FetchClientShrNew(int id)
        {
            PsmartShrManager psmartShrManager = new PsmartShrManager();

            if (id is int i)
            {
                var shr = psmartShrManager.GenerateShrForEmr(id);

                return(shr);
            }
            else
            {
                PsmartShrCardSerialManager psmartShrCardSerialManager = new PsmartShrCardSerialManager();
                var shr = psmartShrCardSerialManager.GenerateShrForEmr("");
                return(shr);
            }
        }
        public DtoShr FetchClientShr(psmartCard psmartCard)
        {
            PsmartShrManager psmartShrManager = new PsmartShrManager();

            if (psmartCard.PATIENTID is int i)
            {
                var shr = psmartShrManager.GenerateShrForEmr(psmartCard.PATIENTID);

                return(shr);
            }
            else
            {
                PsmartShrCardSerialManager psmartShrCardSerialManager = new PsmartShrCardSerialManager();
                var shr = psmartShrCardSerialManager.GenerateShrForEmr(psmartCard.CARD_SERIAL_NO);
                return(shr);
            }
        }
        public DtoShr ProcessCardSerialNumberIdentifierBluecard(psmartCard psmartCard)
        {
            MstPatientManager          patientManager             = new MstPatientManager();
            PsmartShrCardSerialManager psmartShrCardSerialManager = new PsmartShrCardSerialManager();
            DtoShr NewSHR = new DtoShr();

            try
            {
                //  int result = patientManager.UpdatePatientCardSerial(psmartCard);
                string processCardStatus = this.ProcessCardSerialNumberIdentifier(psmartCard);

                if (!string.IsNullOrEmpty(processCardStatus))
                {
                    NewSHR = psmartShrCardSerialManager.GenerateShrForEmr(psmartCard.CARD_SERIAL_NO);
                }
                return(NewSHR);
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }