public int Update(raw_visit entity)
        {
            try
            {
                using ( var ctx = new ClinicDataContext(connString) )
                {
                    var rawVisit = ctx.raw_visit.FirstOrDefault(x => x.visit_uuid == entity.visit_uuid);
                    if ( rawVisit == null )
                    {
                        throw new Exception("Record doesn't exist and cannot be updated");
                    }
                    rawVisit.visit_uuid = entity.visit_uuid;
                    rawVisit.visit_stat = entity.visit_stat;
                    rawVisit.visit_json = entity.visit_json;
                    rawVisit.err_cd = entity.err_cd;
                    rawVisit.rec_updt_user_id_cd = entity.rec_updt_user_id_cd;
                    rawVisit.rec_updt_dt = entity.rec_updt_dt;

                    ctx.Entry(rawVisit).State = System.Data.Entity.EntityState.Modified;

                    int result = ctx.SaveChanges();

                    return result;
                }
            }
            catch ( Exception ex )
            {
                throw ex;
            }
        }
        public int CreateRawVisit(raw_visit entity)
        {
            try
            {

                using ( var ctx = new ClinicDataContext(connString) )
                {
                    ctx.raw_visit.Add(entity);
                    int result = ctx.SaveChanges();

                    return result;
                }
            }
            catch ( Exception ex )
            {
                throw ex;
            }
        }