SQL by Example. 2.

PHP and MySQL Web Application based on Tanner-Whitehouse Standard

 

Sorana BOLBOACĂa, Lorentz JÄNTSCHIb, Andrei ACHIMAŞ CADARIUa

 

a Iuliu Haţieganu Medicine and Pharmacy University, Cluj-Napoca, Romania

b Technical University of Cluj-Napoca, Romania, http://lori.academicdirect.ro

 

 

Abstract

In pediatrics, skeletal maturity, also called “bone age”, an expression of biological maturity of a child, is an important quantitative measure for the clinical diagnosis of endocrinological problems and growth disorders. Bone age is also used in monitoring children with hormone therapy.

Skeletal maturity may be assessed by analysis of the ossification centers of the hand, foot, knee, elbow or pelvis but most often used is the hand. Skeletal maturity diagnosis is usually based on a visual comparison of a left-hand wrist radiograph with atlas patterns and the most common method used is the Tanner-Whitehouse method.

With the help of PHP and  MySQL a computer-assisted software we developed, based on Tanner-Whitehouse method, for bone age assessment of children and young people. The program is a client-server one and all data are saved into a database server. The program (1) display control radiographies, schematic drawings and specifications for every stage of hand bones until maturity stage, (2) allow user to select a maturity stage for every bone, (3) save and query personal data of patients, (4) save and query consultations and (5) make consultation reports.

URL address:

http://vl.academicdirect.ro/medical_informatics/bone_age/v1.2/.

Keywords:

PHP, MySQL, Web application, Tanner-Whitehouse method

 

 

 

Introduction

 

The faster growing of the Internet in the last decades determinates a similar growth in services that are accessible over the Web in all day-to-day activities domains. The medical world has been included in this transformation and medical sites and application are available presently, covering many specialties including radiology [1]. Nowadays, we can talk inclusive about evidence-based medicine Web sites, which provide a large amount of medical knowledge, more of them organized in medical databases [2]. 

In pediatrics, skeletal maturity, an expression of biological maturity of a child, is an important quantitative measure for the clinical diagnosis of endocrinological problems and growth disorders. Bone age is also used in monitoring children with hormone therapy.

Skeletal maturity may be assessed by analysis of the ossification centers of the hand, foot, knee, elbow or pelvis but most often used is the hand. For the assessment of child skeletal maturity, radiologists use a hand and wrist radiography. The assessment is realized by assessing the ossification and maturation of the epiphysis of the hands and wrists comparing them with standards radiographs and standards descriptions. There are al least two methods of evaluating wrist and hand bone age represented by the Tanner-Whitehouse method and the Greulich-Pyle method [3,4]. In the Greulich-Pyle method the hand radiograph as hole is compared with some standard hand radiographs [5].

The Tanner-Whitehouse method [6] involves the examination of 20 bones of the hand and wrist and the assignment of a stage to each bone dependent on the attainment of clearly described bone-specific maturity indicators. In accordance with Tanner-Whitehouse tables, every bone stage has a numerical score, and the scores are summed for each individual to give a maturity score on a scale of 0 to 1000. Using the Tanner-Whitehouse tables, maturity scores are converted to bone age for each individual and the relative maturation can be assessed by comparison of the bone age with the individual’s chronological age.

The main idea what leads to program design was to create a interactive program easy to use, with minimum requirements that allow to manage most of the activities relative to skeletal maturity analysis.

The first question that requires an answer was “We want a server-based application or client based application?” We decided that we want a server-based application because we need to store all data in one database. Another question that required an answers grow up “We want a server side application or a client side application?” If we want a server, side application, to minimize the using of client computer, then requires a Web server installed.

The analysis continues to choose proper operating system of server. Platform independent and free software is a real alternative to avoid all problems concerning license and portability [7]. Once we have an operating system installed, the next step is to choose a proper programming language for software developing. PHP comes with the best offer. The advantage of PHP programs consist in his portability under most of operating system platforms and internal compilation feature that do not necessity the compilation “by hand” from the user. The disadvantage can derive from the same internal compilation that consumes supplementary time in execution. However, this disadvantage can be partially eliminated through installing a PHP proxy that store compiled programs and next execution of the unmodified program use this compiled binary.

In terms of program developing PHP is easy to use, the language borrow syntax from C, Pascal, Basic and Perl, but do not borrow the complex declaration syntax from them. The pointer mechanism is absolute. Thus, a variable used as a string, can be exploited as an integer or real if the value represent a number such that. Modular programming, recursively and graphics are at home! Module loading of compiled programs in other languages and execution of binary programs is also available. System services such as mail service are easy to exploit in PHP scripts. A very easy mechanism to link PHP scripts to HTML scripts make PHP language to be one of the best. Shell executing commands make PHP a useful platform for system administration (PhpSysInfo, WebAdmin, PhpMyAdmin, PhpPgAdmin). Class constructing is also available and PHP posses a strong library of database connectivity. MySQL database server is the best choice to manage patient and consultation data and has a very easy to use syntax, based on SQL specifications. SQL commands can be sends to the database server through PHP programs using MySQL functions. The output of the PHP program is in HTML style and can be viewed by any web client (Microsoft Internet Explorer, Mozzilla, Opera, Netscape, Konkueror).

There are many computer program all over the world, most of them using the pattern recognition [8] with algorithms based on Tanner-Whitehouse methods [9, 10] or using some algorithms based on carpal bones score [11].  All these program are developed in countries where the radiological devices have possibilities to storing digital image because the pattern recognition suppose to work with an high quality right hand radiographies in order to fit correctly the image with the standard image.

Most of the radiological devices used in Pediatric Hospitals in Romania did not have the potential of storages digital imaging of the hand and the assessment of skeletal maturity is performed using manually classic x-rays assessment. In order to help pediatric radiologists we developed, based on Tanner-Whitehouse standards, working with PHP and MySQL, a Web application which to facilitate bone age assessment.

 

 

Implementation Methods

 

In order to develop an application which to can be used on a stand-alone computer as well as on a Web server we choose to work with Apache, PHP and MySQL, technologies that allow to create powerful and fast database Web site applications. Apache is the most popular Web server and is generally considered to be more stable than other servers. It is usually installed on UNIX and Linux systems, but is also available for Microsoft Windows platform. [12] PHP has the unique distinction of being an open-source server-side scripting language that can be integrating it in HTML.  PHP started as a small project to improve a home page and grew into one of the world’s most powerful server-side script [13].

Databases applications have been around for over 30 years, and many have been deployed using network technology long before the web existed. In order to develop an interactive web application we choose to work with MySQL [14], a perfect database management system for storing and sharing information directly from a Website.

 

 

 

MySQL Database Design

 

MySQL is a popular database and its speed and small size make it ideal for a Web application. It also is an open source, which means free under the open source GPL license. Another advantage of the MySQl is that can run on many operating systems as Windows, Linux, Mac O5, most varieties of Unix (Solaris, AIX, DEC Unix), FreeBSD, OS/2, and others. MySQL is a secure system that allows some authorizations or all database privileges (the privilege to create a database or to delete data that in our application is attribute to the administrator) to specific users or group of users.   

The present application uses a database named `TW2`. The database contains five tables named `Patients`, `Consultations`, `Physicians`, `Bones`, and `BoneStages` (see fig. 1).

 

 

 

Fig. 1. Database structure and connectivity

 

`Patients` table contains patient general information’s like: personal no., second name, first name, sex, date of birth and place of birth. The `Patients` table has two unique fields, one is represented by the `IdPatient` that is an auto-increment field and the second filed is represented by the `PersonalNo`, a thirteen character number unique for every person.

The second table is named `Consultations` and stores consultations information data represented by date of consultation, patient’s weight and height, patient diagnostic, the bones that were selected in the skeletal maturity assessment, real score, maturity score and bone age.

The `Physicians` table contained the next information: name of the physicians and the password. The password field is an encrypted one.

The last two tables, `Bones` and `BoneStages` were created in order to store information necessary to compute skeletal maturity score. These two tables, are queried when bone age is computed and they retrieved the bone names, bone stages links to photos and bone stages specifications.

The structure of the relationship is based on tables `Patients` (primary table), `Physicians` (primary table) and `Consultations` where the filed `PersonalNo` is a foreign key from `Patients` and `Physicians` is foreign key from `Physicians` (see fig. 1).

 

 

PHP and MySQL Programming

 

We used the PHP language to write the program in order to perform the application tasks because we consider that the PHP is flexible enough to perform the task we need for our application. Our application has 10 PHP programs: stiluri.php, password.php, index.php, info.php, info_n.php, info_cons.php, patient.php, NewPatient.php, SaveConsultation.php, tw2.php. There are two program that are used in all the rest of the programs: stiluri.php and password.php.

stiluri.php is an additional program where we defined some styles that are used in the program. This allows us to reduce the number of rows in programming. The next example is a style used in index.php, info.php, info_n.php, info_cons.php, patient.php, NewPatient.php, SaveConsultation.php, tw2.php:

 

.style2

{

font: 13pt. Times New Roman;

color: #800000;

}

 

The connection to the TW2 database is realized through the password.php program. The program is a simple one and has just five rows. Through this program store the information for connection with the TW2 database, specified the host server, the user and the password in the variables called $host, $user and $password.

The first page application program is named index.php and allows us to choose where to perform the application (localhost or Internet) and what kind consultation we want to perform. If we have a new patient, we will pick the Insert option from Option drop down list. If we want to perform a new consultation to an older patient, we will choose the Select option from Option drop down list.

When we insert a new patient data or retrieve patient’s information from the database, the application will use the patient.php program.  The new patient registration is made using a SQL command:

 

INSERT INTO `Patients` VALUES ('','<value>',…, '<value>')

 

where first value is empty one and represent `IdPatient`, which is a numeric field primary key with auto increment and is incremented automatically by MySQL database server. If the patient already exists, another registration is not allowed for the same `PersonalNo` filed.

If the patient is already registered into our database, we will choose the Select option. When the patient information’s are registered, the NewPatient.php program gives us a confirmation of registered data into `Patients` table from `TW2` database. If there are, another patient registered with the same `PersonalNo`, the registration will not be possible because the script did not allow this and the application answer will be given by the following program sequence:

 

if($r=mysql_fetch_array($t)){

  echo("Patient with Personal No: ".$HTTP_POST_VARS['PersonalNo']." already exist!<BR>");

  echo("Another registration is not possible.<BR>");

  echo("If you want to make a consultation please click here:");

  echo(" <A HRef='index.php'>New Consultation</A>");

  exit();

}

 

If we know that the patient was already registered into the TW2 database, we will choose the Select option.  Patient selection is made also through a SQL command:

 

SELECT `PersonalNo` FROM `Patients` WHERE `PersonalNo`

LIKE '$HTTP_POST_VARS['PersonalNo']'

 

An UPDATE command is also possible to modify the patient information:

 

UPDATE `Patients` SET `PersonalNo`='<value>', `SecondName`='<value>', …,

WHERE `id`='$HTTP_POST_VARS['PersonalNo']'

 

Performing the Tanner-Whitehouse test is allows using the tw2.php program. First is necessary to select the patient. Into this window, we can see again the patient data that are tacked out from the `Patients` using the next statement:

 

document.write("<BR><hr size=7 color=#191970 width=70%><BR>");

document.write("<center><table width=50% border=1><tr>");

document.write("<td valign=middle align=center>Sex:<BR>");

<?

echo("document.write(\"<input type='text' readonly='true' ");

echo("name='Sex' size='1' value='".strtoupper($r['Sex'])."'>\");");

?>

document.write("<td valign=middle align=right><table border=0>");

document.write("<tr><td valign=middle align=right>");

document.write("Personal No:");

document.write("<td valign=middle align=left>");

<?

echo("document.write(\"<input type='text' name='CNP' ");

echo("size='13' value='".$r['PersonalNo']."' readonly='true'><BR>\");");

?>

 

The script which described the computational part of the program was described in the Client-Server Implementation of Bone Age Assessment Calculations paper15.

The consultations data are saved into the `Consultation` table from `TW2` database. The message of successful registration of the data is script into the SaveConsultations.php program. Inserting a new patient, update the patient information and performing the Tanner-Whitehouse test is allows just for the physicians who are inserted into `Physicians` table from `TW2` database.

Interrogating the database about patient and consultation is performing using the info.php program. We can interrogate the database about patient information if we choose the Consultations option from Option drop down list, or to obtain a report if we pick up the Report option. The patient consultation information’s are obtain using the info_n.php program. We can choose to create a complex report or a simple one using the next statement:

·      Do you wish to display bones?

<select name='bones' class='style2'>

<option value='1'>yes

<option value='2' selected>no

</select>

·      Do you wish to display real TW2 score?

<select name='tw2score' class='style2'>

<option value='1'>yes

<option value='2' selected>no

</select>

·      Do you wish to display maturity score?

<select name='matsc' class='style2'>

<option value='1'>yes

<option value='2' selected>no

</select>

 

The Report option allow to create a report with all the patient data from the TW2 database and this script is in info_cons.php program.

 

 

Implementation and Results

 

Using PHP ad MySQL, a program that offers possibilities of an interactive proceeding for the computer-assisted bone age assessment, was developed. The program can run on a stand-alone computer or on a Web server. The computer is necessary to have installed a phptriad program [13], program which can be freely download from the Internet and an HTML 4.0 web browser (like Internet Explorer 4.0, Netscape 4.7, Mozzilla, Opera). The program is also hosted in educational network of Technical University of Cluj-Napoca, on a Free BSD Unix based server (5.0 DPI software version). The server has installed an Apache web server (1.3.26 software version) and the MySQL database server (3.23.52 software version) is installed and running on it. The program can be tested at the next address: http://vl.academicdirect.ro/medical_informatics/bone_age.

The application has a friendly interface and can be used by any radiologists who know how to use a Web browser (see fig. 2). We can say that the program has two important segments. First, is represented by the part that allows radiologist to insert patient data (fig. 2) and compute maturity score (see fig. 3). The insert patient information part of the program has some fields where the user can choose the information from a drop list. These fields are represented by the patient’s sex, patient’s place of residence and place of birth (fig. 4). We choose these options in order to reduce the time need to fill these fields.

Fig 2. The inserting patient information interface

 

Fig. 3. The maturity score assessment interface

 

Fig. 4. The place of residence drop down list

In order to compute a patient bone age, first is necessary to insert the patient information data into the database and after that to select the required patient. The patient is selected from a drop list. The user can see the patient second name, first name and personal no. In the list the patient are orders by the second name in ascending alphabetical order (see fig. 5).

Fig. 5. Selecting the patient in order to compute skeletal maturity

 

After the user select a patient, a new windows is open and the radiologist, using some radio buttons, must to choose a maturity stage for every 20 bones used in Tanner-Whitehouse method. For every bone the program, allow to choose just a single stage. At the end of the page, we can see a table with the patient information data. It is also necessary to fill in this table other patient information like date of consultation, diagnosis, weight and height. This information will be saved in the `consultations` table from the `TW2` database.

The second part of the program allows users to interrogate the databases in order to find a consultation report (see fig. 6) or a general report.

Fig. 6.  The consultation report interface

 

When we create the consultation report, we can say to the program to give us all the patient data or we can choose to bring us the patient data from the `Patients` table and just date of consultation, diagnosis, weight, height, and bone age from the `Consultations` table.

The consultation reports can be printed or can be saving on a floppy disk in order to send a consultation results to the specialist or to the family doctor.

A pediatric radiologist who works in First Pediatric Hospital in Cluj-Napoca tested the program. The program has some advantages:

·      The time need to obtain final bone age is significantly reduce to 3-5 minute in comparison with the paper evaluation when the radiologist need 8-10 minutes;

·      The program allows a reduction of computational errors in both score and bone age that often occurs using paper as a support for evaluation;

·      All the data are saving in a database, and can be interrogate any time.

The performance of the computerized procedure depends on the interaction user and on the familiarization of the radiologists with a Web browser. On the other hand, the program performance also depends on the radiologist’s experiences, experience which is essential.

 

 

Discussions

 

Nowadays, Internet offers some new opportunities in medical field. Two of them are more important: presenting medical information and database medical application. There are some portals which intend to collect significant information about medical problems [16] or guide developed in order to help physicians to find biomedical resources on Internet, such as HONselect [17], OMNI [18], CISMeF [19] and Medical Matrix [20]. All these sites provide free access to high quality data by filtering relevant information.

We decided to use MySQl and PHP, the dynamic duo, because MySQL provides the database part and PHP provides the application part of the Web database application. As a data based management system, MySQL can store very complex information. As a scripting language, PHP can perform complicated manipulation of data. MySQL and PHP as a pair have several advantages:

·      They are free;

·      They are Web-oriented. Both were designed specifically for use on Web sites and have a set of features that are focused on building dynamic Web sites;

·      They are easy to use because were designed for the purpose of getting a Web site up quickly;

·      They are fast. So MySQL, so PHP were designed with speed as a major goal. Together they provide one of the fastest ways to deliver dynamic Web pages to users.

·      They communicate well with one another. PHP was built-in features for communication with MySQL;

·      A wide base of support is available for both. There are a lot of people available to help, including on e-mail discussion lists, people that have experience using MySQL and PHP together;

·      They are customizable. MySQL and PHP are open source which allowing programmers to modify the PHP and MySQL software in order to fit to some specific environments.

Our project is intended to serve more specialized needs of pediatric radiologists who work with not so sophisticated radiological devices to assess easily child bone age. The aim of the project was to allow the pediatric radiologists to introduce some general data of the patient into a database, to compute the bone age for the child and to perform interrogations on database in order to obtain reports with the actual and previous examinations. 

The application can be use by the resident of radiology which perform the pediatric radiology probation and of course by the pediatric radiologists in day-by-day work.

The program can be extended in order to compute RUS bone maturity score – this score use just radius, ulna and finger bones, and/or Carpal bone maturity score – use only carpal bones. Can also be developing an automated system of bone age maturity evaluation applied on the base of the Tanner-Whitehouse method but for this is necessary first to have the proper radiological devices in the Pediatric Hospitals.

 

 

Conclusions

 

With the help of PHP and  MySQL a computer-assisted software was developed, based on Tanner-Whitehouse method, for bone age assessment of children and young people. The application has a friendly interface and offers a nice environment for skeletal maturity assessments. The program allows a significantly reduction of time need to obtain final bone age and a reduction of computational errors in both score and bone age, errors that often occurs when radiologists used paper as a support for evaluation.

Other advantages of this application is represented by the possibilities of storing patients information as well as patient consultations data, information that can be easily find again when the patient  to the seconds or third consultation.

The advantage offer by the web application is huge. If, for example we consult a patient into a hospital in Cluj, patient who has previous consulted in another hospital in Romania and these two hospital register the patient data into the same TW2 server database it will be so easy to find the previous consultations data.

The performance of the computerized procedure depends on the interaction user and on the familiarization of the radiologists with a Web browser. On the other hand, the program performance also depends on the radiologist’s experiences, experience which is essential.

 

 

Acknowledgement

 

The authors thank to Dr. Carmencita Deneş for her valuable assistance with the hand and wrist x-rays radiography skeletal maturity experience.

 

 

References



[1] Rolland Y.,  Bousquet C., Pouliquen B., Le Beux P., Fresnel A., Duvauferrier R.: Radiology on Internet: advice in consulting websites and evaluating their quality. Eur. Radiol. 2000; 10: 859-866

[2] Delvenne Catherine, Pasleau F. Organising access to Evidence-Based Medicine resources on the Web. ELSVIER. 2003; 71: 1-10

[3] Milner G.R., Levick R.K., Kay R. Assessment of bone age: a comparison of the Greulich and Plye, and Tanner and Whitehouse methods. Clin. Radiol. 1986; 37: 119-212.

[4] Frische H., Riedl S., Waldhör T. Computer-aided estimation of skeletal age and comparison with bone age evaluations by the method of Greulic-Pyle and Tanner-Whitehouse. Pediatr. Radiol. 1996; 26: 226-31.

[5] Greulich W.W., Pyle S.I. Radiographic atlas of skeletal development of the hand-wrist. 2nd edition. Carlifonia. Stanford University Press, 1959.

[6] Tanner J. et all. Assessment of Skeletal Maturity and Prediction of the Adult Height (TW2 Method). London/New York, Academic Press, 1983.

[7] Lorentz JÄNTSCHI, Free Software Development. 1. Fitting Statistical Regressions, Leonardo Journal of Sciences, Vol. 1(2002), p. 31-52, ISSN 1583-0233, http://ljs.utcluj.ro.

[8] Meindert Niemeijer, Casper Maas, Bram van Ginneken. Automanic skeletal age assessment. (WWW page)  http://www.isi.uu.nl/People/Meindert/

[9] Dickhaus H., Habich R., Wastl W., Schőnberg. D. A computer based system for skeletal maturity assessment. Medical signal and image processing. 13:11-20.

[10] Cabello A. Suanes., Esrtada R. Caňete. sistema Automatizo de evaluación de ka maduratción ósea aplicado al método Tanner-Whitehouse 2. Anales Espanoles de Pediatria. 1999; 50(2): 134-139.

[11] Bo-Chun Fan, Chi-Wen Hsieh, Tai-Lang Jong, Chui-Mei Tiu. Automatic Bone Age Estimation Based on Carpal-bone Inage – A Preliminary Report. Chin Med J (Taipei) 2001; 64: 203-208.

[12] Apache Software Foundation (WWW site): http://www.apache.org

[13] PHP (WWW site): http://www.php.net

[14] MySQL (WWW site): http://www.mysql.com

[15] Sorana BOLBOACĂ, Carmencita DENEŞ, Lorentz JÄNTSCHI, Andrei ACHIMAŞ-CADARIU, Free Software Development. 4. Client-Server Implementation of Bone Age Assessment Calculations, Leonardo Electronic Journal of Practices and Technologies, 2002; 2; 1-19.

[16] Ribaric S., Todorovski L., Dimec J., Lunder T. Presentation of dermatological imaages on the Internet. Comput. Methods programs Biomed. 2001; 65:111-121.

[17] Boyer C., Baujard V., Griesser V., Scherrer J.R. HONselect: a multilingual and intelligent search tool integrating heterogeneous Web resources. Stud. Health Technol. Inform. 2000; 77: 273-278.

[18] Norman F. Organizing medical networked information (OMNI). Medical Informatics (Lond). 1998; 23: 43-51.

[19] CISMeF (Catalogue et Index des Sites Médicaux Francophones), University of Rouen, France (WWW page): http://www.chu/rouen.fr/cismef/

[20] Medical Matrix , USA (WWW page): http://www.medmatrix.org/