So in case Anon's response wasn't clear for how to do that, you should set the bar's width to (current health/max health)*maximum length. You can also get fancy and use lerp or some other operation to make it smoothly change there. So, for instance,
Set width to lerp(self.width, (current health/max health)*maximum length, 5*dt) where 5 would generally change how quickly it gets there.
I've attached a quick example of how to do it. I changed the green bar to a Tiled Background object so that it won't get the blurred edges you get from stretching out a sprite.
[attachment=0:3hxpbx18][/attachment:3hxpbx18]