Pulmonary-Embolism program:
Below I present a program I wrote that examines your knowledge about pulmonary embolisms. It also includes an exercise to calculate a wells-score of a randomized patient.
I am especially proud on the randomization aspect:
You can use the site: ‘ http://browxy.com/ ‘ to run the program if you don’t have a compiler yourself. If you have suggestions to improve the program, I would be very glad to hear.
The code:
import java.util.Random;
import java.util.Scanner;
public class PulmoneryEmbolism {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println(“Type in the symptoms of Pulmonary embolism”);
input.nextLine();
System.out.println(“Symptoms: Notoriously mild! Rapid dyspnea at rest or with exertion (73 percent), Pleuritic pain (44 percent), Cough (37 percent) , Orthopnea (28 percent), “);
System.out.println(“Symptoms: Calf or thigh pain and/or swelling (44 percent), Wheezing (21 percent), Hemoptysis (13 percent)”);
System.out.println();
System.out.println(“Type in clinical findings of pulmonery embolism”);
input.nextLine();
System.out.println(“Low specificity, ++JVP, tachypneu, tachycardia, leg-swelling, abnormal lung sounds, hypotension “);
System.out.println(“Differential diagnosis”);
input.nextLine();
System.out.println(“Pneumonia, pneumothorax, pleuritis, rib fracture, pleural effusions (blood), pulmonary vascular disease such as vasculitis, interstitial lung disease, congential heart, COPD exacerbation “);
System.out.println(“Type in diagnostics of pulmonery embolism”);
input.nextLine();
System.out.println(“Diagnostics: sat%, CBC, ABG, D-dimer, X-thorax (for other findings), CTPA, V/Q, contrast ct, leg-echo “);
System.out.println(“Type in at risk populations”);
input.nextLine();
System.out.println(“Malignancy, pregnatn, stroke, hospitalized patients, surgery, neurological disease, thrombotic disorders (obesity,smoking,hypertension)”);
System.out.println(“Type in treatment of stable PE”);
input.nextLine();
System.out.println(“Treatment: O2, hemodynamically stable, anticoagulation (heparin), “);
System.out.println(“Type in treatment of unstable PE”);
input.nextLine();
System.out.println(“Treatment: O2, hemodynamically stable, anticoagulation (heparin), “);
System.out.println(“Complications”);
input.nextLine();
System.out.println(“Right-sided heart failure, “);
System.out.println(“What is the goal of testing D-dimer”);
input.nextLine();
System.out.println(“You can only exclude”);
System.out.println(“Type in the Wellscriteria”);
input.nextLine();
System.out.println(“You score the Wells-criteria according to the following rules”);
System.out.println();
System.out.println(“For clinical symptoms of DVT: +3”);
System.out.println(“For PE is #1 Diagnosis: +3 “);
System.out.println(“If heartrate >100: +1.5”);
System.out.println(“If immobilisation for at least 3 days: +1.5”);
System.out.println(“For surgery in previous 4 weeks: +1.5”);
System.out.println(“For previous DVT: +1.5”);
System.out.println(“For hemoptysis: +1”);
System.out.println(“Malignancy in last 6 months: +1”);
System.out.println(“These are the 8 wells criteria”);
System.out.println();
System.out.println(“Are you ready for the patient? “);
String yesorno = input.nextLine();
System.out.println();
if (yesorno.equalsIgnoreCase(“YES”)) {
Random a = new Random();
Random b = new Random();
Random c = new Random();
Random d = new Random();
Random e = new Random();
Random f = new Random();
Random g = new Random();
Random h = new Random();
int aa = a.nextInt(2);
int bb = b.nextInt(2);
int cc = c.nextInt(2);
int dd = d.nextInt(2);
int ee = e.nextInt(2);
int ff = f.nextInt(2);
int gg = g.nextInt(2);
int hh = h.nextInt(2);
double aaa = 3.0 * aa;
double bbb = 3.0 * bb;
double ccc = 1.5 * cc;
double ddd = 1.5 * dd;
double eee = 1.5 * ee;
double fff = 1.5 * ff;
double ggg = 1.0 * gg;
double hhh = 1.0 * hh;
double score = aaa+bbb+ccc+ddd+eee+fff+ggg+hhh;
System.out.println(“The patient has the following: “);
if (aa == 0) {System.out.print(“No clinical symptoms of DVT. “);} else {System.out.print(“Clinical symptoms of DVT. “);}
if (bb == 0) {System.out.print(“PE is not #1 in the differential diagnosis. “);} else {System.out.print(“PE is #1 Diagnosis in differential diagnosis. “);}
if (cc == 0) {System.out.println(“Heartrate is under 100. “); } else {System.out.println(“Heartrate is above 100. “);}
if (dd == 0) {System.out.print(“No immobilisation. “); } else {System.out.print(“Immobilisation for at least 3 days. “);}
if (ee == 0) {System.out.print(“No surgery in previous 4 weeks. “);} else {System.out.print(“Surgery in previous 4 weeks. “);}
if (ff == 0) {System.out.print(“No previous DVT. “);} else {System.out.print(“There is previous DVT. “);}
if (gg == 0) {System.out.println(“No hemoptysis. “);} else {System.out.println(“Hemoptysis. “);}
if (hh == 0) {System.out.print(“No malignancy in last 6 months. “);} else {System.out.print(“Malignancy in last 6 months. “);}
System.out.println();
System.out.println();
System.out.println(“What is the score?”);
double answer = input.nextDouble();
if (score == answer) {System.out.println(“Well done”);} else
{System.out.println(“Try again”); double answer2 = input.nextDouble();
if (score == answer2) {System.out.println(“Well done”); } else { System.out.println(“Again wrong, the score was ” + score);
}
}
} else {System.out.println(“Lame”);
}
}
}