Giter Club home page Giter Club logo

trial-patient-test's Introduction

take-home-test

Overview

  • clone this repository (do not fork it)
  • implement the required feature
  • publish it to your github
  • send us the link and tell us approximatively how much time you spent on this assignment

Requirements

You are a new developer in the Inato team, and your first job is to add a feature to an existing piece of code.

Existing code

The existing code computes the evolution of the value of a patient for each elapsed day in a clinical trial. Here are the basic rules of this system:

  • each patient has a surgeryIn attribute, which denotes the number of days before the surgery (negative if the surgery is in the past)
  • each patient has a value attribute, which denotes how valuable the patient is
  • at the end of each day our system lowers both attributes for every patient

But there is more:

  • once the surgery has been done, value drops twice as fast
  • the value of a patient is never negative
  • patients with the disease "Multiple sclerosis" actually increase in value as time passes
  • the value of a patient is never more than 50
  • patients with the disease "Pancreatic cancer" cannot be operated, and never decrease in value
  • patients with the disease "Chronic obstructive pulmonary disease", like patients with the disease "Multiple sclerosis", increase in value as their surgery approaches; value increases by 2 when there are 10 days or less and by 3 when there are 5 days or less but value drops to 0 after the surgery

New feature

We have recently started a new project on a disease named "Hepatocellular carcinoma", which has the following property:

  • patients degrade in value twice as fast as normal patients

Guidelines

You are encouraged to refactor the existing code before adding your own, as you would do if this was a real task in real life. We strongly recommend that you write tests to help you during this process.

Feel free to make any changes to the updateValue method implementation and add any new code as long as everything still works correctly. However, do not alter the Patient class or patients property, as those are used by other pieces of the software.

Please commit as frequently as possible to make the review easier.

Start generation

To make sure that you will not break anything in the existing code, we added a log of the simulation in the output.txt file. You can generate a new file by running one of the following commands:

yarn start
docker-compose up

Test

To run tests, run the following :

yarn test

Todos

An ordered list of the different steps we'll need to do

  • Add unit tests inside the trial.test.js
  • Change the folders structure (src, model, controller)
  • Separate the code of the update
  • Implement the new feature
  • Change output.txt to JSON file and use it in the test

trial-patient-test's People

Contributors

simonghrt avatar bastoche avatar

Watchers

James Cloos 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.