
382 N.W.2d 133 (1986)
STATE of Iowa, Appellee,
v.
Debra Jean MOYER, Appellant.
No. 85-395.
Supreme Court of Iowa.
February 19, 1986.
*134 Thomas M. Walter, of Johnson, Bauerle, Hester & Walter, Ottumwa, for appellant.
Thomas J. Miller, Atty. Gen., Roxann M. Ryan, Asst. Atty. Gen., and Annette J. Scieszinski, Co. Atty., for appellee.
Considered by REYNOLDSON, C.J., and HARRIS, McGIVERIN, SCHULTZ, and WOLLE, JJ.
WOLLE, Justice.
Defendant Debra Jean Moyer appeals from the indeterminate five year prison sentence imposed by the district court following her guilty plea and conviction for operating a motor vehicle while under the influence of alcohol (OWI), third offense. Iowa Code § 321.281(2)(c) (1983). Defendant contends that the sentencing court erred in failing to order a presentence substance abuse evaluation, pursuant to a 1984 amendment to Iowa Code section 321.281(2)(c). We conclude that defendant had a statutory right to have a substance abuse evaluation made available to the sentencing court before sentence was imposed. Because no such evaluation was ordered, we vacate the sentence and remand for further proceedings in the district court.
When defendant was arrested on September 30, 1984, for operating a motor vehicle while intoxicated, she had already been convicted of OWI on two earlier occasions that year. Defendant initially entered a plea of not guilty, but she subsequently pleaded guilty as part of a plea agreement which required the county attorney to recommend a suspended sentence, probation, and alcohol treatment at the defendant's expense. The plea agreement was not conditioned upon the concurrence of the court in the county attorney's recommendation of a sentence. See Iowa R.Crim.P. 9 (defendant may withdraw guilty plea if sentencing court does not accept plea agreement which is conditioned upon a charging or sentencing concession). The district court accepted her guilty plea, adjudged her guilty of third-offense OWI, and ordered a presentence investigation, but the court did not order a substance abuse evaluation. At the time defendant was sentenced, the State fulfilled its plea agreement obligations by disclosing the terms of the agreement and recommending probation and alcohol treatment. The sentencing court, however, did not accept the county attorney's recommendation and instead imposed an indeterminate five year sentence of confinement.
Defendant contends that the trial court erred in imposing sentence without first ordering a substance abuse evaluation. She relies upon a 1984 amendment to Iowa Code section 321.281(2)(c), which in part provides:
On a conviction for a second or subsequent offense in violation of this section, the court shall order the defendant to undergo a substance abuse evaluation and the court may order the defendant to follow the recommendations proposed in the substance abuse evaluation for appropriate substance abuse treatment for the defendant.
1984 Iowa Acts ch. 1292 § 4 (emphasis added). Defendant contends that the evaluation provided for by that new statutory language was a mandatory prerequisite to sentencing, while the State responds with several arguments why the court was not required to order such an evaluation before sentencing.
In deciding this issue we must apply sound principles of statutory construction to ascertain what the legislature intended by its 1984 amendment of section 321.281(2)(c). See Iowa National Industrial Loan Co. v. Iowa State Department of Revenue, 224 N.W.2d 437, 439-40 (1974). We first scrutinize the above-quoted wording of the amended statute in the light of Iowa Code section 4.1(36)(a), which states that the word "shall" in a statute imposes a duty unless otherwise specially provided. The use in one sentence of the words "shall" and "may" emphasizes the distinction the legislature intended between the court's duty to order evaluation and the court's discretion in deciding whether to order treatment. The amended statute clearly obligated the district court to order *135 this defendant, convicted of OWI third offense, to undergo a substance abuse evaluation.
The next question, however, is whether the prescribed duty to order an evaluation was so essential to the main objective of the amended statute as to be considered mandatory in nature, invalidating the subsequent sentencing proceedings. We have held that a statutory duty, though ordinarily considered mandatory, may be deemed directory if its performance merely assures order or promptness and is not essential to accomplishing the principal purpose of the statute. See Cooper v. State, 379 N.W.2d 917, 918 (Iowa 1986) (failure to draw jury in manner required by statute did not vitiate jury verdict); Taylor v. Department of Transportation, 260 N.W.2d 521, 522-23 (Iowa 1977) (failure to provide hearing within time prescribed by statute did not invalidate license revocation following delayed hearing).
We conclude that the court's duty to order substance abuse evaluation must be deemed mandatory, not merely directory. Before the statute was amended the sentencing court had the authority, but no duty, to order evaluation and treatment of alcoholism when a defendant had committed more than one OWI offense. Iowa Code § 321.281(4) (1983). The 1984 amendment was clearly designed to eliminate discretion on that matter and mandate a substance abuse evaluation for persons with two or more OWI offenses. Moreover, in amending section 321.281(2)(c), the legislature provided the court greater flexibility and more specific guidelines for ordering treatment recommended as a result of the required evaluation. The amended statute adds specific language providing that when a court, armed with an evaluation, orders the defendant committed for substance abuse treatment, the treating facility is to make regular reports to the court indicating how long the person should remain at the facility for treatment. See Iowa Code § 321.281(2)(c) (1985) (specifically referencing Iowa Code section 125.86 which provides for periodic reports to the court when a person is committed for substance abuse treatment). The amended statute also provides the district court specific authority to punish persons committed to treatment who fail to carry out the order of the court. Violators may be jailed, ordered to perform community service work, and placed on probation.
The State concedes in its brief that the Iowa legislature has given increased emphasis to evaluation and treatment of persons with substance abuse problems. We read amended section 321.281(2)(c) to further that objective by mandating a presentence substance abuse evaluation and encouraging court-ordered treatment whenever any person has been convicted of a second or subsequent OWI offense.
The State contends that no substance abuse evaluation is required until after the court has imposed sentence. The State's argument focuses on the prefatory language of the amendment: "On a conviction for a second or subsequent offense ... the court shall order...." The State argues that the word "conviction" presupposes entry of a judgment and sentence by reason of our holding in State v. Ridout, 346 N.W.2d 837 (Iowa 1984). In Ridout, however, we merely followed an earlier Iowa case which held that the word "offense" in section 321.281 was "synonymous with convictions or judgments," therefore a prior deferred judgment could not be considered as an offense for enhanced-punishment purposes. 346 N.W.2d at 839 (quoting State v. Barlow, 242 Iowa 714, 719, 46 N.W.2d 725, 728 (1951)). Our Ridout and Barlow holdings no longer control, however, because when the legislature in 1984 amended section 321.281(2)(c), it also added the following language:
For the purpose of determining if a violation charged is a second, third, or subsequent offense, a deferred judgment pursuant to section 907.3 for an offense under this section shall be counted as a previous violation.
1984 Iowa Acts ch. 1292 § 4. Consequently, when the legislature used the word "conviction" in fixing the time when the court must order a substance abuse evaluation, it was not equating a conviction with entry of a sentence, but at most with an adjudication that the defendant was guilty *136 of the charged offense. Here, the trial court adjudged defendant guilty of third offense OWI when it accepted her guilty plea. This was a "conviction" triggering the mandatory substance abuse evaluation.
The amended statute mandating a substance abuse evaluation for defendant is also compatible with Iowa Code chapter 901 (1985) which spells out when a presentence investigation report must be furnished the sentencing court, and what the report should contain. A presentence investigation and report is mandatory before the court sentences a person convicted of third offense OWI, a class "D" felony, and it may be ordered for second offense OWI, an aggravated misdemeanor. See Iowa Code §§ 321.281(2)(b), (c); 901.2 (1985). Any presentence investigation report must include the results of court ordered psychiatric or physical evaluations of the defendant. The amendment to section 321.281(2)(c) simply provides that the sentencing court will always have one report, the mandatory substance abuse evaluation, before sentencing persons convicted of a second or subsequent OWI offense.
The State also argues that defendant has not been prejudiced by being sentenced to imprisonment without first undergoing substance abuse evaluation, because equivalent evaluation and treatment are provided for prison inmates. We acknowledge that Iowa Code section 217A.52 (1985) requires the department of corrections to provide a diagnostic intake and classification center "with a view to rehabilitation and to the protection of society." We also recognize that programs for chemical substance abuse treatment may be provided to prison inmates pursuant to Iowa Code section 125.12(3) (1985). But this record does not show what evaluation or treatment, if any, must be provided prison inmates, in comparison with the presentence evaluation and treatment contemplated by the amendment to section 321.281(2)(c). Treatment in the penitentiary after incarceration is not what the legislature had in mind when it mandated a presentence substance abuse evaluation and authorized the sentencing court to order treatment recommended in the report. The evaluation is designed for use by the sentencing court before a sentence has been imposed, not merely for the use of prison authorities after imprisonment has been ordered.
Defendant was entitled to have the statutorily-prescribed substance abuse evaluation completed and reported to the district court before sentencing. The sentencing court ordered no evaluation and had not received equivalent information before imposing sentence. We therefore must vacate the sentence entered, though not the judgment of conviction. This disposition of the case makes it unnecessary for us to address the second issue raised by defendant in this appeal pertaining to the reasons given by the sentencing court in denying defendant's request for a suspended sentence and probation.
We vacate the sentence entered by the district court. On remand the district court shall order defendant to undergo a substance abuse evaluation, and thereafter the sentencing court shall consider such recommendations for treatment as are contained in the evaluation report, along with all other information properly presented at the sentencing hearing.
SENTENCE VACATED; REMANDED.
