KISIM Medical Report IG
0.1.0 - ci-build CH

KISIM Medical Report IG - Local Development build (v0.1.0) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

Examples Post Bundle

How to build and post a bundle

To build and post a bundle, a client system has multiple options.

The implementer can read this implementation guide in detail, then try to build the resources accordingly and send them to KISIM. Most probably this will not work initially, since some resources are invalid or KISIM does expect different fields.

An implementer would simply like to fill a medical report structure with data and return it to KISIM.

For that reason we implemented the $medical-report operation, which allows a client system to let KISIM create all the needed resources for a document Bundle to return.

Initial invocation

At first, the client system will have been invoked as described in Starting the process. During that call, the client received a set of parameters. Those parameters now need to be used again for the $medical-report operation.

Usage of the $medical-report operation

Simply call the operation according to the examples in $medical-report

Depending on the data the client received from KISIM during the initial invocation, the client either needs to call the operation with a compoundId AND reportId or a questionnaireId.

Example call for a K5 Bundle:

/Bundle/$medical-report?encounterId={encounterId}&questionnaireId={questionnaireId}

Response:

Example call for a K6 Bundle:

/Bundle/$medical-report?encounterId={encounterId}&compoundId={compoundId}&reportId={reportId}

Response:

Building the Document with the received resources

The $medical-report operation does not return a Bundle of type Document. The reason for this behaviour is FHIR conformance. A Document-Bundle needs to be immutable, but the client system needs to add additional QuestionnaireResponse resources to the Bundle. With reasoning like that, it can not receive a Document from the server already.

Fortunately, the client receives a Bundle which is almost a Document. The only thing the client system needs to do to turn the received Bundle of type "Collection" into a valid Document which is accepted by the server is the following:

  • Switch the field type to document.
  • Add the QuestionnaireResponse resources to the Bundle as Entries see
  • Add references to the QuestionnaireResponse resources to the Composition as Sections
  • Add a timestamp to the Bundle

With those steps, the Collection Bundle is turned into a FHIR conformant Document Bundle

About references inside the bundle

Every entry component inside the document bundle needs a full url which references the resource.

The FHIR-Server checks those references for conformance. Each resource needs to either have the same base path as the composition resource or a urn:uuid reference.

The corresponding part of the FHIR specification can be found here.