-
-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add Medicine module * fix/missing-pragma-once * add medicine module as source * add test for Medicine module
- Loading branch information
1 parent
e838ce6
commit 2b8d28f
Showing
7 changed files
with
292 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
|
||
namespace faker | ||
{ | ||
class Medicine | ||
{ | ||
|
||
public: | ||
/** | ||
* @brief Returns a random medical condition. | ||
* | ||
* @returns Medical condition. | ||
* | ||
* @code | ||
* Medicine::condition() // "AIDS" | ||
* @endcode | ||
* | ||
*/ | ||
static std::string condition(); | ||
|
||
/** | ||
* @brief Returns a random medical test | ||
* | ||
* @returns Medical test. | ||
* | ||
* @code | ||
* Medicine::medicalTest() // "pulmonary auscultation" | ||
* @endcode | ||
* | ||
*/ | ||
static std::string medicalTest(); | ||
|
||
/** | ||
* @brief Returns a random Medical specialty | ||
* | ||
* @returns Medical specialty. | ||
* @code | ||
* Medicine::specialty() // "Cardiology" | ||
* @endcode | ||
* | ||
*/ | ||
|
||
static std::string specialty(); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "faker-cxx/Medicine.h" | ||
|
||
#include "data/conditon.h" | ||
#include "data/medicaltests.h" | ||
#include "data/specialty.h" | ||
#include "faker-cxx/Helper.h" | ||
|
||
namespace faker | ||
{ | ||
std::string Medicine::condition() | ||
{ | ||
return Helper::arrayElement<std::string>(medicalConditions); | ||
} | ||
|
||
std::string Medicine::medicalTest() | ||
{ | ||
return Helper::arrayElement<std::string>(medicalTests); | ||
} | ||
std::string Medicine::specialty() | ||
{ | ||
return Helper::arrayElement<std::string>(specialties); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
#include <algorithm> | ||
#include <faker-cxx/Medicine.h> | ||
#include <gtest/gtest.h> | ||
|
||
#include "data/conditon.h" | ||
#include "data/medicaltests.h" | ||
#include "data/specialty.h" | ||
|
||
using namespace ::testing; | ||
using namespace faker; | ||
|
||
class MedicineTest : public Test | ||
{ | ||
public: | ||
}; | ||
|
||
TEST_F(MedicineTest, shouldGenerateMedicalCondition) | ||
{ | ||
const auto generatedMedicalCondition = Medicine::condition(); | ||
|
||
ASSERT_TRUE(std::ranges::any_of(medicalConditions, [generatedMedicalCondition](const std::string& medicalCondition) | ||
{ return medicalCondition == generatedMedicalCondition; })); | ||
} | ||
|
||
TEST_F(MedicineTest, shouldGenerateMedicalTest) | ||
{ | ||
const auto generatedMedicalTest = Medicine::medicalTest(); | ||
|
||
ASSERT_TRUE(std::ranges::any_of(medicalTests, [generatedMedicalTest](const std::string& medicalTest) | ||
{ return medicalTest == generatedMedicalTest; })); | ||
} | ||
|
||
TEST_F(MedicineTest, shouldGenerateSpecialty) | ||
{ | ||
const auto generatedSpecialty = Medicine::specialty(); | ||
|
||
ASSERT_TRUE(std::ranges::any_of(specialties, [generatedSpecialty](const std::string& specialty) | ||
{ return specialty == generatedSpecialty; })); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
namespace faker | ||
{ | ||
const std::vector<std::string> medicalConditions = { | ||
"AIDS", | ||
"Anorexia Nervosa", | ||
"Arthritis, Juvenile Rheumatoid", | ||
"Asthma, Moderate or Severe Persistent", | ||
"Bronchiolitis", | ||
"Bulimia", | ||
"Cancer", | ||
"Cardiorespiratory Diseases", | ||
"Celiac Disease", | ||
"Cerebral Palsy", | ||
"Cleft Lip or Palate", | ||
"Crohn’s Disease", | ||
"Cystic Fibrosis", | ||
"Depression", | ||
"Developmental, Sensory, or Motor Disabilities", | ||
"Diabetes Mellitus", | ||
"Down syndrome", | ||
"Elevated Blood Lead Level", | ||
"Epilepsy", | ||
"Failure to Thrive", | ||
"Fetal Alcohol Syndrome", | ||
"Gall Bladder Disease", | ||
"Gastro Esophageal Reflux Disease", | ||
"Gastrointestinal Abnormalities", | ||
"HIV Infection", | ||
"Heart Disease", | ||
"Hepatitis", | ||
"Hypertension, Chronic/Prehypertension", | ||
"Hypertension, Pregnancy-induced", | ||
"Hyperthyroidism", | ||
"Hypoglycemia", | ||
"Hypothyroidism", | ||
"Inborn Errors of Metabolism", | ||
"Inflammatory Bowel Disease (IBD)", | ||
"Lactose Intolerance", | ||
"Large for Gestational Age", | ||
"Liver Disease", | ||
"Lupus Erythematosus", | ||
"Major Surgery, Burns, or Trauma", | ||
"Malabsorption Syndromes", | ||
"Meningitis", | ||
"Multiple Sclerosis", | ||
"Muscular Dystrophy", | ||
"Neonatal Abstinence Syndrome", | ||
"Neural Tube Defect (Spina Bifida)", | ||
"Nutrient Deficiency Diseases", | ||
"Pancreatitis", | ||
"Parasitic Infection", | ||
"Parkinson’s disease", | ||
"Pneumonia", | ||
"Prediabetes", | ||
"Renal Disease", | ||
"Sickle Cell Anemia", | ||
"Small Bowel Enterocolitis and syndrome", | ||
"Small for Gestational Age (SGA)", | ||
"Thalassemia Major", | ||
"Tuberculosis", | ||
"Ulcerative Colitis", | ||
"Ulcers, Stomach or Intestinal", | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
namespace faker | ||
{ | ||
const std::vector<std::string> medicalTests = { | ||
"abdominal palpation", | ||
"cardiac auscultation", | ||
"HEENT examination", | ||
"digital rectal examination", | ||
"neurological examination", | ||
"psychiatric assessment", | ||
"pulmonary auscultation", | ||
"vaginal examination", | ||
"coronary catheterization", | ||
"echocardiography", | ||
"electrocardiogram", | ||
"ballistocardiogram", | ||
"skin biopsy", | ||
"hearing test", | ||
"laryngoscopy", | ||
"capsule endoscopy", | ||
"coloscopy", | ||
"endoscopic retrograde cholangiopancreatography", | ||
"esophagogastroduodenoscopy", | ||
"esophageal motility study", | ||
"esophageal pH monitoring", | ||
"liver biopsy", | ||
"electroencephalogram", | ||
"electromyography", | ||
"neuropsychological tests", | ||
"amniocentesis", | ||
"colposcopy", | ||
"mammography", | ||
"hysteroscopy", | ||
"laparoscopy", | ||
"polysomnography", | ||
"pulmonary plethysmography", | ||
"thoracentesis", | ||
"cystoscopy", | ||
"urodynamic testing", | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
namespace faker | ||
{ | ||
const std::vector<std::string> specialties = { | ||
"Accident and emergency medicine", | ||
"Allergist", | ||
"Anaesthetics", | ||
"Cardiology", | ||
"Child psychiatry", | ||
"Clinical biology", | ||
"Clinical chemistry", | ||
"Clinical microbiology", | ||
"Clinical neurophysiology", | ||
"Craniofacial surgery", | ||
"Dermatology", | ||
"Endocrinology", | ||
"Family and General Medicine", | ||
"Gastroenterologic surgery", | ||
"Gastroenterology", | ||
"General Practice", | ||
"General surgery", | ||
"Geriatrics", | ||
"Hematology", | ||
"Immunology", | ||
"Infectious diseases", | ||
"Internal medicine", | ||
"Laboratory medicine", | ||
"Nephrology", | ||
"Neuropsychiatry", | ||
"Neurology", | ||
"Neurosurgery", | ||
"Nuclear medicine", | ||
"Obstetrics and gynaecology", | ||
"Occupational medicine", | ||
"Oncology", | ||
"Ophthalmology", | ||
"Oral and maxillofacial surgery", | ||
"Orthopaedics", | ||
"Otorhinolaryngology", | ||
"Paediatric surgery", | ||
"Paediatrics", | ||
"Pathology", | ||
"Pharmacology", | ||
"Physical medicine and rehabilitation", | ||
"Plastic surgery", | ||
"Podiatric surgery", | ||
"Preventive medicine", | ||
"Psychiatry", | ||
"Public health", | ||
"Radiation Oncology", | ||
"Radiology", | ||
"Respiratory medicine", | ||
"Rheumatology", | ||
"Stomatology", | ||
"Thoracic surgery", | ||
"Tropical medicine", | ||
"Urology", | ||
"Vascular surgery", | ||
"Venereology", | ||
}; | ||
} |