def transform_NRS7(df):
    """Recodes NRS7 to a ordered number scale, 0-10.
    """
    def transform_row(row):
        if row == "Värsta tänkbara värk":
            return 10
        elif row == "Ingen värk":
            return 0
        else:
            return int(row)
    
    df["ini_NRS7"] = df["ini_NRS7"].apply(transform_row)

    return df