Skip to content

Commit 77a9c23

Browse files
committed
add package ndc code tracking for ncpdp messages
1 parent a96b5ff commit 77a9c23

4 files changed

Lines changed: 14 additions & 2 deletions

File tree

src/fhir/models.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export interface Medication extends Document {
1616
name: string;
1717
codeSystem: string;
1818
code: string;
19+
ndcCode: string,
1920
requirements: Requirement[];
2021
}
2122

@@ -45,6 +46,7 @@ export interface RemsCase extends Document {
4546
dispenseStatus: string;
4647
drugName: string;
4748
drugCode: string;
49+
drugNdcCode?: string;
4850
patientFirstName: string;
4951
patientLastName: string;
5052
patientDOB: string;
@@ -62,6 +64,7 @@ const medicationCollectionSchema = new Schema<Medication>({
6264
name: { type: String },
6365
codeSystem: { type: String },
6466
code: { type: String },
67+
ndcCode: { type: String },
6568
requirements: [
6669
{
6770
name: { type: String },
@@ -112,6 +115,7 @@ const remsCaseCollectionSchema = new Schema<RemsCase>({
112115
patientLastName: { type: String },
113116
patientDOB: { type: String },
114117
drugCode: { type: String },
118+
drugNdcCode: { type: String },
115119
currentPrescriberId: { type: String },
116120
currentPharmacyId: { type: String },
117121
prescriberHistory: [{ type: String }],

src/fhir/utilities.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ export class FhirUtilities {
127127
name: 'Turalio',
128128
codeSystem: 'http://www.nlm.nih.gov/research/umls/rxnorm',
129129
code: '2183126',
130+
ndcCode: '65597-407-20',
130131
requirements: [
131132
{
132133
name: 'Patient Enrollment',
@@ -196,6 +197,7 @@ export class FhirUtilities {
196197
name: 'TIRF',
197198
codeSystem: 'http://www.nlm.nih.gov/research/umls/rxnorm',
198199
code: '1237051',
200+
ndcCode: '63459-502-30',
199201
requirements: [
200202
{
201203
name: 'Patient Enrollment',
@@ -262,6 +264,7 @@ export class FhirUtilities {
262264
name: 'Isotretinoin',
263265
codeSystem: 'http://www.nlm.nih.gov/research/umls/rxnorm',
264266
code: '6064',
267+
ndcCode: '0245-0571-01',
265268
requirements: [
266269
{
267270
name: 'Patient Enrollment',
@@ -305,6 +308,7 @@ export class FhirUtilities {
305308
name: 'Addyi',
306309
codeSystem: 'http://www.nlm.nih.gov/research/umls/rxnorm',
307310
code: '1666386',
311+
ndcCode: '58604-214-30',
308312
requirements: []
309313
}
310314
];

src/lib/etasu.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ export const createNewRemsCaseFromCDSHook = async (
220220
| 'dispenseStatus'
221221
| 'drugName'
222222
| 'drugCode'
223+
| 'drugNdcCode'
223224
| 'patientFirstName'
224225
| 'patientLastName'
225226
| 'patientDOB'
@@ -236,6 +237,7 @@ export const createNewRemsCaseFromCDSHook = async (
236237
dispenseStatus: 'Pending',
237238
drugName: drug?.name,
238239
drugCode: drug?.code,
240+
drugNdcCode: drug?.ndcCode,
239241
patientFirstName: patientFirstName,
240242
patientLastName: patientLastName,
241243
patientDOB: patientDOB,
@@ -591,6 +593,7 @@ const createMetRequirementAndNewCase = async (
591593
| 'dispenseStatus'
592594
| 'drugName'
593595
| 'drugCode'
596+
| 'drugNdcCode'
594597
| 'patientFirstName'
595598
| 'patientLastName'
596599
| 'patientDOB'
@@ -607,6 +610,7 @@ const createMetRequirementAndNewCase = async (
607610
dispenseStatus: dispenseStatusDefault,
608611
drugName: drug?.name,
609612
drugCode: drug?.code,
613+
drugNdcCode: drug?.ndcCode,
610614
patientFirstName: patientFirstName,
611615
patientLastName: patientLastName,
612616
patientDOB: patientDOB,

src/ncpdp/script.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ const handleRemsInitiation = async (message: any, res: Response) => {
204204
patientFirstName: patient?.names?.name?.firstname,
205205
patientLastName: patient?.names?.name?.lastname,
206206
patientDOB: patient?.dateofbirth?.date,
207-
drugCode: drugCode
207+
drugNdcCode: drugCode
208208
});
209209

210210
if (!remsCase) {
@@ -290,7 +290,7 @@ const handleRxFill = async (message: any, res: Response) => {
290290
patientFirstName: patient?.names?.name?.firstname,
291291
patientLastName: patient?.names?.name?.lastname,
292292
patientDOB: patient?.dateofbirth?.date,
293-
drugCode: drugCode
293+
drugNdcCode: drugCode
294294
},
295295
{ dispenseStatus: fillStatus },
296296
{ new: true }

0 commit comments

Comments
 (0)