Simple watchdog for service https://medicover.pl enabling monitoring if medical appoitment visit of defined type has appeared in the system. You can read about it on below website.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
bin
config
db
lib
log
public
test
vendor/assets
.gitignore
Gemfile
Gemfile.lock
LICENSE
MedicoverVisitWatchdog.rb
Procfile
README.rdoc
Rakefile
config.ru
scaffold_notes
startServerWithEnvVariables.sh

README.rdoc

README

Simple watchdog for service medicover.pl enabling monitoring if medical appoitment visit of defined type has appeared in the system. You can read about it under: bnowakowski.pl/proof-of-concept-for-scheduling-a-medical-appointment-automatically/

Sample deployment on heroku

If you want to try this app it would be easiest to deploy it on Heroku (you wouldn't be required to install Ruby and Rails dependencies, configure AS etc). Once you've installed Heroku toolbelt (CLI command) and created Heroku application you need to: git push heroku heroku run rake db:migrate heroku open

Configuring app

Go to: /medicover_apis/new, you can find standard values (as of date of writing this Readme) below:

  • Url = mol.medicover.pl

  • New visit path = /api/MyVisits/SearchFreeSlotsToBook?language=pl-PL

  • Refresh token path = /Users/Account/LogOn

One should also fill Username and Password which will be used to log in to medical care provider (via HTTPS) and obtain and use further a token. Please keep in mind that if you deploy on Heroku you shoulnd't put your credentials in to the wild. In such case you should sniff your token while logging to Medicover and upload it to an app (please keep in mind it's expiry date so you can't be too slow with this).

Add appointment watchdog

Go to: /medicover_visit_queries/new you can find standard values (as of date of writing this Readme) below:

  • Booking type = 200

  • Language = -1

  • Doctor = -1

  • Period of the day = 0

  • Set because of pcc = f

  • Is set because promote specialization = f

Values of rest fields (which list you can find below) should be looked up on mol.medicover.pl (via Firebug, Charles etc) as one need to pick type of visit or localisation.

  • Region (localisation)

  • Specialization (type of visit)

  • Clinic (particular clinic in given localisation)

  • Search since (date from which visits will be searched)

Go to: medicover_visits_watchdogs/new and pick query that you've just created. Please be advised that mail notification configuration is currently hardcoded in medicover_visits_watchdogs_controller.rb in method refresh_visits. Once you've done above you can add to your cron line like: 00 * * * * curl https://REPLACE-WITH-YOUR-APP-NAME.herokuapp.com/