Bundle

class fhir_biobank.bundle.Bundle(bundle_id: str, entries: List[fhir_biobank.bundle.Entry], bundle_type='transaction')[source]

Bases: object

This class represents a Bundle - a container for collection of resources. Bundle can be used for sending/returning/storing a set of resources,etc.

Parameters
  • bundle_id (string) – Internal id that represents unique Bundle

  • entries (List[Entry]) – List of Entries that should be included in a Bundle. Each Entry contains Resource. Entries represent the collection of resources contained in this Bundle.

  • bundle_type (Optional[str]) – String that indicates the purpose of this Bundle. Correct values are: “document”, “message”, “transaction”, “transaction-response”, “batch”, “batch-response”, “history”, “searchset”, “collection”

Raises
  • TypeError – This exception is raised when incorrect types of arguments are provided.

  • ValueError – This exception is raised when incorrect value inside argument is provided.

bundleJSON()[source]

Method that creates JSON representation of an Patient Resource.

Returns

FHIR Bundle represented in a json format.

property bundleType

Getter for a Bundle type that indicates purpose of this Bundle.

Returns

String that indicates the purpose of this Bundle.

property entries

Getter for a collection of entries already in a FHIR.

Returns

List of Entries that are in a Bundle.

property id

Getter for bundle id - internal id that represents unique Bundle

Returns

String - internal id that represents unique Bundle.

class fhir_biobank.bundle.Entry(resource: Union[fhir_biobank.patient.PatientResource, fhir_biobank.specimen.SpecimenResource, fhir_biobank.condition.ConditionResource], resource_full_url: str, resource_short_url: str, request_method: str = 'PUT')[source]

Bases: object

This class represents an entry in a bundle. Entry contains resource and its full and short url.

Parameters
  • resource ([PatientResource, SpecimenResource,ConditionResource]) – resource that an entry will contain. It can be either PatientResource, SpecimenResource or a ConditionResource.

  • resource_full_url (string) – full url of the resource that is in the entry. for example: https://example.com/Patient/0

  • resource_short_url (string) – short (relative) url of the resource that is in the entry. for example: Patient/0

  • request_method (string) – this method indicates desired action to be preformed for a given resource. Correct values are: GET PUT POST DELETE

Raises

TypeError – This exception is raised when incorrect types of arguments are provided

property FHIRInterpretation

Getter for a FHIR object that is created from this class.

Returns

Entry in a correct FHIR interpretation

entryJSON()[source]

Method that creates JSON representation of an Entry Resource.

Returns

FHIR Entry resource represented in a json format.

property requestMethod

Getter for the request method.

Returns

request method indicating desired action to be preformed for a given resource.

property resource

Getter for resource property.

Returns

resource that is contained by the entry.

property resourceFullUrl

Getter for the resource full url.

Returns

Full url of the resource.

property resourceShortUrl

Getter for the resource short url.

Returns

short url of the resource.