Perform an Assessment After New Patient Creation

This article is part of the systems administration guide. You will require administration access to view the pages mentioned in this article.

The code below will perform an assessment after a new patient is created.

  1. Create a New Patient Registration Form assessment with Code: PD-001
  2. Publish and enable the assessment - check the code matches the code above PD-001 - if not change in the trigger script to match the assessment code
  3. Add the trigger script via:
    1. Admin > Workflow > Trigger Classes > Patient > Scripts > New
  4. Enter the Code below
  5. Activate the Trigger script after adding to Trigger Script > Patient

================

CODE -START

================

// Set Assessment  
var assessment = patient.add_assessment('PD-001');


// Perform assessment
if (assessment) {
  assessment.perform();
}
else {
  console.info("New Patient Registration Form was not found or is not enabled");
}

================

CODE - END

================