private hitsToSearchEntries()

in src/elasticSearchService.ts [399:422]


    private hitsToSearchEntries({
        hits,
        baseUrl,
        mode = 'match',
    }: {
        hits: any[];
        baseUrl: string;
        mode: 'match' | 'include';
    }): SearchEntry[] {
        return hits.map((hit: any): SearchEntry => {
            // Modify to return resource with FHIR id not Dynamo ID
            const resource = this.cleanUpFunction(hit._source);
            return {
                search: {
                    mode,
                },
                fullUrl: URL.format({
                    host: baseUrl,
                    pathname: `/${resource.resourceType}/${resource.id}`,
                }),
                resource,
            };
        });
    }