8000 ENG-454 Inbound XCPD includes custodian by leite08 · Pull Request #4012 · metriport/metriport · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ENG-454 Inbound XCPD includes custodian #4012

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,22 @@ function createSubjectAndRegistrationEvent(response: InboundPatientDiscoveryResp
},
},
},
custodian: {
"@_typeCode": "CST",
assignedCustodian: {
"@_typeCode": "CST",
},
assignedEntity: {
"@_classCode": "ASSIGNED",
id: {
"@_root": METRIPORT_HOME_COMMUNITY_ID_NO_PREFIX,
},
code: {
"@_code": "NotHealthDataLocator",
"@_codeSystem": "1.3.6.1.4.1.19376.1.2.27.2",
},
},
},
},
};
return subject;
Expand Down
24 changes: 12 additions & 12 deletions packages/lambdas/src/ihe-gateway-v2-inbound-patient-discovery.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import { APIGatewayProxyEventV2 } from "aws-lambda";
import { analyticsAsync, EventTypes } from "@metriport/core/external/analytics/posthog";
import { getSecretValue } from "@metriport/core/external/aws/secret-manager";
import { createInboundXcpdResponse } from "@metriport/core/external/carequality/ihe-gateway-v2/inbound/xcpd/create/xcpd-response";
import { processInboundXcpdRequest } from "@metriport/core/external/carequality/ihe-gateway-v2/inbound/xcpd/process/xcpd-request";
import { processInboundXcpd } from "@metriport/core/external/carequality/pd/process-inbound-pd";
import { InboundMpiMetriportApi } from "@metriport/core/mpi/inbound-patient-mpi-metriport-api";
import { getEnvVar, getEnvVarOrFail } from "@metriport/core/util/env-var";
import { out } from "@metriport/core/util/log";
import {
InboundPatientDiscoveryReq,
InboundPatientDiscoveryResp,
} from "@metriport/ihe-gateway-sdk";
import { errorToString } from "@metriport/shared";
import { processInboundXcpdRequest } from "@metriport/core/external/carequality/ihe-gateway-v2/inbound/xcpd/process/xcpd-request";
import { processInboundXcpd } from "@metriport/core/external/carequality/pd/process-inbound-pd";
import { createInboundXcpdResponse } from "@metriport/core/external/carequality/ihe-gateway-v2/inbound/xcpd/create/xcpd-response";
import { InboundMpiMetriportApi } from "@metriport/core/mpi/inbound-patient-mpi-metriport-api";
import { getEnvVarOrFail, getEnvVar } from "@metriport/core/util/env-var";
import { getSecretValue } from "@metriport/core/external/aws/secret-manager";
import { analyticsAsync, EventTypes } from "@metriport/core/external/analytics/posthog";
import { out } from "@metriport/core/util/log";
import { APIGatewayProxyEventV2 } from "aws-lambda";
import { capture } from "./shared/capture";
import { getEnvOrFail } from "./shared/env";

const apiUrl = getEnvVarOrFail("API_URL");
Expand All @@ -23,8 +24,7 @@ const lambdaName = getEnvOrFail("AWS_LAMBDA_FUNCTION_NAME");
const mpi = new InboundMpiMetriportApi(apiUrl);
const { log } = out(`ihe-gateway-v2-inbound-patient-discovery`);

// TODO move to capture.wrapHandler()
export async function handler(event: APIGatewayProxyEventV2) {
export const handler = capture.wrapHandler(async (event: APIGatewayProxyEventV2) => {
try {
if (!event.body) return buildResponse(400, { message: "The request body is empty" });

Expand Down Expand Up @@ -68,7 +68,7 @@ export async function handler(event: APIGatewayProxyEventV2) {
log(`${msg}: ${errorToString(error)}`);
return buildResponse(500, "Internal Server Error");
}
}
});

function buildResponse(status: number, body: unknown) {
return {
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"create-medical-records": "ts-node src/customer-requests/medical-records-create",
"get-consolidated": "ts-node src/customer-requests/get-consolidated",
"download-docs": "ts-node src/customer-requests/download-docs",
"mock-ihe-gateway": "ts-node src/carequality/mock-ihe-gateway",
"mock-ihe-gateway": "ts-node src/saml/mock-ihe-gateway",
"integration-test-and-compare-total-resource-counts": "bash src/fhir-converter/scripts/run_integration_and_compare.sh",
"compare-total-resource-counts": "bash src/fhir-converter/scripts/compare_total_resource_counts.sh",
"compare-resource-counts-per-file": "bash src/fhir-converter/scripts/compare_resource_counts_per_file.sh",
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/saml/mock-ihe-gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const mpi = new InboundMpiMetriportApi(apiUrl);

const app: Application = express();

app.use(express.raw({ type: "application/soap+xml", limit: "2mb" }));
app.use(express.raw({ type: ["application/soap+xml", "application/xml", "text/xml"] }));

app.post("/v1/patient-discovery", async (req: Request, res: Response) => {
try {
Expand Down
0