Each subject and their carers/family members will receive verbal and written information followed by signing of the Informed Consent Forms (ICFs). The study is divided into two arms. In both arms patients will receive standard regular oral or subcutaneous medication for relieving non-breakthrough symptoms. In the standard care arm, patients will receive standard as needed medication (SANM) administered orally, sublingually or subcutaneously for breakthrough symptoms. The experimental arm will consist of two stages: in Stage 1 of the study, PecFent will be given to patients in order to treat breakthrough pain instead of subcutaneous opioids. PecFent will be titrated in order to establish an effective treatment dose to manage pain. SANM administered orally, sublingually or subcutaneously will be used to treat agitation and other symptoms.