import { DataTypeQuery, DetailedPopulationGroupResult, ExpressionStackEntry, GapsDataTypeQuery, ReasonDetailData } from '../types/Calculator'; import { GracefulError } from '../types/errors/GracefulError'; /** * Iterate through base queries and add clause results for parent query and retrieve * * @param queries base queries parsed from ELM * @param detailedResult execution results for this patient * @returns same query info but with info about clause results for query and retrieve */ export declare function processQueriesForGaps(queries: DataTypeQuery[], detailedResult: DetailedPopulationGroupResult): GapsDataTypeQuery[]; /** * Generate a FHIR DetectedIssue resource for Gaps in Care per https://hl7.org/fhir/us/davinci-deqm/STU3/StructureDefinition-gaps-detectedissue-deqm.html * * @param queries numerator queries from a call to findRetrieves * @param measureReport FHIR MeasureReport to be referenced by the issue */ export declare function generateDetectedIssueResources(queries: GapsDataTypeQuery[], measureReport: fhir4.MeasureReport, improvementNotation: string): { detectedIssues: fhir4.DetectedIssue[]; withErrors: GracefulError[]; }; /** * "Groups" gaps queries that are functionally the same in terms of putting a patient into the improvement population * (whether that is the numerator or the denominator, depending on the improvement notation). For the moment, only handles * "or"-d queries, where any one of the listed DataTypeQuery objects would put the patient into the improvement population. * * @param queries list of queries from the execution engine. * @returns an array of arrays of type DataTypeQuery */ export declare function groupGapQueries(queries: GapsDataTypeQuery[]): GapsDataTypeQuery[][]; /** * Detects scenario in expressionStack where this query is part of an "Or" * i.e. Either the first entry in the stack is an "Or," or it is an "ExpressionRef" right on top of an "Or" * * @param expressionStack the current expression stack for this query * @returns Matching "Or", or null if not found */ export declare function getOrExpressionFromStack(expressionStack?: ExpressionStackEntry[]): ExpressionStackEntry | null; /** * Generate FHIR GuidanceResponse resources for queries that are gaps * * @param queries list of all queries that are gaps for this measure * @param measureURL fully qualified URL referencing the measure * @param improvementNotation ImprovementNotation.POSITIVE or ImprovementNotation.NEGATIVE * @returns list of FHIR GuidanceResponse resources with detailed gaps information */ export declare function generateGuidanceResponses(queries: GapsDataTypeQuery[], measureURL: string, improvementNotation: string): { guidanceResponses: fhir4.GuidanceResponse[]; withErrors: GracefulError[]; }; /** * Creates a FHIR CodeableConcept object representing a reason detail for the GuidanceResponse resource. * * @param reason The reason detail data for a single reason. * @returns The FHIR CodeableConcept object to add to the GuidanceResponse.reasonCode field. */ export declare function generateReasonCode(reason: ReasonDetailData): fhir4.CodeableConcept; /** * Generate a Gaps in Care Bundle resource per https://hl7.org/fhir/us/davinci-deqm/STU3/StructureDefinition-gaps-bundle-deqm.html * * @param detectedIssue FHIR DetectedIssue generated during gaps * @param measureReport FHIR MeasureReport generated during calculation * @param patient Current FHIR Patient processed in execution */ export declare function generateGapsInCareBundle(detectedIssues: fhir4.DetectedIssue[], measureReport: fhir4.MeasureReport, patient: fhir4.Patient): fhir4.Bundle; /** * Add reason detail data to each DataTypeQuery passed in * * @param retrieves numerator queries from a call to findRetrieves * @param improvementNotation string indicating positive or negative improvement notation for the measure being used * @param detailedResult result from calculation to look up clause values * @return mapped list of queries with reason detail info if relevant */ export declare function calculateReasonDetail(retrieves: GapsDataTypeQuery[], improvementNotation: string, detailedResult?: DetailedPopulationGroupResult): { results: GapsDataTypeQuery[]; withErrors: GracefulError[]; }; /** * * @param q The query which contains the filters to add to the data requirement * @param dataRequirement Data requirement to add date filters to * @param withErrors Errors object which will eventually be returned to the user if populated * @returns void, but populated the dataRequirement filters */ export declare function addGapFiltersToDataRequirement(q: GapsDataTypeQuery, dataRequirement: fhir4.DataRequirement, withErrors: GracefulError[]): void; export declare function hasDetailedReasonCode(gr: fhir4.GuidanceResponse): boolean;