-
Notifications
You must be signed in to change notification settings - Fork 687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid medications in Synthea #469
Comments
Thanks @shabiel. I added a note to the wiki to reinforce this practice: https://github.com/synthetichealth/synthea/wiki/Generic-Module-Framework:-Basics#rxnorm-codes |
Thank you. Here's another one: 316049. That's Hydrochlorothiazide 25mg as a component. It can be part of 20-30 prescribable drugs. I am not sure what I want to do about it yet. I can fix them again, but I want a long term solution. Something like a pull request reject if the RxNorm is not a valid RxNorm for a prescribable drug. Let me think about it. |
GitHub does support pull request templates, so it's possible to add a checklist of requirements for the contributor and reviewer to verify on each pull request. As the synthea community continues to grow I think it would be a good idea to define some expectations that new contributions should adhere to. It's beneficial for both potential contributors to know in advance what the objective grading criteria are, as well as helpful for reviewers so they don't forget to check something potentially important. |
I am thinking of an automated way: a web service call on each pull request to check if the RxNorm has NDCs. I haven't validated these yet, but something like this: https://rxnav.nlm.nih.gov/RxNormAPIs.html#uLink=RxNorm_REST_getAllHistoricalNDCs and https://rxnav.nlm.nih.gov/RxNormAPIs.html#uLink=RxNorm_REST_getAllNDCs. |
316052: HCTZ 6.25mg does not exist on the market (and as far as I know, it never did, at least for humans. Maybe cats or dogs get to have it!). |
I will work over the next three days to get these fixed, so we can close the issue. |
I started on this. I wrote a script to extract all RxNorm codes from Synthea and analyze them. Here is the script and the preliminary results: #!/bin/bash
file1=/tmp/syn.rxnorm.all
file2=/tmp/syn.rxnorm.sorted.uniq
rm -f $file1 $file2
# Grab all the RxNorm codes in all the models
echo "Extracting all RxNorm codes..."
for model in $(find src/main/resources/modules -type f); do
jq -rc '.. | .codes?[]? | select(.system == "RxNorm").code' < $model >> $file1
done
# Deduplicate the codes, so we only have unique codes
echo "Deduplicating..."
cat $file1 | sort -n | uniq > $file2
#cat $file2
#exit 0
echo "Calling RxNorm API to check NDCs"
echo "CODE TYPE #NDCS" | column -tx
while read -r code; do
ndcsLength=$(curl -s https://rxnav.nlm.nih.gov/REST/rxcui/$code/ndcs.json | jq -c '.ndcGroup.ndcList.ndc | length')
tty=$(curl -s https://rxnav.nlm.nih.gov/REST/rxcui/$code/property.json?propName=tty | jq -r '.propConceptGroup.propConcept[0].propValue')
output="$code $tty $ndcsLength"
echo $output | column -tx
done < $file2 Result:
I am very pleased with this. You can already tell where the problems are! I will refine the script as I learn more. |
Please consider submitting a pull request to add your refined script to a |
I raised this issue before, and made a pull request to clean up the existing meds, but I see it crept up again. I will put it here in github: When picking an RxNorm code, you must use something that has an NDC on the market, now or in the past.
E.g.: 1153378 is Clonazepam Oral. That is not something a patient can take. It has to be Clonzapeam 0.5mg oral tablet (197527) as an example.
The text was updated successfully, but these errors were encountered: