Skip to content

Commit

Permalink
Merge pull request #2294 from metriport/fix-duration-xcpd-ihev2
Browse files Browse the repository at this point in the history
fix(ihev2): request timestamp undefined
  • Loading branch information
jonahkaye committed Jun 19, 2024
2 parents aff2615 + c3c9e63 commit 816c4c8
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ describe("processXCPDResponse", () => {
expect(response).toEqual({
...expectedXcpdResponse,
responseTimestamp: expect.any(String),
requestTimestamp: expect.any(String),
});
});
it("should process the match XCPD response with multiple addresses and patient names correctly", async () => {
Expand All @@ -54,6 +55,7 @@ describe("processXCPDResponse", () => {
expect(response).toEqual({
...expectedMultiNameAddressResponse,
responseTimestamp: expect.any(String),
requestTimestamp: expect.any(String),
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ async function handleSuccessResponse({
id: outboundRequest.id,
patientId: outboundRequest.patientId,
timestamp: outboundRequest.timestamp,
requestTimestamp: outboundRequest.timestamp,
responseTimestamp: dayjs().toISOString(),
gateway,
documentReference: documentReferences,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ async function handleSuccessResponse({
id: outboundRequest.id,
patientId: outboundRequest.patientId,
timestamp: outboundRequest.timestamp,
requestTimestamp: outboundRequest.timestamp,
responseTimestamp: dayjs().toISOString(),
gateway,
documentReference: documentReferences,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export async function handleRegistryErrorResponse({
id: outboundRequest.id,
patientId: outboundRequest.patientId,
timestamp: outboundRequest.timestamp,
requestTimestamp: outboundRequest.timestamp,
responseTimestamp: dayjs().toISOString(),
gateway,
operationOutcome,
Expand Down Expand Up @@ -110,6 +111,7 @@ export async function handleHttpErrorResponse({
return {
id: outboundRequest.id,
timestamp: outboundRequest.timestamp,
requestTimestamp: outboundRequest.timestamp,
responseTimestamp: dayjs().toISOString(),
gateway: gateway,
patientId: outboundRequest.patientId,
Expand Down Expand Up @@ -145,6 +147,7 @@ export async function handleEmptyResponse({
id: outboundRequest.id,
patientId: outboundRequest.patientId,
timestamp: outboundRequest.timestamp,
requestTimestamp: outboundRequest.timestamp,
responseTimestamp: dayjs().toISOString(),
gateway,
operationOutcome,
Expand Down Expand Up @@ -178,6 +181,7 @@ export async function handleSchemaErrorResponse({
id: outboundRequest.id,
patientId: outboundRequest.patientId,
timestamp: outboundRequest.timestamp,
requestTimestamp: outboundRequest.timestamp,
responseTimestamp: dayjs().toISOString(),
gateway,
operationOutcome,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export function handleHttpErrorResponse({
return {
id: outboundRequest.id,
timestamp: outboundRequest.timestamp,
requestTimestamp: outboundRequest.timestamp,
responseTimestamp: new Date().toISOString(),
gateway,
patientId: outboundRequest?.patientId,
Expand Down Expand Up @@ -71,6 +72,7 @@ export function handlePatientErrorResponse({
const response: OutboundPatientDiscoveryResp = {
id: outboundRequest.id,
timestamp: outboundRequest.timestamp,
requestTimestamp: outboundRequest.timestamp,
responseTimestamp: new Date().toISOString(),
gateway,
patientId: outboundRequest.patientId,
Expand Down Expand Up @@ -106,6 +108,7 @@ export function handleSchemaErrorResponse({
const response: OutboundPatientDiscoveryResp = {
id: outboundRequest.id,
timestamp: outboundRequest.timestamp,
requestTimestamp: outboundRequest.timestamp,
responseTimestamp: new Date().toISOString(),
gateway,
patientId: outboundRequest.patientId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ function handlePatientMatchResponse({
const response: OutboundPatientDiscoveryResp = {
id: outboundRequest.id,
timestamp: outboundRequest.timestamp,
requestTimestamp: outboundRequest.timestamp,
responseTimestamp: new Date().toISOString(),
externalGatewayPatient: {
id: subject1.patient.id._extension,
Expand Down Expand Up @@ -190,6 +191,7 @@ function handlePatientNoMatchResponse({
const response: OutboundPatientDiscoveryResp = {
id: outboundRequest.id,
timestamp: outboundRequest.timestamp,
requestTimestamp: outboundRequest.timestamp,
responseTimestamp: new Date().toISOString(),
gateway: gateway,
patientId: outboundRequest.patientId,
Expand Down

0 comments on commit 816c4c8

Please sign in to comment.