CHAPTER 6

 


Programming and Programming Languages for Healthcare IT

Alex Mu-Hsing Kuo, Andre Kushniruk

   In this chapter, you will learn how to

•  Explain the importance of programming for healthcare information technology

•  Describe operating systems and their functions

•  Identify the differences between interpreted and compiled programming languages

•  Use object-oriented programming languages

•  Apply web markup and scripting languages

•  Understand simple HTML and XML statements


 

In the world of computers, a program is a sequence of instructions or machine codes telling the computer how to perform specific tasks. Machine code is the computer’s primitive language and consists of sequences of binary 1s and 0s that the computer processor (e.g., made by Intel or AMD) understands. To simplify the process of programming, a wide variety of higher-level programming languages have been developed. A programming language can be defined as a set of notations designed for writing programs to communicate instructions to a computer. Many programming languages are in existence today, such as BASIC, Perl, Fortran, COBOL, C, C++, and Java. An understanding of healthcare information technology requires knowledge about programming and programming languages that can be used for implementing healthcare information systems (HISs).

As this chapter will illustrate, a range of different programming languages have been used to create software in healthcare. They generally fall into one of two categories: interpreted languages (e.g., Basic and Perl) or compiled languages (e.g., Fortran and COBOL). With a compiled language, a computer program (or set of programs) called a compiler transforms the language source codes into machine-specific instructions (a binary form known as object code) before being saved as an executable file. With interpreted languages, the code is saved in the same format that it was created in. Next, an interpreter immediately translates the high-level instruction into an intermediate form, which the interpreter then executes. The interpreter analyzes and executes each line of source code in succession, without looking at the entire program (see Figure 6-1). Basically, interpreting code is slower than running the compiled code because the interpreter must analyze each statement in the program each time it is executed and then perform the desired action. Nevertheless, the compiled code simply performs the entire program, which is more efficient and has higher performance.

Images

 

Figure 6-1 Compiler vs. interpreter working process

Languages and Virtual Machines

Modern computer systems consist of a number of layers, starting with the underlying hardware layer (the hardware that the computer software runs on), moving up to layers dealing with operating systems, and finally moving up to layers dealing with running application software (e.g., applications written for business or healthcare). The evolution of computer systems can be characterized by the invention of many languages, which were developed over time to specifically make programming and human interactions with computers easier. Initially computer systems were programmed in machine language (1s and 0s, as mentioned earlier in this section). Programming at the machine level was tedious and difficult, and as a result, assembly languages appeared early in the evolution of computer systems. Assembly languages use symbolic instructions, such as “Load a register with a value from memory location A,” which in a specific assembly language might look like “LOAD R0 A.” The limitations of assembly languages are that they require knowledge of a computer’s specific architecture, such as the central processing unit (CPU) registers or memory locations, and will run only on specific types of computers (IBM mainframe, Mac, PC, etc.). To make interacting with computers simpler, operating systems began to evolve that would take care of low-level functions of running computer software so that programmers could focus on the task they want to carry out, rather than worrying about how to interact with underlying hardware and lower levels of hardware and software.

Operating Systems

Operating systems have evolved to make writing programs and running computer systems easier by handling lower-level computer functions instead of operating at the machine or assembly language level. Essentially, an operating system creates a virtual layer or machine, where functions or operations are simulated with software rather than actually existing in the hardware. The functions of an operating system are as follows:

•  Process management   A process is an individual program or operation, such as a word processing application being run on a PC. Each process needs resources to run to completion (e.g., CPU time, memory, files, and input/output devices), and the operating system manages this.

•  Memory management   For a program to be executed, it has to be mapped to memory addresses and loaded into computer memory; this is also handled by the operating system.

•  Storage management   The operating system provides a uniform and logical view of the storage of information in files and maps files onto physical media.

•  Protection and security   The operating system controls access to processes and access by users to computer resources.

•  Distributed system management and processing   Network operating systems allow for the sharing of files and resources across an entire network.

There are many types of operating systems, with Microsoft Windows being one operating system that has been used extensively for HISs. Hospitals and healthcare organizations have widely adopted Microsoft operating systems, initially running Microsoft DOS and now Microsoft Windows. Apple’s Mac OS X (recently rebranded macOS) has also become widely used in HIT. In addition, open source operating systems are common; these operating systems have been made available in source-code format rather than compiled binary code. Linux and Unix are examples of this type of operating system. The C language was created in conjunction with the development of the Unix operating system, and it allowed for an efficient and modular approach to the development of that operating system. The C language itself also became a widely used type of programming language, as will be described in the next section.

Recently, mobile health applications are popping up all over. Health professionals are incorporating them into their healthcare practices and management to be more effective and efficient. Patients are using them to monitor specific aspects of their health, fill in gaps in their medical care, and take more responsibility for their well-being. These mobile health applications are usually installed in mobile devices running mobile operating systems (MOSs). An MOS allows smartphones, tablets, and other mobile devices to run applications and programs. Examples of mobile device operating systems include Apple’s iOS, Google’s Android, Microsoft’s Windows 10 Mobile, Linux Foundation’s Tizen, BlackBerry 10 (based on the QNX OS), and Firefox OS.

In healthcare, the issue of the interoperability of systems is critical. If operating systems and applications are not interoperable, electronic data cannot be exchanged. Although the cross-platform exchange of data between systems such as Windows and macOS has improved, it’s important to carefully consider the ability of different hardware and software to seamlessly exchange health data.

The C Language

C is a general-purpose compiled language initially developed by Dennis Ritchie between 1969 and 1973 at Bell Labs. It was designed to provide language constructs that map efficiently to machine instructions, and to require minimal runtime support.1

To edit a C program, the very first thing you need is a text editor to edit the C source codes. Several text editors are available for editing a C program, such as Adobe Dreamweaver, Microsoft WordPad, Microsoft Notepad, and TextPad (from Helios Software Solutions). Among them, TextPad (www.textpad.com) is a powerful, general-purpose editor for Microsoft Windows that can edit plain-text files. It is very easy to use, with all the features that a power C programmer requires. The second tool you will need is a C compiler that you can use to compile the program. Examples are GNU Compiler Collection (GCC), MinGW compiler, and Code::Blocks for Windows.

Now, we will use a very simple example to explain how to edit and run the following C program. We use TextPad to edit the program.

#include <stdio.h>
  main()
  {
    printf("Hello World! ");
    printf("This is my first C program.");
  }

At the very beginning of the C program is the syntax #include <stdio.h>. This links the standard input/output (I/O) library to the program so that the program can interact with the screen, keyboard, and file system of the computer. In C, libraries are files of already-compiled code, which you can merge with your program at compilation time. Each library comes with a number of associated header files (.h), which make the functions easier to use.

The second line of the program is main(). Every C program must contain a function called main(). It is the start point of the program execution. The main() function declares the start of the function, while the two curly brackets (lines 3 and 6) after main() show the start and finish of the function. Curly brackets in C are used to group statements into a function or in the body of a loop. Such a grouping is known as a compound statement or a block.

The most common type of instruction in C is a statement, which is the smallest independent unit in the language. You write statements in order to convey to the compiler that you want to perform a task. Statements in C are terminated by a semicolon. C-language syntax is case sensitive. Most C programs are in lowercase letters. For example, the fourth line in this program, printf(“Hello World! ”);, will print the words “Hello World!” on the screen. The text to be printed is enclosed in double quotes. The at the end of the text tells the program to print a newline as part of the output. Line 5, printf(“This is my first C program.”);, is used to write out the text “This is my first C program.” on the screen.

After finishing the source code editing, we save it as MyProgram.c (with .c as the file extension). Now, we are able to use a C compiler (e.g., GCC) to compile the program. For example, the compilation command on Unix is cc o “MyProgram MyProgram.c.” At this point, if there are errors in the program, the compiler will show the error information on the screen. We should then correct these errors in the program and recompile the program. If there are no more errors in it, the compiler will return no error messages and will create an object file called MyProgram (in Unix, the default object filename is a.out). Then, we can execute the object file to see the output, as shown in Figure 6-2.

Images

 

Figure 6-2 A simple C program printing two lines of text

The C++ Language

Since the C programming language was developed, new approaches to programming have appeared. One of the most significant advances has been the concept of object-oriented programming. C++ is an object-oriented programming language developed as an extension to the C language by Bjarne Stroustrup at Bell Labs in 1983. It is now one of the most popular programming languages and is implemented on a wide variety of hardware and operating system platforms. Object-oriented programming is focused around the concept of objects, which represent things around you. An object can be a person, place, or thing. For example, an object can be used to represent a patient. Objects are actual instances of classes (e.g., the class Patient). The Patient class can have a number of attributes (e.g., Name, Address, Patient Number, etc.), which objects of that class have. In addition, using the concept of classes, objects can be classified or organized into hierarchies. For example, a Patient may be classified as either an In-Patient (if the patient is in the hospital) or an Out-Patient (if the patient is outside the hospital). In-Patient and Out-Patient are said to be subclasses of the parent class Patient. C++ added these object-oriented features to its syntax with the ability to define classes, such as a Patient class, which for the Patient class would look something like this:

Class Patient
{
   // Here would go the statements defining the class in detail
   // could specify attributes like Name, Address, Patient Number
   // could also specify the operations that could be done on Patient objects
}

The C++ syntax and program development processes are very similar to those of the C language. You can use any text editor to edit a C++ program file. If you are on a Unix machine, you would save the file with the filename xxx.C (make sure it ends with .C, not .c—it is case sensitive!), while if you are on a Windows operating system, you would save the file with file extension .cpp. For example, you could use TextPad to edit a C++ program called MyProgram.C (Figure 6-3).

Images

 

Figure 6-3 A simple C++ program printing out two lines of text

In the program, the first line, // my first program in C++, is a comment line, as indicated by the beginning two slashes (//). Comment lines do not affect the behavior of the program. You can use comments to include short explanations or definitions within the program to help the reader understand the programming logic.

The second line beginning with a hash (#), #include <iostream>, is a directive for the preprocessor. It is not a regular code line with expressions (which are combinations of symbols adhering to C++ programming rules of expression), but instead contains instructions for the compiler’s preprocessor. In this case, the directive #include <iostream> tells the preprocessor to include the iostream standard file. This specific file includes the declarations of the basic standard I/O library in C++, and it is included because its functionality is going to be used later in the program.

The third line, using namespace std;, includes all parts of the namespace in C++. Creating a namespace in C++ is useful to organize a set of related algorithms, function objects, program utilities, and other collections of code that can logically be grouped together. Thereby this sets apart a portion of code for more effective programming, referencing across the program, and code understandability across programmers, among other uses. The namespace std includes all standard C++ libraries. The iostream library we mentioned earlier is part of the std namespace. Therefore, when we use the std namespace, we don’t need to include the extended name of the iostream file.

The fourth line, int main (), is the point at which the C++ program starts its execution, independently of its location within the source code. It does not matter whether there are other functions with other names defined before or after it. The main() function is always the first one to be executed in any C++ program. For that same reason, it is essential that all C++ programs have a main() function. Similar to C, the two curly brackets (lines 5 and 9) after main() show the start and finish of the function.

The sixth and seventh lines, cout << “Hello World! ”; and cout << “This is a simple C++.”;, will write out the words “Hello World!” and “This is a simple C++.” on the screen, respectively. The cout is the name of the standard output stream in C++. It is declared in the iostream standard file within the std namespace.

The eighth line, return 0;, is a return statement that causes the main() function to finish. A return code of 0 for the main() function is generally interpreted to mean the program worked as expected without any errors during its execution. This is the most usual way to end a C++ console program.

Next, we will use a compiler (e.g., GCC for a Unix machine) to compile the program. At the Unix prompt, we type the following command:

g++ MyProgram.C o MyProgram

Then, a file called MyProgram is located in the same directory containing MyProgram.C. To run the program, we simply type MyProgram at the Unix prompt. Two lines of words will display on the screen, as shown in Figure 6-3.

There are several advantages to using C++, as follows:2

•  C++ is a third-generation language that allows programmers to express their ideas at a high level as compared to low-level assembly languages.

•  C++ also allows a programmer to get down into the low-level workings and fine-tune as necessary. For example, it allows the programmer strict control over memory management.

•  C++ is a language with international standards. After years of development, the C++ programming language standard was ratified in 1998 as ISO/IEC 14882:1998. The standard was amended by the 2003 technical corrigendum, ISO/IEC 14882:2003. The current standard extending C++ with new features was ratified and published by ISO in 2014 as ISO/IEC 14882:2014. Code written in C++ that conforms to the international standards can be easily integrated with preexisting codes and allows programmers to reuse common functions. This will dramatically reduce program development time.

•  Since C++ is an object-oriented language, this makes programming easier and allows easy reuse of code or parts of code through inheritance.

•  As mentioned at the beginning of this section, C++ is a very widely used programming language. Many tools and study resources are available for C++ program development.

The Java Language

Java is an object-oriented programming language originally created by Sun Microsystems (subsequently acquired by Oracle). The language syntax is very similar to C or C++, but Java has a simpler object model and fewer low-level facilities.3 To design a Java program, all source code is first edited in plain-text files with .java as the file extension. The programmer can use any text editor (e.g., Adobe Dreamweaver, Microsoft WordPad or Notepad, or TextPad) to edit the code. These source files are then compiled into .class files by a Java compiler. The .class file contains bytecodes, which are the machine language of the Java Virtual Machine (Java VM or JVM). Then, the just-in-time code generator converts the bytecode into the native machine code, which is at the same programming level. Because the JVM is available on many different operating systems, the same .class files are capable of running on different operating systems, such as Microsoft Windows, macOS, or Linux (see Figure 6-4).4 In other words, the same Java application is able to run on multiple platforms through the JVM.

Images

 

Figure 6-4 An overview of the Java programming process

To run a Java program, you need two tools: the Java Development Kit (JDK) SE and a text editor. In the example of Figure 6-5, we use TextPad to edit the source code (HelloWorld.java). The Java programming language compiler (Javac) can translate (by pressing CTRL-1) the source codes into bytecodes (HelloWorld.class) that the Java Virtual Machine can understand. Then, the Java application launcher tool uses the JVM to run (press CTRL-2) the program. It will then display the greeting “Hello Java World!”

Images

 

Figure 6-5 A simple Java program printing “Hello Java World!”

In conclusion, using Java as a system development tool has the following benefits:5

•  Object oriented   Java programs can be easily extended because Java is an object-oriented programming language.

•  Platform independent   When a Java program is compiled into platform-independent bytecode, rather than compiled into platform-specific code such as C or C++, the bytecode can be distributed over the Web and interpreted by the JVM on whichever platform it is being run.

•  Architecture neutral   The Java compiler generates an architecture-neutral object file format, which makes the compiled code executable on any processors that have the Java runtime system.

•  Portable   The architecture-neutral and implementation-independent characteristics of Java make it very portable.

•  High performance   With the use of just-in-time compilers, Java enables high performance.

•  Multithreaded   With Java’s multithreaded feature, it is possible to write programs that can do many tasks simultaneously. This design feature allows developers to construct interactive applications that run very smoothly.

•  Distributed and dynamic   Java is designed for a distributed environment on the Internet and is considered to be more dynamic than C or C++. Also, Java programs can carry an extensive amount of runtime information that can be used to verify and resolve accesses to objects at runtime.

•  Easy to learn   Java is designed to be easy to learn. If you understand the basic concept of object-oriented programming (OOP), then you can easily master Java.

Hypertext Markup Language (HTML)

HTML is a markup language for describing web pages, not a programming language like Java or C++. Markup tags (also called elements) are the major components in an HTML document (usually called a page). They are keywords (tag names) surrounded by angle brackets, as in <html>. HTML tags normally appear in pairs like <html>...</html>. Tags and elements are often used to describe the same thing. Additionally, the tag names are not case sensitive.

An HTML page can be considered a document tree that could contain four main parts, as follows:6

•  Doctype (optional)   The first tag to appear in the source code of a web page is the doctype declaration. The <!doctype> is not an HTML tag. It is an optional part that provides the web browser with information (a declaration) about what kind of document it is and what HTML version is used in the page so that the browser can display the document correctly.

•  HTML   Immediately after the <!doctype> comes the <html> element. It is the root element of the document tree, and everything that follows is a descendant of that root element.

•  Head (optional)   The <head> tag is used for text and tags that do not show up directly on the page. It is a container for all the head elements. Elements inside <head> can include scripts, instruct the browser where to find style sheets, provide meta information, and more.

•  Body   The <body> tag is used for text and tags that are shown directly on the page. This is where the page shows the contents. Everything that you can see in the browser window is contained inside this element, including paragraphs, lists, links, images, tables, and more.

An HTML element is everything from the start tag to the end tag. There are rules for editing HTML elements.6

•  HTML elements normally come in pairs like <h1> and </h1>.

•  An element starts with a start, or opening, tag (e.g., <h1>) and ends with an end, or closing, tag (e.g., </h1>). The end tag is written like the start tag, with a forward slash before the tag name.

•  The element content is everything between the start and end tags (e.g., <h1>Introduction to HTML</h1>).

•  Some HTML elements have empty content. An empty element is closed in the start tag, as in <br/> ("<br></br>").

•  Most HTML elements can have attributes. Attributes provide additional information about HTML elements. Similar to elements, there are several rules for editing attributes.6

• Attributes are always specified in the start tag.

• Attributes come in name and value pairs, as in name="value".

To understand the HTML document structure and how different elements or attributes work, it’s useful to consider a simple web page with typical content features, as shown in Figure 6-6. In this example, the author uses the HTML5 doctype for the document. The <title> tag shown in the browser toolbar defines the page title as “Alex’s Home Page.” It is required in all HTML/XHTML documents.

Images

 

Figure 6-6 A simple HTML document and the corresponding web page

The text between <body> and </body> is the visible page content. Here, the text “Introduction to HTML” between <h1> and </h1> is displayed as a heading. The text “Edited by Alex Kuo” between <p> and </p> is displayed as a paragraph, and the tag <font> specifies the font size (4), font face (verdana), and color (red) of the text. Size, face, and color are attribute names of this tag, while 4, verdana, and red are values for each attribute, respectively.

The <a> tag creates a link to another document by using the href attribute. In this example, the hyperlink text is “Visit W3Schools,” and the URL for the link is http://www.w3schools.com/.

In real application, you would use a text editor to edit an HTML document and save it as xxx.html (.html is the file extension of an HTML document). Then, you would use a web browser (e.g., Microsoft Internet Explorer, Google Chrome, or Firefox) to read the HTML document and display it as a web page. The browser does not display the HTML tags but uses the tags to interpret the content of the page.

Web-based HTML content can be enhanced with multimedia on a variety of software platforms. For example, Adobe Flash is an animation program/platform that can be used to enhance web pages with video, animation, and interactivity. It can be used to stream audio and video, and flash animations have been used for broadcasts, games, and advertising. Flash content can be displayed on computer systems using Adobe Flash Player, which is a freely available plug-in for web browsers.

Extensible Markup Language (XML)

XML is a markup language much like HTML. However, it is different from HTML, which was designed to display data with a focus on how data looks. XML was created to structure, store, and transport data. So, an XML document is nothing more than a plain-text document. Any software that can handle plain text can also handle XML.6

The tags used in HTML are predefined. However, XML tags are designed to be self-descriptive and not predefined. Document authors must define their own tags. For example, the tags in Figure 6-7 are not predefined in any XML standard. These tags are defined by the author.

Images

 

Figure 6-7 A simple XML document with author-defined, self-descriptive tags

It is also important to understand that XML is not a replacement for HTML. The main objective of XML is to simplify data sharing and transport (data interoperability). In the real world, one of the most time-consuming challenges for computer system developers is to exchange data between incompatible systems over the Internet because computer systems and databases contain data in incompatible formats. XML data is stored in plain-text format. This provides a software- and hardware-independent way of storing data. Also, exchanging data as XML greatly reduces this complexity, since the data can be read by different, incompatible applications as well as by humans.

As shown in Figure 6-7, an XML document consists of two parts: the prolog (also called the XML declaration) and instances (also called XML elements). The first line in an XML document always is the prolog that defines the version (in this example, 1.0) and the encoding used (ISO-8859-1 = Latin-1/West European character set). The elements in an XML document form a document tree (Figure 6-8). The tree starts at the root (<bookstore>) and branches (<book>) to the lowest level of the tree. All elements can have subelements (child elements, such as <title>, <author>, etc.).

Images

 

Figure 6-8 An XML tree structure

There are two types of XML documents: well-formed XML and valid XML. A well-formed XML document has XML syntax as follows:

•  The document must have a root element (e.g., <bookstore>).

•  All elements in the document must have a start tag and a closing tag (e.g., <book> ... </book>).

•  Tags are case sensitive (e.g., <BOOKSTORE> ≠ <bookstore>).

•  Elements must be properly nested (<bookstore> <book> ...</bookstore></book> is not a correct XML structure).

•  XML attribute values must be quoted (e.g., <book category="COOKING">).

A valid XML document is a well-formed XML document that also conforms to the rules of a document type definition (DTD) or schema. Therefore, a valid XML must be a well-formed document. However, it may not be true that a well-formed XML is a valid document (Figure 6-9).

Images

 

Figure 6-9 Two types of XML document

There are several benefits to using XML.67

•  XML is a W3C Recommendation (which is considered a Web standard), endorsed by software industry market leaders.

•  XML tags are designed to be self-descriptive and not predefined. New tags can be created as they are needed.

•  Tags, attributes, and elements provide context information that can be used to interpret the meaning of content. For example, <price>30.00</price> represents a book’s price as $30, thus opening up new possibilities for highly efficient search engines, intelligent data mining, agents, and so on. This is a major advantage over HTML or plain text, where context information is difficult or impossible to evaluate.

•  XML supports multiple data formats and can easily map existing data structures such as relational databases to XML. This is very beneficial to data interoperability.

•  Information coded in XML is easy to read and understand and can be processed easily by computers.

Active Server Pages (ASP)

Active Server Pages (ASP) is a powerful tool for making dynamic and interactive web pages. It is a server-side script language developed by Microsoft that runs inside the Microsoft Windows Internet Information Services (IIS) server. When you use a browser to read an HTML document, the browser at the client computer interprets the tags and displays the document as a web page on the browser. However, when an Internet Explorer browser reads an ASP file, IIS passes the request to the ASP engine at the server. The ASP engine reads the ASP file line by line and executes the scripts in the file. Scripts may access any data or databases and return the results to the browser as plain HTML (see Figure 6-10).

Images

 

Figure 6-10 An ASP working process

An ASP file can contain text, HTML, XML, and scripts, and it has the file extension .asp. The ASP commands are surrounded by the symbols <% and %>. Similar to C, C++, Java, HTML, and XML editing, you use a text editor to edit an ASP file and save it as xxx.asp. For example, in Figure 6-11, the <% response.write ...%> command in the ASPtest.asp file is used to output the text “Hello ASP. I like you.” to the browser.

Images

 

Figure 6-11 A simple ASP file and the corresponding result in a browser

Figure 6-12 shows a more complex ASP file that accesses a Microsoft Access database and converts the data stored in a Student table to an XML document.

Images

 

Figure 6-12 A more complex ASP file to convert database data to an XML document

There are several benefits to using ASP, as follows:6

•  ASP can be used to dynamically edit, change, or add any content on a web page.

•  ASP customizes a web page to make it more useful for individual users.

•  ASP responds to user queries or data submitted from HTML forms.

•  Programmers can easily use ASP to access any data or databases and return the results to a browser.

•  ASP provides good application security (since ASP code cannot be viewed from the browser).

•  ASP can minimize network traffic because the scripts are run on the server side.

•  Compared with CGI and Perl, ASP is easier to learn.

PHP: Hypertext Preprocessor (PHP)

PHP: Hypertext Preprocessor (PHP) is also a server-side scripting language where scripts are executed on the server and returned to the browser as plain HTML, like ASP. PHP runs efficiently on different platforms (Windows, Linux, Unix, etc.) and is compatible with almost all servers used today (Apache, IIS, etc.). It supports many databases, such as MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, and more.8

A PHP document has a file extension of .php and can contain text, HTML tags, and scripts. A script always starts with <?php and ends with ?>. The script can be placed anywhere in the PHP document. Each code line in it must end with a semicolon, which is a separator and is used to distinguish one set of instructions from another. For example, in Figure 6-13, the <?php echo “Hello PHP. I love you.”; ?> command will output the text “Hello PHP. I love you.” to the browser.

Images

 

Figure 6-13 A simple PHP file and the corresponding result in a browser

In Figure 6-14 (a), the PHP script accesses a Microsoft Access database and converts the data stored in a Student table to an XML document shown in Figure 6-14 (b), which is the same database and result shown in Figure 6-12 (b).

Images

 

Figure 6-14 A more complex PHP script to convert database data to an XML document

There are several benefits to using PHP, as follows:6

•  PHP is open source software that can be downloaded and used freely.

•  PHP runs efficiently on different platforms and supports many databases (e.g., MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, and Generic ODBC).

•  PHP is compatible with almost all servers used today (e.g., Apache, IIS, etc.).

•  PHP is easy to learn and runs efficiently on the server side.

Programming Languages and Development Environments for Mobile Health Application Development

There are several languages that can be used to develop mobile health applications. These tools include Java, Objective-C, C++, Swift, Python, and HTML5. The language chosen for mobile development depends on the mobile operating system device used. Here are development languages for two major mobile operating systems:

•  iOS   Swift is the main language for developing mobile applications running on Apple iOS. Xcode is an integrated development environment (IDE) containing a suite of software development tools for developing mobile applications for iOS. Swift is a multi-paradigm, compiled programming language for iOS, OS X, and watchOS applications that builds on the best of C and Objective-C (a hybrid of C). The iOS SDK is Apple’s software development kit to develop mobile applications for iOS.

•  Android   The official language for Android development is Java. It is possible to develop C and C++ apps using the Android Native Development Kit (NDK), but Google doesn’t promote that practice.

Chapter Review

This chapter provided you with an overview of a number of languages that are often used in the development of software in the healthcare industry. For details on any one of the languages, the reader is referred to the many books and manuals available. The chapter began with a discussion of compiled versus interpreted programming languages and also discussed the importance of operating systems. A number of high-level programming languages were described, including C, C++, and Java. Although not a programming language, the Hypertext Markup Language (HTML) is integral to understanding how web applications work and was also discussed, along with XML for structuring, storing, and transferring data. The chapter also discussed Active Server Pages (ASP), a powerful tool for making dynamic and interactive web pages, and PHP, a popular scripting language. All of the languages described in this chapter are used in creating many different types of HIT applications, and their use and application in healthcare will continue to grow. Finally, programming languages and development environments for mobile health application development is described for the two main mobile device operating systems of iOS and Android.

Questions

To test your comprehension of the chapter, answer the following questions and then check your answers against the list of correct answers at the end of the chapter.

    1.  A compiler is a _________________.

         A.  set of machine codes

         B.  programming language

         C.  program that transforms language source codes into machine-specific instructions

         D.  sequences of binary 1s and 0s

    2.  Apple iOS or Google Android is a _________________.

         A.  webpage design language

         B.  wording system

         C.  compiling language

         D.  mobile device operating system

    3.  You can use _________________ to edit a C program.

         A.  Microsoft Word

         B.  TextPad

         C.  Microsoft PowerPoint

         D.  Microsoft Excel

    4.  C++ is _________________.

         A.  an object-oriented programming language

         B.  a first-generation language

         C.  a markup language

         D.  by Sun Microsystems

    5.  In Java, _________________.

         A.  the syntax is not similar to C++

         B.  bytecodes are the machine language of the Java Virtual Machine

         C.  the same program cannot run on different machines

         D.  you use Microsoft Word to edit the source program

    6.  HTML is a _________________.

         A.  markup language

         B.  general-purpose programming language

         C.  machine language

         D.  network protocol

    7.  Which of the following statements is correct?

         A.  XML was designed to display data with a focus on how the data appears.

         B.  The tags used in XML are predefined.

         C.  XML tags are designed to be self-descriptive and not predefined.

         D.  A well-formed XML document is also a valid XML document.

    8.  What is the purpose of PHP: Hypertext Preprocessor (PHP)?

         A.  It was designed to protect data security.

         B.  It defines an XML structure.

         C.  It cannot run efficiently on different computer platforms.

         D.  It is a server-side scripting language where the scripts are executed on the server and returned to the browser as plain HTML.

Answers

    1.  C. A compiler is a program that transforms language source codes into machine-specific instructions. The code is then saved as an executable computer-readable file.

    2.  D. Apple iOS and Google Android are mobile device operating systems.

    3.  B. You can use TextPad to edit a C program. Adobe Dreamweaver, Microsoft WordPad, and Microsoft Notepad are other text editors that can be used to edit C programs.

    4.  A. C++ is an object-oriented programming language that is currently one of the most popular programming languages and is implemented on a wide variety of hardware and operating system platforms.

    5.  B. In Java, bytecodes are the machine language of the Java Virtual Machine.

    6.  A. HTML is a markup language for describing web pages. HTML is not a programming language like Java or C++.

    7.  C. XML tags are designed to be self-descriptive and not predefined. Document authors must define their own tags.

    8.  D. PHP: Hypertext Preprocessor (PHP) is a server-side scripting language where the scripts are executed on the server and returned to the browser as plain HTML.

References

    1.  King, K. N. (2008). C programming: A modern approach, second edition. Norton.

    2.  Overland, B. (2011). C++ without fear: A beginner’s guide that makes you feel smart, second edition. Prentice Hall.

    3.  Core Java Tutorial. Overview of Java. Accessed on January 22, 2017, from https://sites.google.com/site/alljavadevelopers/j2se-turorial.

    4.  Tutorialspoint.com. (n.d.). Java: Overview. In Java tutorial. Accessed on August 18, 2016, from www.tutorialspoint.com/java/java_overview.htm.

    5.  Java Programming. Features of Java. Accessed on January 22, 2017, from http://www.sitesbay.com/java/features-of-java.

    6.  W3Schools.com. Accessed on August 19, 2016, from www.w3schools.com.

    7.  Fawcett, J., Ayers, D., & Quin, R. E. (2012). Beginning XML, fifth edition. Wrox.

    8.  Gilmore, W. J. (2012). Beginning PHP and MySQL: From novice to professional, fourth edition. Apress.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.76.43