Inclusion Criteria:  patient hospitalized in a palliative care unit patient aged 18 or over patient with an estimated vital prognosis of a few hours to a few days* patient with persistent suffering despite optimal palliative care* patient gave informed consent in advance or if unable to do so, consent given by a family member or legal representative (patients under guardianship) patient covered by a social security scheme. * Validated after collegial and multidisciplinary discussion including the opinion of a doctor outside the palliative care team.  Exclusion Criteria:  contraindication or known allergy to sodium oxybate or midazolam significant risk of seizure venous access not possible pregnancy or breastfeeding person in exclusion period from another research protocol at the time of consent signing any condition which in the investigator's opinion could increase and jeopardize persons safety in case of research participation