Upon final voluntary compromise settlement of any claim, including a claim of medical malpractice, against any person based on alleged liability of that person for injury or damage arising out of any occurrence, the parties may make any agreement they desire concerning previous voluntary services or partial payments of the claim. If the claim is tried in a court, after entry of judgment involving the claim, the value of any previous voluntary service or partial payment of the claim must be deducted from the amount of the judgment if the value thereof was included in the assessment of damages contained in the judgment. If, after entry of judgment involving the claim, it is determined by the judgment that the amount of injury or damages is less than the value of the previous services and voluntary payments, the provider of the services or payer of the payments has no claim for relief for the recovery of amounts by which the voluntary services or payments exceed the final court judgment.
N.D.C.C. § 32-39-03