When my dad was being looked after when he had cancer they had a fully adjustable electric bed, there was also an air filled mattress with multiple pockets with a controller/pump that would alternate which pockets were inflated so your weight wasn't pressing down on the same part of the body all night. They're not cheap to buy though.
When he was at home the Macmillan nurse arranged for a memory foam type full depth mattress to be loaned to us from the Community Equipment Service place, plastic coated and cleaned regularly so you don't have to worry about it not been hygienic, we didn't have to paying for this.