Skip to content

Commit 816f9f5

Browse files
committed
Pushing small hotfix
1 parent 5b18107 commit 816f9f5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/helpers/contextUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const logger = require('./logger');
22
const { getBundleResourcesByType } = require('./fhirUtils');
33

4-
async function getPatientFromContext(mrn, context) {
4+
function getPatientFromContext(mrn, context) {
55
logger.debug('Getting patient from context');
66
const patientInContext = getBundleResourcesByType(context, 'Patient', {}, true);
77
if (!patientInContext) {

test/helpers/contextUtils.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ describe('getPatientFromContext', () => {
1717
},
1818
],
1919
};
20-
test('Should return Patient resource in context', async () => {
21-
const patient = await getPatientFromContext(MOCK_PATIENT_MRN, patientContext);
20+
test('Should return Patient resource in context', () => {
21+
const patient = getPatientFromContext(MOCK_PATIENT_MRN, patientContext);
2222
expect(patient.id).toEqual(patientResource.id);
2323
});
2424

25-
test('Should throw an error if there is no patient in context', async () => {
26-
await expect(getPatientFromContext(MOCK_PATIENT_MRN, {})).rejects.toThrow('Could not find a patient in context; ensure that a PatientExtractor is used earlier in your extraction configuration');
25+
test('Should throw an error if there is no patient in context', () => {
26+
expect(() => getPatientFromContext(MOCK_PATIENT_MRN, {})).toThrow('Could not find a patient in context; ensure that a PatientExtractor is used earlier in your extraction configuration');
2727
});
2828
});

0 commit comments

Comments
 (0)