@Test public void processWithNullConfigReturnsNull() throws ComponentLookupException { Assert.assertNull(this.mocker.getComponentUnderTest().process(null)); }
@Override public RecordConfiguration process(RecordConfiguration config) { if (config == null || this.dab.getCurrentDocumentReference() == null) { return config; } final Patient patient = this.patients.get(this.dab.getCurrentDocumentReference()); if (patient == null) { return config; } for (final RecordSection section : config.getEnabledSections()) { final List<RecordElement> enabledElements = Collections.unmodifiableList(section.getEnabledElements()); final List<RecordElement> consentedElements = this.consentAuthorizer.filterForm(enabledElements, patient); disableNonConsentedElements(enabledElements, consentedElements); disableSectionIfNoEnabledElements(section); } return config; }
ConsentsRecordConfigurationModule implements RecordConfigurationModule { @Override public RecordConfiguration process(RecordConfiguration config) { if (config == null || this.dab.getCurrentDocumentReference() == null) { return config; } final Patient patient = this.patients.get(this.dab.getCurrentDocumentReference()); if (patient == null) { return config; } for (final RecordSection section : config.getEnabledSections()) { final List<RecordElement> enabledElements = Collections.unmodifiableList(section.getEnabledElements()); final List<RecordElement> consentedElements = this.consentAuthorizer.filterForm(enabledElements, patient); disableNonConsentedElements(enabledElements, consentedElements); disableSectionIfNoEnabledElements(section); } return config; } }
ConsentsRecordConfigurationModule implements RecordConfigurationModule { @Override public RecordConfiguration process(RecordConfiguration config) { if (config == null || this.dab.getCurrentDocumentReference() == null) { return config; } final Patient patient = this.patients.get(this.dab.getCurrentDocumentReference()); if (patient == null) { return config; } for (final RecordSection section : config.getEnabledSections()) { final List<RecordElement> enabledElements = Collections.unmodifiableList(section.getEnabledElements()); final List<RecordElement> consentedElements = this.consentAuthorizer.filterForm(enabledElements, patient); disableNonConsentedElements(enabledElements, consentedElements); disableSectionIfNoEnabledElements(section); } return config; }  }
ConsentsRecordConfigurationModule implements RecordConfigurationModule { @Override public RecordConfiguration process(RecordConfiguration config) { if (config == null || this.dab.getCurrentDocumentReference() == null) { return config; } final Patient patient = this.patients.get(this.dab.getCurrentDocumentReference()); if (patient == null) { return config; } for (final RecordSection section : config.getEnabledSections()) { final List<RecordElement> enabledElements = Collections.unmodifiableList(section.getEnabledElements()); final List<RecordElement> consentedElements = this.consentAuthorizer.filterForm(enabledElements, patient); disableNonConsentedElements(enabledElements, consentedElements); disableSectionIfNoEnabledElements(section); } return config; }  @Override RecordConfiguration process(RecordConfiguration config); @Override int getPriority(); @Override boolean supportsRecordType(String recordType); }
ConsentsRecordConfigurationModule implements RecordConfigurationModule { @Override public RecordConfiguration process(RecordConfiguration config) { if (config == null || this.dab.getCurrentDocumentReference() == null) { return config; } final Patient patient = this.patients.get(this.dab.getCurrentDocumentReference()); if (patient == null) { return config; } for (final RecordSection section : config.getEnabledSections()) { final List<RecordElement> enabledElements = Collections.unmodifiableList(section.getEnabledElements()); final List<RecordElement> consentedElements = this.consentAuthorizer.filterForm(enabledElements, patient); disableNonConsentedElements(enabledElements, consentedElements); disableSectionIfNoEnabledElements(section); } return config; }  @Override RecordConfiguration process(RecordConfiguration config); @Override int getPriority(); @Override boolean supportsRecordType(String recordType);  }