Ruby Create Dictionary.html from double colon files

This takes a text file of the form below and creates an html dictionary version with a TOC :


Ambiguous Genitalia

Overview:: Four major defects can cause gender confusion in the neonate: 1) female pseudohermaphroditism or adrenogentital syndrome, 2) male pseudohermaphroditism, 3) true hermaphroditism, and 4) mixed gonadal dysgenesis. A physical examination and a chromosome analysis can make the correct diagnosis with approximately 90% accuracy. Gonadal symmetry is sought for - if there is symmetry in the gonadal findings, then the diagnosis is most likely a causative agent applied equally to both sides, such as an androgenized genetic female (=female pseudohermaphroditism) or an incompletely virilized genetic male (= male pseudohermaphroditism). Asymmetry refers to position of one gonad to the other, relative to the external inguinal ring. A buccal smear is felt by some to be useful in that Barr or Chromatin bodies (indicative of the presence of the second female X chromosome) may be found. Therefore: 1) Chromatin Positive, Symmetry = Fem pseudoherm; 2) Chromatin Positive, Asymmetry = True herm; 3) Chromatin Negative,Symmetry = Male pseudoherm; 5) Chromatin Negative, Asymmetry = Mixed gonad dysgen.

Caveats:: Genetic females recognized in the neonatal period historically were raised as female no matter how virilized. This is not currently the case. In genetic males the gender assignment was traditionally based on the phallus size - anyone with an 'inadequate' phallus is raised as a female. What constitutes an inadequate phallus ? Absolute values are impossible, but the measurements are made from the dorsum to the tip of the stretched glans. The following are 'inadequate': < 2.5 cm in the term infant; < 2.0 cm in the 34 week premie; < 1.5 cm in the 30 week preemie. Additionally, a thin (< 1 to 1.5 cm diameter) phallus is of concern. An elevated or normal MIS levels signifies a functioning testis.

Clinical:: The following work-up of the child with AG (ambiguous genitalia) may be indicated:H & P, HCG stimulation and enzyme ratios, Family pedigree, Genitogram, Maternal drug history, Cystoscopy, Buccal smear with Y fluorescence, Laparoscopy, Urinary steroids, Gonadal biopsy (longitudinal), Electrolytes,Androgen receptors (genital skin).

Female pseudohermaphroditism - Description:: (approximately 1/3 of all patients). This refers to 46, XX karyotype patients with severe masculinization secondary to exposure in utero to either endogenous or exogenous androgens.

Female pseudohermaphroditism - Etiology::The most common cause is the adrenogenital syndrome (CAH). CAH is the only cause of ambiguous genitalia that is life-threatening in the newborn period. 95% of these patients will have a 21-hydroxlyase deficiency. The gene for 21 hydroxylase has 2 alleles coded for in the Class II MHComplex, and there is therefore an A and B form of 21 OHase deficiency - the common form is the B variant. Mutations in the A genes result in milder, later onset forms of the disease. 21 hydroxylase deficiency results in aldosterone (mineralocorticoid) and cortisol (glucocorticoid) deficiencies, resulting in salt-wasting, hypotension, and adrenal crises. Other etiologies include 3 beta and 11 hydroxylase deficiencies. The 21, 3, and 11 are all forms of congenital adrenal hyperplasia (CAH). 11Beta OHase deficiency results in mild virilism (in affected females) and hypertension. In this variant, both mineralocorticoid and steroid replacement should be provided, since steroids alone may suppress the mineralocorticoid.

Female pseudohermaphroditism - Evaluation::The prenatal diagnosis of CAH can be made from DNA analysis of CVS (chorionic villous sampling) or amniotic fluid hormone levels during or after the 2nd trimester. The best way to test for CAH is to look for elevated precursors: {Deficiency,Elevated Precursor,Frequency} = [21 Hydroxylase; 17 hydroxyprogesterone; 95% cases] and [3BetaSteroid dehydrogenase; 17 hydroxypregnenolone: < 5% cases] and [11 Beta hydroxylase; 11 deoxycortisol; rare]. Clinically, prompt identification of patients with CAH is critical. Virilization is present in the female, and in the male only barely identifiable hyperpigmentation of the scrotum may be present. The history of an early or unexplained death in a sibling should alert one to the possibility. A filter-paper test for the most common defect (test is for 17 hydroxyprogesterone) is available. ECG findings of peaked T waves or arrhythmia's may be the first sign. Internal structures are normal, and only the external structures are affected (this is true because the adrenal develops after the 11th week of gestation when the internal structures are already formed). All genetically female patients have the potential to be fertile and should be raised as females. The phenotype is variable from very male appearing to milder forms. The life-threatening electrolyte abnormalities (hyperkalemia, hyponatremia) may not occur until 3 - 5 days after birth, and the adrenal crisis may not occur until 1-2 weeks of age.

Female pseudohermaphroditism - Treatment:: Can even be preventative, if CAH is identified prenatally - dexamethasone is given (1 - 1.5 mg, daily in 2 divided doses) to the mother, starting at the 6 - 7th week of gestation (before sexual differentiation). CVS is used to assess therapy - if the fetus is genetically male, Tx is stopped, if the fetus is female, Tx is continued until amniocentesis during 2nd trimester to confirm the Dx. Fetoscopy has been used to evaluate the external genitalia. Medical management of CAH consists of provision of glucocorticoid (hydrocortisone, 12.5 -15 mg/M2 q 8 hrs, provision of mineralocorticoid (Fludrocortisone 0.1mg q am), hydration, correction of Na, K+ abnormalities. All patients with female pseudohermaphroditism should be raised as females. Surgically, clitoral recession is done in the early neonatal period, and a cutback or flap vaginoplasty is usually done at 3 - 6 months of age. A pull-through vaginoplasty is usually delayed until about 2 years of age. Which of these is required depends on the level of entry of the vagina into the urogenital sinus.

Male Pseudohermaphroditism - General:: Accounts for approximately 1/3 of all patients. These patients have a 46 X,Y karyotype but deficient masculinization of the external genitalia. The effects of androgens on sexual differentiation are via receptors in the nucleus.

etc.......

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
p "Enter a title"
title  = gets.chomp
dict = {}
IO.foreach(title + ".txt") do
|x| 
if
y = /::/.match(x)
y = y.pre_match
z=/::/.match(x)
z = z.post_match
dict[y] = z
end
end
File::open(title + '.htm', 'w') do |f|
	f.puts "<HTML>\n<link href='Level3_3.css' rel='stylesheet' type='text/css'><HEAD><TITLE>" + title + "</TITLE></HEAD>"
	f.puts "<CENTER><A NAME=\"page_top\"><H1>" + title + "</H1></A>"	
  	f.puts "by Charles L. Snyder, MD<BR>\n"
	f.puts "</CENTER>\n<HR>\n"
	dict.keys.sort.each {|s| f.puts "<br>#{s}</br>"}
	f.puts "</CENTER>\n<HR>\n"
  i=0
  while i < (dict.length)
  f.puts "<A NAME=\"$anchor\"><H2>" + dict.keys.sort[i] + "</H2></A>" + dict.values[i] + "<BR>"
	f.puts "<CENTER><A HREF=\'javascript:window.history.back()\'>Back</A>&nbsp"
  f.puts "</CENTER>\n<HR>\n"
  i = i + 1
  end
end

Comments are closed.