Skip to content

Commit

Permalink
chore: restore backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
ruscoder committed May 24, 2024
1 parent bd1e5bb commit 35441b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion ts/server/src/app.service.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Injectable } from '@nestjs/common';
import { resolveTemplate } from './utils/extract';
import { Resource } from 'fhir/r4b';
import * as fhirpath_r4_model from 'fhirpath/fhir-context/r4';

@Injectable()
export class AppService {
resolveTemplate(qr: Resource, template: object): object {
return resolveTemplate(qr, template);
return resolveTemplate(qr, template, { root: qr }, fhirpath_r4_model);
}
}
4 changes: 2 additions & 2 deletions ts/server/src/utils/extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ export function embeddedFHIRPath(a: string): Embedded | undefined {
};
}

export function resolveTemplate(qr: Resource, template: any, context?: any, model?: any): any {
export function resolveTemplate(qr: Resource, template: any, context?: any, model?: Model): any {
return resolveTemplateRecur(qr, { rootNode: template }, context, model)['rootNode'];
}

function resolveTemplateRecur(
resource: Resource,
template: any,
initialContext: object,
model: any,
model: Model,
): any {
return iterateObject(template, initialContext, (node, context) => {
if (isPlainObject(node)) {
Expand Down

0 comments on commit 35441b4

Please sign in to comment.