Manual Reference Source Test
import ConsultationService from 'clinical6/src/services/ConsultationService.js'
public class | source

ConsultationService

Extends:

AbstractServiceJsonApiService → ConsultationService

Service handling Consultation calls with specific endpoints.

Method Summary

Public Methods
public

async join(consultation: Consultation, participant: ConsultationParticipant, options: String): Promise

Call a POST request on the main obj.type expecting JSON API information.

Inherited Summary

From class AbstractService
public get
public set
public
private
From class JsonApiService
public

options: *

public

async delete(obj: Object, options: String): Promise

Call a DELETE request on the main obj.type expecting JSON API information.

public

async get(params: Object, options: String): Promise

Call a GET request expecting JSON API information.

public

async getChildren(parent: Object, child: Object, options: String): Promise

Call a GET request expecting JSON API information for children given a parent.

public

async insert(obj: Object, options: String): Promise

Call a POST request on the main obj.type expecting JSON API information.

public

async update(obj: Object, options: String): Promise

Call a PATCH request on the main obj.type expecting JSON API information.

Public Methods

public async join(consultation: Consultation, participant: ConsultationParticipant, options: String): Promise source

Call a POST request on the main obj.type expecting JSON API information.

Params:

NameTypeAttributeDescription
consultation Consultation

Consultation to join

participant ConsultationParticipant

Participant joining

options String
  • optional

Modify the nature of the call and response

options.url String
  • optional

Override the url for this call

options.cacheMode String
  • optional

Override the caching method for this call

options.meta Object
  • optional

Pass and retrieve through reference meta data

Return:

Promise

Promise with object

Example:

import { consultationService, Consultation, ConsultationParticipant } from 'clinical6';
const consultation = new Consultation({ ... });
const participant = new ConsultationParticipant({ ... });

// You can update an awarded badge using the `updateAwardedBadge` method
const meta = {};
consultationService.join(consultation, participant, { meta });

// You should use instead `consultation.join()`
consultation.join();  // join using the logged in user
// or
consultation.join(participant);