| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Want to get organized in 2022? Let Dokkio put your cloud files (Drive, Dropbox, and Slack and Gmail attachments) and documents (Google Docs, Sheets, and Notion) in order. Try Dokkio (from the makers of PBworks) for free. Available on the web, Mac, and Windows.

View
 

COP 4834 Summer 2012 Assignment 7 - AJAX Pages

Page history last edited by Dr. Ron Eaglin 9 years, 6 months ago

 Assignment 7 - AJAX Pages

 

Objectives

 

To be able to use AJAX for rich interactive pages

Ability to create pages from forms

 

Assignment

 

You will create a page that implements the Trauma Alert, and Trauma Team Response Name and Time for trauma responses. This is on the Trauma Flow Sheet. We want to make the entry of this data as easy as possible - so to do it, we will use some AJAX to simplify entry.

 

For this assignment - you will create functionality of 2 sections of the form, in a tabbed dialog. There will be 2 tabs; Mechanism of Injury and Pre-Hospital Information. After the user fills out the initial for to create a Trauma (created in COP 4834 Summer 2012 Assignment 3 - Passing Data in Web Systems )  - this form will come up next. You only need to create 2 tabs on this form, here is the data for each form with the XML string associated data.

 

Please note:  I am giving you User Control Code for Mechanism of Injury that you can use if you desire. You must create the User Control for the Pre-Hospital form yourself.

 

Mechanism of Injury Form

 

Form Prompt
 XML String
Notes
Mechanism of Injury

PatientMechanismOfInjury - options AUTO, MC, FALL, GSW, STAB, BICYCLE, CRUSH, BURN, OTHER

MC is motorcycle, GSW is Gunshot Wound

Main box, allows multiple selection.
Seatbelt
PatientAutomobileWearingSeatbelt - YES or NO
Only displays if AUTO is  selected
Auto
PatientAutomobileAccidentRelationship  - Driver, Passenger, Pedestrian
Only displays if AUTO is  selected
Speed
PatientMotorVehicleSpeed - Text prompt
Displays if AUTO or MC is selected
Fall
PatientFallDescription - Text Prompt
Displays if FALL is selected
Caliber
PatientGunshotCaliber - Text Prompt
Displays if GSW selected
Airbag PatientAutomobileAirbag - YES or NO Displays if AUTO is selected
 
 
 
Type PatientMCHelmetType - None, 1/2, 3/4, Full
Displays if MC is selected
Other PatientMechanismOfInjuryOther - Text Box
Displays if other is selected

If multiple items are selected, store all items separated with semicolon (;)

 

Pre-Hospital Form

 

Form Prompt
XML String
Notes
GCS PTA
PatientPrehospitalGCS - Text Box

numeric between 1-15 

http://en.wikipedia.org/wiki/Glasgow_Coma_Scale 

 Meds Given
PatientPrehospitalMedicationsGiven - Text Box
 
No Prompt

PatientPrehospitalProcedures - check boxes (allow multiple)

Spinal Immobilization (long backboard)

Resp Spont

ET Tube     

BG

AMBU

NT

O2

Splints

Simply save all that are selected  separated by semicolon (;)
Tube #
PatientPrehsopitalETTubeNumber - Textbox
Only if ET selected (numeric)
BG PatientPrehospitalBloodGlucose numeric
NT #
PatientPrehospitalNasoTrachealIntubation

Only if NT selected (numeric)

http://emedicine.medscape.com/article/1663655-overview 

Splints PatientPrehospitalSplintTypes Only if Splint selected (string)
O2 @ ___
PatientPrehospitalOxygenDeliveryRate Only if O2 selected volume of flow numeric in liters per minute
LPM Via ___
PatientPrehospitalOxygendeliveryMethod

Only if O2 selected delivery of O2, text of delivery method

http://www.dmacc.edu/instructors/kegeorge/prac5/matrixII.htm 

Total Amount IV

Abs Field

PatientPrehospitalIVAbsorbed Numeric

 

I have provided you code for the Trauma Team Response and Name in the lecture Lecture - Advanced - User Control Arrays - you are free to use this and incorporate this into your project.

 

Information

 

You will need to install the correct version of AJAX Control Toolkit from CodePlex here http://ajaxcontroltoolkit.codeplex.com/releases/view/87024 Good video based instruction on how to install the toolkit are available on the site.

 

You can also look at my video of putting a TabControl on your site Lecture - AJAX - Tabbed Dialog

 

User Controls are pretty straightforward and can be found at Lecture - Form Objects - User Controls and Lecture - Advanced - User Control Arrays  

 

If you look at Case Study - Trauma Flow Database there is useful information there specifically on this topic.

 

Estimated Completion Time

 

Hours typically taken to complete

 

Supporting Lectures 

 

Information and links about lectures supporting the assignment here

 

Questions and Answers

 

Answers to student questions about the assignment here

 

External Resources

TraumaFlowHelper.aspx
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
using System.Data;
namespace TraumaFlow.Code
{
    public class TraumaFlowHelper
    {
        public static string connectionName = "TraumaFlowConnectionString";
        public static string getConnectionString()
        {
            DatabaseHelper dh = new DatabaseHelper(connectionName);
            return dh.getConnectionString(connectionName);
        }
        public static void fillTextBox(TextBox tb, string XMLName, int TraumaFormID)
        {
            tb.Text = getValue(XMLName, TraumaFormID);
        }
        public static string getValue(string XMLName, int TraumaFormID)
        {
            if (XMLName == "PatientReportedName") return TraumaFlowHelper.getPatientName(TraumaFormID);
            string sql = "SELECT Value FROM view_TextMedicalData ";
            sql += "WHERE XMLName = '" + XMLName + "'";
            sql += " AND id = " + Convert.ToString(TraumaFormID);
            DatabaseHelper dh = new DatabaseHelper(connectionName);
            return dh.executeSqlReturnString(sql);
        }
        public static string getPatientName(int TraumaFormID)
        {
            string sql = "SELECT name FROM TraumaForm WHERE id = '" + TraumaFormID.ToString() + "'";
            
            DatabaseHelper dh = new DatabaseHelper(connectionName);
            return dh.executeSqlReturnString(sql);
        }
        public static string getTraumaFormDate(int TraumaFormID)
        {
            string sql = "SELECT Arrival FROM TraumaForm WHERE id = '" + TraumaFormID.ToString() + "'";
            DatabaseHelper dh = new DatabaseHelper(connectionName);
            return dh.executeSqlReturnString(sql);
        }
        public static int getCodeID(string XMLName, int TraumaFormID)
        {
            string sql = "SELECT CodeID FROM view_CodedMedicalData ";
            sql += "WHERE XMLName = '" + XMLName + "'";
            sql += " AND id = " + Convert.ToString(TraumaFormID);
            try
            {
                DatabaseHelper dh = new DatabaseHelper(connectionName);
                return Convert.ToInt32(dh.executeSqlReturnString(sql)); 
            }
            catch
            { 
                return 0; 
            }
        }
        public static DataTable matchStaffNames(string pattern)
        {
            string sql = "SELECT StaffName FROM StaffNames WHERE UPPER(StaffName) LIKE '%" + pattern.ToUpper() + "%'";
            DatabaseHelper dh = new DatabaseHelper(connectionName);
            return dh.executeSqlReturnDataTable(sql);
        }
        public static DataTable getAllXMLNames()
        {
            string sql = "SELECT DISTINCT(NameText) FROM NameResolution";
            DatabaseHelper dh = new DatabaseHelper(connectionName);
            return dh.executeSqlReturnDataTable(sql);
        }
        public static string[] traumaTeamMembers()
        {
            string[] s = {"TRAUMA_A_NURSE","RUNNER","LAB_TECH","ED_MD","TRAUMA_B_NURSE","OR_NURSE_TECH", 
                          "RADIOLOGY_TECH", "ORTHO_TECH", "SCRIBE", "RESP_THERAPY", "CHAPLAIN", "OTHER"};
            return s;
        }
        public static void insertMedicalData(string nameText, string value)
        {
            // stored procedure has logic for insert OR update
            updateMedicalData(0, nameText, value);
        }
        public static void updateMedicalData(int traumaFormID, string nameText, string value)
        {
            if (doesMedicalDataExist(traumaFormID, nameText, value)) return;
            string sql = "EXEC [sp_InsertMedicalData] " + Convert.ToString(traumaFormID) + ", '" + nameText + "', NULL , '" + value + "'";
            DatabaseHelper dh = new DatabaseHelper(connectionName);
            dh.executeSqlNonQuery(sql);
        }
        public static bool doesMedicalDataExist(int traumaFormID, string nameText, string value)
        {
            string categoryID = getCategoryIDFromNameText(nameText);
            string sql = "SELECT COUNT(*) FROM MedicalData WHERE TraumaFormID = " + Convert.ToString(traumaFormID);
            sql += " AND CategoryID = " + getCategoryIDFromNameText(nameText);
            sql += " AND ValueText = '" + value + "'";
            DatabaseHelper dh = new DatabaseHelper(connectionName);
            int c = dh.executeSqlReturnInt(sql);
            return (c >= 1);
        }
        public static string getCategoryIDFromNameText(string nameText)
        {
            string sql = "SELECT CategoryID FROM NameResolution WHERE NameText = '" + nameText +"'";
            DatabaseHelper dh = new DatabaseHelper(connectionName);
            return dh.executeSqlReturnString(sql);
        }
    }
} 

 

 

 

Grading Criteria

 

Grading criteria

 

Comments (0)

You don't have permission to comment on this page.