This tutorial shows how to develop an application for letting users schedule an appointment based on their illness. Patients will be able to make a schedule at any desired time during the day and doctors can see their schedule on their calendar.
Preparing and Designing
Name: To show off Doctors and Patients
Specialty: To show off Doctor’s specialty
Phone: Numbers a person has to call with a telephone
Email: A message sent by email
Age: The length of time that a person has lived
Weight: Heaviness of a person
Height: The measurement from base to top
Address: Detailed address
Insurance Policy Number: Specific number for the company that insures the patient
Insurance Company: The company that insures the patient
Reason: The reason for the patient’s visit
Illness: After figuring out the patient’s ill
Treatment: The process that the doctor will be applying for the patient
Medicine: To make the patients' illness better
After deciding your data fields, think about how you want to collect and present data to the user. In this example, we will create 4 different forms to cover functionality;
Specialties: Adding doctor specialties
Doctor Identification: identifying the doctor’s information
Patient Identification: Identifying the patient’s information
Treatment Claim Form: To organize an appointment and also anything assigned the doctor
Calendar: To show off doctor’s appointment schedule
Developing Applications
Now that we designed our application data and UI, it is time to develop an application using Xpoda Studio. Login to Xpoda Studio and add a new form.
Specialties Form
First of all, in this form, we want to record doctors’ specialties.
Add a new form and name it “XP_SPECIALTIES”. From the toolbar on the left side, add a new Text Box and name it as “Specialties” in both fields. Optionally, you can add a Label and also name it as “SPECIALTIES”. When the Label field clicked, you play with its color and font type as you wish.
Doctor Identification Form
This form will be identifying doctors’ information.
Firstly, we should give a name to our table and name it as “XP_DOCTORID”. We continue adding a Dropdown Box from the toolbox and name it “Name”. Considering doctors are our clients we should pull the data out of our database. In order to do this, we headed to our database using Query Wizard (on the right pane at the bottom of the blank SQL Query field. That been said doctors our clients we need to find our (XPoda_Client_Users) table and use this query;
SELECT
XPODA_CLIENT_USERS.UserID,
XPODA_CLIENT_USERS.UserFullName
FROM
dbo.XPODA_CLIENT_USERS WITH (NOLOCK)
Continue adding a Drop Down Box and as we’ve done above, we need to pull out the data from our database. In order to do this, we headed to “XP_SPECIALTIES” table and use this query;
SELECT
XP_SPECIALTIES.Specialties,
XP_SPECIALTIES.Specialties
FROM
dbo.XP_SPECIALTIES WITH (NOLOCK)
Additionally, we need to add a field to be able to add phone numbers. In order to do this, add a Text Box and name it “Phone” and also you need to choose the phone as a mask on the Property Pane (right side), and add another Text Box to be able to add email addresses and name it “Email”.
Patient Identification Form
Firstly, we should give a name to our table and name it as “XP_PATIENT”. In this form, we need to record patients first. In order to do this, add a Text Box from the toolbox and name it “Name”. Continue adding a Drop Down Box to add genders and name it “Gender”. After you make it you need to find the Field Style on the right pane and see Constant Value and leave as it is. Scroll down and see a blank field and fill it typing;
Female
Male
Others
Continue adding a Numeric Box to identify the age and, add a Numeric Box to measure weight and name it “Weight”, add a Numeric Box to measure height and name it “Height”, add Text Box to be able to save phone numbers and name it “Phone” and also you need to choose the phone as a mask on the Property Pane (right side) and, add a Text Box to save addresses and turn the -Multi-Line- to be able to add more than one lines and name it “Address”, and add a Numeric Box to save insurance policy number and name it as “Insurance Policy Number”, and add a Text Box to save Insurance Company and name it as “Insurance Company”.
Treatment Claim Form
In this field, we should pull out the data from our database. Then we will pull out the data to fill up the rest of the fields automatically in both sides (Patients and Doctors)
While the “Patient Name” field selected, use this query;
SELECT
XP_PATIENT.UserTableID,
XP_PATIENT.Name
FROM
dbo.XP_PATIENT WITH (NOLOCK)
to pull out the data from the table called “XP_PATIENT”
In order to do this, we need to add this text as “When any field clicked that followed after the “Patient Name” as Gender or Age or Weight or Height or Phone or Address or Insurance Policy Number or Insurance Company on the left side of the form we need to find the “Linked Object” field and type “PatientInformation” as we named it on the “Patient Name” action and also on the “Linked Object Area” field we need to find what field we clicked as the same name in the list. For example;
Linked Object: PatientInformation
Linked Object Area: Gender
After we pull out the patients’ information from its table, we also need to add an action on it to fill out the rest of the fields automatically.
In order to do this, while the “Patient Name” field selected, from properties pane (right side pane), hit the “Add New Action” button (on the right side of the settings icon) and choose “When the value changed” as the Type of Action. We want to “Create a New Data Object” when the value changes. Give it an object name and call it “PatientInformation”. After all, we should write its SQL Query and in query box enter following query;
SELECT
XP_PATIENT.UserTableID,
XP_PATIENT.Gender,
XP_PATIENT.Age,
XP_PATIENT.Weight,
XP_PATIENT.Height,
XP_PATIENT.Phone,
XP_PATIENT.Address,
XP_PATIENT.Insurance_Policy_Number,
XP_PATIENT.Insurance_Company
FROM
dbo.XP_PATIENT WITH (NOLOCK)
WHERE
XP_PATIENT.UserTableID = '$PPatient_Name'
and hit the save button down. Then “Save” from the top.
Appointments
In this field, we should pull out the data from our database.
While the “Doctor Name” selected, use this query;
SELECT
XPODA_CLIENT_USERS.UserID,
XPODA_CLIENT_USERS.UserFullName
FROM
dbo.XPODA_CLIENT_USERS WITH (NOLOCK)
For the Doctor’s field, we want to run an SQL query and the rest of the fields will fill up automatically.
In order to do this, while the “Doctor’s Name” selected, from properties pane (right side pane), select the property as “When the value changed” we want to update the value. In order to do this, hit the “Add New Action” button (on the right side of the settings icon) and choose “When the value changed” as the Type of Action. Choose the value area as “Specialty”. After all, we should write its SQL Query and in query box enter following query;
SELECT
XP_DOCTORID.Specialties
FROM
dbo.XP_DOCTORID WITH (NOLOCK)
WHERE
XP_DOCTORID.Name = '$PDoctor_Name'
and hit the save button down. Then “Save” from the top.
Calendar
We want to show off the doctors’ schedule on this calendar.
While the “Calendar” selected, on properties pane (right side pane), set User List as vertical, Edit Form as where you’d like to set the data for, user as the Doctor, heading as the reason, Start as Start, Finish as Finish. After we’ve all done this, use this query;
SELECT
XPODA_CLIENT_USERS.UserID,
XPODA_CLIENT_USERS.UserFullName,
XPODA_CLIENT_USERS.UserColor
FROM
dbo.XPODA_CLIENT_USERS WITH (NOLOCK)
Finally, we completed our application. Click "Run" to see your application.