Add magnesium 500 mg capsules, and specify form of magnesium

This commit is contained in:
RunasSudo 2023-02-24 23:48:19 +11:00
parent 38486e6206
commit fd22cd79d6
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A
3 changed files with 25 additions and 4 deletions

View File

@ -78,18 +78,25 @@ for mp_preferred_term in sorted(brand_names.keys()):
for i in range(1, len(words)):
short_name = ' '.join(words[0:i])
# Conflict if ambiguous brand name prefix
if any(b.startswith(short_name) for m in brand_names.keys() if m != mp_preferred_term for b in brand_names[m]):
# Conflict
continue
# Exceptions
if short_name == 'Coloxyl with':
continue
continue # Looks strange to cut off here
if short_name == 'Magnesium':
continue # Disambiguates Magnesium Forte
# Can shorten
if brand_name in brand_names[mp_preferred_term]:
brand_names[mp_preferred_term].remove(brand_name)
# Don't list brand name if it is same as generic
if short_name.lower() != mp_preferred_term.lower():
brand_names[mp_preferred_term].add(short_name)
break
# Add to database

View File

@ -141,7 +141,10 @@ for mpp_id in sorted(list(mpps_to_parse)):
mp = root.find('pbs:drugs-list', ns).find('pbs:mp[@xml:id="' + mp_id + '"]', ns)
mp_code = mp.find('pbs:code[@rdf:resource="http://pbs.gov.au/Drug/MP"]', ns).text # Must look this up because the <code> in <mp-reference> is only SNOMED
# Manual fixups for metoprolol
# -------------
# Manual fixups
# Metoprolol
if 'METOPROLOL' in mpp_preferred_term:
# Incorrect capitalisation
mpp_preferred_term = mpp_preferred_term.replace('METOPROLOL SUCCINATE Tablet', 'metoprolol succinate')
@ -156,6 +159,11 @@ for mpp_id in sorted(list(mpps_to_parse)):
mp_id = None
mp_code = '432PBSC'
# Magnesium
if mpp_preferred_term.startswith('magnesium 37.4 mg'):
# Specify form
mpp_preferred_term = mpp_preferred_term.replace('magnesium 37.4 mg', 'magnesium (as aspartate) 37.4 mg')
cur.execute('INSERT INTO pbs_mpp (code, mp_code, preferred_term) VALUES (?, ?, ?)', (mpp_code, mp_code, mpp_preferred_term))
# Queue the MP for parsing
@ -179,6 +187,10 @@ for mp_id in sorted(list(mps_to_parse)):
# Specified as all uppercase in PBS XML for some reason
mp_preferred_term = 'metoprolol'
if mp_code == '686PBSC':
# Specify form
mp_preferred_term = 'magnesium aspartate'
cur.execute('INSERT INTO pbs_mp (code, preferred_term) VALUES (?, ?)', (mp_code, mp_preferred_term))
# Parse TPPs

View File

@ -22,6 +22,8 @@ ferrous sulfate + folic acid,"ferrous sulfate 270 mg (iron 87.4 mg) + folic acid
ferrous sulfate + folic acid,"ferrous sulfate 270 mg (iron 87.4 mg) + folic acid 300 microgram capsule, 60",Fefol,https://www.mimsonline.com.au.acs.hcn.com.au/Search/AbbrPI.aspx?ID=2850001_2,2023-02-04,
iron polymaltose,"iron (as polymaltose) 100 mg tablet, 30",Maltofer,https://www.mimsonline.com.au.acs.hcn.com.au/Search/AbbrPI.aspx?ID=6800001_2,2023-02-04,
lactulose,"lactulose 0.67 g/mL oral liquid, 500 mL",Actilax,https://amhonline.amh.net.au.acs.hcn.com.au/chapters/gastrointestinal-drugs/laxatives/osmotic-laxatives/lactulose,2023-02-18,
magnesium oxide + magnesium phosphate + magnesium amino acid chelate,"magnesium (as oxide) 337 mg + magnesium (as phosphate) 36 mg + magnesium (as amino acid chelate) 27 mg (total magnesium 400 mg) capsule, 30",Magnesium Forte,https://www.chemistwarehouse.com.au/buy/113879,2023-02-24,
magnesium oxide + magnesium phosphate + magnesium amino acid chelate,"magnesium (as oxide) 337 mg + magnesium (as phosphate) 36 mg + magnesium (as amino acid chelate) 27 mg (total magnesium 400 mg) capsule, 100",Magnesium Forte,https://www.chemistwarehouse.com.au/buy/111599,2023-02-24,
melatonin,"melatonin 2 mg modified release tablet, 30",Circadin,https://amhonline.amh.net.au.acs.hcn.com.au/chapters/psychotropic-drugs/drugs-anxiety-sleep-disorders/other-drugs-anxiety-sleep-disorders/melatonin,2023-02-10,
melatonin,"melatonin 2 mg modified release tablet, 60",Circadin,https://amhonline.amh.net.au.acs.hcn.com.au/chapters/psychotropic-drugs/drugs-anxiety-sleep-disorders/other-drugs-anxiety-sleep-disorders/melatonin,2023-02-10,
montelukast,"montelukast 10 mg tablet, 14",Singulair,https://amhonline.amh.net.au.acs.hcn.com.au/chapters/respiratory-drugs/drugs-asthma-chronic-obstructive-pulmonary-disease/other-drugs-asthma/montelukast,2023-02-06,

1 MP MPP TPP Source Accessed Hide
22 ferrous sulfate + folic acid ferrous sulfate 270 mg (iron 87.4 mg) + folic acid 300 microgram capsule, 60 Fefol https://www.mimsonline.com.au.acs.hcn.com.au/Search/AbbrPI.aspx?ID=2850001_2 2023-02-04
23 iron polymaltose iron (as polymaltose) 100 mg tablet, 30 Maltofer https://www.mimsonline.com.au.acs.hcn.com.au/Search/AbbrPI.aspx?ID=6800001_2 2023-02-04
24 lactulose lactulose 0.67 g/mL oral liquid, 500 mL Actilax https://amhonline.amh.net.au.acs.hcn.com.au/chapters/gastrointestinal-drugs/laxatives/osmotic-laxatives/lactulose 2023-02-18
25 magnesium oxide + magnesium phosphate + magnesium amino acid chelate magnesium (as oxide) 337 mg + magnesium (as phosphate) 36 mg + magnesium (as amino acid chelate) 27 mg (total magnesium 400 mg) capsule, 30 Magnesium Forte https://www.chemistwarehouse.com.au/buy/113879 2023-02-24
26 magnesium oxide + magnesium phosphate + magnesium amino acid chelate magnesium (as oxide) 337 mg + magnesium (as phosphate) 36 mg + magnesium (as amino acid chelate) 27 mg (total magnesium 400 mg) capsule, 100 Magnesium Forte https://www.chemistwarehouse.com.au/buy/111599 2023-02-24
27 melatonin melatonin 2 mg modified release tablet, 30 Circadin https://amhonline.amh.net.au.acs.hcn.com.au/chapters/psychotropic-drugs/drugs-anxiety-sleep-disorders/other-drugs-anxiety-sleep-disorders/melatonin 2023-02-10
28 melatonin melatonin 2 mg modified release tablet, 60 Circadin https://amhonline.amh.net.au.acs.hcn.com.au/chapters/psychotropic-drugs/drugs-anxiety-sleep-disorders/other-drugs-anxiety-sleep-disorders/melatonin 2023-02-10
29 montelukast montelukast 10 mg tablet, 14 Singulair https://amhonline.amh.net.au.acs.hcn.com.au/chapters/respiratory-drugs/drugs-asthma-chronic-obstructive-pulmonary-disease/other-drugs-asthma/montelukast 2023-02-06