Hi Yella,
There is no constraint of installing EHP4 before EHP7. They both are independent. Just make sure that before installing EHP4, do the schema mapping of SAP_HCM with your database schema. After this you install EHP4, it will throw no error.
Thanks,
Gaurav