The application is related to Medical needs, information about patients, doctors, hospitals etc. I have decided to make the new version using Yii, since some other developer will take over if the project is successful and Yii (or other popular frameworks) is a very well documented framework for anyone to use. The choice of Yii against other PHP frameworks is rather just an impulsive one. I have read comparisons of the good PHP frameworks and Yii is among the top few. Anyway moving on...
While I am building this application, which is a moderately feature rich one, I intend to write about my experiences. Hope this helps anyone looking for a quick introduction and example for Yii. I am trying to make this a tutorial for Yii, I will try my best here. The project needs data for multiple types:
- General User Profile (could be a patient)
- Nursing Home
- Other Medical companies like: Medical Shop, Diagnostic Center, Fitness Center, Ambulance Provider, Nurse, etc.
Other information include:
- Specialization: this is related to Doctors, explained below
- Address: City, State, Country, etc. Any entity can have multiple addresses
- Phone: can be either a fixed or a mobile (cellular) phone. Any entity can have multiple phones, also address can have phones associated with them
- Department: Hospitals or Nursing Homes can specify many departments
- Branch: Hospitals, Nursing Homes of Other companies can have multiple locations/branches.
- Image: multiple images for any entity.
- User: this is used for authentication, simple email/password for now.
In Yii terms the relations look like this:
- Doctors can have one or more Specialization (HAS_MANY in Yii Model)
- Doctor, Hospital, Nursing Home, Other, Profile have a one-to-one mapping to Entity (BELONGS_TO in Yii)
- Entity can have multiple Addresses, Phones, Images (HAS_MANY in Yii)
- Entity can have many Departments (HAS_MANY). This is limited to only Hospital, Nursing Home or Other types though at the application level.
- Entity can have another Entity as Branch (HS_MANY). This is also limited to Hospital, Nursing Home or Other types at the application level.
I will write about setting up Yii Models in the next blog entry...