Coder Social home page Coder Social logo

emilybache / katamedicineclash Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 14.0 193 KB

Sample solution and graph visualization code for the MedicineClash Code Kata

License: MIT License

C++ 7.15% Java 2.59% JavaScript 1.76% Python 55.73% Ruby 32.53% Makefile 0.24%

katamedicineclash's Introduction

This Kata is included in my book "The Coding Dojo Handbook".

  • In the folder for each language, are skeleton classes for the domain objects, to get you started on the kata.
  • In the folder "Refactoring" is a refactoring version of this kata
  • In the folder "SampleVisualization", is some Python code that can create a graph to visualize a medicine clash.

Kata: Medicine Clash

As a Health Insurer,

I want to be able to search for patients who have a medicine clash,

So that I can alert their doctors and get their prescriptions changed.

Health Insurance companies don't always get such good press, but in this case, they actually do have your best interests at heart. Some medicines interact in unfortunate ways when they get into your body at the same time, and your doctor isn't always alert enough to spot the clash when writing your prescriptions. Sometimes, medicine interactions are only identified years after the medicines become widely used, and your doctor might not be completely up to date. Your Health Insurer certainly wants you to stay healthy, so discovering a customers has a medicine clash and getting it corrected is good for business, and good for you!

For this Kata, you have a recently discovered medicine clash, and you want to look through a database of patient medicine and prescription records, to find if any need to be alerted to the problem. Create a "Patient" class, with a method "Clash" that takes as arguments a list of medicine names, and how many days before today to consider, (defaults to the last 90 days). It should return a collection of days on which all the medicines were being taken during this time.

Doing this kata on cyber-dojo

As an alternative to downloading the code, click one of the links below to create a new cyber-dojo to work in, then press "start" to get going coding.

Data Format

You can assume the data is in a database, which is accessed in the code via an object oriented domain model. The domain model is large and complex, but for this problem you can ignore all but the following entities and attributes:

Patient
+ medicines

Medicine
+ name
+ prescriptions

Prescription
+ dispense date
+ days supply

So each Patient has a list of Medicines. Medicines have a unique name. Each Medicine has a list of Prescriptions. Each Prescription has a dispense date and a number of days supply.

You can assume:

  • patients start taking the medicine on the dispense date.
  • the "days supply" tells you how many days they continue to take the medicine after the dispense date.
  • if they have two overlapping prescriptions for the same medicine, they stop taking the earlier one. Imagine they have mislaid the medicine they got from the first prescription when they start on the second prescription.

katamedicineclash's People

Contributors

emilybache avatar tplesnar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.