Source:
public void addModelAttributes(PageModel model, Patient patient, AppDescriptor app, PatientIdentifierType primaryIdentifierType, String breadcrumbOverride) throws Exception { if (RegistrationAppUiUtils.getRegistrationAppId() != app.getId()) { AppDescriptor customApp = Context.getService(AppFrameworkService.class).getApp(RegistrationAppUiUtils.getRegistrationAppId()); if (customApp != null) { app = customApp; } } NavigableFormStructure formStructure = RegisterPatientFormBuilder.buildFormStructure(app); if (patient == null) { patient = new Patient(); } NameSupportCompatibility nameSupport = Context.getRegisteredComponent(NameSupportCompatibility.ID, NameSupportCompatibility.class); AddressSupportCompatibility addressSupport = Context.getRegisteredComponent(AddressSupportCompatibility.ID, AddressSupportCompatibility.class); model.addAttribute("patient", patient); model.addAttribute("primaryIdentifierType", primaryIdentifierType); model.addAttribute("appId", app.getId()); model.addAttribute("formStructure", formStructure); model.addAttribute("nameTemplate", nameSupport.getDefaultLayoutTemplate()); model.addAttribute("addressTemplate", addressSupport.getAddressTemplate()); model.addAttribute("includeRegistrationDateSection", !app.getConfig().get("registrationEncounter").isNull() && !app.getConfig().get("allowRetrospectiveEntry").isNull() && app.getConfig().get("allowRetrospectiveEntry").getBooleanValue() ); model.addAttribute("allowUnknownPatients", app.getConfig().get("allowUnknownPatients").getBooleanValue()); model.addAttribute("allowManualIdentifier", app.getConfig().get("allowManualIdentifier").getBooleanValue()); model.addAttribute("patientDashboardLink", app.getConfig().get("patientDashboardLink") !=null ? app.getConfig().get("patientDashboardLink").getTextValue() : null); model.addAttribute("enableOverrideOfAddressPortlet", Context.getAdministrationService().getGlobalProperty("addresshierarchy.enableOverrideOfAddressPortlet", "false")); model.addAttribute("breadcrumbOverride", breadcrumbOverride); model.addAttribute("relationshipTypes", Context.getPersonService().getAllRelationshipTypes()); }

Target:
public void addModelAttributes(PageModel model, Patient patient, AppDescriptor app, PatientIdentifierType primaryIdentifierType, String breadcrumbOverride) throws Exception { if (RegistrationAppUiUtils.getDefaultRegistrationAppId().equals(app.getId())) { AppDescriptor customApp = Context.getService(AppFrameworkService.class).getApp(RegistrationAppUiUtils.getDefaultRegistrationAppId()); if (customApp != null) { app = customApp; } } NavigableFormStructure formStructure = RegisterPatientFormBuilder.buildFormStructure(app); if (patient == null) { patient = new Patient(); } NameSupportCompatibility nameSupport = Context.getRegisteredComponent(NameSupportCompatibility.ID, NameSupportCompatibility.class); AddressSupportCompatibility addressSupport = Context.getRegisteredComponent(AddressSupportCompatibility.ID, AddressSupportCompatibility.class); model.addAttribute("patient", patient); model.addAttribute("primaryIdentifierType", primaryIdentifierType); model.addAttribute("appId", app.getId()); model.addAttribute("formStructure", formStructure); model.addAttribute("nameTemplate", nameSupport.getDefaultLayoutTemplate()); model.addAttribute("addressTemplate", addressSupport.getAddressTemplate()); model.addAttribute("includeRegistrationDateSection", !app.getConfig().get("registrationEncounter").isNull() && !app.getConfig().get("allowRetrospectiveEntry").isNull() && app.getConfig().get("allowRetrospectiveEntry").getBooleanValue() ); model.addAttribute("allowUnknownPatients", app.getConfig().get("allowUnknownPatients").getBooleanValue()); model.addAttribute("allowManualIdentifier", app.getConfig().get("allowManualIdentifier").getBooleanValue()); model.addAttribute("patientDashboardLink", app.getConfig().get("patientDashboardLink") !=null ? app.getConfig().get("patientDashboardLink").getTextValue() : null); model.addAttribute("enableOverrideOfAddressPortlet", Context.getAdministrationService().getGlobalProperty("addresshierarchy.enableOverrideOfAddressPortlet", "false")); model.addAttribute("breadcrumbOverride", breadcrumbOverride); model.addAttribute("relationshipTypes", Context.getPersonService().getAllRelationshipTypes()); }