@@ -278,15 +278,15 @@ const getGuidanceResponse = async order => {
278278 return null ;
279279 }
280280
281- // Make the etasu call with the auth number if it exists, if not call with patient and medication
281+ // Make the etasu call with the case number if it exists, if not call with patient and medication
282282 let body = { } ;
283- if ( order . authNumber !== '' && ! env . USE_INTERMEDIARY ) {
283+ if ( order . caseNumber && ! env . USE_INTERMEDIARY ) {
284284 body = {
285285 resourceType : 'Parameters' ,
286286 parameter : [
287287 {
288- name : 'authNumber ' ,
289- valueString : order . authNumber
288+ name : 'caseNumber ' ,
289+ valueString : order . caseNumber
290290 }
291291 ]
292292 } ;
@@ -334,7 +334,7 @@ const getGuidanceResponse = async order => {
334334 'content-type' : 'application/json'
335335 }
336336 } ) ;
337- console . log ( 'Retrieved order' , response ) ;
337+ console . log ( 'Retrieved order' , JSON . stringify ( response . data , null , 4 ) ) ;
338338 console . log ( 'URL' , etasuUrl ) ;
339339 const responseResource = response . data . parameter ?. [ 0 ] ?. resource ;
340340 return responseResource ;
@@ -358,8 +358,8 @@ const getDispenseStatus = (order, guidanceResponse) => {
358358async function parseNCPDPScript ( newRx ) {
359359 // Parsing XML NCPDP SCRIPT from EHR
360360 const incompleteOrder = {
361- caseNumber : newRx . Message . Header . MessageID . toString ( ) , // Will need to return to this and use actual pt identifier or uuid
362- authNumber : newRx . Message . Header . AuthorizationNumber ,
361+ orderId : newRx . Message . Header . MessageID . toString ( ) , // Will need to return to this and use actual pt identifier or uuid
362+ caseNumber : newRx . Message . Header . AuthorizationNumber ,
363363 prescriberOrderNumber : newRx . Message . Header . PrescriberOrderNumber ,
364364 patientName :
365365 newRx . Message . Body . NewRx . Patient . HumanPatient . Name . FirstName +
0 commit comments