
475 N.W.2d 901 (1991)
239 Neb. 281
WEST NEBRASKA GENERAL HOSPITAL, a Corporation, Appellee,
v.
FARMERS INSURANCE EXCHANGE, Appellant.
No. 89-647.
Supreme Court of Nebraska.
October 18, 1991.
*903 J.L. Zimmerman and Joy Shiffermiller of Atkins Ferguson Zimmerman Carney, P.C., Scottsbluff, for appellant.
John F. Wright of Wright, Sorensen & Brower, P.C., Scottsbluff, for appellee.
HASTINGS, C.J., and BOSLAUGH, WHITE, SHANAHAN, GRANT, and FAHRNBRUCH, JJ.
*904 WHITE, Justice.
This action was brought by plaintiff-appellee, West Nebraska General Hospital (West Nebraska), against defendant-appellant, Farmers Insurance Exchange (Farmers), to enforce a hospital lien. Farmers filed a general demurrer. West Nebraska then filed a motion for summary judgment, which the trial court granted, awarding West Nebraska $26,909.02 plus interest. Farmers appeals.

FACTUAL BACKGROUND
Kenneth Schneider was involved in an automobile-motorcycle accident with Janae Kehm. As a result of the accident Schneider required treatment at West Nebraska. During his approximately 8 weeks of treatment Schneider incurred medical bills of $31,361.07.
The automobile driven by Kehm was covered by a liability insurance policy issued by Farmers. On June 22, 1987, Bobby Willey, a claims representative for Farmers, and Peter Hoagland, the attorney representing Schneider, reached an agreement to settle Schneider's claims for the policy limits of $50,000. The following morning Hoagland picked up the settlement draft from Farmers' offices. At the time this settlement occurred, Willey was aware of Schneider's treatment at West Nebraska and of the full amount of his medical bills.
On June 22, 1987, the same day the settlement was reached, West Nebraska's attorney mailed a letter claiming a lien in the amount of $4,412.05 to Lawrence Lessert, one of Farmers' independent insurance agents. Lessert does not recall the exact date of receipt of this letter, other than that it was "within the next couple days" after its mailing. Confused as to his responsibility regarding the lien, Lessert called Willey, who told him to forward the entire package to Willey's office. Willey does not remember the exact date of the phone call from Lessert. The letter claiming the lien was received by Willey on July 1.
The full amount claimed in the June 22 lien was paid in early July 1987. Subsequently, on July 16, the hospital sent Farmers a "Supplemental Hospital Lien" claiming the balance due of $26,959.02. It is this supplemental lien which forms the basis for this lawsuit.

ASSIGNMENTS OF ERROR
On appeal Farmers asserts 10 separate assignments of error. Based on the arguments presented in its brief, these combine to assign as error the trial court's overruling the demurrer and the court's granting of West Nebraska's motion for summary judgment. Farmers argues that (1) it is not a proper party defendant in an action to foreclose a hospital lien because it did not cause Schneider's injuries; (2) West Nebraska did not comply with the notice requirements of Neb.Rev.Stat. § 52-401 (Reissue 1988) prior to Farmers' settlement with Schneider, and therefore the trial court erred in finding that the lien attached; and (3) even if the lien attached, West Nebraska could not enforce it due to its failure to satisfy the statute's notice requirements, and the trial court erred in finding either that no such compliance was necessary or that Farmers had sufficient notice of the lien in this case.

STANDARD OF REVIEW
Summary judgment is proper when the evidence in the record discloses that there is no genuine issue of material fact and that the moving party is entitled to judgment as a matter of law. On appeal this court views the evidence in the light most favorable to the party against whom the judgment is granted. Wiles v. Metzger, 238 Neb. 943, 473 N.W.2d 113 (1991). Here, then, we view the evidence in the light most favorable to Farmers in analyzing its appeal.

THE STATUTE
Interpretation of the Nebraska hospital lien statute, § 52-401, is a matter of first impression in this court. Therefore, it is necessary to fully discuss the statute's general scheme in order to resolve the issues involved in this case.
*905 Attachment of the Lien.
It is first necessary to determine when a hospital lien attaches. The statute states that when a hospital performs services in connection with the treatment of an injury, the hospital "shall have a lien...." § 52-401. Courts interpreting similar statutes with the mandatory language "shall" hold that the lien attaches upon admission of the patient to the hospital for treatment. See, In re Nelson, 92 B.R. 837 (D.Minn.1988); Rolla Community Hosp. v. Dunseith Com. N. Home, 354 N.W.2d 643 (N.D.1984); Palm Springs Gen. Hosp. v. State Farm Mut. Auto. I. Co., 218 So.2d 793 (Fla.App.1969). See, also, Commerce Sav. Scottsbluff v. F.H. Schafer Elev., 231 Neb. 288, 436 N.W.2d 151 (1989) (same for fertilizer liens). We agree.
Holding that the hospital lien attaches when medical services are provided does not render the notice provisions of the statute superfluous. The hospital's lien is enforceable as against the injured party upon attachment, regardless of whether the hospital complies with the statute's notice provisions. Perfection, on the other hand, is required if the hospital seeks to enforce the lien against third parties, such as the tort-feasor. See In re Nelson, supra. Read in this manner, the statutory scheme is similar to the well-known rule that the recording of a deed or mortgage is only relevant as against subsequent purchasers for value, but does not affect the validity of the transaction as between the parties themselves. See, McKenzie v. Beaumont, 70 Neb. 179, 97 N.W. 225 (1903); Staples v. Miller, 319 N.W.2d 57 (Minn.1982). Thus, if in this case West Nebraska provided the Kehms written notice that it claimed a lien, and the Kehms subsequently settled with Schneider to the exclusion of West Nebraska, the Kehms would be liable to the hospital for the deficiency. If no such notice was provided, however, and the Kehms reached a good faith settlement with Schneider, the hospital's only remedy would be against Schneider.

Enforcing the Lien.
Having held that a hospital lien attaches upon admission of the patient to the hospital for treatment, we find it necessary to address Farmers' argument that it is not a proper party defendant in this case.
The Nebraska hospital lien statute provides:
Whenever any person shall employ a physician, nurse, or hospital to perform professional service or services of any nature, in the treatment of or in connection with an injury, and such injured person shall claim damages from the party causing the injury, such physician, nurse, or hospital, as the case may be, shall have a lien upon any sum awarded the injured person in judgment or obtained by settlement or compromise on the amount due for the reasonable value of services necessarily performed, except that no such lien shall be valid against anyone coming under the Nebraska Workers' Compensation Act. In order to prosecute such lien, it shall be necessary for such physician, nurse, or hospital to serve a written notice upon the person or corporation from whom damages are claimed that such physician, nurse, or hospital claims a lien for such services and stating therein the amount due and the nature of such services, except that whenever an action is pending in court for the recovery of such damages, it shall be sufficient to file the notice of such lien in the pending action.
§ 52-401. The Legislature enacted this statute in 1927. Unfortunately, legislative histories for statutes dating that far back do not exist. However, it is the case that
[a] lien created by statute is limited in operation and extent by the terms of the statute and can arise and be enforced only in the event and under the facts and conditions provided in the statute. It cannot be extended by the court to cases not within the statute.
County Board of Platte County v. Breese, 171 Neb. 37, 44-45, 105 N.W.2d 478, 482-83 (1960).
Under the statute, when the injured party "claim[s] damages from the party *906 causing the injury," the statute gives the hospital "a lien upon any sum awarded the injured person in judgment or obtained by settlement or compromise on the amount due...." § 52-401. Analyzing a similar hospital lien statute, the bankruptcy court for the district of Maryland described such a lien as transferring the interest of the injured party in the proceeds of a judgment or settlement to the hospital. In re Howard, 43 B.R. 135 (D.Md.1983). See, also, In re Nelson, 92 B.R. 837 (D.Minn.1988) (lien attaches to the patient's preexisting cause of action upon rendition of services by the hospital). Applying this interpretation to the case at bar, the lien transferred to West Nebraska Schneider's interest in sums obtained in judgment or settlement of his claims, up to the value of the services provided by West Nebraska less a reasonable portion of the costs of recovery, including attorney fees. See United Services Automobile Assn. v. Hills, 172 Neb. 128, 109 N.W.2d 174 (1961) (subrogor who accepts proceeds of litigation in which he did not participate must contribute proportional share of expenses, including attorney fees).
Direct actions against liability insurance carriers based on the negligence of the insured are not permitted in Nebraska. State Auto. & Cas. Underwriters v. Farmers Ins. Exchange, 204 Neb. 414, 282 N.W.2d 601 (1979). Therefore, Schneider could not sue Farmers directly for his injuries. If the lien statute is interpreted as transferring part of Schneider's interest to West Nebraska, then West Nebraska cannot sue Farmers directly either.
Such an interpretation is consistent with the language of § 52-401 when read as a whole. The first sentence of the statute gives the hospital a lien on any amounts the injured party receives from judgment or settlement of his claims. The second sentence requires the hospital to perfect the lien by giving the tort-feasor notice of its existence prior to any such settlement or judgment. In the context of the attorney lien statute, Neb.Rev.Stat. § 7-108 (Reissue 1987), the purpose of which is very similar to that of the hospital lien statute, this court noted that the notice requirement is designed "`to prevent a bona fide settlement of the controversy by the litigants and payment by the debtor to the creditor in ignorance of the attorney's rights....'" (Emphasis omitted.) Kleager v. Schaneman, 212 Neb. 333, 339, 322 N.W.2d 659, 663 (1982), quoting Cones v. Brooks, 60 Neb. 698, 84 N.W. 85 (1900). As noted by the appellant, if the Legislature intended the hospital lien created in the first sentence of § 52-401 to be enforceable against insurance companies, it would have required the hospital to provide them notice as well, as have a number of other states. See, e.g., Colo.Rev.Stat.Ann. § 38-27-102 (West 1990); D.C.Code Ann. § 38-302 (1990); Ind.Code Ann. § 32-8-26-4(b)(3) (Burns Cum.Supp.1991); Iowa Code Ann. § 582.2 (West 1950); N.M.Stat.Ann. § 48-8-2(C) (1987); N.D.Cent.Code Ann. §§ 35-18-03 and 35-18-05 (1987).
Moreover, as appellee's attorney stated during oral argument, an insurer acts as the tort-feasor's agent in settling with the injured party. Thus, any "settlement" reached is not between the injured party and the insurer, but between the injured party and the tort-feasor. That the insurer writes the check is the result of an independent contractual arrangement and does not alter this basic structure. Because the hospital lien statute creates a lien against the proceeds of a settlement, regardless of where the tort-feasor gets the money to pay that settlement, the tortfeasor is generally the party against which the hospital must assert its lien. See, Nationwide Mut. Ins. Co. v. A.H.C.C.C.S., 166 Ariz. 514, 803 P.2d 925 (1990) (no direct action against insurance company to enforce hospital lien where statute extends lien only to "claims for damages"); Booth v. Seaboard Fire & Marine Insurance Company, 285 F.Supp. 920 (D.Neb.1968), rev'd on other grounds 431 F.2d 212 (8th Cir.1970) (no direct action against tort-feasor's insurer under subrogation provision of Workers' Compensation Act).
We are careful to point out, however, that insurance companies are not *907 completely shielded from liability under our holding. Upon perfection of a lien by a hospital, a duty arises on the part of the tort-feasor's insurer not to impair the hospital's rights under that lien. If such an insurer settles directly with the injured party despite the existence of a perfected hospital lien, it has breached that duty and is liable directly to the hospital. See Palm Springs Gen. Hosp. v. State Farm Mut. Auto. I. Co., 218 So.2d 793 (Fla.App.1969). Thus, had West Nebraska sued the Kehms in this case, and complied with the notice provisions of the statute, it would have had a lien on any amounts paid by or on behalf of the Kehms to the extent of Schneider's unpaid bills. If Farmers desired to settle directly with Schneider it would, as the Kehms' agent, have a duty to satisfy the lien and if it failed to do so would be liable to the hospital.
Thus, the only remaining issue is whether the lien in this case was perfected prior to the settlement. For the reasons set out below, we hold that it was not.
Perfection of the Lien.
The hospital lien statute requires a hospital asserting a lien to "serve a written notice upon the person or corporation from whom damages are claimed ... except that whenever an action is pending in court for the recovery of such damages, it shall be sufficient to file the notice of such lien in the pending action." § 52-401.
Rolla Community Hosp. v. Dunseith Com. N. Home, 354 N.W.2d 643 (N.D.1984), is often cited in discussions of the significance of noncompliance with the notice provisions of a hospital lien statute. There, a woman sued a nursing home for injuries allegedly sustained there. The hospital which treated her filed a hospital lien statement and served it on the nursing home and the attorney representing the injured party. The hospital filed its statement more than 30 days after providing services to the woman, however, in contravention of the statute. Subsequently, the woman settled her suit against the nursing home. The hospital then brought suit in federal court against the nursing home's insurance company to enforce its lien. The federal district court certified to the North Dakota Supreme Court the question of whether the hospital's failure to strictly comply with the statute's notice provisions barred its suit. The North Dakota court replied that the suit was not barred, holding that if the insurer had actual notice of the filed lien but nevertheless settled with the injured party, the lien was enforceable.
It is important to note that Rolla and other cases holding that actual notice is sufficient to satisfy a hospital lien's notice requirements involve situations wherein the hospital filed some notice of its lien, but that filing did not comply with the statute for technical reasons. See, S.W. Com. Health Services v. Safeco Ins., 108 N.M. 570, 775 P.2d 1287 (1989) (mailing of copy of lien statement to insurer's local office rather than its home office as required by statute); Illini Hospital v. Bates, 135 I11.App.3d 732, 482 N.E.2d 235 (1985) (notices sent by certified mail rather than by registered mail as required by statute); Rolla, supra (failure to file within 30 days of provision of services as required by statute).
Here, West Nebraska is not asserting such a technical defect, but argues that Farmers' actual knowledge that the hospital was treating Schneider and of the amount of his bills is sufficient notice under the statute. Knowledge that the hospital treated Schneider is different from notice that the hospital is claiming a lien for the amounts owed, however. As several of Farmers' witnesses pointed out, Schneider's rich uncle, his mother, or another insurance company might have paid his hospital bills. Without notice that the hospital is claiming a lien on settlement proceeds to satisfy the injured party's debts, knowledge that such debts exist is not sufficient to satisfy the notice provisions of § 52-401.
Such an analysis is consistent with prior Nebraska cases interpreting lien statutes. See, Commerce Sav. Scottsbluff v. F.H. Schafer Elev., 231 Neb. 288, 436 N.W.2d 151 (1989) (fertilizer lien inapplicable against subsequent lienholders where not filed within 60 days of the last date the product, machinery, or labor is supplied, as *908 required by statute); County Board of Platte County v. Breese, 171 Neb. 37, 105 N.W.2d 478 (1960), quoting United States v. Beaver Run Coal Co., 99 F.2d 610 (3d Cir.1938) (a lien is enforceable only when there has been at least substantial compliance with the statutory requirements).
We therefore hold that at least substantial compliance with the notice requirements of § 52-401 is necessary to perfect a hospital lien. Although we do not decide what may constitute substantial compliance in any given case, it is clear that West Nebraska did not substantially comply with the statute's notice provisions in this case. It mailed its notice of intention to claim a lien to Farmers on the day the settlement agreement was reached. This was more than 6 weeks after Schneider's release from the hospital. Prior to the time the settlement agreement was reached, West Nebraska provided no indication whatsoever that it planned to claim a lien. Farmers could have no actual or constructive knowledge of such an intent and is not liable under the hospital lien statute. Therefore, the trial court erred in granting West Nebraska's motion for summary judgment. We reverse, and remand the cause for the entry of judgment in favor of Farmers.

REVERSED AND REMANDED WITH DIRECTIONS.
CAPORALE, J., not participating.
