title: CompilerError: Stack too deep, try removing local variables
body: <p>I am trying to do a dapp project.</p>
  <p>I have an error about stack too deep, but I don't know how can I solve this problem.</p>
  <blockquote>
  <p>CompilerError: Stack too deep, try removing local variables.
  --&gt; contracts/proje.sol:145:5:
  |
  145 | function addRecord(address _addr, s ... gedOn, string memory ipfs) public {
  | ^ (Relevant source part starts here and spans across multiple lines).</p>
  </blockquote>
  <p>And actually, struct will consist of more data than there is. If this gives an error in the number of data, what do we do when we want to enter too much data?</p>
  <pre><code>contract Patient is Clinic {
      uint256 public p_index = 0;
  
      struct Records {
          string cname;
  
          string l_cadence;
          string r_cadence;
          string n_cadence;
  
          string l_dsupport;
          string r_dsupport;
          string n_dsupport;
  
          string l_footoff;
          string r_footoff;
          string n_footoff;
  
          string l_steptime;
          string r_steptime;
          string n_steptime;
  
  
          string admittedOn;
          string dischargedOn;
          string ipfs;
      }
  
      struct patient {
          uint256 id;
          string name;
          string phone;
          string gender;
          string dob;
          string bloodgroup;
          string allergies;
          Records[] records;
          address addr;
      }
  
      address[] private patientList;
      mapping(address =&gt; mapping(address=&gt;bool)) isAuth;
      mapping(address=&gt;patient) patients;
      mapping(address=&gt;bool) isPatient;
  
      function addRecord(address _addr, string memory cname, string memory l_cadence, string memory r_cadence, string memory n_cadence, string memory l_dsupport, string memory r_dsupport, string memory n_dsupport, string memory l_footoff, string memory r_footoff, string memory n_footoff, string memory l_steptime, string memory r_steptime, string memory n_steptime, string memory admittedOn, string memory dischargedOn, string memory ipfs) public {
          
      }
  }
  </code></pre>