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

Section

Expression Extends:

class Section extends aggregate(SectionModel, Helper)

Helper class representing a Section.

Static Member Summary

Static Public Members
public static get

Constructor Summary

Public Constructor
public

constructor(response: Object): Section

Constructor for Section

Member Summary

Public Members
public get

Get Sections

public
public get
public set
Private Members
private
private

_type: *

Method Summary

Public Methods
public

connectChildren(childArray: Array<any>)

Connects children and provides appropriate data elements in the data field.

public

Synchronize Sections if the content is a section this will load sections belonging to it

public

Gets the data depending on 'type' and the 'object' fields

public

Get Status and set it to this.status

public

Transition between states using actions

Static Public Members

public static get type: String source

Public Constructors

public constructor(response: Object): Section source

Constructor for Section

Params:

NameTypeAttributeDescription
response Object
  • nullable: false

Requires all fields that are necessary for SectionModel

Return:

Section

Returns a new Section instance

Public Members

public get sections: Array<Object>: * source

Get Sections

Return:

Array<Object>

Array of objects depending on the type of sub sections.

public status: String source

public get type: String source

public set type: String source

Private Members

private _sections: Object[] source

private _type: * source

Public Methods

public connectChildren(childArray: Array<any>) source

Connects children and provides appropriate data elements in the data field. It is important to note that invalid children will only have Section wrappers but no data. This will not throw any errors when there is no data from the server. Check the network capability of the browser or developer tool (Charles etc) to find invalid calls.

Params:

NameTypeAttributeDescription
childArray Array<any>

should contain an array of deserialized Sections in JSON

public getChildren(): Promise source

Synchronize Sections if the content is a section this will load sections belonging to it

Return:

Promise

A Promise of an array of objects depending on the type of sub sections.

public getData(): Section source

Gets the data depending on 'type' and the 'object' fields

Return:

Section

public getStatus(): Promise source

Get Status and set it to this.status

Return:

Promise

A Promise containing the status (String)

public transition(action: String): Promise source

Transition between states using actions

Params:

NameTypeAttributeDescription
action String

The action must be a string like 'acknowledge'

Return:

Promise

Returns a promise but will alsoassign the new state to the Flow intance