Index

lib/core/src/utils/utils.ts

adHocId
adHocId()
Returns : string
assert
assert(x, e, context?, cause?)
Parameters :
Name Optional Default value
x No
e No 'unknown assertion error'
context Yes
cause Yes
assertMap
assertMap(x)
Parameters :
Name Optional
x No
Returns : Map<KEY | VALUE>
assertProperty
assertProperty(x, keys: PropertyNames, message?: string)

Checks if all keys are property names of given object x. Works as a typeguard assertig that properties to all the keys exist. Will throw an error if a property is missing -- unlike has.

Parameters :
Name Type Optional
x No
keys PropertyNames No
message string Yes
b64DecodeUnicode
b64DecodeUnicode(str: string)

Decode base64 string into utf-8

Parameters :
Name Type Optional
str string No
Returns : string
b64EncodeUnicode
b64EncodeUnicode(str: string)

Encode a utf-8 string as base64

Parameters :
Name Type Optional
str string No
Returns : string
biEndSortFn
biEndSortFn(pos1, pos2)

Sorting function meant to be used in Array.sort(). Interprets zero and positive values as counting from the start and negative values as counting from the end. Non-number values are treated as in between the positive and negative values (their order is considered to be irrelevant).

Parameters :
Name Optional
pos1 No
pos2 No
Returns : | "0" | "1"
camel2Underscore
camel2Underscore(str: string)
Parameters :
Name Type Optional
str string No
Returns : string
cycleString
cycleString(str: string)
Parameters :
Name Type Optional
str string No
Returns : string
deflateObject
deflateObject(obj, path: string, recursionCount: number)

Needs documentation :D

obj, 'PROP1.PROP2' -> obj.PROP1.PROP2

Parameters :
Name Type Optional Default value
obj No
path string No ''
recursionCount number No 0
fallbackPromise
fallbackPromise(ms: number, data?: T)

Returns a promise, that will resolve after a given number of milliseconds with optionally provided data. Meant to be used in Promise.race in conjunction with other promises, that are prone to never resolve.

Parameters :
Name Type Optional
ms number No
data T Yes
Returns : Promise<T>
flattenErrors
flattenErrors(callback)

Use isErrorFree() instead

Parameters :
Name Optional
callback No
Returns : boolean
gcd
gcd(...numbers: undefined)

Find the greatest common divisor. *

Parameters :
Name Optional
numbers No
Returns : number
getDecimalPlaces
getDecimalPlaces(num)

Counts the number of decimal places

Parameters :
Name Optional
num No
Returns : number

Number of decimal places if a single number is provides. If an array of number is provided, returns the the maximum of the individual results.

getFallbackPromise
getFallbackPromise(ms: number, data?: T)

Returns a promise, that will resolve after a given number of milliseconds with optionally provided data. Meant to be used in Promise.race in conjunction with other promises, that are prone to never resolve.

Parameters :
Name Type Optional
ms number No
data T Yes
Returns : Promise<T>
getTimeoutPromise
getTimeoutPromise(ms: number, message?: string)

Returns a promise that will never resolve, but reject after the given number of milliseconds with an optional message. Meant to be used in Promise.race in conjunction with other promises, that are prone to never resolve.

Parameters :
Name Type Optional
ms number No
message string Yes
Returns : Promise<void>
has
has(x, ...keys: PropertyNames)

Checks if all keys are property names of given object x. Works as a typeguard assertig that properties to all the keys exist. Will return false if a proerty is missing-- unlike assertProperties.

Parameters :
Name Type Optional
x No
keys PropertyNames No
hasErrors
hasErrors(callback, log_errors)

Checks if callback throws any errors; returns true if so.

Parameters :
Name Optional Default value
callback No
log_errors No false
Returns : boolean
inflateObject
inflateObject(obj, path: string, recursionCount: number)

Needs documentation :D

obj, 'PROP1.PROP2' -> { PROP1: { PROP2: obj }}

Parameters :
Name Type Optional Default value
obj No
path string No
recursionCount number No 0
Returns : NestedRecord<T>
isErrorFree
isErrorFree(callback, log_errors)

Checks if callback throws any errors; returns true if not.

Parameters :
Name Optional Default value
callback No
log_errors No false
Returns : boolean
isNestedRecord
isNestedRecord(x, type)
Parameters :
Name Optional
x No
type No
Returns : NestedRecord<T>
log
log(...args: undefined)
Parameters :
Name Optional
args No
mapSort
mapSort(map, sort)
Parameters :
Name Optional
map No
sort No
Returns : number
mergeObjects
mergeObjects(obj1, obj2, recursionCount?)

Needs documentation -.-

Parameters :
Name Optional
obj1 No
obj2 No
recursionCount Yes
Returns : NestedRecord<T>
mergeObjects
mergeObjects(obj1, obj2, recursionCount?: number)
Parameters :
Name Type Optional
obj1 No
obj2 No
recursionCount number Yes
Returns : NestedRecord | T
round
round(num: number, decimal_places: number)

Round a number to a given number of decimal places.

Parameters :
Name Type Optional
num number No
decimal_places number No
Returns : number
sortByKeyFn
sortByKeyFn(key: string, secondary_key)

Returs a sorting function to be used in Array.sort(). Objects will be sorted by their property mathching the first parameter. If a second paramter is given, the property matching it will be used as secondary sort criterium. Values will be sorted by biEndSortFn. If a property turns out to be a function, the function will be called and its return value used for sorting.

Parameters :
Name Type Optional Default value
key string No
secondary_key No null
Returns : | "0" | "1"
throwError
throwError(e, offender?, context?)

Throws an error and logs extra information. Also unlike normal throw it can be used after a return statement: return throwError(...)

Parameters :
Name Optional
e No
offender Yes
context Yes
Returns : never
timeoutPromise
timeoutPromise(ms: number, message?: string)

Returns a promise that will never resolve, but reject after the given number of milliseconds with an optional message. Meant to be used in Promise.race in conjunction with other promises, that are prone to never resolve.

Parameters :
Name Type Optional
ms number No
message string Yes
Returns : Promise<void>
uuidv4
uuidv4()
Returns : string

lib/features/src/transmission/combined/combined-transmission.commons.ts

assertCmbTransmissionConfig
assertCmbTransmissionConfig(x)
Parameters :
Name Optional
x No
assertCmbTransmissionMeta
assertCmbTransmissionMeta(x)
Parameters :
Name Optional
x No
isCmbTransmissionConfig
isCmbTransmissionConfig(x)
Parameters :
Name Optional
x No
isCmbTransmissionMeta
isCmbTransmissionMeta(x)
Parameters :
Name Optional
x No

lib/core/src/items/entries/entry.class.ts

assertEntryConfig
assertEntryConfig(x)
Parameters :
Name Optional
x No
Returns : EntryConfig
isEntryConfig
isEntryConfig(x, throw_errors)
Parameters :
Name Optional Default value
x No
throw_errors No false
Returns : EntryConfig

lib/core/src/items/item-store.class.ts

assertItemStorage
assertItemStorage(x)

Checks if an input conforms to ItemStorage interface. Throws an error it doesn't.

Parameters :
Name Optional
x No
Returns : ItemStorage
assertItemStoreConfig
assertItemStoreConfig(x)

Checks if an input is an ItemStoreConfig. Throws an error if it isn't

Parameters :
Name Optional
x No
Returns : ItemStoreConfig

lib/core/src/items/questions/questions.commons.ts

assertNumberOptionConfig
assertNumberOptionConfig(x)
Parameters :
Name Optional
x No
Returns : NumberOptionConfig
assertQuestionConfig
assertQuestionConfig(x)
Parameters :
Name Optional
x No
Returns : QuestionConfig
isAnswerType
isAnswerType(x)
Parameters :
Name Optional
x No
Returns : AnswerType
isBooleanOptionConfig
isBooleanOptionConfig(x)
Parameters :
Name Optional
x No
isNumberOptionConfig
isNumberOptionConfig(x)
Parameters :
Name Optional
x No
Returns : NumberOptionConfig
isQuestionConfig
isQuestionConfig(x)
Parameters :
Name Optional
x No
Returns : QuestionConfig
isStringOptionConfig
isStringOptionConfig(x)
Parameters :
Name Optional
x No
Returns : StringOptionConfig
isTranslationList
isTranslationList(x)
Parameters :
Name Optional
x No
Returns : TranslationList

lib/core/src/rcc-rtc/rcc-rtc.commons.ts

assertRccRtcConfig
assertRccRtcConfig(x)
Parameters :
Name Optional
x No
Returns : RccRtcConfig
isRccRtcConfig
isRccRtcConfig(x)
Parameters :
Name Optional
x No
Returns : RccRtcConfig

lib/core/src/rcc-websocket/rcc-websocket.commons.ts

assertRccWebSocketConfig
assertRccWebSocketConfig(x)
Parameters :
Name Optional
x No
Returns : RccWebSocketConfig
isRccWebSocketConfig
isRccWebSocketConfig(x)
Parameters :
Name Optional
x No
Returns : RccWebSocketConfig

lib/core/src/items/reports/report.class.ts

assertReportConfig
assertReportConfig(x)
Parameters :
Name Optional
x No
Returns : ReportConfig
isReportConfig
isReportConfig(x)
Parameters :
Name Optional
x No
Returns : ReportConfig

lib/common/src/scheduled-notifications/scheduled-notification.commons.ts

assertScheduledNotification
assertScheduledNotification(x)
Parameters :
Name Optional
x No
isScheduledNotification
isScheduledNotification(x)
Parameters :
Name Optional
x No

lib/core/src/items/sessions/sessions.commons.ts

assertSessionConfig
assertSessionConfig(x)

Checks if a value conforms to the SessionConfig interface. If not, throw an AssertionError.

Parameters :
Name Optional
x No
Returns : SessionConfig
isSessionConfig
isSessionConfig(x)

Checks if a value conforms to the SessionConfig interface.

Parameters :
Name Optional
x No
Returns : boolean

lib/core/src/items/symptom-checks/symptom-checks.commons.ts

assertSymptomCheckConfig
assertSymptomCheckConfig(x)
Parameters :
Name Optional
x No
Returns : SymptomCheckConfig
assertSymptomCheckMetaConfig
assertSymptomCheckMetaConfig(x)
Parameters :
Name Optional
x No
isQuestionScheduleConfig
isQuestionScheduleConfig(x, throw_errors)
Parameters :
Name Optional Default value
x No
throw_errors No false
isSymptomCheckConfig
isSymptomCheckConfig(x)
Parameters :
Name Optional
x No
Returns : SymptomCheckConfig

lib/core/src/items/questions/question-validator.ts

booleanChecks
booleanChecks(value, config: QuestionConfig)
Parameters :
Name Type Optional
value No
config QuestionConfig No
Returns : void
decimalChecks
decimalChecks(value, config: QuestionConfig)
Parameters :
Name Type Optional
value No
config QuestionConfig No
Returns : void
integerChecks
integerChecks(value, config: QuestionConfig)
Parameters :
Name Type Optional
value No
config QuestionConfig No
Returns : void
stringChecks
stringChecks(value, config: QuestionConfig)
Parameters :
Name Type Optional
value No
config QuestionConfig No
Returns : void
undefinedChecks
undefinedChecks(value, config: QuestionConfig)
Parameters :
Name Type Optional
value No
config QuestionConfig No
Returns : void
unknownChecks
unknownChecks(value, config: QuestionConfig)
Parameters :
Name Type Optional
value No
config QuestionConfig No
Returns : void

lib/core/src/encryption/encryption.operators.ts

decrypt
decrypt(encryptionHandler: EncryptionHandler, pass_through)
Parameters :
Name Type Optional Default value
encryptionHandler EncryptionHandler No
pass_through No false
Returns : OperatorFunction<any, any>
encrypt
encrypt(encryptionHandler: EncryptionHandler)
Parameters :
Name Type Optional
encryptionHandler EncryptionHandler No
Returns : OperatorFunction<any, any>

lib/common/src/translations/nong/translators/string.translator.ts

extendTranslationKey
extendTranslationKey(key: TranslationKey, ...content: undefined)

This function is meant for basic replacements in translation strings. Occurences of %n , with n being some integer, will be replaced by the n-th paramter, starting at 1. Occurences of %s with s being a single lowercase letter, will be replaced by the parameters in the order of their appearance; same lower case letters will be replaced by different values. The replacement text will only include capital letters, digits, dots and underscores, everything else will be stripped off:

    extendTranslationKey('SOME_SCOPE.%s' | fill: paused ? 'player_running':'player_paused') == 'SOME_SCOPE.PLAYER_PAUSED' //true iff pause is truthy.

extendTranslationKey('SOME_SCOPE.GROUP_%2.LABEL_%1' | fill :  'long', 1) == 'SOME_SCOPE.GROUP_1.LABEL_LONG' //true

    extendTranslationKey('SOME_SCOPE.GROUP_%s.LABEL_%t' | fill :  'long', 1) == 'SOME_SCOPE.GROUP_LONG.LABEL_1' //true
Parameters :
Name Type Optional
key TranslationKey No
content No
Returns : TranslationKey
isTranslationKey
isTranslationKey(key: string)
Parameters :
Name Type Optional
key string No
Returns : TranslationKey
isTranslationMap
isTranslationMap(x)
Parameters :
Name Optional
x No
Returns : TranslationMap
isTranslationTemplate
isTranslationTemplate(str: string)
Parameters :
Name Type Optional
str string No
normalizeTranslationKey
normalizeTranslationKey(str: string)

Strips everything, that is not a capital letter, underscore, dot, a digit or a curley bracket, off a given string. If the result would be an empty string (thus no translation key) '_EMPTY_KEY' is returned instead and a warning logged.

Parameters :
Name Type Optional
str string No
Returns : TranslationKey

lib/core/src/encryption/aes-utils.ts

fromBase64
fromBase64(base64: string)
Parameters :
Name Type Optional
base64 string No
Returns : Uint8Array
GcmCreateKey
GcmCreateKey()
Returns : Promise<string>
GcmDecrypt
GcmDecrypt(b64_combined: string, b64_key: string)
Parameters :
Name Type Optional
b64_combined string No
b64_key string No
Returns : Promise<any>
GcmEncrypt
GcmEncrypt(data: any, b64_key: string)
Parameters :
Name Type Optional
data any No
b64_key string No
Returns : Promise<string>
randomString
randomString(length: number)
Parameters :
Name Type Optional
length number No
Returns : string
toBase64
toBase64(b)
Parameters :
Name Optional
b No
Returns : string

lib/examples/src/example-report-preparator/example-report-preparator-report-store.service.ts

getBooleanRun
getBooleanRun(length: number)
Parameters :
Name Type Optional
length number No
Returns : boolean[]
getValueRun
getValueRun(length: number)
Parameters :
Name Type Optional
length number No
Returns : number[]
randomValue
randomValue(last: number)
Parameters :
Name Type Optional Default value
last number No 1
Returns : number

lib/examples/src/static-entry-store/static-entry-store.service.ts

getPastDate
getPastDate(days_ago: number)
Parameters :
Name Type Optional
days_ago number No
Returns : string
random
random(min: number, max: number, p: number)
Parameters :
Name Type Optional Default value
min number No
max number No
p number No 1
Returns : number
randomWalk
randomWalk(max: number)
Parameters :
Name Type Optional Default value
max number No 1000
Returns : number[]

lib/common/src/interfaces.ts

getProvider
getProvider(token, x: ProductOrFactory, multi: boolean)
Parameters :
Name Type Optional Default value
token No
x ProductOrFactory No
multi boolean No false
Returns : Provider
isFactory
isFactory(x: ProductOrFactory)
Parameters :
Name Type Optional
x ProductOrFactory No
Returns : Factory<T>

lib/features/src/basic-query-widgets/scale/scale.component.ts

getSteps
getSteps(a)
Parameters :
Name Optional
a No
Returns : number[]

lib/common/src/actions/actions.commons.ts

hasDescription
hasDescription(action)
Parameters :
Name Optional
action No
hasNotification
hasNotification(action)
Parameters :
Name Optional
action No
isCustomAction
isCustomAction(action)
Parameters :
Name Optional
action No
Returns : HandlerAction
isDownloadAction
isDownloadAction(action)
Parameters :
Name Optional
action No
Returns : DownloadAction
isHandlerAction
isHandlerAction(action)
Parameters :
Name Optional
action No
Returns : HandlerAction
isPathAction
isPathAction(action)
Parameters :
Name Optional
action No
Returns : PathAction

lib/common/src/translations/nong/translators/map.translator.ts

hasTranslations
hasTranslations(x)

Type guard for ObjectWithTranslations

Parameters :
Name Optional
x No

lib/core/src/items/entries/entry-store.class.ts

identifyItemBy
identifyItemBy(item: Entry)
Parameters :
Name Type Optional
item Entry No
Returns : string

lib/core/src/items/reports/report-store.class.ts

identifyItemBy
identifyItemBy(item: Report)
Parameters :
Name Type Optional
item Report No
Returns : string

lib/core/src/items/sessions/session-store.class.ts

identifyItemBy
identifyItemBy(item: Session)
Parameters :
Name Type Optional
item Session No
Returns : string

lib/core/src/items/symptom-checks/symptom-check-store.class.ts

identifyItemBy
identifyItemBy(item: SymptomCheck)
Parameters :
Name Type Optional
item SymptomCheck No
Returns : string

lib/common/src/export/export.commons.ts

isExportResult
isExportResult(x, throw_errors)
Parameters :
Name Optional Default value
x No
throw_errors No false
Returns : ExportResult<T>

lib/common/src/translations/nong/interfaces.ts

isFinal
isFinal(x: TranslationResult)
Parameters :
Name Type Optional
x TranslationResult No
isIntermediate
isIntermediate(x: TranslationResult)
Parameters :
Name Type Optional
x TranslationResult No

lib/features/src/transmission/rtc/rtc-transmission.commons.ts

isRtcTransmissionConfig
isRtcTransmissionConfig(x, throw_errors)
Parameters :
Name Optional Default value
x No
throw_errors No false
isRtcTransmissionMeta
isRtcTransmissionMeta(x, throw_errors)
Parameters :
Name Optional Default value
x No
throw_errors No false

lib/core/src/items/schedules/interfaces.ts

isScheduleConfig
isScheduleConfig(x, flatten_errors)
Parameters :
Name Optional Default value
x No
flatten_errors No true
Returns : ScheduleConfig

lib/features/src/transmission/websocket/websocket-transmission.commons.ts

isWsTransmissionConfig
isWsTransmissionConfig(x, throw_errors)
Parameters :
Name Optional Default value
x No
throw_errors No false
isWsTransmissionMeta
isWsTransmissionMeta(x, throw_errors)
Parameters :
Name Optional Default value
x No
throw_errors No true
Returns : WsTransmissionMeta

lib/common/src/routing/routing.module.ts

overrideRoute
overrideRoute(route: Route)
Parameters :
Name Type Optional
route Route No
Returns : Provider

lib/common/src/home/home.commons.ts

provideHomePageEntry
provideHomePageEntry(config)
Parameters :
Name Optional
config No
Returns : Provider

lib/common/src/items/item.commons.ts

provideItemAction
provideItemAction(x: ProductOrFactory)

Add an action to the item type of the provided ItemAction. Any time the app makes item actions available to the user the given ItemAction will be included - if appropriate.

Parameters :
Name Type Optional
x ProductOrFactory No
Returns : Provider
provideItemRepresentation
provideItemRepresentation(x: ProductOrFactory)

Assign a {@ItemRepresentation} to an item type. Only one such representation can be assigned to each item type. If you assign multiple representations to the same item type, there is no guarantee of which one will be used.

Parameters :
Name Type Optional
x ProductOrFactory No
Returns : Provider
provideItemSelectionFilter
provideItemSelectionFilter(x: ProductOrFactory)

Register an ItemSelectionFilter. Whenever items are selected a filter menu will provide the option to filter out all items that match this filter.

Parameters :
Name Type Optional
x ProductOrFactory No
Returns : Provider

lib/common/src/main-menu/main-menu.commons.ts

provideMainMenuEntry
provideMainMenuEntry(entry: ProductOrFactory)
Parameters :
Name Type Optional
entry ProductOrFactory No
Returns : Provider

lib/common/src/settings/settings.commons.ts

provideSettingsEntry
provideSettingsEntry(config: ProductOrFactory)
Parameters :
Name Type Optional
config ProductOrFactory No
Returns : Provider

lib/common/src/translations/ng/translations.commons.ts

provideTranslationMap
provideTranslationMap(scope, translationMap: TranslationMap)
Parameters :
Name Type Optional
scope No
translationMap TranslationMap No
Returns : Provider
provideTranslator
provideTranslator(translatorClass: Type, ...dependencies: undefined)

This function makes a Translator avaible to RccTranslationService and RccTranslatePipe. The Translator will also be injectable.

```

Parameters :
Name Type Optional
translatorClass Type No
dependencies No
Returns : Provider

lib/common/src/widgets/widgets.commons.ts

provideWidget
provideWidget(widgetComponent: Type)

Registers WidgetComponents to be used by RccWidgetComponent.

  • ```
Parameters :
Name Type Optional
widgetComponent Type No

lib/core/src/export/fhir/report-fhir.ts

report2fhir
report2fhir(report: Report, questions, languageCode: string)
Parameters :
Name Type Optional
report Report No
questions No
languageCode string No

lib/common/src/translations/nong/translator.class.spec.ava.ts

runTranslatorTests
runTranslatorTests(TranslatorExtension)
Parameters :
Name Optional
TranslatorExtension No
Returns : void

lib/features/src/schedules/schedule.translator.ts

toDE
toDE(schedule: Schedule)
Parameters :
Name Type Optional
schedule Schedule No
Returns : string
toEN
toEN(schedule: Schedule)
Parameters :
Name Type Optional
schedule Schedule No
Returns : string

lib/core/src/items/questions/question.class.ts

unknownConfig
unknownConfig(id: string)
Parameters :
Name Type Optional
id string No
Returns : QuestionConfig

lib/features/src/questions/question-edit-widgets/question-edit-validators.ts

validateAnswerType
validateAnswerType(answerTypes)

Validatior function factory.

Validates the answer type. The Factory requires an array of valid answer types.

Parameters :
Name Optional
answerTypes No
Returns : ValidationErrors | null
validateMinMax
validateMinMax(control: AbstractControl)

Validates FormControls for minimum and maximum asnwer values, when editing questions. Controls for min and max must either be disabled or have a number value. Expects a AbstractControl similar to this:

``FormGroup({ enableMin: FormControl(), min: FormControl(), enableMax: FormControl(), max: FormControl(), })```

Parameters :
Name Type Optional
control AbstractControl No
Returns : ValidationErrors | null
validateOption
validateOption(answerType)

Validatior function factory.

Validates a FormGroup representing an answer Option. The Factory requires a string or an AbstractControl representing the answer type.

Can only be used on FormGroups similiar to this:

`` FormGroup({ value: FormControl<string|number>(), label: FormControl(), //... }) ```

Parameters :
Name Optional
answerType No
validateOptions
validateOptions(answerType)

Validatior function factory.

Validates FormArrays that contain controls for options, when editing questions.

Checks if the number of options is correct depending on answer type and no dupliocates exist.

Can only be used on a FormArray like this:

``FormArray<FormGroup<{ value: FormControl<string|number>(), label: FormControl<string()}>>

```

Parameters :
Name Optional
answerType No
validateWording
validateWording(control: AbstractControl)
Parameters :
Name Type Optional
control AbstractControl No
Returns : ValidationErrors | null

results matching ""

    No results matching ""