ResourceMapper

Maps a QuestionnaireResponse to FHIR resources and vice versa.

The process of converting QuestionnaireResponse s to other FHIR resources is called extraction. The reverse process of converting existing FHIR resources to QuestionnaireResponse s to be used to pre-fill the UI is called population.

This class supports Definition-based extraction , StructureMap-based extraction , and expression-based population .

See the developer guide for more information.

Functions

Link copied to clipboard
suspend fun extract(questionnaire: Questionnaire, questionnaireResponse: QuestionnaireResponse, structureMapExtractionContext: StructureMapExtractionContext? = null, profileLoader: ProfileLoader? = null): Bundle

Extract FHIR resources from a questionnaire and questionnaireResponse.

Link copied to clipboard
suspend fun populate(questionnaire: Questionnaire, launchContexts: Map<String, Resource>): QuestionnaireResponse

Performs Expression-based population and returns a QuestionnaireResponse for the questionnaire that is populated from the launchContexts.