The document outlines a database schema for tracking clinical skills equipment for a clinical skills center, including tables for equipment specifications, locations, items, borrowers, loans, rooms, skills, equipment-skill relationships, and equipment pictures. Fields include equipment name, manufacturer, description, manual, and picture indexes to store multiple views of equipment. The schema aims to manage equipment inventory, locations, borrowing and loan tracking, and equipment-skill associations.
8. 7
A Practical Protocol for Dialysate Flow Rate Selection.
Background:
Dialysate flow rates are often standardised as unit policy, due to the lack of a selection protocol.
Some units opt for the factory default setting, following the rationale that they have little
information to justify altering it. Other units opt for maximum rate, as they are aware this can be
beneficial to some patients.
Following the ‘factory default setting’ policy will result in some patients receiving less dialysis than
they could benefit from, whilst following the ‘maximum rate for all’ policy increases costs without
delivering benefit for all.
Most variable parameters of haemodialysis are specified in the dialysis prescription, and the only
obstacle to using this policy for dialysate flow rate, appears to be the lack of a protocol to follow.
Method of Study:
It was proposed that a study to determine the circumstances where high dialysate flow resulted in
significant improvement in clearance could be performed by measuring clearance periodically during
treatment (using a non-invasive sodium dialysance comparison technique)-1
and comparing this with
blood water flow to give a clearance efficiency figure-percentage of blood water cleared of urea. In
order to separate diffusive and convective clearance, it would be necessary to record ultrafiltration
rate as well.
Volunteers established on dialysis for at least three months were recruited from a maintenance
haemodialysis population, without restrictions around age, nature of access, or any other factors.
The minimum data set required for each scenario was calculated (for p<0.01) to be 120, and four
scenarios were investigated, Both high flux and low flux with dialysate flow rates of 500ml/min and
800ml/min, requiring at least 480 treatments to be monitored. As dialyser performance and blood
chemistry alter during treatment, the data was collected every twenty-five minutes and mean figures
calculated.
As effective blood water flow would be diminished by recirculation, a correction factor was applied.
Analysis:
Blood water flow was calculated using a plasma water fraction figure obtained by subtracting total
protein from plasma volume (Fp), and a fixed red blood cell water fraction figure of 0.72 (Fr).
Haematocrit (HCT) expressed as a decimal was also used in the formula:
Qbw = Qb [Fp + HCT(Fr – Fp)]
The clearance (K), effective blood flow, and ultrafiltration rate were recorded every twenty-five
minutes throughout the treatment. This is the minimum measurement interval available on the
measuring method utilised.
Blood water flow was adjusted for recirculation, using the total recirculation figure obtained from a
blood temperature module on the dialysis machine utilising temperature bolus dilution monitoring-3
,
in the formula:
Corrected QBW = Apparent QBW X [100- Recirc/100]
Diffusive clearance was separated from total clearance by calculating the U.F. rate per minute and
dividing by two-6
, then subtracting from total clearance, to leave diffusive clearance.
K(Diff) = K – U.F./120
9. 8
The clearance efficiency (K(Diff) / Corrected QBW) was plotted against the corrected blood
water flow, and the resulting plots at different dialysate flow rates were compared.
Low Flux Dialyser Results:
A comparison of the two curves expressed as percentage improvement ({[C.E. (800) – C.E. (500)]/C.E.
(500)} X 100)
Indicates significant advantage to higher dialysate flow, when higher corrected blood water flows are
available.
0
10
20
30
40
50
60
70
80
90
100
0 50 100 150 200 250 300
CorrC.E.
Corr B.W.F.
Low Flux 500ml/min
0
10
20
30
40
50
60
70
80
90
100
0 50 100 150 200 250 300
Corr.C.E.
Corr B.W.F.
Low Flux 800ml/min
0
5
10
15
20
25
0 100 200 300
Clearanceimprovement(%)
Corrected blood water flow (ml/min)
Low flux
10. 9
High Flux Dialyser Results:
The same comparison yeilds a very similar result;
Discussion:
The small differences between the two plots of improvement are unlikely to indicate anything more
than bias resulting from the initial high flux dialyser patient cohort being small. When the study was
started, most patients were on low flux dialysis, but as new guidelines were adopted this situation
changed.
The selection of 500ml/min as a common dialysate flow rate was based on the use of less efficient
dialysers, and assumed a blood flow rate of 200ml/min. The argument was that two-and-a-half times
blood flow would be easily adequate dialysate flow, as there was a limit to solute transfer rate
consequential to the membrane and fluid barrier resistances (combined, these are referred to as the
mass transfer function, KOA).
0
20
40
60
80
100
0 50 100 150 200 250 300
CorrC.E.(%)
Corr B.W.F.(ml/min)
High Flux 500ml/min
0
20
40
60
80
100
0 50 100 150 200 250 300
CorrC.E.(%)
Corr B.W.F. (ml/min)
High Flux 800ml/min
0
5
10
15
20
25
0 50 100 150 200 250 300
ClearanceImprovement(%)
Corr. B.W.F.ml/min
High flux
11. 10
Alan S. Michaels published the formula that describes dialyser solute flux, in 1966. It is:
CB - CD
J = tD + tM + tB
-7
DD kDM DB
The denominator is KOA, and was often described as the limiting factor to urea clearance, whilst the
numerator is diffusion gradient, and has largely been ignored. Mass transfer coefficients have
increased significantly over the past forty years, making the effect of dialysate flow rate more
significant for those presenting significant solute mass for removal. This is dependant on blood water
flow rate, as the urea is dissolved within the blood water, and the blood water must circulate around
the body to take up urea from the interstitial fluid, before being presented for further dialysis, hence
the need to correct for recirculation.
An active spreadsheet was produced, which requires effective blood flow and recirculation figures
from the machine, and haematocrit and total protein form blood results. This spreadsheet then
produces a figure for corrected blood water flow, which can be compared with a fixed guide figure to
determine appropriate dialysate flow rate selection.
Haematocrit Total
Protein
Plasma
Water
Blood
Water
Blood
Flow
Total
Recirculation
Correction Corrected
Blood
Water
Flow
(Decimal) (g/l) (Decimal) (ml/min) (ml/min) (%) (ml/min)
Conclusions:
Today’s dialysers tend to be larger and more porous than previously, and venous access is improving.
These factors contribute to a change in requirements from dialysis machines, with increased
dialysate flow being beneficial to those with higher blood water flows.
Utilisation of an active spreadsheet negates the requirement for complex calculation, allowing many
to select dialysate flows appropriately.
References:
1 Nephrology Dialysis Transplantation 2001 Vol. 16 Pages 1053-8
Accuracy and safety of online clearance monitoring based on conductivity variation.
Uwe Kuhlmann, Rainer Goldau, Nader Samadi, Thomas Graf, Malte Gross, Giancarlo Orlandini, Harold
Lange.
2 Nephrology Dialysis Transplantation 1996 vol. 11 pages 2023-30
Ionic Dialysance as a Method for On-line Monitoring of Delivered Dialysis Without Blood Sampling.
C. Manzoni, S. Di Fillipo, M. Corti, F. Locatelli
3 Nephrology Dialysis Transplantation 199 vol.14 pages 376-83
Validation of haemodialysis recirculation and access blood flow measured by thermodilution
Daniel Schneditz, Erjun Wang, Nathan W. Levin..
4 American Journal of Kidney Diseases 35(1) pages 105-11 Jan 2000
In vivo effects of dialysate flow rate on Kt/V in maintenance hemodialysis patients.
12. 11
Hauk M., Kuhlmann M.K., Riegel W., Kohler H.
5 Kidney International 51(6) pages 2013-7 Jun 1997
Hemodialyzer mass transfer-area coefficients for urea increase at high dialysate flow rates.
Leypoldt J.K., Cheung A.K., Agodoa L.Y., Daugirdas J.T., Greene T., Keshaviah P.R.
6 The International Journal Of Artificial Organs vol. 7 no. 5 1984 pages 263-268
In vitro study of combined convection-diffusion mass transfer in hemodialysers. B.B. Gupta and
M.Y.Jaffrin.
7 American Society of Artificial Organs 1966 vol. 12 pages 387-392
Operating Parameters And Performance Criteria For Hemodialyzers And Other Membrane Separation
Devices. Alan S. Michaels
8 International Journal of Artificial Organs 1993 vol. 16 no. 8 pages 585-91
A Model for Non-invasive Estimation of in vivo Dialyzer Performances and Patient’s Conductivity
During Hemodialysis..
T. Petitclerc, N. Goux, A.L. Reynier, B.Bene
9 American Journal of Kidney Diseases 2001 vol. 37 no. 2 pages 316-20
Increasing Dialysate Flow Rate Increases Dialyzer Urea Mass Transfer-Area Coefficients During
Clinical Use.
Rosemary Ouseph MD, Richard A. Ward PhD.
13. 12
The use of simulated practice as a tool in clinical training is becoming increasingly popular.
Motivation arises in part from the public commentary on changing academic requirements in nursing,
and also from empirical evidence from the use of simulation training in other demanding
environments, notably aviation.
It has been suggested in the media that nursing and midwifery students studying to degree level may
result in practitioners who are more academic than practical and so better suited to submission of
essays; reports etc. than dealing with the needs of their patients. If this is addressed along with the
changing attitude towards learning on real patients (with modern technology there is less need for
this approach), it is apparent that simulated practice should be more prominent in the University
curricula than previously.
Other stimuli are recognition of different learning styles, and the verbose Chinese proverb “Not
hearing is not as good as hearing, hearing is not as good as seeing, seeing is not as good as mentally
knowing, mentally knowing is not as good as acting; true learning continues up to the point that
action comes forth.” Xún Zǐ (310 – 237 B.C.), which is frequently translated as “I hear and I forget; I
see and I remember; I do and I understand.” It is also attributed to Confucius.
The outcomes identified in Mosby’s Nursing Suite indicate both improved preparedness for practice
from experiencing multi-professional working, and improved retention of learning. Maginnis
describes the advantages of actual clinical practice, but the greater opportunity to prepare students
in a safe education environment before moving to a hostile clinical environment which may be
remote from educational support.
It is necessary for participants to immerse themselves in the scenario as if it were real (Wilford),
where the successful activity can boost confidence whilst difficulty may diminish confidence (Byrne).
The view was that it not only allowed the participants to get a taste of practical skills, but helped
them to form new thought processes around planning and critical review. This is an area which
should be introduced early in courses in a non-traumatic way. A low-fidelity simulation (injection;
urine testing; N.G. tube aspirant pH etc.) may be followed up with questions such as “How do you
think that went?”; “What could you do to improve on the way things went on future occasions?”;
“How could things be better organised to make the procedure run more smoothly?”. This would
represent an early introduction to the critical reflection and discussion of debriefing.
The Harvard medical school article describes debriefing as “a crucial step in clarifying and
consolidating insights and lessons from simulations.”
14. 13
Kolb’s experiential learning cycle is cited in John M. O’Donnell’s presentation to demonstrate the
place of debriefing in simulated practice
, where debriefing forms the Reflective
Observation element. It is reasoned (Dreifuerst) that debriefing encourages a framework to develop
in the students mind to relate experiences and identify positive and negative aspects, allowing the
formation of ideas which may inspire innovation and higher level practice.
The ratio of questions to statements should be around 3:1 and the debriefing should last around
twice as long as the scenario, although students may need encouragement to participate
(Overstreet).
Three phases are described (Arafeh), Reaction; Analysis; and Summary. Of these, Analysis is
considered the most significant. Poor outcomes may be linked to errors in the participant’s mental
frameworks, which may be corrected in debriefing to allow the participant better understanding of
how to achieve their objectives, or even re-evaluate those objectives.
It is important that simulation and debriefing are distinct from practise of skills for assessment such
as OSCE’s
Technology and scenario design can play an important role in the simulation activity, but debriefing
effectively makes all the difference to the student experience.
Bibliography and References:
Arafeh Julie M. R., MSN, RN; Hansen Sara Snyder, MSN, RN;Nichols Amy, EdD, RN Debriefing in
Simulated-Based Learning. Facilitating a Reflective Discussion J Perinat Neonat Nurs Vol. 24, No.
4, pp. 302–309 2010 Wolters Kluwer Health | Lippincott Williams & Wilkins
Byrne A J, Blagrove M T, McDougall S J P ; Dynamic confidence during simulated clinical tasks.
Postgrad Med J 2005;81:785–788.
15. 14
Cant Robyn P, Cooper Simon J; The benefits of debriefing as formative feedback in nurse
education http://www.ajan.com.au/Vol29/29-1_Cant.pdf
Dreifuerst Kristina Thomas; The essentials of debriefing in simulation learning: a concept analysis
Nursing Education Perspectives March/April 2009
Fanning Ruth M., Gaba David M.; The Role of Debriefing in Simulation-Based Learning. Society for
Simulation in Healthcare, vol. 2, Number 2, Summer 2007
Maginnis C, Croxon L ; Transfer of learning to the nursing clinical practice setting. The International
Electronic Journal of Rural and Remote Health Research, education, practice and policy. 8th
April 2010
Mosby’s Nursing Suite. 9th
March 2011
http://confidenceconnected.com/connect/article/filling_the_gap_clinical_simulations_prepare_stud
ents_for_the_nursing_/ Accessed 1st
March 2012
O’Donnell John M.; Debriefing in Simulation Education: Using a Structured and Supported Model.
Overstreet Maria L.; "The Current Practice of Nursing Clinical Simulation Debriefing: A Multiple Case
Study. " PhD diss., University of Tennessee, 2009.
http://trace.tennessee.edu/utk_graddiss/627
No Author Named: Debriefing Assessment for Simulation in Healthcare
http://www.harvardmedsim.org/debriefing-assesment-simulation-healthcare.php
Wilford Amanda, Doyle Thomas J.’ Integrating simulation training into the nursing curriculum
http://www.fondacomedical.com/clinical_papers/Integratingsimulationtraining.pdf
You may like to look at this http://nursingstandard.rcnpublishing.co.uk/archive/article-an-evaluation-
of-simulated-clinical-practice-for-adult-branch-students {I haven’t seen it as I am not a registered
user}
16. 15
Spring Web Application Development
FHSC Clinical Skills Equipment database schema
Equipment
Specification
Location
Item
Borrowers
Loans
Room
Skills
Equipme
nt/Skill
Pictures
17. 16
Equipment Specification:
CatalogueNumber{PK}
esName
esManufacturer
esDescription
esManual
Pictures:
CatalogueNumber(from Equipment Specification) {Dual attribute PK with Index}
Index(to store multiple views of an item)
Either the picture as an OLE object; or the picture file name
Equipment/Skill:
EqSkillNumber{PK}
CatalogueNumber(from Equipment Specification)
SkillNumber(From Skills)
Skills:
SkillNumber{PK}
Description
Location:
SiteID{PK}
SiteName&Address
Room:
RoomNumber{PK}
SiteID(From Location)
RoomName
Item:
ItemNumber{PK}
CatalogueNumber(from Equipment Specification)
RoomNumber(from Room)
Loaned? (Y/N)
Loans:
ItemNumber(from Item){Dual Attribute PK with LoanDate}
BorrowerNumber(from Borrower)
LoanDate
ExpectedReturnDate
ActualReturnDate
18. 17
Borrowers:
BorrowerNumber{PK}
Contact Name
email
Organisation Name
Address
Telephone Number
These Fields will be integers:
CatalogueNumber
EqSkillNumber
SkillNumber
ItemNumber
BorrowerNumber
Everything else will be character strings (including RoomNumber as we will need to put the building
pre-fix to avoid duplicates (WHB004)), except the dates in Loans.
42. 41
The Clinical SkillsFacilitiesinCambridge,Chelmsford,andPeterboroughare under-utiliseddue toinadequate
information.
I orderfor an academicto prepare fora skillssession,orfora lessonplanwithresource requirementslisttobe
createditwouldbe necessaryforthemto have accessto informationonall available options.Thisshould
include locationandusage detailstoallow the mostappropriate equipmenttobe specifiedundereach
circumstance.
A documentoutliningthese requirementswasproducedinApril 2012
The Requirementfora Clinical SkillsEquipmentDatabase
The Facultyof Health,Social Care, andEducationhas a range of clinical skillslaboratoriesspreadoverthe
three differentcampuses,Rivermead;VictoriaHouse (due tomove toYoungStreet);andGuildHouse.These
are equippedwitharange of differentsimulationandpractise deviceswhichallowforsimulatedpractice;
objective structuredclinical examinations(OSCE’s),andgeneral skillsteaching.
43. 42
In orderto effectivelymanage thisvaluable resource arequirementforamulti-facettedandflexible
SharePointwebapplicationhasbeenidentified.Academicstaff willneedtobe able toeasilyidentifythe
nature;location;viewpicturesandinformationresourcesof appropriate Clinical SkillsEquipmenttofacilitate
theirteaching,butnotinputnewequipment,administrateloansetc.These roleswouldbe limitedtothe
technical staff withinthe Clinical Skillsareas.Ease of updating,includinglinkstoadditionalresourcessuchas
videodemonstrations,isanessential elementof thisresource,whichappearsnottohave beenunderstoodby
IT Services.
By definitionClinicalSkillsisafluidenvironmentwhere bestpractice guidelinesfrequentlychange,and
available technologyalters.The needfordevelopmentactivitytobe underthe control of the service is
apparent,especiallyasthe developmentwill needtobe informedandprioritisedbasedonknowledge from
withinthe Faculty.Itshouldnotbe conductedbysomeone withoutClinicalSkillsknowledge.There hasbeen
suggestionbyITServicesthattheytake overthe project,eventhoughthere have beendiscussionson-going
since July2011, duringwhichthe intentiontodevelopthe systemin-house hasalwaysbeenmade apparent.
The discussionswere necessaryaspartway throughthe developmentprocessthe Facultydeveloperidentified
an error inthe configurationof the SharePointServerimplementationrenderingitunusableasadvisedby
Microsoft.The suggestionthatIT Servicestake overcontradictsthe following:
http://www.informit.com/articles/article.aspx?p=23953&seqNum=5
ThirteenOrganizational Structure Mistakes
1. Combiningsoftware developmentandoperationsinto a single organization.
The job of operationsistokeepapplicationsupandrunning.The easiest waytodothisisto neverchange
anything.Combiningdevelopmentandoperationsintoasingle organizationhasthe natural tendencytostifle
innovation.Software developmentorganizationsshouldbe separatedfromoperationstoallow newand
modifiedapplicationstobe developedasrequiredtosupportthe businessneedsof the company.
The requirementsfromITServices:
1) To provide adevelopmentenvironmentinwhichtoworkwithinthe Clinical SkillsLaboratories.
2) A correctlyconfiguredServerimplementationof NetBeansandMSSQLset-upinwhichto run.
3) Necessaryinformationsuchasfile structures/paths.
4) Such supportas isnecessarytoachieve the statedoutcomesexpediently.
Work has beenslowedbylackof widespreadunderstandingof the importance of thisactivitytoensure an
improvedstudentexperience andmake muchbetteruse of available resources.
Whilstitcan be seenthatsome progresshasbeenmade ona webapplicationonthe Springframework(with
itsextensivelibrarymakingaveryflexible and highperformance systemachievableatmodestcost) there is
still arounda monthsworkto completionof all the differentfunctions,suchasuserdefinedsearchesanddata
entrypagesto ensure the systemremainscurrent.
47. 46
ASP.Net
We would like to prepare a very simple .NET web application (2-3 pages) demonstrating some of his skills, he
should be mindful to cover one or all of the following elements;
- Clean, simple web front end (use of tools like Twitter Bootstrap are advised)
o Attention to detail expected
- Complete simple tasks:
o Add/read data from SQL database or TXT file
o Work with ASP.net list controls to display results
o Compute a simple total
- We sometimes recommend a simple expenses application
o Add an expense receipt with name and value
o Read all expenses to a list, calculating the total value
- Clean code, no rip-off of sample sites
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="_Default" %>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
48. 47
<div class="jumbotron">
<h1>This application is to assist in the management of travel costs</h1>
<p class="lead"></p>
</div>
<div class="row">
<div class="col-md-4">
<h2>Submit a request for travel expenses</h2>
<p>
You can add a travel expense submission by pressing "Submit".
</p>
<p>
<a class="btn btn-default" href="Submit">Submit »</a>
</p>
</div>
<div class="col-md-4">
<h2>Statistical information</h2>
<p>
"Review" allows you to view the different journey lengths and costs. It also
provides totals, and an average cost per mile.
</p>
<p>
<a class="btn btn-default" href="Review">Review »</a>
</p>
</div>
<div class="col-md-4">
<h2>Overview</h2>
<p>
The "Table of Expenses" displays the full database table.
</p>
<p>
<a class="btn btn-default" href="TableDisplay">Table of Expenses »</a>
</p>
</div>
</div>
</asp:Content>
<%@ Page Title="Expense Request" Language="C#" MasterPageFile="~/Site.Master"
AutoEventWireup="true" CodeFile="Submit.aspx.cs" Inherits="Submit" %>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
<h2><%: Title %>.</h2>
<h3>Your expense submission page.</h3>
<p>Use this area to provide information on your travel costs.</p>
<div class="row">
<asp:Label ID="NameLabel" runat="server" Text="Your Name"
ForeColor="#000099"></asp:Label>
<asp:TextBox ID="NameBox" runat="server"></asp:TextBox>
49. 48
<asp:Label ID="DateLabel" runat="server" Text="Submission Date"
ForeColor="#000099"></asp:Label>
<asp:TextBox inputtype="date" ID="DateBox" runat="server" Text='<%#
date %>'></asp:TextBox>
<asp:Label ID="DistLabel" runat="server" Text="Distance Travelled"
ForeColor="#000099"></asp:Label>
<asp:TextBox ID="DistBox" runat="server"></asp:TextBox>
<asp:Label ID="CostLabel" runat="server" Text="Amount Claimed"
ForeColor="#000099"></asp:Label>
<asp:TextBox ID="CostBox" runat="server"></asp:TextBox>
<p><br><br /></p>
</div>
<div class="row">
<asp:Label ID="labelMessage" runat="server" Text=""></asp:Label>
<asp:Button ID="buttonSubmit" runat="server" Text="Submit Claim"
OnClick="ButtonSubmit_Click" />
</div>
</asp:Content>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.OleDb;
using System.Data.SqlClient;
using System.Configuration;
public partial class Submit : Page
{
public String date;
protected void Page_Load(object sender, EventArgs e)
{
date = DateTime.Today.ToString("dd/MM/yyyy");
DataBind();//adds today's date to the submit date field
}
protected void ButtonSubmit_Click(object sender, EventArgs e)
{
string name = "";
string date = "";
string dist = "";//to take the values from the page
string cost = "";
string query = "";
50. 49
string connection ="Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=|DataDirectory|Expenses.mdb";
//General validation of the values in the text fields
if (string.IsNullOrWhiteSpace(NameBox.Text))
{
labelMessage.Text = "Please enter your name";
return;
}
if (string.IsNullOrWhiteSpace(DateBox.Text))
{
labelMessage.Text = "Please enter your travel date";
return;
}
DateTime dateValue;
if (!DateTime.TryParse(DateBox.Text, out dateValue))
{
labelMessage.Text = "Sorry I don't understand your travel date. Please use
dd/mm/yyyy format.";
return;
}
if (string.IsNullOrWhiteSpace(DistBox.Text))
{
labelMessage.Text = "Please enter a distance.";
return;
}
int intValue;
if (!int.TryParse(DistBox.Text, out intValue))
{
labelMessage.Text = "Please enter a whole number in distance box.";
return;
}
if (string.IsNullOrWhiteSpace(CostBox.Text))
{
labelMessage.Text = "Please enter the cost.";
return;
}
double doubleValue;
if (!double.TryParse(CostBox.Text, out doubleValue))
{
labelMessage.Text = "Please enter a decimal number in cost box (pounds and
pence).";
return;
}
date = DateBox.Text.ToString();
dist = DistBox.Text.ToString();
cost = CostBox.Text.ToString();//take in the validated values
name = NameBox.Text.ToString();
//use ADO/DAO to apply the data to the database
query = "INSERT INTO Travel values (TravelDate, Distance, Cost,
StaffName)";//Partial string
OleDbConnection conn = new OleDbConnection(connection);
51. 50
OleDbCommand insertCommand = new OleDbCommand(query, conn);//Partial insert
command
insertCommand.Parameters.Add("TravelDate", OleDbType.DBDate);//add the data label
and type
insertCommand.Parameters["TravelDate"].Value = date;//add the value, associating
it with the label
insertCommand.Parameters.Add("Distance", OleDbType.Integer);
insertCommand.Parameters["Distance"].Value = dist;
insertCommand.Parameters.Add("Cost", OleDbType.Double);
insertCommand.Parameters["Cost"].Value = cost;
insertCommand.Parameters.Add("StaffName", OleDbType.VarChar);
insertCommand.Parameters["StaffName"].Value = name;
conn.Open();
insertCommand.ExecuteNonQuery();
conn.Close();
labelMessage.Text = "Your request has been submitted.";
}
}
<%@ Page Title="Table of Travel Expenses" Language="C#" MasterPageFile="~/Site.master"
AutoEventWireup="true" CodeFile="TableDisplay.aspx.cs" Inherits="TableDisplay" %>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" Runat="Server">
<asp:SqlDataSource ID="SqlDataSource1" Runat="server"
SelectCommand="SELECT TravelDate, Distance, Cost, StaffName FROM Travel ORDER BY TravelDate"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" />
<h2><%: Title %>.</h2>
<h3>The Source of the Breakdown on the Review Page.</h3>
<p>This page displays all available information.</p>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1" BackColor="#CCFFFF" BorderColor="#990033" GridLines="Horizontal"
CellSpacing="20" HorizontalAlign="Center" Width="609px">
52. 51
<Columns>
<asp:BoundField DataField="TravelDate" HeaderText="TravelDate"
SortExpression="TravelDate" DataFormatString='{0:dd-MMM-yyyy}' />
<asp:BoundField DataField="Distance" HeaderText="Distance"
SortExpression="Distance" />
<asp:BoundField DataField="Cost" HeaderText="Cost (£)" SortExpression="Cost" />
<asp:BoundField DataField="StaffName" HeaderText="StaffName"
SortExpression="StaffName" />
</Columns>
</asp:GridView>
</asp:Content>
public partial class TableDisplay : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
public IQueryable<TravelExpense> Get_TravelExpenses()
{
TravelExpenseContext db = new TravelExpenseContext();
var query = db.TravelExpenses;
return query;
}
}
<%@ Page Title="Review of Costs" Language="C#" MasterPageFile="~/Site.Master"
AutoEventWireup="true" CodeFile="Review.aspx.cs" Inherits="Contact" %>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
<h2><%: Title %>.</h2>
<h3>A depiction of costs for different journeys</h3>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
54. 53
</td>
</tr>
</ItemTemplate>
<LayoutTemplate>
<table runat="server">
<tr runat="server">
<td runat="server">
<table id="itemPlaceholderContainer" runat="server" border="1"
style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-
style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;">
<tr runat="server" style="background-color: #FFFBD6; color:
#333333;">
<th runat="server">Distance</th>
<th runat="server">Cost (£)</th>
</tr>
<tr id="itemPlaceholder" runat="server">
</tr>
</table>
</td>
</tr>
<tr runat="server">
<td runat="server" style="text-align: center;background-color: #FFCC66;
font-family: Verdana, Arial, Helvetica, sans-serif;color: #333333"></td>
</tr>
</table>
</LayoutTemplate>
<SelectedItemTemplate>
<tr style="background-color: #FFCC66; font-weight: bold;color: #000080;">
<td>
<asp:Label ID="DistanceLabel" runat="server" Text='<%#
Eval("Distance") %>' />
</td>
<td>
<asp:Label ID="CostLabel" runat="server" Text='<%# Eval("Cost") %>' />
</td>
</tr>
</SelectedItemTemplate>
</asp:ListView>
</div>
<div class="row">
<div class="col-md-6">
<h2>The total mileage covered by staff in this period is <%# tDist %> miles, and
the cost was £<%# tCost %>.<br>
<br />This results in an average travel cost of <%# avMiles %> pence/mile.
</h2>
</div>
</div>
<p>
</p>
</asp:Content>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.OleDb;
using System.Data.SqlClient;
using System.Configuration;
public partial class Contact : Page
{
55. 54
public string tCost = "";//accessible from the page
public string tDist = "";
public string avMiles = "";
protected void Page_Load(object sender, EventArgs e)
{
bool test1;
bool test2;
double num1 = 0;
int num2 = 0;
object totalDist;//recievers for the two vaules
object totalCost;
double simpleCost = 0;//average per mile
string distance = "SELECT Sum(Distance) FROM Travel";
string cost = "SELECT Sum(Cost) FROM Travel";
//ADO/DAO to retrieve the data from the table
OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=|DataDirectory|Expenses.mdb");
OleDbCommand distCmd = new OleDbCommand(distance, conn);
OleDbCommand costCmd = new OleDbCommand(cost, conn);
conn.Open();
OleDbDataReader distReader = distCmd.ExecuteReader();
if (distReader.HasRows)
{
while (distReader.Read())
{
totalDist = distReader.GetValue(0);//The value of the first (and only)
item in the reader
tDist = totalDist.ToString();
}
}
OleDbDataReader costReader = costCmd.ExecuteReader();
if (costReader.HasRows)
{
while (costReader.Read())
{
totalCost = costReader.GetValue(0);
tCost = totalCost.ToString();
}
}
test1 = double.TryParse(tCost, out num1);//Check the values are of the correct
type
test2 = int.TryParse(tDist, out num2);
if (test1 == true && test2 == true)
{
simpleCost = Math.Round((double.Parse(tCost) * 100 / int.Parse(tDist)),
2);//Calculate cost per mile in pence
avMiles = simpleCost.ToString();//value for page
}
conn.Close();
DataBind();//apply to page
}
}
56. 55
JQuery
Dear Chris,
Thank you for your recent application for a developer role with the Web Team here at City University
London.
I am pleased to tell you that you have been successful in progressing to the next round of recruitment.
We would like you to complete a short assessment of your technical skills, which you can find at the
following GitHub repository:
https://github.com/CityUniversityLondon/developer-assessment
It should take no more than an hour or two. The deadline is 9 am on Tuesday, 6th May, at which time
we will select candidates for interview.
If you have any questions in the meantime, please contact us on this email address
(webteam.jobs@city.ac.uk).
Thanks.
--
Tom Waddington, Web Development Manager
City University London
60. 59
The final pic is the result of pressing the button which displays the images in turn for four second
each.
61. 60
/********************************************
To display the images in a lightbox, individually
and sequencially.
Written by Chris Worledge using inspiration
from Barebones Lightbox Template
by Kyle Schaeffer
*********************************************/
// Display the lightbox
function lightbox(imageUrl) {
// jQuery wrapper (optional, for compatibility only)
(function($) {
// Add lightbox/shadow <div/>'s if not previously added
if($('#lightbox').size() == 0){
var theLightbox = $('<div id="lightbox"/>');
var theShadow = $('<div id="lightbox-shadow"/>');
$(theShadow).click(function(e){
closeLightbox();
});
$('body').append(theShadow);
$('body').append(theLightbox);
}
// Remove any previously added content
$('#lightbox').empty();
// Insert HTML content
if(imageUrl != null){//Find the chosen image, and apply it to the lightbox
$('#lightbox').append('<img class="thumbnail" src="' + imageUrl + '">');
}
// Move the lightbox to the current window top + 100px
$('#lightbox').css('top', $(window).scrollTop() + 100 + 'px');
// Display the lightbox
$('#lightbox-shadow').fadeIn('fast', function(){
$('#lightbox').fadeIn('fast');
});
})(jQuery); // End jQuery wrapper
}
// Close the lightbox
function closeLightbox(){
62. 61
// jQuery wrapper (optional, for compatibility only)
(function($) {
stopSequence();//This stops the rolling display
// Hide lightbox/shadow <div/>'s
$('#lightbox').hide();
$('#lightbox-shadow').fadeOut('slow');
// Remove contents of lightbox
$('#lightbox').empty();
})(jQuery); // End jQuery wrapper
}
var wait = 0;//It has to be here for two function to use it
function autobrowse() {
// jQuery wrapper (optional, for compatibility only)
(function($) {
var i = 0;
changeLightBox(i);//Display the fiirst image before the pause
i++;
wait = setInterval(function(){sequence()},4000);
function sequence(){
changeLightBox(i);//Sequence through with 4 secong pause
if (i==19)
i=0;
else i++;
}
})(jQuery); // End jQuery wrapper
}
function stopSequence() {
clearInterval(wait);//Otherwise you can't stop it!
}
function changeLightBox(i){
// jQuery wrapper (optional, for compatibility only)
(function($) {
switch(i)//To select each picture in turn
{
case 0:
lightbox('i/sass/01_tn.jpg');
break;
case 1:
lightbox('i/sass/02_tn.jpg');
break;
63. 62
case 2:
lightbox('i/sass/03_tn.jpg');
break;
case 3:
lightbox('i/sass/04_tn.jpg');
break;
case 4:
lightbox('i/sass/05_tn.jpg');
break;
case 5:
lightbox('i/sems/01_tn.jpg');
break;
case 6:
lightbox('i/sems/02_tn.jpg');
break;
case 7:
lightbox('i/sems/03_tn.jpg');
break;
case 8:
lightbox('i/sems/04_tn.jpg');
break;
case 9:
lightbox('i/sems/05_tn.jpg');
break;
case 10:
lightbox('i/shs/01_tn.jpg');
break;
case 11:
lightbox('i/shs/02_tn.jpg');
break;
case 12:
lightbox('i/shs/03_tn.jpg');
break;
case 13:
lightbox('i/shs/04_tn.jpg');
break;
case 14:
lightbox('i/shs/05_tn.jpg');
break;
case 15:
lightbox('i/soi/01_tn.jpg');
break;
case 16:
lightbox('i/soi/02_tn.jpg');
break;
case 17:
lightbox('i/soi/03_tn.jpg');
break;
case 18:
lightbox('i/soi/04_tn.jpg');
break;
66. 65
Translate text to numbers
</title>
<script language="JavaScript" src="textToNumbers.js">
</script>
<link rel=stylesheet href="style1.css" type"text/css">
</head>
<p div id="acer">
A little demo of converting text to a sum number. Place the text in the first
text area below and press the Translate button. The text is read and numbers added together.
The result is displayed in the second text box.
<textarea ID="Area">
Enter text here...
</textarea>
<p style="position:absolute; top:380px;" FORM>
<INPUT TYPE="button" Style="background:#AACCFF; cursor:hand;" Value="Translate"
onClick="dispTot()">
<INPUT TYPE="Text" Name="Result" ID="Result">
<INPUT TYPE="button" Style="background:#AACCFF; cursor:hand;" Value="Test Text"
onClick="add(text2num('one two three fourteen'))">
</FORM>
var Small = {
'zero': 0,
'one': 1,
'two': 2,
'three': 3,
'four': 4,
'five': 5,
'six': 6,
'seven': 7,
'eight': 8,
'nine': 9,
67. 66
'ten': 10,
'eleven': 11,
'twelve': 12,
'dozen': 12,
'thirteen': 13,
'fourteen': 14,
'fifteen': 15,
'sixteen': 16,
'seventeen': 17,
'eighteen': 18,
'nineteen': 19,
'twenty': 20,
'score': 20,
'thirty': 30,
'forty': 40,
'fifty': 50,
'sixty': 60,
'seventy': 70,
'eighty': 80,
'ninety': 90
};
var Magnitude = {
'hundred': 100,
'thousand': 1000,
'million': 1000000,
'billion': 1000000000,
'trillion': 1000000000000
};
var a, g, n;
function feach(str) {
if (str != "and"){//ignores 'and' to allow for a hundred and twenty thousand etc.
var x = Small[str];
if (x != null) {
g = g + x;//always add the small numbers(up to ninety)
}
var y = Magnitude[str];
if (y != null){
if (g == 0){
g = y;//if the text was 'a hundred' we would add the hundred
}
else{
g = g * y;//if it was four hundred we would multiply the
hundred
68. 67
}
}
if (x == null && y == null){
n = n + g;//when we hit a non number word we add the value to
the total
g = 0;
}
}
}
function text2num(txt) {
a = txt.toString().split(/[s-]+/);//creates an array of words from the text
g = 0;
n = 0;
m = "flush";
a.forEach(feach);//iterates through the array testing if each word is a number etc
feach(m);//ensures the final values are added to the total
return n;//sends the total back
}
function test(){
return "test";//just for testing
}
function add(text){
var TheTextBox = document.getElementById("Result");
TheTextBox.value = text;//adds the total to the textbox
}
function dispTot() {
var description = document.getElementById("Area");
var t = description.value;//gets the text from the textbox
var txt = t.toLowerCase();//in case of capitals
var r = text2num(txt);//gets the total
add(r);
}
70. 69
A list of all patients registered with one of the clinics on the system:
Go
alter procedure PiratePractisePatients
AS
Select Patient.Forenames+' '+ Patient.Surname as PiratePractisePatients,
Convert(VARCHAR, DateOfBirth, 106) as BirthDate From Patient
Where Clinic_Name = 'Pirate Practise'
go
Execute PiratePractisePatients
A list of patients seen by a particular GP in the past 3 days:
Go
Alter procedure DrPalantinesThreeDays
AS
Select Distinct Patient.Forenames+' '+ Patient.Surname as
Patients_seeing_Dr_Palintine_2ndto4th_December From Patient, Appointment
Where Patient.Medical_Reg_No = Appointment.Medical_Reg_No
AND Appointment.AppDate Between '12-02-2008' And '12-04-2008'
AND Appointment.Doctor = 'Dr Palintine'
go
Execute DrPalantinesThreeDays
Appointment
Appointment_no
Doctor
AppDate
AppTime
Medical_Reg_No
Clinic
C_Name
C_Address1
C_Address2
C_Town_City
C_Postcode
C_Telephone_No
Consultant
ConName
Hospital
Special_Interest
Hospital
H_Name
H_Address1
H_Address2
H_Town_City
H_Postcode
Medical_Record
MedicalRecordNo
Appointment_no
Symptoms
Diagnosis
Patient
Medical_Reg_No
PaPassword
Surname
Forenames
DateOfBirth
Clinic_Name
P_Telephone_No
P_Address1
P_Address2
P_Town_City
P_Postcode
Prescription
Prescription_No
MedicalRecordNo
Prescribing_Authority
Prescribing_Date
Prescription_Item
Prescription_No
Item_No
Drug
Dose
Freq
CourseLength
Referral
referralNo
MedicalRecordNo
ConName
LetterDate
Staff
StName
Staff_Type
stPassword
Clinic_Name
71. 70
An appointment list for a GP for the following day:
Go
Alter procedure DrAntonTomorrow
AS
Select Appointment.Appointment_no as Dr_Anton_5_12_08,
Convert( VARCHAR,Appointment.AppTime,108) as Time, Patient.Forenames+' '+
Patient.Surname as Patients
From Appointment, Patient
Where Appointment.Doctor = 'Dr Anton'
And Appointment.AppDate = '12-05-2008'
And Appointment.Medical_Reg_No = Patient.Medical_Reg_No
go
Execute DrAntonTomorrow
72. 71
A full medical report for a particular patient with at least 3
appointments, 2 prescriptions, and a referral.
use 0408183_assignment
go
IF OBJECT_ID ('appointmentcount', 'V') IS NOT NULL
DROP VIEW appointmentcount ;
GO
CREATE VIEW appointmentcount AS
select Patient.Medical_Reg_No, count(Appointment.Appointment_no) as
NumOfApp
from Patient, Appointment
where Patient.Medical_Reg_No = Appointment.Medical_Reg_No
group by Patient.Medical_Reg_No
go
IF OBJECT_ID ('prescriptioncount', 'V') IS NOT NULL
DROP VIEW prescriptioncount ;
GO
Create view prescriptioncount AS
select Patient.Medical_Reg_No, count(Prescription.Prescription_No) as
NumOfPresc
from Patient, Appointment, Medical_Record, Prescription
WHERE Patient.Medical_Reg_No = Appointment.Medical_Reg_No and
Appointment.Appointment_no = Medical_Record.Appointment_no and
Medical_Record.MedicalRecordNo = Prescription.MedicalRecordNo
group by Patient.Medical_Reg_No
go
IF OBJECT_ID ('referralcount', 'V') IS NOT NULL
DROP VIEW referralcount ;
GO
Create view referralcount AS
select Patient.Medical_Reg_No, count(Referral.ConName) as NumOfRef
from Patient, Appointment, Medical_Record, Referral
WHERE Patient.Medical_Reg_No = Appointment.Medical_Reg_No and
Appointment.Appointment_no = Medical_Record.Appointment_no and
Medical_Record.MedicalRecordNo = Referral.MedicalRecordNo
group by Patient.Medical_Reg_No
go
DECLARE curMultipleApp3Pres2Ref1 CURSOR FOR
select appointmentcount.NumOfApp, prescriptioncount.NumOfPresc,
referralcount.NumOfRef, appointmentcount.Medical_Reg_No
from appointmentcount, prescriptioncount, referralcount
Where appointmentcount.Medical_Reg_No = prescriptioncount.Medical_Reg_No
and
prescriptioncount.Medical_Reg_No = referralcount.Medical_Reg_No
DECLARE @numOfAppID Int
DECLARE @numOfPresID int
Declare @numOfRefID int
Declare @patientID nvarchar(8)
open curMultipleApp3Pres2Ref1
FETCH NEXT FROM curMultipleApp3Pres2Ref1 INTO
@numOfAppID, @numOfPresID, @numOfRefID,@patientID
WHILE @@Fetch_Status = 0
BEGIN
SET NOCOUNT ON;
if @numOfAppID >2 and @numOfPresID>1 and @numOfRefID>0
SELECT Patient.Medical_Reg_No, Patient.Forenames, Patient.Surname,
Appointment.Doctor, Convert(VARCHAR, Appointment.AppDate, 106) as Seen,
73. 72
Medical_Record.Symptoms, Medical_Record.Diagnosis, Prescription_Item.Drug,
Referral.ConName
FROM Patient, Appointment, Prescription, Prescription_Item, Medical_Record
Left OUTER JOIN Referral
ON Medical_Record.MedicalRecordNo = Referral.MedicalRecordNo
WHERE Patient.Medical_Reg_No = Appointment.Medical_Reg_No and
Appointment.Appointment_no = Medical_Record.Appointment_no and
Medical_Record.MedicalRecordNo = Prescription.MedicalRecordNo and
Prescription.Prescription_No = Prescription_Item.Prescription_No and
Patient.Medical_Reg_No = @patientID
FETCH NEXT FROM curMultipleApp3Pres2Ref1 INTO
@numOfAppID, @numOfPresID, @numOfRefID,@patientID
END
CLOSE curMultipleApp3Pres2Ref1
DEALLOCATE curMultipleApp3Pres2Ref1
Go
Database Administrators Plan
Server and Database Security and User Administration:
Appropriate firewall and anti-virus software would be essential both on servers and all client
machines.
Server and database security will be achieved through identification of users and determination of
their needs. A patient will only have access via a web application, which will require them to enter
their user name and login password. This will be used to identify the records they may access,
which will be related to their Medical Registration Number, giving them access to their own
appointment and medical information. It is likely that only recent information would be made
available on-line as too much information without the knowledge to comprehend its significance
should be avoided. Requests for full information would be addressed by providing access to it
within the surgery, with appropriate counselling/advise provided to avoid confusion.
Staff will be split into three groups.
Administrative staff will be able to book appointments for patients who telephone, so must have
rights to patient and appointment tables in their entirety. This will also give them access to
produce appointment schedules for doctors. They will need access to referral information to
produce referral letters, this will include Medical Record and Prescription information. A subgroup
of administrators could be given these additional access rights at individual clinic management
discretion.
74. 73
Medical staff will be able to view and add data in all tables, with labelling from their login
information applied to the diagnosis, prescription and referral data. Editing of input information
will be limited to pre-submission forms in the application. The database proper will not allow
editing of submitted data.
Nurses will have the same viewing rights as doctors, but will not be allowed to add diagnosis,
prescription, or referral.
All in clinic users will be authenticated using windows authentication and access rights determined
by their login category. External access via a web application will be managed by providing view s
for each patient including the information they are entitled to view, with application for
appointment as their only data entry option. A simple stored procedure applying the login identity
to a query to create/update the view will gather all the available information. the query can be
limited to go back a particular period of time as deemed appropriate.
New users would be applied to the windows server systemand their login group would act as the
indicator of the rights to be applied in the SQL server database system. Individual requirements
could be accomodated by creating bespoke groups as required, with access priveliges adjustable
down to individual column level. This may be necessary for columns such as password.
Stored procedures would be employed to provide specific information of interest to a user group
without having to provide them with access to all the source data.
A systemof recording e-mail addresses and e-mailing somebody a password if they forget it is
commonly used. It would be unwise to use the e-mail address as the user ID as other people will
know somebody's e-mail address and they may be neighbours who share the same doctors
surgery/clinic.
Administration priveliges would be guarded, as the potential for catastrophe is considerable. If
there are not two members of staff suitably qualified to accept these responsibilities a reciprical
arrangement where another administrator is co-opted as stand-in in the event of holiday or
sickness absence would be instigated. Both parties would benefit from mutual support, and this
may extend to a network offering forum advice as well as absence cover.
Servers would be physically secured to prevent malicious damage or theft.
75. 74
Database Settings and Configurations:
The database will be set up to store log file seperate to data files to improve efficiency. A
prediction of data volume over time would be necessary to determine storage requirements. Auto
creation and update of statistics could be employed although auto update is to be replaced by
scheduled update in the maintenance schedule, but auto shrinking may be avoided as it would
impact performance and may not be necessary. Full recovery model would be employed to
minimise the risk of loosing data in the event of failure. Checksum page damage option will detect
pages to be repaired in the event of a database recovery.
Storing related tables on different discs will allow them to be accessed simultaneously. This is
achieved by placing them in different filegroups and specifying the locations of these filegroups on
different disks. This activity would be incompatible with a server employing a striped RAID option.
It is becoming more common for clinical databases to store images of patients to act as memory
triggers to clinicians reviewing cases in the patients absence. This requires more storage space and
may reduce performance of the server, but may improve the performance of the activity by
improving the clinician understanding of the situation. The balance is likely to be struck in favour
of this approach, which would require a record of consent to be maintained.
The systemis intended as a distributed system with a wide area network divided at each clinic into
local area networks. The systemmanagement server will be located at one clinic, and a mirroring
server at a second location. In the event of an integrity check failure of the systemmanagement
server, the mirror server would be employed whilst recovery was implemented. This approach
would ensure continuous availability of the system. It would be necessary to encrypt data for
transmission between locations and a private link would be preferable to sending data over the
internet.
Regular audit activity would include random activity investigation, as well as specific activity
trailing, this would include consideration of data source and modification altering. Error correction
would generally be acchieved by addition of correction information maintaining the original
entries to allow monitoring. For example a medical record could only be edited prior to submission,
but would not be available for editing post submission. All such submissions would be labelled
with the user information, client machine identification, date and time, to allow audit trailing.
A log of record updates would be employed to assist in recovery in the event of failure or fallover.
Record locking would be relatively straightforward as patient medical record information would be
inaccessable during consultation, but would not be required legitimately by a third party under
these circumstances.
76. 75
Start up procedures would not be employed frequently as the servers would generally run
continuously to provide patient access out of hours.
Management of Indexes and Views:
In order to identify indexes it would be necessary to identify common activities which involve
searches and design indexes based on the most prevelant parameters. As clustered indexes are
limited to one per table and are especially effective, these would be targeted at the largest volume
of activity. In the absence of available information, it would be necessary to monitor activity to
determine requirements. Should clustered indexes be applied erroneously, they may be altered
when this becomes apparent as they do not alter the data.
It is likely that data related to each clinic would be indexed to prevent search of all data when
clinic specific information is required.
The Database Engine Tuning Advisor provides information on optimisation of indexes. This
information would be considered and action taken where considered prudent.
Views may be created to combine related columns from different tables as well as to filter or
select data to improve its relevance. Since the range of data may be restricted it is important to
consider the effect that any omission may have on the users perspective. Whilst the search for
efficiency is laudible, it must not be achieved by compromising integrity. Hence data must not be
seperated from related data without this being apparent to the user. This topic could be discussed
in greater detail, but in the context of this activity it will be sufficient to indicate that the author is
aware that inappropriate filtering could have disasterous consequences, so any activity which may
cause radical consequences should be based on complete information and not selective views.
By creating indexes on views to improve performance, the views become stored objects rather
than virtual tables. This requires careful consideration as to its impact on performance, but may be
the realistic approach where much activity is occuring on views. The first index created must be
clustered.
Views may be used to screen out information which is outside the requirements of the user, so as
to avoid compromising sensitive information unnecessarily. This would facilitate compliance with
the data protection act which covers data distribution as well as data storage. Updates of views
would be based on triggers responding to addition of data.
The use of horizontal security, where views are limited to specific rows, would be employed to
give patients access to their data without access to that of other patients.
77. 76
Database Maintenance Including Database Backup, Integrity Check,
Database Shrinking, Indexes and Statistics Maintenance and
Maintenance Scheduling:
A documented maintenance plan would be employed which would include backup, integrity check,
shrinking, and index and statistics maintenance. Regular manual monitoring of aspects such as
available storage space should also be scheduled and documented.
In order to determine the backup activity for a given database it is necessary to compare the
consequence of risk, with the cost of alleviating it. Since the database availability is ensured by
mirroring it is unlikely that the practises could justify additional resources for further backup, so it
is likely that the mirroring activity would be considered sufficient backup to cope with failure as
the two servers would be located on different sites. An option with reasonable costs would be to
purchase an external hard drive and use it for daily full backup out of normal surgery hours
augmented with periodic differential backup. This activity should be accomplished at both sites to
guard against fire etc. This activity would be documented in a seperate log.
Constraints are employed to limit opportunity for submission of erroneous data, however it is
important to avoid prevention of legitimate activity by poorly defined constraints. It is necessary
to employ a continual user feedback approach to ensure the system is not creating inefficiency.
Both formal and informal communication should be employed to optimise design parameters. The
successful compromise of limiting inappropriate data entry with allowing trouble free use would
improve the outcome of integrity checking.
Shrinking would be employed cautiously as it will impact performance. The data volume involved
and the availability of economical high volume storage media, would limit the requirement of this
activity. Thresholds for shrinking activity would relate to current storage space, and upgrade of
this space would be considered periodically.
Index and statistics information is used by thedatabase engine to inform it of routes to particular
data.
Reorganising and rebuilding indexes would have significant impact on performance if conducted
infrequently. By scheduling these as frequently out-of-hours activities their impact will diminish as
less alteration will occur on each occasion. This approach will avoid sudden and unanticipated
alterations in performance which can be disconcerting for users.
Statistics must be kept current in conjunction with indexes as they will interact and also affect
performance. The automatic updating may be employed, but scheduled updates are a preferred
78. 77
alternative as they are more complete and reliable. These activities should also be sceduled to
avoid impacting on performance during periods of high demand. All statistics should be updated
not just column or index statistics.
The performance monitor would also be utilised frequently to highlight an performance
bottleknecks and inform their resolution.
79. 78
STEPproject report:
Enhancement of Bluetooth link for wireless headset use with amateur radio.
Company; RPF Communications.
Student; Chris Worledge.
81. 80
Background:
Chris Worledge has just completed the second year of BSc (hons) Computer Science at Anglia
Ruskin University. Having no car meant the working day started and ended with an eight mile
bicycle ride which meant he was the brightest employee first thing in the morning, and was able to
improve his fitness over the eight weeks noticeably.
RPF Technical services is a small company with four full time staff engaged in bespoke design work
for other manufacturers. It has a daughter company called RPF Communications with no
additional staff.
RPF Communications currently market a range of devices to support amateur radio enthusiasts.
One of these devices allows the use of wireless headsets (as used with mobile telephones) using
Bluetooth® technology.
The project aim was to provide an enhancement to this functionality, allowing high quality
headsets to be fully utilised, extending the frequency response beyond that of telephone quality
speech systems.
82. 81
Detail:
The product currently marketed to provide wireless headset operation is called the Talksafe. The
required enhancement was to increase the frequency range of the audio signal to take full
advantage of the capacity of a high-fidelity headset. This implies a name of “Wide Audio Range
Talksafe”, which provides a unique selling point in its quirky acronym Wart.
XYP4372 Wart
The Bluetooth® standard communication link is called SCO (synchronous connection-oriented link)
but this has the telephone quality audio range. To provide the quality enhancement required it
was necessary to change the link type employed to eSCO (enhanced synchronous connection-
oriented link).
New hardware was to be designed using a device that RPF had no prior experience of. It was
hoped that the use of this device would provide greater control and flexibility than the one
employed previously. The chip-set employed in this device was manufactured by the same
company as the one in the previous device so it was assumed that there would be little difficulty in
the translation process.
Following design of the hardware it would be possible to design code that complimented it
precisely.
The advantages to RPF would be an enhancement of their product range which had not been
achieved previously due to lack of available effort, and the introduction of an alternative to their
previous Bluetooth® device which it was expected would be more flexible.
The advantages to the author would be an opportunity to revisit the workplace after the second
year of degree study in order to put context to some of the learning, an opportunity to produce C
code in a real work environment, and material to stimulate ideas for the third year major project.
Project plan:
The intention was to design the hardware first and pass this to others to be manufactured. The
software could then be written to compliment the hardware design, and the two married to
enable testing and modification to improve the final outcome.
A diagram of the project plan is depicted on the next page.
83. 82
This plan did not seem optimistic for the time scale of the project.
Read
background
information
Design
hardware
Hardware
productio
n
Write code
changes
Compile
and build
binary file
Apply binary file
to hardware
The previous hardware design and general
information relevant to usage, along with a
requirements specification document which
was discussed for clarification.
Debug and
improve.
A minimal requirement concerning function and
performance was included in the requirements
specification.
Reference was made to previous design.
The board was
etched and
some
components
applied.
Comprehending a large
volume of dispersed code.
Altering link type,
responding to buttons, and
illuminating indicators.
Respond to
compiler errors.
Address any
shortcomings and
enhance performance.
Install the
software on the
flash memory
Read
background
information
84. 83
Project Progression:
A meeting was held in the first week, after the requirements specification had been absorbed. This
served to limit some of the less practical aspects and clarify precisely what was required. As the
author had not designed electronics for twenty years, and the technology had changed
considerably over that time, the hardware design represented a stimulating mental challenge. It
was completed over two-and-a-half weeks with a lot of the time consumed learning to use the
schematic and p.c.b. layout application “Easy PC” which was less ‘easy-peasy’ than hoped!
The design was modified in line with company policy and the author was disappointed not to be
consulted on this at all. The p.c.b. layout was passed to a colleague for etching, and when this was
done, some components were added.
The background reading on the code was extensive and challenging, as the existing code was
spread amongst over 300 files and consisted of around half a million lines. The chosen language of
C being new to the author enhanced this challenge. Once the layout and function had been
absorbed the task was accomplished over a couple of weeks, and following some revision based
on discussion with colleagues it was compiled in half a day. This surprised some colleagues who
had anticipated this activity being more time consuming.
The next stage of installing the binary files on the flash memory and debugging proved an
insurmountable hurdle within the timeframe. The chipset manufacturers supplied a P.C.
application for compiling, building the binary files, and debugging, but its efficacy proved limited.
Although it gave the impression of adequate progress, any attempt at debugging produced
communication error messages. This scenario was discussed at length with the chip-set
manufacturers technical support staff, who were unable to provide explanation. Being directed to
the U.S. support in Texas added complication and delay, but this was overcome after a few more
e-mails.
85. 84
The first stage in addressing this problem was to alter the format of the link library as it was
constructed by the IDE as a linked list, and the chip-set required a mapped array. The company
Technical Director accomplished this as it was beyond the experience of the author. The result of
this activity gave the appearance that the problem had been resolved, but on closer inspection
this was not the case. A repetition of this scenario took until the end of the project, so at the time
of writing the project was incomplete.
Results:
Although it was disappointing to leave the project incomplete the experience was both
worthwhile and enjoyable. An introduction into a different area of work activity was combined
with the opportunity to interact with a group of motivated people. The experience of this work
will undoubtedly enhance both the remaining study and employability of the author.
Learning outcomes:
The experience of coding in a ‘real world’ environment has provided context to what had
previously only been explored academically. An up-to-date view of current work trends will be
useful in targeting study effort as well as future employment application. Success in code
production on a large code volume project has given the author confidence in his programming
ability. Translation of learning to a different language and structure demonstrated their flexibility.
An introduction to new technologies, both electronic components and applications was
appreciated.
86. 85
Recommendations:
The problem of incompatibility between the IDE output and the chipset may be related to the
release level of the chipset. The release employed is numbered 3 whilst the current one is 5. This
may mean that the current release of the IDE is aimed at use with the current release of the
chipset, although continuing production of previous releases should be supported. The only device
that would respond to the code was on a development board which had different switch and
indicator configuration, making it difficult to test the software on it. This device on a suitably
designed board would be another option which should be considered.
87. 86
Appendix:
Examples of revised code and the author’s electronics design are provided
CSRStackConnectionconnection.h
/*!
@brief Synchronous packet types.
*/
typedef enum
{
sync_hv1 = 0x0001,
sync_hv2 = 0x0002,
sync_hv3 = 0x0004,
sync_all_sco = sync_hv3 | sync_hv2 | sync_hv1,
sync_ev3 = 0x0008,
sync_ev4 = 0x0010,
sync_ev5 = 0x0020,
sync_all_esco = sync_ev5 | sync_ev4 | sync_ev3,
sync_2ev3 = 0x0040,
sync_3ev3 = 0x0080,
sync_2ev5 = 0x0100,
sync_3ev5 = 0x0200,
sync_all_edr_esco = sync_3ev5 | sync_2ev5 | sync_3ev3 | sync_2ev3,
sync_all_pkt_types = sync_all_edr_esco | sync_all_esco | sync_all_sco
} sync_pkt_type;
/*!
@brief Synchronous connection link type.
*/
typedef enum
{
sync_link_unknown,
sync_link_sco,
sync_link_esco
} sync_link_type;
/*!
@brief Message received due to a call to ConnectionSyncConnect or
ConnectionSyncResponse.
*/
typedef struct
{
hci_status status; /*!< Indicates the success or failure of the
connection attempt. */
sync_link_type link_type; /*!< Specifies whether a SCO or eSCO
packet type was obtained. */
Sink audio_sink; /*!< The Synchronous connection sink. */
uint32 rx_bandwidth; /*!< Receive bandwidth. */
uint32 tx_bandwidth; /*!< Transmit bandwith. */
uint8 sco_handle; /*!< Link Manager SCO Handle. */
} CL_DM_SYNC_CONNECT_CFM_T;
/*!
@brief Message received due to a call to ConnectionGetLinkQuality.
*/
typedef struct
{
hci_status status; /*!< HCI status code.*/
uint8 link_quality; /*!< The link quality setting.*/
Sink sink; /*!< The sink.*/