Skip to content

Commit 3c3c470

Browse files
committed
fix export name for specificity
1 parent ffed1ad commit 3c3c470

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/helpers/contextUtils.js

Lines changed: 2 additions & 2 deletions
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 getPatient(mrn, context) {
4+
async function getPatientFromContext(mrn, context) {
55
const patientInContext = getBundleResourcesByType(context, 'Patient', {}, true);
66
if (!patientInContext) {
77
throw Error('Could not find a patient in context');
@@ -11,5 +11,5 @@ async function getPatient(mrn, context) {
1111
}
1212

1313
module.exports = {
14-
getPatient,
14+
getPatientFromContext,
1515
};

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const {
6161
} = require('./helpers/conditionUtils');
6262
const { getDiseaseStatusCode, getDiseaseStatusEvidenceCode, mEpochToDate } = require('./helpers/diseaseStatusUtils');
6363
const { formatDate, formatDateTime } = require('./helpers/dateUtils');
64-
const { getPatient } = require('./helpers/contextUtils');
64+
const { getPatientFromContext } = require('./helpers/contextUtils');
6565

6666
module.exports = {
6767
// CLI Related utilities
@@ -127,5 +127,5 @@ module.exports = {
127127
logOperationOutcomeInfo,
128128
mEpochToDate,
129129
// Context operations
130-
getPatient,
130+
getPatientFromContext,
131131
};

test/helpers/contextUtils.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
const { getPatient } = require('../../src/helpers/contextUtils');
1+
const { getPatientFromContext } = require('../../src/helpers/contextUtils');
22

33
const MOCK_PATIENT_MRN = '123';
44

5-
describe('getPatient', () => {
5+
describe('getPatientFromContext', () => {
66
const patientResource = {
77
resourceType: 'Patient',
88
id: 'mCODEPatientExample01',
@@ -18,11 +18,11 @@ describe('getPatient', () => {
1818
],
1919
};
2020
test('Should return Patient resource in context', async () => {
21-
const patient = await getPatient(MOCK_PATIENT_MRN, patientContext);
21+
const patient = await getPatientFromContext(MOCK_PATIENT_MRN, patientContext);
2222
expect(patient.id).toEqual(patientResource.id);
2323
});
2424

2525
test('Should throw an error if there is no patient in context', async () => {
26-
await expect(getPatient(MOCK_PATIENT_MRN, {})).rejects.toThrow('Could not find a patient in context');
26+
await expect(getPatientFromContext(MOCK_PATIENT_MRN, {})).rejects.toThrow('Could not find a patient in context');
2727
});
2828
});

0 commit comments

Comments
 (0)