Exemplo n.º 1
0
        public void PlaceElementsExamGeneral(Texture2D buttonTexture, SpriteFont font)
        {
            Controls.Button continueButton = new Controls.Button(buttonTexture, font)
            {
                Text = "Continue"
            };
            Controls.Textbox textTitle = new Controls.Textbox(font, "Results of General Exam");

            Controls.Textbox textTemp            = new Controls.Textbox(font, $"Temperature: {PatientData.GeneralExamData[0]}");
            Controls.Textbox textHeartRate       = new Controls.Textbox(font, $"Heart Rate: {PatientData.GeneralExamData[1]}");
            Controls.Textbox textRespiratoryRate = new Controls.Textbox(font, $"Respiratory Rate: {PatientData.GeneralExamData[2]}");
            Controls.Textbox textBloodPressure   = new Controls.Textbox(font, $"Blood Pressure: {PatientData.GeneralExamData[3]}");
            Controls.Textbox textObservations    = new Controls.Textbox(font, $"Observations: {PatientData.GeneralExamData[4]}");

            // Add event handler
            continueButton.Click += ContinueButton_Click;

            // Place elements
            _screen.Place(textTitle, 0, 0);
            _screen.Place(textTemp, 2, 0);
            _screen.Place(textHeartRate, 4, 0);
            _screen.Place(textRespiratoryRate, 6, 0);
            _screen.Place(textBloodPressure, 8, 0);
            _screen.Place(textObservations, 10, 0);
            _screen.Place(continueButton, 12, 1);
        }
Exemplo n.º 2
0
 public Window()
 {
     this.Position = Utils.Global.currResolution / 2;
     this.Size     = new Vector2(300, 300);
     Texture       = Utils.Global.Load <Texture2D>("WindowBG");
     ExitButton    = new Controls.Buttons
                         (new Vector2((Position.X + Texture.Width), Position.Y), new Vector2(32, 18), "ExitButton");
     tBox = new Controls.Textbox(new Vector2(Position.X + 12, Position.Y + Texture.Height / 2));
     //rBox = new Controls.Readbox(new Vector2(Position.X + 12, (Position.Y + Texture.Height / 2)), "Drape sacre leurs on echos qu leurs trois. Un se troupeau veterans contient victoire je criaient amoureux. Certitude une incapable apprendre des abondance citadelle direction. Retombait escadrons annoncait portieres en ma boulevard he. Remit du parut treve subir il la xv. Noces jet saute oui rirez ete parce.");
 }
        private void CreateAndPlaceElements(Texture2D mmButtonTexture, SpriteFont mmButtonFont)
        {
            // Create Button Objects
            Controls.Button backButton = new Controls.Button(mmButtonTexture, mmButtonFont)
            {
                Text = "Back"
            };
            Controls.Button addcorrectcopd = new Controls.Button(mmButtonTexture, mmButtonFont)
            {
                Text = "correctcopd"
            };
            Controls.Button addcorrectpneumonia = new Controls.Button(mmButtonTexture, mmButtonFont)
            {
                Text = "correctpneumonia"
            };
            Controls.Button addcorrectchf = new Controls.Button(mmButtonTexture, mmButtonFont)
            {
                Text = "correctcopd"
            };
            Controls.Button addincorrectcopd = new Controls.Button(mmButtonTexture, mmButtonFont)
            {
                Text = "incorrectcopd"
            };
            Controls.Button addincorrectpneumonia = new Controls.Button(mmButtonTexture, mmButtonFont)
            {
                Text = "incorrectpneumonia"
            };
            Controls.Button addincorrectchf = new Controls.Button(mmButtonTexture, mmButtonFont)
            {
                Text = "incorrectcopd"
            };

            Controls.Textbox displayCoins = new Controls.Textbox(mmButtonFont, $"my accuracy is: {_playerManager.Player.NumCoins}");

            _screen.Place(displayCoins, 0, 2);

            // Assign event handlers for the buttons (so they actually do something)
            backButton.Click            += BackButton_Click;
            addcorrectcopd.Click        += addcorrectcopd_Click;
            addcorrectpneumonia.Click   += addcorrectpneumonia_Click;
            addcorrectchf.Click         += addcorrectchf_Click;
            addincorrectcopd.Click      += addincorrectcopd_Click;
            addincorrectpneumonia.Click += addincorrectpneumonia_Click;
            addincorrectchf.Click       += addincorrectchf_Click;
            // Place button objects (row and col indices gotten from DesignScreenLayout() function above)

            _screen.Place(backButton, 0, 0);
            _screen.Place(addcorrectcopd, 1, 0);
            _screen.Place(addcorrectchf, 1, 1);
            _screen.Place(addcorrectpneumonia, 1, 2);
            _screen.Place(addincorrectcopd, 2, 0);
            _screen.Place(addincorrectchf, 2, 1);
            _screen.Place(addincorrectpneumonia, 2, 2);
        }
Exemplo n.º 4
0
        private void CreateAndPlaceElements(Texture2D buttonTexture, SpriteFont font)
        {
            // Add elements
            #region CreateElements

            // Create Button Objects
            Controls.Button backButton = new Controls.Button(buttonTexture, font)
            {
                Text = "Back"
            };
            Controls.Button pneumoniaButton = new Controls.Button(buttonTexture, font)
            {
                Text = "Pneumonia"
            };
            Controls.Button copdButton = new Controls.Button(buttonTexture, font)
            {
                Text = "COPD"
            };
            Controls.Button chfButton = new Controls.Button(buttonTexture, font)
            {
                Text = "CHF"
            };


            // Text describing what to do
            Controls.Textbox instructionText = new Controls.Textbox(font, "Diagnose the underlying cause of the patient's Acute Respiratory Failure");

            #endregion

            // Assign event handlers for the buttons (so they actually do something)
            #region AssignEventHandlers
            chfButton.Click       += ChfButton_Click;
            copdButton.Click      += CopdButton_Click;
            pneumoniaButton.Click += PneumoniaButton_Click;
            backButton.Click      += BackButton_Click;

            #endregion

            // Place button objects (row and col indices gotten from DesignScreenLayout() function above)
            #region PlaceElements

            _screen.Place(backButton, 0, 0);
            _screen.Place(instructionText, 2, 0);
            _screen.Place(chfButton, 4, 1);
            _screen.Place(copdButton, 6, 1);
            _screen.Place(pneumoniaButton, 8, 1);

            #endregion
        }
Exemplo n.º 5
0
        public void PlaceElementsExamImaging(Texture2D buttonTexture, SpriteFont font)
        {
            Controls.Textbox titleText  = new Controls.Textbox(font, "Imaging Results");
            Controls.Button  okayButton = new Controls.Button(buttonTexture, font)
            {
                Text = "Okay"
            };
            Controls.Textbox infoText = new Controls.Textbox(font, "At the time of the alpha release, no imaging results are available. Stay tuned for imaging results in the Beta release.");

            okayButton.Click += OkayButton_Click;

            _screen.Place(titleText, 0, 0);
            _screen.Place(infoText, 2, 0);
            _screen.Place(okayButton, 4, 1);
        }
Exemplo n.º 6
0
        public void PlaceElementsExamAbdomen(Texture2D buttonTexture, SpriteFont font)
        {
            Controls.Textbox textTitle   = new Controls.Textbox(font, "Results from Abdomen Exam");
            Controls.Textbox examResults = new Controls.Textbox(font, $"Observations: {PatientData.AbdomenData}");

            Controls.Button continueButton = new Controls.Button(buttonTexture, font)
            {
                Text = "Continue"
            };

            continueButton.Click += ContinueButton_Click;

            _screen.Place(textTitle, 0, 0);
            _screen.Place(examResults, 2, 0);
            _screen.Place(continueButton, 4, 1);
        }
        private void CreateAndPlaceElements(Texture2D spriteTexture, Texture2D buttonTexture, SpriteFont font)
        {
            // Add elements
            #region CreateElements

            // Create Button Objects
            Controls.Button backButton = new Controls.Button(buttonTexture, font)
            {
                Text = "Main Menu"
            };
            Controls.Button diagnoseButton = new Controls.Button(buttonTexture, font)
            {
                Text = "Diagnose Patient"
            };
            Controls.Button investigateButton = new Controls.Button(buttonTexture, font)
            {
                Text = "Investigate Symptom"
            };

            // Patient sprite
            Controls.Sprite patientSprite = new Controls.Sprite(spriteTexture);

            // Text describing what to do
            Controls.Textbox instructionText = new Controls.Textbox(font, "Diagnose the patient's cause of ARF or select a symptom to investigate");

            #endregion

            // Assign event handlers for the buttons (so they actually do something)
            #region AssignEventHandlers

            backButton.Click        += BackButton_Click;
            diagnoseButton.Click    += DiagnoseButton_Click;
            investigateButton.Click += InvestigateButton_Click;

            #endregion

            // Place button objects (row and col indices gotten from DesignScreenLayout() function above)
            #region PlaceElements

            _screen.Place(backButton, 0, 1);
            _screen.Place(patientSprite, 2, 1);
            _screen.Place(instructionText, 4, 0);
            _screen.Place(diagnoseButton, 5, 1);
            _screen.Place(investigateButton, 5, 3);

            #endregion
        }
Exemplo n.º 8
0
        public void PlaceElementsExamOxygen(Texture2D buttonTexture, SpriteFont font)
        {
            Controls.Button continueButton = new Controls.Button(buttonTexture, font)
            {
                Text = "Continue"
            };
            Controls.Textbox textTitle = new Controls.Textbox(font, "Review of Oxygen Information");

            Controls.Textbox dataValue1 = new Controls.Textbox(font, $"Oxygen Saturation: {PatientData.OxygenData[0]}");
            Controls.Textbox dataValue2 = new Controls.Textbox(font, $"Amount of Oxygen Given: {PatientData.OxygenData[1]}");

            // Add event handler
            continueButton.Click += ContinueButton_Click;

            // Place elements
            _screen.Place(textTitle, 0, 0);
            _screen.Place(dataValue1, 2, 0);
            _screen.Place(dataValue1, 4, 0);
            _screen.Place(continueButton, 6, 1);
        }
        private void CreateAndPlaceElements(Texture2D buttonTexture, SpriteFont font)
        {
            // Add elements
            #region CreateElements

            // Create Button Objects
            Controls.Button backButton = new Controls.Button(buttonTexture, font)
            {
                Text = "Back"
            };
            Controls.Button examGeneral = new Controls.Button(buttonTexture, font)
            {
                Text = "Perform General Examination"
            };
            Controls.Button examHead = new Controls.Button(buttonTexture, font)
            {
                Text = "Examine Head"
            };
            Controls.Button examNeck = new Controls.Button(buttonTexture, font)
            {
                Text = "Examine Neck"
            };
            Controls.Button examLungs = new Controls.Button(buttonTexture, font)
            {
                Text = "Examine Lungs"
            };
            Controls.Button examExtremities = new Controls.Button(buttonTexture, font)
            {
                Text = "Examine Extremities"
            };
            Controls.Button examSkin = new Controls.Button(buttonTexture, font)
            {
                Text = "Examine Skin"
            };
            Controls.Button examAbdomen = new Controls.Button(buttonTexture, font)
            {
                Text = "Examine Abdomen"
            };
            Controls.Button examOxygen = new Controls.Button(buttonTexture, font)
            {
                Text = "Review Oxygen Information"
            };
            Controls.Button examBloodwork = new Controls.Button(buttonTexture, font)
            {
                Text = "Request Bloodwork"
            };
            Controls.Button examImaging = new Controls.Button(buttonTexture, font)
            {
                Text = "Request Imaging"
            };


            // Text describing what to do
            Controls.Textbox instructionText = new Controls.Textbox(font, "Select an action to further investigate the patient's condition");

            #endregion

            // Assign event handlers for the buttons (so they actually do something)
            #region AssignEventHandlers

            backButton.Click      += BackButton_Click;
            examGeneral.Click     += ExamGeneral_Click;
            examHead.Click        += ExamHead_Click;
            examNeck.Click        += ExamNeck_Click;
            examLungs.Click       += ExamLungs_Click;
            examExtremities.Click += ExamExtremities_Click;
            examSkin.Click        += ExamSkin_Click;
            examAbdomen.Click     += ExamAbdomen_Click;
            examOxygen.Click      += ExamOxygen_Click;
            examBloodwork.Click   += ExamBloodwork_Click;
            examImaging.Click     += ExamImaging_Click;

            #endregion

            // Place button objects (row and col indices gotten from DesignScreenLayout() function above)
            #region PlaceElements

            _screen.Place(backButton, 0, 0);
            _screen.Place(instructionText, 2, 0);

            _screen.Place(examGeneral, 4, 1);
            _screen.Place(examHead, 6, 1);
            _screen.Place(examNeck, 8, 1);
            _screen.Place(examLungs, 10, 1);
            _screen.Place(examExtremities, 12, 1);
            _screen.Place(examSkin, 14, 1);
            _screen.Place(examAbdomen, 16, 1);
            _screen.Place(examOxygen, 18, 1);
            _screen.Place(examBloodwork, 20, 1);
            _screen.Place(examImaging, 22, 1);

            #endregion
        }
Exemplo n.º 10
0
        private void CreateAndPlaceElements(Texture2D buttonTexture, SpriteFont font)
        {
            // Add elements
            #region CreateElements

            // Create Button Objects
            Controls.Button reasoningButtonCorrect = new Controls.Button(buttonTexture, font)
            {
                Text = ReasoningChoices[ReasoningState.Correct]
            };

            List <Controls.Button> incorrectButtons = new List <Controls.Button>();
            incorrectButtons.Add(new Controls.Button(buttonTexture, font)
            {
                Text = ReasoningChoices[ReasoningState.Incorrect1]
            });
            incorrectButtons.Add(new Controls.Button(buttonTexture, font)
            {
                Text = ReasoningChoices[ReasoningState.Incorrect2]
            });
            incorrectButtons.Add(new Controls.Button(buttonTexture, font)
            {
                Text = ReasoningChoices[ReasoningState.Incorrect3]
            });


            // Text describing what to do
            Controls.Textbox instructionText = new Controls.Textbox(font, "Please select the correct conclusion from the symptom information");

            #endregion

            // Assign event handlers for the buttons (so they actually do something)
            #region AssignEventHandlers
            reasoningButtonCorrect.Click += ReasoningButtonCorrect_Click;
            incorrectButtons[0].Click    += ReasoningButtonIncorrect1_Click;
            incorrectButtons[1].Click    += ReasoningButtonIncorrect2_Click;
            incorrectButtons[2].Click    += ReasoningButtonIncorrect3_Click;

            #endregion

            // Place button objects (row and col indices gotten from DesignScreenLayout() function above)
            #region PlaceElements
            _screen.Place(instructionText, 0, 0);

            // Randomly assign correctButton's position
            Random rnd             = new Random();
            int    correctRowIndex = rnd.Next(1, 5);

            _screen.Place(reasoningButtonCorrect, correctRowIndex * 2, 1);

            // Determine what indices remain for the other three buttons
            List <int> incorrectRowIndices = new List <int>();
            for (int i = 1; i < 5; ++i)
            {
                if (i != correctRowIndex)
                {
                    incorrectRowIndices.Add(i * 2);
                }
            }

            // Add incorrect buttons at the remaining indices
            for (int i = 0; i < 3; ++i)
            {
                _screen.Place(incorrectButtons[i], incorrectRowIndices[i], 1);
            }



            #endregion
        }
Exemplo n.º 11
0
        public void PlaceElementsExamBloodwork(Texture2D buttonTexture, SpriteFont font)
        {
            Controls.Textbox titleText      = new Controls.Textbox(font, "Bloodwork Results");
            Controls.Button  continueButton = new Controls.Button(buttonTexture, font)
            {
                Text = "Continue"
            };

            // Add event handler
            continueButton.Click += ContinueButton_Click;

            //Place title Text and button
            _screen.Place(titleText, 0, 0);
            _screen.Place(continueButton, 17, 1);

            #region PlacingDataInfo

            List <String> dataValueTitles = new List <String>();
            #region DefiningPossibleValues

            dataValueTitles.Add("White blood cells");
            dataValueTitles.Add("Hemoglobin");
            dataValueTitles.Add("Hematocrit");
            dataValueTitles.Add("Platelets");
            dataValueTitles.Add("Sodium");
            dataValueTitles.Add("Potassium");
            dataValueTitles.Add("Chloride");
            dataValueTitles.Add("Bicarbonate");
            dataValueTitles.Add("BUN");
            dataValueTitles.Add("Creatinine");
            dataValueTitles.Add("Glucose");
            dataValueTitles.Add("BNP");
            dataValueTitles.Add("ABG - pH");
            dataValueTitles.Add("ABG - pcO2");
            dataValueTitles.Add("ABG - pO2");
            dataValueTitles.Add("Lactate");

            #endregion

            int numberBloodworkValues = dataValueTitles.Count;



            int rowIndex = 2;
            int colIndex = 1;
            for (int i = 0; i < numberBloodworkValues; ++i)
            {
                _screen.Place((new Controls.Textbox(font, $"{dataValueTitles[i]}: {PatientData.BloodworkData[i]}")), rowIndex, colIndex);

                // Every other iteration, increase row value
                // Every iteration, swap between column index 1 and 3
                if (i % 2 == 1)
                {
                    rowIndex += 2;
                    colIndex  = 1;
                }
                else
                {
                    colIndex = 3;
                }
            }

            #endregion
        }
        private void CreateAndPlaceElements(Texture2D buttonTexture, SpriteFont font)
        {
            #region CreateElements
            Controls.Button finishButton = new Controls.Button(buttonTexture, font)
            {
                Text = "Finish"
            };

            Controls.Textbox summaryTitle          = new Controls.Textbox(font, "Summary of Diagnostic Process");
            Controls.Textbox reasoningTitle        = new Controls.Textbox(font, "Reasoning Steps");
            Controls.Textbox correctDiagnosisTitle = new Controls.Textbox(font, "Correct Dignosis");
            Controls.Textbox userDiagnosisTitle    = new Controls.Textbox(font, "User Diagnosis");

            Controls.Textbox correctTitle   = new Controls.Textbox(font, "Correct");
            Controls.Textbox incorrectTitle = new Controls.Textbox(font, "Incorrect");

            Controls.Textbox userDiagnosisText    = new Controls.Textbox(font, getDiagnosisString(PlayerDiagnosis));
            Controls.Textbox correctDiagnosisText = new Controls.Textbox(font, getDiagnosisString(CorrectDiagnosis));

            Controls.Textbox coinAwarded = new Controls.Textbox(font, $"Coins Awarded: {_amountCoinsAwarded}");
            Controls.Textbox expAwarded  = new Controls.Textbox(font, $"Experience Awarded: {_amountExpAwarded}");


            #region CreatingReasoningElements

            List <Controls.Textbox> correctReasoningChoices = new List <Controls.Textbox>();
            List <Controls.Textbox> userReasoningChoices    = new List <Controls.Textbox>();

            // Create Textbox UI elements using reasoning choices
            int remainingReasoningSlots = 5;
            foreach (KeyValuePair <SymptomState, String> kvp in UserReasoning)
            {
                // Currently, only 5 reasoning slots can be shown (need to make a UI element with scrolling)
                if (remainingReasoningSlots == 0)
                {
                    break;
                }

                // Create textbox UI elements based upon reasoning choices selected by user
                // This assumes that for every symptom where reasoning is selected by the user,
                // the corresponding correct reasoning is added properly
                userReasoningChoices.Add(new Controls.Textbox(font, kvp.Value));
                correctReasoningChoices.Add(new Controls.Textbox(font, CorrectReasoning[kvp.Key]));

                // Decrement by one to indicate one less remaining slot
                remainingReasoningSlots -= 1;
            }
            #endregion

            #endregion


            // Add event handler for finish button
            finishButton.Click += FinishButton_Click;


            #region PlaceElements

            // Titles
            _screen.Place(summaryTitle, 0, 0);
            _screen.Place(reasoningTitle, 4, 1);
            _screen.Place(correctTitle, 5, 1);
            _screen.Place(incorrectTitle, 5, 3);
            _screen.Place(correctDiagnosisTitle, 1, 1);
            _screen.Place(userDiagnosisTitle, 1, 3);
            _screen.Place(userDiagnosisText, 2, 1);
            _screen.Place(correctDiagnosisText, 2, 3);


            // Button
            _screen.Place(finishButton, 12, 1);

            // Exp and coin values
            _screen.Place(coinAwarded, 11, 0);
            _screen.Place(expAwarded, 11, 1);

            #region AddReasoningElements
            int sizeOfLists = userReasoningChoices.Count;
            for (int i = 0; i < sizeOfLists; ++i)
            {
                // The rows where reasoning is placed are [5-9]
                int rowValue = i + 6;
                _screen.Place(correctReasoningChoices[i], rowValue, 1);
                _screen.Place(userReasoningChoices[i], rowValue, 3);
            }

            #endregion

            #endregion
        }