index

suspend fun index(file: File)

Indexes a knowledge artifact as a JSON object in the provided file.

This creates a record of the knowledge artifact's metadata and the file's location. When the knowledge artifact is requested, knowledge manager will load the content of the file, deserialize it and return the resulting FHIR resource.

This operation does not make a copy of the knowledge artifact, nor does it checksum the content of the file. Therefore, it cannot be guaranteed that subsequent retrievals of the knowledge artifact will produce the same result. Applications using this function must be aware of the risk of the content of the file being modified or corrupt, potentially resulting in incorrect or inaccurate result of decision support or measure evaluation.

Use this API for knowledge artifacts in immutable files (e.g. in the app's assets folder).