extract

suspend fun extract(questionnaire: <ERROR CLASS>, questionnaireResponse: <ERROR CLASS>, structureMapExtractionContext: StructureMapExtractionContext? = null): <ERROR CLASS>

Extract FHIR resources from a questionnaire and questionnaireResponse.

This method will perform StructureMap-based extraction if the Questionnaire specified by questionnaire includes a targetStructureMap extension. In this case structureMapExtractionContext is required; extraction will fail and an empty Bundle is returned if structureMapExtractionContext is not provided.

Otherwise, this method will perform Definition-based extraction .

Return

Bundle containing the extracted Resources or empty Bundle if the extraction fails. An exception might also be thrown in a few cases

Parameters

questionnaire

A Questionnaire with data extraction extensions.

questionnaireResponse

A QuestionnaireResponse with answers for questionnaire.

structureMapExtractionContext

The IWorkerContext may be used along with StructureMapUtilities to parse the script and convert it into StructureMap.