All Projects → HicServices → BadMedicine

HicServices / BadMedicine

Licence: GPL-3.0 license
Library and CLI for randomly generating medical data like you might get out of an Electronic Health Records (EHR) system

Programming Languages

C#
18002 projects
TSQL
950 projects

Projects that are alternatives of or similar to BadMedicine

mocha-wrap
Fluent pluggable interface for easily wrapping `describe` and `it` blocks in Mocha tests.
Stars: ✭ 54 (+200%)
Mutual labels:  tests, testing-tools
regression-testing
Regression testing in Elm!
Stars: ✭ 22 (+22.22%)
Mutual labels:  tests, testing-tools
playwright-test
Run unit tests with several runners or benchmark inside real browsers with playwright.
Stars: ✭ 81 (+350%)
Mutual labels:  tests, testing-tools
ctest
A simple portable C test runner
Stars: ✭ 17 (-5.56%)
Mutual labels:  tests, testing-tools
Cypress
Fast, easy and reliable testing for anything that runs in a browser.
Stars: ✭ 35,145 (+195150%)
Mutual labels:  tests, testing-tools
PixelTest
Fast, modern, simple iOS snapshot testing written purely in Swift.
Stars: ✭ 56 (+211.11%)
Mutual labels:  tests, testing-tools
ts-mock-imports
Intuitive mocking library for Typescript class imports
Stars: ✭ 103 (+472.22%)
Mutual labels:  tests, testing-tools
Patient2Vec
Patient2Vec: A Personalized Interpretable Deep Representation of the Longitudinal Electronic Health Record
Stars: ✭ 85 (+372.22%)
Mutual labels:  ehr, electronic-health-records
Avoriaz
🔬 a Vue.js testing utility library
Stars: ✭ 771 (+4183.33%)
Mutual labels:  tests, testing-tools
estj
EstJ is my own test framework!
Stars: ✭ 13 (-27.78%)
Mutual labels:  tests, testing-tools
Telegraf-Test
Telegraf Test - Simple Test ToolKit of Telegram Bots
Stars: ✭ 22 (+22.22%)
Mutual labels:  tests, testing-tools
Acutest
Simple header-only C/C++ unit testing facility.
Stars: ✭ 170 (+844.44%)
Mutual labels:  tests, testing-tools
Mongodb Memory Server
Spinning up mongod in memory for fast tests. If you run tests in parallel this lib helps to spin up dedicated mongodb servers for every test file in MacOS, *nix, Windows or CI environments (in most cases with zero-config).
Stars: ✭ 1,376 (+7544.44%)
Mutual labels:  tests, testing-tools
pdd-graph
PDD Graph : Bridging MIMIC-III and Linked Data Cloud
Stars: ✭ 31 (+72.22%)
Mutual labels:  patient, ehr
jest-watch-suspend
Suspending jest watch mode
Stars: ✭ 13 (-27.78%)
Mutual labels:  testing-tools
eat
Json based scenario testing tool(which can have test for functional and non-functional)
Stars: ✭ 41 (+127.78%)
Mutual labels:  testing-tools
EntryCustomReturnPlugin
Xamarin.Forms Plugin to customize the Xamarin.Forms.Entry Keyboard Return Button
Stars: ✭ 81 (+350%)
Mutual labels:  nuget
tools
Tools used for Penetration testing / Red Teaming
Stars: ✭ 63 (+250%)
Mutual labels:  testing-tools
baset
Testing tool for baseline strategy
Stars: ✭ 26 (+44.44%)
Mutual labels:  testing-tools
trafficator
Traffic generator for local analytics testing
Stars: ✭ 27 (+50%)
Mutual labels:  testing-tools

BadMedicine

Build Status NuGet Badge Total alerts

Library and CLI for randomly generating medical data like you might get out of an Electronic Health Records (EHR) system. It is intended for generating data for demos and testing ETL / cohort generation/ data management tools.

BadMedicine differs from other random data generators e.g. Mockaroo, SQL Data Generator etc in that data generated is based on (simple) models generated from live EHR datasets collected for over 30 years in Tayside and Fife (UK). This makes the data generated recognisable (codes used, frequency of codes etc) from a clinical perspective and representative of the problems (ontology mapping etc) that data analysts would encounter working with real medical data.

Datasets generated are not suitable for training AI algorithms etc (See What is Modelled?)

Datasets

The following synthetic datasets can be produced.

Dataset Description
Demography Address and patient details as might appear in the CHI register
Biochemistry Lab test codes as might appear in Sci Store lab system extracts
Prescribing Prescription data of prescribed drugs
Carotid Artery Scan Scan results for Carotid Artery
Hospital Admissions ICD9 and ICD10 codes for admission to hospital
Maternity Records of births etc

Usage:

BadMedicine is available as a nuget package for linking as a library

The standalone CLI (BadMedicine.exe) is available in the releases section of Github

Usage is as follows:

BadMedicine.exe c:\temp\

You can change how much data is produced (e.g. 500 patients, 10000 records per dataset):

BadMedicine.exe c:\temp\ 500 10000

Or run only a single dataset:

BadMedicine.exe c:\omg 5000 200000 -l -d CarotidArteryScan

You can seed the generator (Guids generated will still differ)

BadMedicine.exe c:\omg 5000 200000 -l -d CarotidArteryScan -s 5000

Building

Building requires MSBuild 15 or later (or Visual Studio 2017 or later). You will also need to install the DotNetCore 2.2 SDK.

You can build a OS specific binary

First build BadMedicine.csproj

dotnet publish BadMedicine.csproj -r win-x64 --self-contained
cd .\bin\Debug\netcoreapp2.2\win-x64\

Direct to Database

You can generate data directly into a relational database (instead of onto disk).

To turn this mode on rename the file BadMedicine.template.yaml to BadMedicine.yaml and provide the connection strings to your database e.g.:

Database:
  # Set to true to drop and recreate tables described in the Template
  DropTables: false
  # The connection string to your database
  ConnectionString: server=(localdb)\MSSQLLocalDB;Integrated Security=true;
  # Your DBMS provider ('MySql', 'PostgreSql','Oracle' or 'MicrosoftSQLServer')
  DatabaseType: MicrosoftSQLServer
  # Database to create/use on the server
  DatabaseName: BadMedicineTestData

Library Usage

You can generate test data for your program yourself by referencing the nuget package:

//Seed the random generator if you want to always produce the same randomisation
var r = new Random(100);

//Create a new person
var person = new Person(r);

//Create test data for that person
var a = new HospitalAdmissionsRecord(person,person.DateOfBirth,r);

Assert.IsNotNull(a.Person.CHI);
Assert.IsNotNull(a.Person.DateOfBirth);
Assert.IsNotNull(a.Person.Address.Line1);
Assert.IsNotNull(a.Person.Address.Postcode);
Assert.IsNotNull(a.AdmissionDate);
Assert.IsNotNull(a.DischargeDate);
Assert.IsNotNull(a.Condition1);

What is Modelled?

Data generated by BadMedicine is driven by Aggregate distributions of real health data collected in Tayside (UK). This means that codes appear in data with the frequency that match real data. For example in the Hospital Admissions data we can see that ICD9 codes (denoted by dash) cease being recorded in ~1997 in favour of ICD10 codes and we can see the most common admission conditions are sensible:

alt text

ICD 9 and ICD 10 codes in Condition1 (the main condition) upon Hospital Admission

What is not Modelled?

No inter dataset / inter record level randomisation model exists. For example the following would not be modelled:

  • If a patient is on Drug A they are more likely to also be on Drug B
  • Hospitalisations are more likely to be at the beginning/end of a patients life
  • Drug A is likely to be given to patients discharged having been treated for condition Y
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].