Customisation of Record Processing and Display Classes

Record Processing

Confirm that your project has a org.rti.zcore.projectname.dao.PersistenceDAOImpl; if it does not exist, copy org.rti.zcore.dao.PersistenceDAOImpl and create it. Modify org.rti.zcore.projectname.dao.PersistenceDAOImpl to customise processing of a submitted form. If the form submits values for the client's height, you may wish for that value to be updated on the patient table.

        switch (formFieldId) {
            case 490:  // sex change?
                PatientDAO.updateSex(conn, patientId, value);
                break;
            case 159:  // height
            	PatientDAO.updateHeight(conn, patientId, value);
                break;
            case 2279:  // sex change?
                updateAgeCategory(conn, patientId, value);
                break;
            case 2540:  // updates dead col in patient table.
            	if (value == 1) { // set to true
            		PatientDAO.updateDead(conn, patientId, true);
            	} else {
            		PatientDAO.updateDead(conn, patientId, false);
            	}
            	break;
        }

You may also override some of the zcore classes, substituting custom classes in application.properties. This will affect the generation of dynaStrutsConfig.xml:

# Used for generation of dynaStrutsConfig in GenerateStrutsConfig. If empty, will default to org.rti.zcore.struts.action.FormAction
dynasite.struts.form.save=org.rti.zcore.dar.struts.action.FormAction
# Used for generation of dynaStrutsConfig in GenerateStrutsConfig. If empty, will default to org.rti.zcore.struts.action.FormDisplayAction
dynasite.struts.form.display=org.rti.zcore.dar.struts.action.FormDisplayAction
# Used for generation of dynaStrutsConfig in GenerateStrutsConfig. If empty, will default to org.rti.zcore.struts.action.ListAction
dynasite.struts.listform.display=org.rti.zcore.dar.struts.action.ListAction
# Used for generation of dynaStrutsConfig in GenerateStrutsConfig. If empty, will default to org.rti.zcore.struts.action.PatientRecordListAction
dynasite.struts.patientlistform.display=org.rti.zcore.dar.struts.action.PatientRecordListAction

Custom Flows

It is necessary to create a custom PatientHomeAction for your project. PatientHomeAction forwards the user to the most logical flow when clicking a link from the search results. Be sure to change the action in struts-config.xml as well:

action path="/patientHome" type="org.rti.zcore.tims.struts.action.PatientHomeAction"

Other Custom Classes

Other classes are typically copied from zcore-base and modified. Remember to change the package in the controller (struts-config.xml). 

  • HomeAction - Home page
  • PatientSearchDAO - customise the query used for Search on the Home page.
  • CreateTestPatientAction - Create test records
  • ChooseReportAction - Reports menu
  • PatientTaskAction - optional - only if you need to change the default task listing (based on flowId)