- Node.js (LTS edition, currently 20.x)
- At least one of the following matching services:
- Run
npm install
to install the necessary packages. - Run
npm start
to start the application. - Launch the application from the SMART launcher.
- Visit SMART Launcher
- Launch
http://localhost:3200/launch
- Ensure that the "Simulate launch within the EHR user interface" option is disabled as local development is unable to set cookies in an iframe over plain http
- Select a practitioner and a patient
- Page will load with name of selected patient displayed
Present on the application's search page is the option of several matching services. For each one you wish to use, you must also have their wrapper running (see Requirements).
npm install
npm start
NOTE: TrialScope and TrialJectory both run on port 3000
so thus you will not be able to run them at the same time. This is because TrialScope will be phased out soon.
Testing this SMART App is more meaningful when we can supply test patients that exercise various aspects of the application. Test patients are represented as FHIR R4 bundles at src/utils/r4_test_patients
. To upload the test patients to the public SMART sandbox:
- Add FHIR R4 Patient Bundles at
src/utils/r4_test_patients/
; e.g. mCODE R1 STU1, US Core, etc. Two example mCODE Patient Bundles are provided. - Run
npm run upload-test-patients
ornpm run upload-test-patients:dump
.- Result of running either command:
- The HTTP status response codes of each input Patient Bundle and its entries are printed to the command-line. A
200 OK
code indicates a successful upload. A201 Created
code indicates successful upload for the first time. A400 Bad Request
indicates an unsuccessful upload, and a diagnostic message is printed out for further troubleshooting.
- The HTTP status response codes of each input Patient Bundle and its entries are printed to the command-line. A
- Additional result of running the latter command:
- Each inputted Patient Bundle is split into two separate Resources: a Patient and a Bundle containing the remaining Resources. The script then creates an untracked directory,
/test_patient_dump/R4/
, and populates it with the pairs of Resources. This directory is useful for development or upload troubleshooting purposes.
- Each inputted Patient Bundle is split into two separate Resources: a Patient and a Bundle containing the remaining Resources. The script then creates an untracked directory,
- Result of running either command:
Tests can be run by executing:
npm test
Code liniting can be run by executing:
npm run lint
Some issues can be automatically corrected with:
npm run lint:js --fix
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.