Application modernization with PHP, the Source-to-Image toolkit, and OpenShift

Summary

This code pattern is a PHP web application for a conceptual health records system, designed to showcase how Kubernetes-based micro-services modernize a traditional application using OpenShift’s Source-to-Image (S2I) toolkit.

This sample code is part of a series of code patterns that focuses on a fictional health care company and demonstrates app modernization using the enterprise Kubernetes environment of Red Hat OpenShift on IBM Cloud™. You learn how to populate and access large amounts of data on a MySQL database using REST APIs from a Java EE application. In addition, you use OpenShift’s Source-to-Image toolkit by deploying both Node.js and PHP web applications that make RESTful calls to the APIs from the Java EE application and display the data from the MySQL database.

Description

“Example Health” is a conceptual healthcare or health insurance company. It has been around a long time and has hundreds of thousands of patient records. The company’s health records look very similar to the health records of most insurance companies.

Originally, Example Health used a monolithic application structure for the health records application. The application structure was a full stack Java application running on WebSphere Application Server, connected to a DB2 database on System z.

Recently, Example Health decided to modernize the health records application and break it up into microservices. The development team decided to move to a SQL database connected to a Java EE application running on Open Liberty for the business logic and a Node.js application for the patient application user interface. In addition, Example Health decided to deploy these applications on Red Hat OpenShift on IBM Cloud.

Since moving to OpenShift, Example Health has expanded to include new microservices that include a PHP application for health records administrators (as shown in this code pattern) and a Node.js analytics application.

With the health records admin app, administrators of the Example Health medical records can view all of the patients that are a part of the system and statistical breakdowns of the following patient data:

  • Age
  • Gender
  • Top three medications used
  • Diabetes prevalence
  • Asthma prevalence

Here’s a view administrators might see when they log in: Screen capture of example health records app

Flow

Health records admin app modernization with microservices and OpenShift S2I architecture flow diagram

  1. The user (a health records administrator) opens the PHP app.
  2. Data is populated in one of two ways:

    • a. If no API URL is specified, the PHP application populates the application with local data from JSON files.
    • b. If an API URL is specified, the PHP application populates the application with data from REST API calls of the example-health-jee-openshift sample app.

Instructions

To try out this code pattern, see the detailed technical steps in the README.md file in the GitHub repository.

  1. Complete the prerequisite configuration steps.
  2. Create a fork in the repository.
  3. Deploy to OpenShift on IBM Cloud.
  4. Update the gateway timeout settings.
Max Shapiro