Getting Started - Patient Appointments by Resource Organizer MPage
First Steps
- If you haven't done so already, setup Clinical Office: MPage Developer in your Cerner environment by following the steps found in our documentation.
-
Open the mpage-developer-template found on GitHub
(https://github.com/clinicaloffice/mpage-developer-template)
and click the Use this template button followed by the
Create a new repository menu option.
-
From the Create a new repository window, if you have more than one GitHub account,
ensure that the owner is set to the account you wish to use.
Enter a unique repository name and a description.
Set the visibility of your project to Private or Public.
Most clients would set the visibility to Private, however, our version of this tutorial has been set to Public
so you can view the source code.
Finish by clicking the Create repository button.
-
Once created, you will see the GitHub page for your project.
Click the Code button to reveal the Clone window.
Copy the URL of your repository with the Copy button.
-
Open Visual Studio Code. If you have a project open, close it.
Click the Clone Repository button. A new window will appear in the top centre of
the screen asking you to enter a repository URL. Paste the URL you copied into this
field.
If you prefer, you can also use the command prompt method described here.
- You will be prompted to authorize Visual Studio Code if this is your first time cloning a repository from GitHub. Follow the on-screen steps to grant Visual Studio Code access to your GitHub account.
- You will be prompted with a file explorer window. Navigate to the folder where you wish to create your project folder. Do not create a folder with your project name as the GitHub clone action will create this for you. Click the Select as Repository Destination button. You will now be asked to trust the authors of the files in the folder. Ensure the checkbox is selected and click the Yes, I trust the authors button.
-
Once the folder has been opened, navigate to the Edit menu and select Replace in Files. Replace all instances of
the original template name mpage-developer-template with the
template name of your project (e.g. organizer-appointments-by-resource).
This step will ensure that everything is named correctly both inside the compiled JavaScript component and
in the filenames.
This step is critical!
- Library versions can change frequently. It's a good idea to delete the package-lock.json file when creating a new project.
-
Open the terminal and type in
npm install
If your security settings are defined properly for PowerShell, or you are already setup to use the CMD prompt, you should see the libraries being added.
If you see the error message shown below, you need to change your terminal settings.
From the Help menu, click Show All Commands and search for terminal: select default profile. Once found, click on it and select Command Prompt. Open your terminal again and you should see it listed as CMD. Type in npm install again, and you should see the support files loaded into your project. You may see warnings for deprecated packages which can be ignored. You will now have a new package-lock.json file in your project. -
If you are using a development machine that is in the same network as the Discern Web Services server, you
can add proxy settings that will allow real-time development of your MPages while connected to Cerner.
Instructions for setting up the proxy can be found
here.
Using the built-in Angular proxy is the fastest and easiest way to develop MPages.
If you are not able to use the proxy due to security restrictions of your organization, the next best method is to host your Angular component on an external web host. The least favourable and slowest method is to compile, copy to the custom_mpage_content folder and refresh folder. This method is a full deployment.
Both an externally hosted component and component hosted in the custom_mpage_content folder require a full deployment setup before you can test your code. Instructions on this can be found here.
-
After your proxy has been set up, return to your command prompt and type in the following line to start
the proxy server.
ng serve
-
Open your web browser to http://localhost:4200 to view your running MPage. You should see the phrase "Create something wonderful".
If your proxy has been set up correctly, you should also have a pop-up window on the screen asking you to sign in. The username must consist of your Cerner username followed by the @ symbol and the domain name you are attempting to access (e.g. john.simpson@b1234). The password should be your Cerner password front-end password.
If your Cerner password contains the @ symbol in it, you will need to change your password before you can use the proxy server. This is a defect in the Discern Web Services server and not with Angular or the proxy server. -
As a final test before we start coding, open the MPage Developer debugger by pressing
CTRL + /.
You should see two information messages describing the browser and where the proxy is running CCL scripts from.
You should also see two entries labeled [Queue Id: 0]. One represents initiating a call to CCL while the
other describes the completion of the CCL execution.
-
Click the tab marked System to view information about your current MPage context.
You will see values for the current node and domain, but most importantly you will see the context that the
MPage is running in.
If the context says CHART, you will be running in chart mode which means the person_id and encntr_id for the
current selected patient in PowerChart will be used.
Our MPage will be displaying data for multiple levels and will be running at the organizer level.
We will correct this shortly.
- We are now ready to start programming.
