Skip to content

Commit 3658f33

Browse files
committed
More specific error message per DM1
1 parent 626a919 commit 3658f33

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/extractors/CSVCTCAdverseEventExtractor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function formatData(adverseEventData, patientId) {
4141
if (!(adverseEventCode && effectiveDate && grade)) {
4242
throw new Error('The adverse event is missing an expected attribute. Adverse event code, effective date, and grade are all required.');
4343
} else if (functionCode && !actor) {
44-
throw new Error('The adverse event is missing an expected attribute. Adverse event actor is a required element within the Participation extension');
44+
throw new Error('The adverse event is missing an expected attribute. Adverse event actor is a required element when a functionCode value is included.');
4545
}
4646

4747
const categoryCodes = category.split('|');

src/templates/CTCAdverseEventTemplate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ function CTCAdverseEventTemplate({
142142
}
143143

144144
if (functionCode && !actor) {
145-
throw Error('Trying to render an AdverseEventTemplate, but a required argument is missing; actor is a required value');
145+
throw Error('Trying to render an AdverseEventTemplate, but a required argument is missing; actor is a required value when functionCode is included');
146146
}
147147

148148
return {

test/extractors/CSVCTCAdverseEventextractor.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe('CSVCTCAdverseEventExtractor', () => {
3636
test('should join data appropriately and throw errors when missing required properties', () => {
3737
const expectedErrorString = 'The adverse event is missing an expected attribute. Adverse event code, effective date, and grade are all required.';
3838
const expectedCategoryErrorString = 'A category attribute on the adverse event is missing a corresponding categoryCodeSystem or categoryDisplayText value.';
39-
const expectedActorErrorString = 'The adverse event is missing an expected attribute. Adverse event actor is a required element within the Participation extension';
39+
const expectedActorErrorString = 'The adverse event is missing an expected attribute. Adverse event actor is a required element when a functionCode value is included.';
4040
const localData = _.cloneDeep(exampleCTCCSVAdverseEventModuleResponse);
4141
const patientId = getPatientFromContext(MOCK_CONTEXT).id;
4242

0 commit comments

Comments
 (0)