Skip to content

Commit

Permalink
Add instance type to warning message
Browse files Browse the repository at this point in the history
Update test for caret rule on profile to more closely resemble realistic
output.
  • Loading branch information
mint-thompson committed Mar 27, 2024
1 parent ca3c095 commit 0fa7a8a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/processor/InstanceProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export class InstanceProcessor {
i,
flatInstanceArray,
instanceOfJSON.type,
target.id,
`${target.instanceOf} ${target.id}`,
fisher
);
// if the value is empty, we can't use that
Expand Down
4 changes: 2 additions & 2 deletions test/extractor/CaretValueRuleExtractor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1076,13 +1076,13 @@ describe('CaretValueRuleExtractor', () => {
const element = ProcessableElementDefinition.fromJSON(looseSD.differential.element[12]);
const caretRules = CaretValueRuleExtractor.process(element, looseSD, defs);
const expectedRule = new ExportableCaretValueRule('component.valueDateTime');
expectedRule.caretPath = 'patternDateTime';
expectedRule.caretPath = 'minValueDateTime';
expectedRule.value = '2013-01-01 00:00:00.000';
expect(caretRules).toHaveLength(1);
expect(caretRules[0]).toEqual<ExportableCaretValueRule>(expectedRule);
expect(loggerSpy.getAllMessages('warn')).toHaveLength(1);
expect(loggerSpy.getLastMessage('warn')).toMatch(
/Value 2013-01-01 00:00:00\.000 on ObservationWithCaret\.component\.valueDateTime element patternDateTime is not a valid FHIR dateTime/s
/Value 2013-01-01 00:00:00\.000 on ObservationWithCaret\.component\.valueDateTime element minValueDateTime is not a valid FHIR dateTime/s
);
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/extractor/fixtures/caret-value-profile.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
{
"id": "Observation.component.valueDateTime",
"path": "Observation.component.valueDateTime",
"patternDateTime": "2013-01-01 00:00:00.000"
"minValueDateTime": "2013-01-01 00:00:00.000"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion test/processor/InstanceProcessor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ describe('InstanceProcessor', () => {
expect(result.rules).toContainEqual(birthDateRule);
expect(loggerSpy.getAllMessages('warn')).toHaveLength(1);
expect(loggerSpy.getLastMessage('warn')).toMatch(
/Value 1985\/07\/12 on invalid-date-patient element birthDate is not a valid FHIR date/s
/Value 1985\/07\/12 on Patient invalid-date-patient element birthDate is not a valid FHIR date/s
);
});

Expand Down

0 comments on commit 0fa7a8a

Please sign in to comment.