Functional constipation (Idiopathic)
Causes of secondary constipation
Medications
Endocrine or metabolic
Diabetes mellitus
Diabetic neuropathy
Autonomic neuropathy
Hypothyroidism
Hyperparathyroidism
Hypopituitarism, Panhypopituitarism
Hypercalcemia
Hypocalcemia,
Hypokalemia
Hypomagnesemia
Uremia / chronic renal insufficiency
Pregnancy
Diet or Lifestyle
Low fiber diet, dehydration, inactive lifestyle/immobility
Psychological
Depression; Anxiety; Somatization
Anorexia nervosa / eating disorders
Sexual abuse
Structural / Anorectal 
Anal fissures, strictures, hemorrhoids
Diverticulosis,  megacolon
Proctitis
Inflammatory bowel disease
Obstruction (small or large bowel)
-Colonic strictures; Postinflammatory, radiation, ischemic, or surgical stenosis
-Obstructive colonic mass lesions / Extraintestinal mass
-Colorectal cancer
-Hernia
Pelvic floor dysfunction
Rectal prolapse or rectocele
Neurologic
Autonomic neuropathy,
Multiple sclerosis
Spinal cord injury
Paraplegia
Parkinson disease
Myotonic dystrophy
Systemic sclerosis
Hirschsprung disease
Cerebrovascular disease (stroke)
Irritable bowel syndrome
Cognitive impairment; Dementia
Chronic intestinal pseudo-obstruction (rare dysfunction of peristalsis)
Myogenic
Amyloidosis
Myotonic dystrophy
Muscular dystrophies
Dermatomyositis,
Scleroderma,
Chronic intestinal pseudo-obstruction (rare dysfunction of peristalsis)
Other causes: older age, lack of privacy or time

Thinking through the Differential Diagnosis
Constipation can be divided into several major categories by cause: Structural abnormalities with the GI tract; Myopathic conditions; Psychological conditions; Neurologic disorders;  Endocrine and Metabolic conditions

Further Reading
Can Fam Physician. 2015 Feb; 61(2): 152–158. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4325863/
Am Fam Physician. 2015 Sep 15;92(6):500-504. https://www.aafp.org/afp/2015/0915/p500.html
Am Fam Physician. 2011 Aug 1;84(3):299-306. https://www.aafp.org/afp/2011/0801/p299.html
Am Fam Physician. 2014 Jul 15;90(2):82-90. https://www.aafp.org/afp/2014/0715/p82.html
Am Fam Physician. 2005 Dec 1;72(11):2277-2284. https://www.aafp.org/afp/2005/1201/p2277.html

print