Skip to content

Commit

Permalink
remove import that wasn't compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
Ariel Virgulto committed Sep 6, 2024
1 parent f703ce8 commit 3d42530
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 34 deletions.
16 changes: 6 additions & 10 deletions src/hooks/hookResources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ import {
BundleEntry
} from 'fhir/r4';
import Card, { Link, Suggestion, Action } from '../cards/Card';
import {
HookPrefetch,
TypedRequestBody,
TypedResponseBody
} from '../rems-cds-hooks/resources/HookTypes';
import { HookPrefetch, TypedRequestBody } from '../rems-cds-hooks/resources/HookTypes';
import config from '../config';
import {
RemsCase,
Expand All @@ -28,7 +24,7 @@ import { ServicePrefetch } from '../rems-cds-hooks/resources/CdsService';
import { hydrate } from '../rems-cds-hooks/prefetch/PrefetchHydrator';

type HandleCallback = (
res: TypedResponseBody,
res: any,
hydratedPrefetch: HookPrefetch | undefined,
contextRequest: FhirResource | undefined,
patient: FhirResource | undefined
Expand Down Expand Up @@ -360,7 +356,7 @@ const getErrorCard = (

// handles order-sign and order-select currently
export const handleCardOrder = async (
res: TypedResponseBody,
res: any,
hydratedPrefetch: HookPrefetch | undefined,
contextRequest: FhirResource | undefined,
resource: FhirResource | undefined
Expand Down Expand Up @@ -485,7 +481,7 @@ const getSuggestions = (
// make sure code here is applicable to all supported hooks.
export async function handleCard(
req: TypedRequestBody,
res: TypedResponseBody,
res: any,
hydratedPrefetch: HookPrefetch,
contextRequest: FhirResource | undefined,
callback: HandleCallback
Expand Down Expand Up @@ -517,7 +513,7 @@ export async function handleCard(
// handles all hooks, any supported hook should pass through this function
export function handleHook(
req: TypedRequestBody,
res: TypedResponseBody,
res: any,
hookPrefetch: ServicePrefetch,
contextRequest: FhirResource | undefined,
callback: HandleCallback
Expand Down Expand Up @@ -732,7 +728,7 @@ const getSuggestionOrEmptyArray =

// handles patient-view and encounter-start currently
export const handleCardEncounter = async (
res: TypedResponseBody,
res: any,
hookPrefetch: HookPrefetch | undefined,
_contextRequest: FhirResource | undefined,
resource: FhirResource | undefined
Expand Down
8 changes: 2 additions & 6 deletions src/hooks/rems.encounterstart.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
EncounterStartHook,
SupportedHooks,
TypedResponseBody
} from '../rems-cds-hooks/resources/HookTypes';
import { EncounterStartHook, SupportedHooks } from '../rems-cds-hooks/resources/HookTypes';
import { ServicePrefetch, CdsService } from '../rems-cds-hooks/resources/CdsService';
import { handleCardEncounter, handleHook } from './hookResources';

Expand All @@ -24,7 +20,7 @@ const definition: CdsService = {
prefetch: hookPrefetch
};

const handler = (req: TypedRequestBody, res: TypedResponseBody) => {
const handler = (req: TypedRequestBody, res: any) => {
console.log('REMS encounter-start hook');
const contextRequest = undefined;
handleHook(req, res, hookPrefetch, contextRequest, handleCardEncounter);
Expand Down
8 changes: 2 additions & 6 deletions src/hooks/rems.orderselect.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
SupportedHooks,
TypedResponseBody,
OrderSelectHook
} from '../rems-cds-hooks/resources/HookTypes';
import { SupportedHooks, OrderSelectHook } from '../rems-cds-hooks/resources/HookTypes';
import { ServicePrefetch, CdsService } from '../rems-cds-hooks/resources/CdsService';
import { handleCardOrder, handleHook } from './hookResources';

Expand All @@ -22,7 +18,7 @@ const definition: CdsService = {
prefetch: hookPrefetch
};

const handler = (req: TypedRequestBody, res: TypedResponseBody) => {
const handler = (req: TypedRequestBody, res: any) => {
console.log('REMS order-select hook');
const context = req.body.context;
const selection = context.selections?.[0];
Expand Down
8 changes: 2 additions & 6 deletions src/hooks/rems.ordersign.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
OrderSignHook,
SupportedHooks,
TypedResponseBody
} from '../rems-cds-hooks/resources/HookTypes';
import { OrderSignHook, SupportedHooks } from '../rems-cds-hooks/resources/HookTypes';
import { ServicePrefetch, CdsService } from '../rems-cds-hooks/resources/CdsService';
import { handleCardOrder, handleHook } from './hookResources';

Expand All @@ -22,7 +18,7 @@ const definition: CdsService = {
prefetch: hookPrefetch
};

const handler = (req: TypedRequestBody, res: TypedResponseBody) => {
const handler = (req: TypedRequestBody, res: any) => {
console.log('REMS order-sign hook');
const contextRequest = req.body.context.draftOrders?.entry?.[0]?.resource;
handleHook(req, res, hookPrefetch, contextRequest, handleCardOrder);
Expand Down
8 changes: 2 additions & 6 deletions src/hooks/rems.patientview.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
PatientViewHook,
SupportedHooks,
TypedResponseBody
} from '../rems-cds-hooks/resources/HookTypes';
import { PatientViewHook, SupportedHooks } from '../rems-cds-hooks/resources/HookTypes';
import { ServicePrefetch, CdsService } from '../rems-cds-hooks/resources/CdsService';
import { handleCardEncounter, handleHook } from './hookResources';

Expand All @@ -24,7 +20,7 @@ const definition: CdsService = {
prefetch: hookPrefetch
};

const handler = (req: TypedRequestBody, res: TypedResponseBody) => {
const handler = (req: TypedRequestBody, res: any) => {
console.log('REMS patient-view hook');
const contextRequest = undefined;
handleHook(req, res, hookPrefetch, contextRequest, handleCardEncounter);
Expand Down

0 comments on commit 3d42530

Please sign in to comment.