Skip to content

Commit

Permalink
add device and medecation refs to bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
Rost-is-love committed May 13, 2024
1 parent 1fecaca commit 3b5d321
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ips_ig/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ AIDBOX_FHIR_PACKAGES=hl7.fhir.r4.core#4.0.1:hl7.fhir.uv.ips#1.1.0
AIDBOX_VALIDATE_BINDING_URL="https://r4.ontoserver.csiro.au/fhir/ValueSet/\$validate-code"
```

Also, it is possible to deploy Aidbox with [Helm charts](https://github.com/Aidbox/helm-charts/tree/main). To do so, follow the steps outlined below:
It is possible to deploy Aidbox with [Helm charts](https://github.com/Aidbox/helm-charts/tree/main). To do so, follow the steps outlined below:

### 1. Add aidbox helm repo

Expand Down
13 changes: 12 additions & 1 deletion ips_ig/src/ips.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,20 @@ export const getResourcesFromRefs = async (
const performerRef = resource.performer ? getRefs(resource.performer) : [];
const partOfRef = resource.partOf ? getRefs(resource.partOf) : [];
const hasMemberRef = resource.hasMember ? getRefs(resource.hasMember) : [];
const deviceRef = resource.device?.reference ? [resource.device?.reference] : [];
const medicationRef = resource.medicationReference?.reference
? [resource.medicationReference?.reference]
: [];
const resourceRef = `${resource.resourceType}/${resource.id}`;
return {
refs: [...acc.refs, ...performerRef, ...partOfRef, ...hasMemberRef],
refs: [
...acc.refs,
...performerRef,
...partOfRef,
...hasMemberRef,
...deviceRef,
...medicationRef,
],
bundleResources: [...acc.bundleResources, resourceRef],
};
},
Expand Down
4 changes: 3 additions & 1 deletion ips_ig/src/operations.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { randomUUID } from "node:crypto";
import assert from "node:assert";
import { FastifyReply } from "fastify";
import { Request } from "./types";
import {
Expand All @@ -11,7 +12,8 @@ import { Patient } from "@aidbox/sdk-r4/types";

const generateSummary = async ({ http, appConfig }: Request, patient: Patient) => {
try {
const patientId = patient.id!!;
assert(patient.id, "Patient Id is required");
const patientId = patient.id;
const { sections, bundleData }: any = await generateSections(http, patientId);
const composition = createComposition(sections, patientId);
const refResources = await getResourcesFromRefs(http, bundleData);
Expand Down

0 comments on commit 3b5d321

Please sign in to comment.