zdavatz / oddb2xml

oddb2xml, create xml files using refdata, swissmedic and bag xml files
http://www.ywesee.com/Oddb2xml/Index
GNU General Public License v3.0
8 stars 5 forks source link

Add Pharmacodes via GTIN if they are missing. #80

Closed zdavatz closed 11 months ago

zdavatz commented 12 months ago
  1. https://emediplan.ch/wp-content/uploads/2023/11/20231101__MappingPharmacodeToGtinToSwissmedicDescription.xlsx
  2. Add Pharmacodes via GTIN if they are missing.
  3. Make sure latest file is downloaded.
  4. Download URL for each month is always:
  5. https://emediplan.ch/wp-content/uploads/2023/10/20231001__MappingPharmacodeToGtinToSwissmedicDescription.xlsx
  6. https://emediplan.ch/wp-content/uploads/2023/09/20230901__MappingPharmacodeToGtinToSwissmedicDescription.xlsx
  7. etc. We only need to download the latest file.
zdavatz commented 12 months ago

this script seems to work:

#!/bin/bash

# Set the base URL
base_url="https://emediplan.ch/wp-content/uploads/"

# Get the current year and month
current_year=$(date +%Y)
current_month=$(date +%m)

# Form the URL with the first day of the current month
file_url="${base_url}${current_year}/${current_month}/${current_year}${current_month}01__MappingPharmacodeToGtinToSwissmedicDescription.xlsx"

# Set the destination directory where you want to save the file
#rm /tmp/*.xlsx
destination_directory="/tmp"

# Download the file
echo "Downloading file..."
wget -P "$destination_directory" "$file_url" -O pharmacodes.xlsx

# You can add additional commands here if needed

echo "Download complete."
zdavatz commented 11 months ago

it looks like only two Pharmacodes are missing.

zdavatz commented 11 months ago

GTIN: 7612449123870 Pharmacode: 2834904 GTIN: 7612449123924 Pharmacode: 2834910