Not sure why you would need to write code for this. The idea is to setup "Services" and "Products" in OpenERP, that the Cashier/Billing person can "add" to the patient's quotation while creating a bill. So, if a person was admitted, then charges for bed can be added as a "service".
For more information please read this:
User Manual for Stock Management:
https://docs.google.com/document/d/1R5uvdBmfgLR_ccbFTiGKDpN8x2Hc6xDHcuPUkz_hKO8/edit#heading=h.1tw1ormw2zhl (See the section on how to create a service)