Charles Tritt / Mbed 2 deprecated PatientStructure

Dependencies:   mbed

Fork of test_patient_structure by MSOE EE2905

Revision:
0:c435f76658b2
Child:
1:060801821b1c
diff -r 000000000000 -r c435f76658b2 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Nov 02 18:31:39 2017 +0000
@@ -0,0 +1,39 @@
+#include "mbed.h"
+#include "patients.h"
+
+//Pretend we have a pulse oximeter attached to A0 which provides the SpO2
+//as a fraction.
+AnalogIn pulse_oximeter(A0);
+
+int main()
+{
+    // Create an array of patient_record structures to form the patient database.
+    struct patient_record all_patients[MAX_PATIENTS];
+    // Keep track of the number of patients.
+    int enrollment=0;
+    
+    //Add patient info.
+    newPatient(&(all_patients[enrollment]),"George","Washington");
+    enrollment++;
+
+    newPatient(&(all_patients[enrollment]),"John","Adams");
+    enrollment++;
+    
+    newPatient(&(all_patients[enrollment]),"Thomas","Jefferson");
+    enrollment++;
+
+    //Look up a patient--this one is not in our database.    
+    int X=lookup_patient_name(all_patients,"Abraham","Lincoln");
+    pc.printf("Abraham Lincoln is patient %d\n",X);
+    
+    //Look up a patient.    
+    int Y=lookup_patient_name(all_patients,"Thomas","Jefferson");
+    pc.printf("Thomas Jefferson is patient %d\n",Y);
+   
+    //Enter patient's vitals.
+    recordBPinteractive(all_patients, pulse_oximeter);
+
+    while(1);   
+
+
+}
\ No newline at end of file