pleiar

React

React

React

React

React

React

React

React

React

React

React

React

cloneDeep

cloneDeep

CalcExplanationLine

CalcExplanationLine

CalcExplanationLine

A line containing calculation descriptions

new CalcExplanationLine()

Extends React.PureComponent

device

device
Static Members
isAppMode()
isMobileDevice()
isIOSApp()
isTouchScreen()

device

A collection of helper functions that can be used to identify the device or mode that we're running in

device
Static Members
isAppMode()
isMobileDevice()
isIOSApp()
isTouchScreen()

medSynonymsState

The medSynonyms redux state

medSynonymsState
Properties
search (string)

dictionaryState

The dictionary redux state

dictionaryState
Properties
search (string)

globalSearchState

The global search redux state

globalSearchState
Properties
search (string)

globalState

The global pleiar redux state

globalState
Properties
formulaVisibility (boolean)
round (boolean)

externalResourcesState

The external resources redux state

externalResourcesState
Properties
search (string)
onlyNorwegian (boolean)

FESTDrugEntry

FESTDrugEntry

ReduxEventOrString

This is a union type that accepts either a string or an event.

ReduxEventOrString

Type: (string | SyntheticEvent<HTMLInputElement>)

BPValuesList

This is an object that is used to build the union in BPValuesType. It is also used to build BPValues, which is probably what you're after.

BPValuesList

nutriCalcSharedState

Shared nutricalc redux state

nutriCalcSharedState
Properties
weight ((number | ""))

asyncLoaderRoleType

asyncLoaderRoleType
Properties
_ALR_initializing (Promise<null>?)
_ALR_hasInitialized (boolean?)
_ALR_onInitialize (Array<function (): any>?)
onInitialize (function (function (): any): any)
initialize (function (): Promise<null>)
hasInitialized (function (): boolean)

tokenSupports

This performs feature detection on an element. It checks if a "token list" (like the a element's rel= attribute) supports a specific value, for instance if it supports rel="noopener".

tokenSupports(source: DOMTokenList, check: string): boolean
Parameters
source (DOMTokenList)
check (string)
Returns
boolean

aSupportsRel

Performs rel="" feature detection on the anchor element

aSupportsRel(check: string): boolean
Parameters
check (string)
Returns
boolean

nutriCalcReqAgeGroup

Age groups for nutricalcreq

nutriCalcReqAgeGroup

Type: ("18-30" | "31-69" | "70+")

nutriCalcBMIState

The nutricalc bmi redux state

nutriCalcBMIState
Properties
height ((number | ""))

AUTH_URL

AUTH_URL

setMedSynonymsSearchString

Redux action. Sets the search string for searching the medSynonyms

setMedSynonymsSearchString(search: string): medSynonymsAction
Parameters
search (string)
Returns
medSynonymsAction

setDictSearchString

Redux action. Sets the search string for searching the dictionary

setDictSearchString(search: string): dictionaryAction
Parameters
search (string)
Returns
dictionaryAction

removeMarkdown

Removes all markdown formatting from a string

removeMarkdown(markdown: string): string
Parameters
markdown (string)
Returns
string

AccordionElements

This is used to define elements for SimpleAccordion

AccordionElements

Type: Array<{header: string, render: (React.Node | string)}>

medCalcInfusionState

The medcalc redux infusion state

medCalcInfusionState
Properties
content ((number | ""))
hours ((number | ""))
minutes ((number | ""))
mode (("ml/t" | "dråpar/sek"))
additionalCalculations (boolean)

applyBrowserWorkaroundsIfNeeded

Applies workarounds for Microsoft browsers. Sets the ms-workarounds and either ms-edge or ms-ie classes on the body (for applying CSS workarounds) and polyfills a missing Number.parseFloat in IE.

applyBrowserWorkaroundsIfNeeded()

setValue

Redux action that sets the value of one of the input fields in the nutricalc-req calculator

setValue(field: ("ageGroup" | "patientState" | "temp"), value: (number | "" | nutriCalcReqAgeGroup | nutriCalcReqPatientState)): nutriCalcReqAction
Parameters
field (("ageGroup" | "patientState" | "temp"))
Returns
nutriCalcReqAction

toggleFoodList

Redux action that toggles display of the food list in the nutricalc

toggleFoodList(): nutriCalcDayAction
Returns
nutriCalcDayAction

setNewsBP

Redux action. Sets the BP value for the NEWS calculator

setNewsBP(BP: string): newsAction
Parameters
BP (string)
Returns
newsAction

setGlobalSearchString

Redux action that sets the search string for searches using the global search function

setGlobalSearchString(search: string): globalSearchAction
Parameters
search (string)
Returns
globalSearchAction

toggleRounding

Redux action that toggles rounding of numbers

toggleRounding(): globalAction
Returns
globalAction

setContent

Redux action that sets the content (in ml) of the infusion

setContent(content: (number | "")): medCalcInfusionAction
Parameters
content ((number | ""))
Returns
medCalcInfusionAction

setWeight

Redux action that sets the weight of a patient

setWeight(value: (number | "")): nutriCalcSharedAction
Parameters
value ((number | ""))
Returns
nutriCalcSharedAction

setHeight

Redux action that sets the height of a person

setHeight(value: (number | "")): nutriCalcBMIAction
Parameters
value ((number | ""))
Returns
nutriCalcBMIAction

getValueFromLiteralOrEvent

Helper function that retrieves a string value, given either a string, or a SyntheticEvent. Used to be able to treat an event or a string interchangably, so that for instance a function can accept both an event (ie. be triggered by a input field) and a string (value provided by us by manually calling it).

getValueFromLiteralOrEvent(thing: (string | SyntheticEvent<HTMLInputElement>)): string
Parameters
thing ((string | SyntheticEvent<HTMLInputElement>))
Returns
string

nutriCalcDayState

T he nutricalc-day redux state

nutriCalcDayState
Properties
isFoodListOpen (boolean)
minimum ((number | ""))

setExtRSearchString

Redux action that sets the search string for searches through the external resources list.

setExtRSearchString(search: string): externalResourcesAction
Parameters
search (string)
Returns
externalResourcesAction

numbers

This provides some static helper functions for formatting and parsing numbers.

numbers
Static Members
parseFloatishFromThing(thing)
floatishInRangeFromThing(thing, min, max)
getFloatishFromThing(thing)
getFloatishOrZeroFromThing(thing)
parseFloatish(toParse)
parseFloat(toParse)
format(number)
roundNearestTen(number)
round(no, roundTo)
conditionalRound(no, roundingEnabled, roundTo)
roundToSimplestSignificant(no)
conditionalRoundToSimplestSignificant(no, roundingEnabled)

DictionaryEntry

A signle dictionary entry

DictionaryEntry
Properties
expression (string)
moreInfoURLs (Array<string>?)
description (string)
keywords (string?)
seeHandbook (string?)
lookupKey (string?)
seeAlso (Array<string>)

DictionaryEntry

Renders a single entry in the dictionary

Props:

  • entry: The entry to render
  • rawEntry: A boolean, if true it will return just the entry, with no "read more", no title etc. rawEntry implies forceAuth=true and inhibitTitle=true
  • inhibitTitle: A boolean, if true will omit the title of the entry
  • forceAuth: A boolean, if true, will not verify that a user is logged in
  • whitelistedAuthRequiredEntries: The number of whitelisted entries displayed before authentication is required. Used to construct the text for the InlineAuthBlock.
new DictionaryEntry()

Extends React.PureComponent

lunrMetadata

Metadata returned from a lunr search

lunrMetadata

medCalcState

Medcalc redux state

medCalcState
Properties

ReduxEventOrStringCallback

Signature/type for the generic redux callbacks that accept either an event object or a string

ReduxEventOrStringCallback

Type: function (ReduxEventOrString): void

LabValueNoticeType

The type for the LabValueGenericNotices object

LabValueNoticeType
Properties
refStringSpecial ({})

Covid19

The Pleiar.no free software infromation page

new Covid19()

Extends React.PureComponent

nutriCalcReqPatientState

Patient states for nutricalcreq

nutriCalcReqPatientState

Type: ("bed" | "up" | "building")

medSynonymsAction

Actions accepted by the medSynonyms reducer

medSynonymsAction
Properties
type ("MEDSYNONYMS_SET_SEARCH_STRING")
search (string)

dictionaryAction

Actions accepted by the dictionary reducer

dictionaryAction
Properties
type ("DICT_SET_SEARCH_STRING")
search (string)

globalSearchAction

The actions accepted by the global search redux reducer

globalSearchAction
Properties
type ("GLOBAL_SEARCH_SET_SEARCH_STRING")
search (string)

slug

This is a global helper object that can be used to generate slugs. Uses github-slugger to generate the slugs.

Caveat: You must make sure that no code that you are calling is also generating slugs at the same time, since you then may end up with inconsistent slugs (see the docs for reset().

slug
Static Members
get(name)
reset()

OptionSelectorKey

A single entry used for OptionSelector. (this is explicitly not exact, so that any of our users can use a datastructure that they already have other items in)

OptionSelectorKey

Type: string

nutriCalcSharedAction

Actions accepted by the nutriCalcShared redux reducer

nutriCalcSharedAction
Properties
type ("NUTRICALC_SHARED_SET_WEIGHT")
value ((number | ""))

externalResourcesAction

Actions accepted by the external resources reducer

externalResourcesAction

Type: ({type: "EXT_RES_SET_SEARCH_STRING", search: string} | {type: "EXT_RES_TOGGLE_ONLYNORWEGIAN"})

HandbookBase

Base class for Handbook* objects. Provides shared methods for looking up objects.

new HandbookBase()
Instance Members
_warn(message)
_rootDatastructure()
_newHandbookIndex(path)
_newHandbookEntry(path)
_rootPath()
_lookupEntry(path)
_lookupIndex(path)
__lookup(path)
toplevelParent
path

searchSnippetComponent

This is the end result that we return (in the form of an array of searchSnippetComponents)

searchSnippetComponent

Type: ({type: "normal", str: string} | {type: "highlight", str: string} | {type: "delimiter"})

MedCalcInfo

The informational message displayed in the home page

new MedCalcInfo()

Extends React.PureComponent

globalAction

Actions accepted by the global state reducer

globalAction
Properties
type (("TOGGLE_FORMULA_VISIBILITY" | "TOGGLE_ROUNDING"))

nutriCalcBMIAction

Actions accepted by the nutriCalcBMI reducer

nutriCalcBMIAction
Properties
type ("NUTRICALC_BMI_SET_HEIGHT")
value ((number | ""))

QuickRefIndex

Represents a single "index" entry in the quickref. That is, an entry that contains other entries. The quickref only contains one level, so this should always be the root of the tree.

new QuickRefIndex()

Extends HandbookIndex

Instance Members
_rootDatastructure()
_newHandbookIndex(path)
_newHandbookEntry(path)
_rootPath()

FrontPage

Renders the front page info text

new FrontPage(props: {})

Extends React.PureComponent

Parameters
props ({})

PageTitle

A helper component that updates the title of the page. Accepts an optional title parameter. If this is provided then the title will be set to "Pleiar.no - TITLE". Otherwise it will be set to "Pleiar.no".

new PageTitle(props: {title: string?}): null
Parameters
props ({title: string?})
Returns
null

nutriCalcSetFields

Fields for nutricalcreq that accepts non-boolean values

nutriCalcSetFields

Type: ("ageGroup" | "patientState" | "temp")

SimpleAccordionProps

Props for SimpleAccordion

SimpleAccordionProps
Properties
elements (AccordionElements)
alwaysOpen (boolean?)

NutriCalc

Root of the nutricalc component.

new NutriCalc()

Extends React.PureComponent

NEWSDispatchProps

Props for the NEWS class

NEWSDispatchProps
Properties
onBPUpdate (function (string): void)
onPulseUpdate (function (string): void)
onTempUpdate (function (string): void)
onRFUpdate (function (string): void)
onSpO2Update (function (string): void)
onConsciousnessUpdate (function (string): void)
onToggleO2 (function (): void)
onToggleAlternateSPO2 (function (): void)

StructuredDataAutoProps

Props for StructuredData when type="auto"

StructuredDataAutoProps
Properties
walled (boolean)
type ("auto")

NotFound

The component that renders our 404 message.

new NotFound(props: NotFoundProps)

Extends React.PureComponent

Parameters
props (NotFoundProps)

BPValuesType

Type for BP values

BPValuesType

Type: $Keys<any>

nutriCalcState

nutricalc redux state

nutriCalcState
Properties

CalcResultWithExplanation

A calculator result that returns a result property and a <CalcExplanation>

CalcResultWithExplanation
Properties
result (number)
description (React.Element<any>?)

AuthFailed

Displays an "authentication failed" message

new AuthFailed()

Extends React.PureComponent

nutriCalcDayAction

Actions accepted by the nutriCalcDay redux reducer

nutriCalcDayAction

Type: ({type: "NUTRICALC_DAY_TOGGLE_FOODLIST"} | {type: "NUTRICALC_DAY_SET_ENTRY_VALUE", entryNo: number, key: string, val: string} | {type: "NUTRICALC_DAY_SET_MINIMUM", minimum: (number | "")} | {type: "NUTRICALC_DAY_REMOVE_ENTRY", entryNo: number} | {type: "NUTRICALC_DAY_RESET"})

setEntryValue

Redux action that sets the value of a line in the nutrition calculator

setEntryValue(entryNo: number, key: string, val: string): nutriCalcDayAction
Parameters
entryNo (number)
key (string)
val (string)
Returns
nutriCalcDayAction

toggleFormulaVisibility

Redux action that toggles the visibility of formulas

toggleFormulaVisibility(): globalAction
Returns
globalAction

setMinutes

Redux action that sets the number of minutes the infusion is to be given over

setMinutes(minutes: (number | "")): medCalcInfusionAction
Parameters
minutes ((number | ""))
Returns
medCalcInfusionAction

NutriCalcDayLineState

The stored datatype for a singe line in the nutricalc-day calculator

NutriCalcDayLineState
Properties
custom (boolean)
food (string)
kcal (number)
items (number)

nutriCalcBoolFields

Fields for nutricalcreq that accepts boolean values

nutriCalcBoolFields

Type: ("febrile" | "skinny")

medCalcInfusionAction

Actions accepted by the medcalc infusion reducer

medCalcInfusionAction

Type: ({type: "MEDCALC_INFUSION_SET_CONTENT", content: (number | "")} | {type: "MEDCALC_INFUSION_SET_HOURS", hours: (number | "")} | {type: "MEDCALC_INFUSION_SET_MINUTES", minutes: (number | "")} | {type: "MEDCALC_INFUSION_SET_MODE", mode: ("ml/t" | "dråpar/sek")} | {type: "MEDCALC_INFUSION_TOGGLE_ADDITIONAL_CALCULATIONS"})

MarkdownHeader

A normal header generator that also adds a slug (id) if it can

new MarkdownHeader()

Extends React.PureComponent

CourseCompleted

Displays the score of a completed quiz

new CourseCompleted()

Extends React.Component

toggleValue

Redux action that sets the value of one of the boolean fields in the nutricalc-req calculator

toggleValue(field: ("febrile" | "skinny")): nutriCalcReqToggleAction
Parameters
field (("febrile" | "skinny"))
Returns
nutriCalcReqToggleAction

toggleOnlyNorwegian

Redux action that toggles display of only Norwegian entries in the external resources list

toggleOnlyNorwegian(): externalResourcesAction
Returns
externalResourcesAction

hightlightIndex

This is the index used to indicate the location of a string that should be highlighted

hightlightIndex
Properties
start (number)
stop (number)

lunrResult

Datastructure returned from lunr for a single search, and therefore also from PleiarSearcher

lunrResult
Properties
ref (string)
matchData ({metadata: lunrMetadata})

QuickRefSearchResult

The quickref search result renderer

new QuickRefSearchResult()

Extends React.PureComponent

SimpleAccordion

Render an accordion, which is a set of Collapse elements that are managed together so that only one is open.

new SimpleAccordion(props: SimpleAccordionProps)

Extends React.PureComponent

Parameters
Instance Members
toggleEnterNo(entry)

OptionSelectorList

The list of OptionSelectorEntry items that is used by @{link OptionSelector}.

OptionSelectorList

Type: (Array<OptionSelectorEntry> | NEWSOptionList)

IndexEntry

A single entry in the search index

IndexEntry
Properties
id (string)
tittel (string?)
body (string?)
keywords (string?)
url (string?)

IndexEntry

A single entry in the search index

IndexEntry
Properties
id (string)
tittel (string?)
body (string?)
keywords (string?)
url (string?)

DictionaryDataStructure

The data structure used to store DictionaryEntry items

DictionaryDataStructure

Type: Array<DictionaryEntry>

LabValueGenericNotices

A constant list of generic notices that apply to specific groups of lab values. This is used both when rendering a single cleartext element and when rendering tables.

LabValueGenericNotices

Type: LabValueNoticeType

HandbookLikeSearchResult

A rendering component that can render a HandbookEntry with a searchSnippet, which is an array of searchSnippetComponents that helper.lunrSnippet has built.

new HandbookLikeSearchResult()

Extends React.PureComponent

nutriCalcReqState

nutriCalcReq redux state

nutriCalcReqState
Properties
patientState (nutriCalcReqPatientState)
febrile (boolean)
skinny (boolean)
temp (number)

StructuredDataArticleProps

Props for StructuredData when type="article"

StructuredDataArticleProps
Properties
walled (boolean)
type ("article")
title (string)
author (string?)
image (string?)

LanguageInformation

Displays a line containing the language of an ExternalResourcesEntry, if that language is not Norsk.

new LanguageInformation()

Extends React.PureComponent

pleiarReduxState

Global pleiar redux state

pleiarReduxState
Properties
nutriCalc (nutriCalcState)
medCalc (medCalcState)
externalResources (externalResourcesState)
dictionary (dictionaryState)
globalSearch (globalSearchState)
news (newsState)
medSynonyms (medSynonymsState)
global (globalState)

CalcResultWithExplanationLines

A calculator result that returns a result property and a description array of <CalcExplanationLine>s

CalcResultWithExplanationLines
Properties
result (number)
description (CalcExplanationLineArray)

ToolContainer

This is the container each tool should wrap itself in. It functions like <MainContainer>, but this expects a <MainContainer> to exist as its parent already, so it won't do much other than return a div with a class set and a navigation link. It will also wrap it in <RequiresAuth> unless you pass requiresAuth={false}.

new ToolContainer()

Extends React.PureComponent

OptionSelectorSubcomponentProps

The required props to render any subcomponent of OptionSelector (and thus also OptionSelector)

OptionSelectorSubcomponentProps
Properties
options (OptionSelectorList)
label ((string | React.Node | Array<React.Node>))
placeholder (string?)
onChange (function (string): void)
selected ((string | null)?)

setNewsPulse

Redux action. Sets the BP value for the NEWS calculator

setNewsPulse(pulse: string): newsAction
Parameters
pulse (string)
Returns
newsAction

ATCCodeUnconnected

Renders a single ATC code

new ATCCodeUnconnected()

Extends React.PureComponent

CalcExplanationEntryUnconnected

Lowest level of a CalcExplanationLine, outputs the column if needed

new CalcExplanationEntryUnconnected()

Extends React.PureComponent

WordDefinition

This is a more complete replacement for <abbr>, providing the same functionality through a reactstrap <Tooltip>, which also permits things like embedding react elements within the definition.

Props:

  • content: The content
  • definition: The definition
  • id: An id for the element
new WordDefinition()

Extends React.PureComponent

setHours

Redux action that sets the number of hours the infusion is to be given over

setHours(hours: (number | "")): medCalcInfusionAction
Parameters
hours ((number | ""))
Returns
medCalcInfusionAction

A <Link> wrapper that returns links relative to /ordliste/

new DictionaryLink()

Extends React.PureComponent

lineUpdateCallback

The signature for the callback called when a line is updated

lineUpdateCallback

Type: function (number, string, string): void

apps

This is the list of all apps that should be displayed in the menu

The name is the label, id is the path, route is the route if it can not be inferred and exact is a boolean specifying if the exact prop needs to be supplied to react-router

apps

Type: appList

removeEntry

Redux action that removes a line from the nutrition calculator

removeEntry(entryNo: number): nutriCalcDayAction
Parameters
entryNo (number)
Returns
nutriCalcDayAction

asyncLoaderRole

This is a "base" object that you can add to another object to add functionality to that object to asynchronously load some data.

It expects the following methods, with these exact signatures, to be present in any object that consumes it:

_performAsyncImport() - This should return the promise from the import call, like: import(/* webpackChunkName: "search-index", webpackPreload: true * / '../data/search-index.json').

_loadedData(data) - this gets the data structure once it has been loaded.

asyncLoaderRole

Type: asyncLoaderRoleType

Static Members
_performAsyncImport()
_loadedData()
onInitialize(func)
initialize()
hasInitialized()

This is a class that wraps anchor-elements that link to external websites.

The default is to open those in a new tab. This exposes us to security risks because of window.opener (see https://mathiasbynens.github.io/rel-noopener/). The workaround for this is to add rel="noopener" to anchor elements. However, this is not supported in all browsers, so we need to add rel="noreferrer" as well, which isn't actually what we want to do. Thus this wrapper element will detect if noopener is supported, and if it is we will use noopener without noreferrer. Otherwise we will use both noopener and noreferrer.

If you don't want to open in a new tab, specify sameWindow={true}, this reverts ExternalLink to work just like a regular anchor.

basicStyle makes the generated -element not have the class "external-link". This is useful when the child is an image, or when you just want to style some link like any other. Note that sameWindow={true} implicitly enables basicStyle.

In addition to the props it directly supports, namely href, and the internal "sameWindow", and child elements, it will also pass on arbitrary props to the a-element.

new ExternalLink()

Extends React.PureComponent

MainContainer

This is the main container for the app. All toplevel components must use this to ensure that the design is correct and that the page title gets updated

new MainContainer()

Extends React.Component

pulseValuesList

This is an object that is used to build the union in pulseValuesType. It is also used to build pulseValues, which is probably what you're after.

pulseValuesList

singleSnippetContainer

This is a container used to indicate a single sentence of text that should be highlighted.

singleSnippetContainer
Properties
highlight (Array<hightlightIndex>)
from (number)
length (number)
snippet (string)

MedCalc

The root component for the medcalc page.

This handles rendering the base UI, setting the page title correctly and passing control off to the actual calculator components

new MedCalc()

Extends React.PureComponent

ExternalResourcesEntry

A single external resource entry

ExternalResourcesEntry
Properties
title (string)
url (string)
description (string)
keywords (string?)
language (("Norsk" | "Engelsk"))

ExternalResourcesEntry

Renders a single entry in the external resources list

new ExternalResourcesEntry()

Extends React.PureComponent

ReactSelectOptions

Type for the react-select options object

ReactSelectOptions
Properties
value (string)
label (string)

quizDataManager

MedSearcher is the search wrapper for the medication synonyms data. This is different from PleiarSearcher. PleiarSearcher uses lunr to index everything on the site, except for medications. This class uses a fairly dumb method of searching through the medication list.

quizDataManager

Type: QuizDataManagerType

Static Members
_data
data()
_performAsyncImport()
_loadedData(data)

ResolvedLunrRef

A single result from getResultFromRef

ResolvedLunrRef

Type: ({type: "dictionary", dictionary: DictionaryEntry} | {type: "externalResources", externalResources: ExternalResourcesEntry} | {type: "labValue", labValues: LabValueEntry} | {type: "handbook", handbook: HandbookEntry} | {type: "tool", tool: ToolListEntry} | {type: "nutrition", nutrition: NutritionInfoEntry} | {type: "external", external: ExternallyIndexedItem} | {type: "quickref", quickref: QuickRefEntry} | {type: "quiz", quiz: SearchMetadataEntry})

StructuredDataProps

Props for StructuredData

StructuredDataProps

Type: (StructuredDataAutoProps | StructuredDataArticleProps)

nutriCalcReqToggleAction

nutriCalcReq actions that toggle boolean fields

nutriCalcReqToggleAction

Type: ({type: "NUTRICALC_REQ_TOGGLE", field: "febrile"} | {type: "NUTRICALC_REQ_TOGGLE", field: "skinny"})

QuickRefIndexRender

The Pleiar.no quickref index/list renderer

new QuickRefIndexRender()

Extends React.PureComponent

NEWSState

State for the NEWS class

NEWSState
Properties
displayO2TableInfo (boolean)

NutriCalcBMIProps

Props for NutriCalcBMI

NutriCalcBMIProps
Properties
(any)
(any)

LabValueMaterialMap

A constant list of "material shorthand" to "material full name" values. This is used both when rendering a single cleartext element and when rendering tables.

LabValueMaterialMap

index

Method that performs the actual indexing. This has no data import of its own, so you have to supply all of the datastructures yourself.

index(externalResources: ExternalResourcesDataStructure, dictionary: DictionaryDataStructure, labValues: LabValueDataStructure, handbook: HandbookDataStructure, tools: ToolsListDataStructure, nutrition: NutritionDataStructure, externallyIndexed: ExternallyIndexedList, quickref: HandbookDataStructure, quizData: QuizDataContainer): LunrObject
Parameters
externalResources (ExternalResourcesDataStructure)
labValues (LabValueDataStructure)
externallyIndexed (ExternallyIndexedList)
quizData (QuizDataContainer)
Returns
LunrObject

constructIndex

This constructs the actual index, providing data and title maps to indexFromSource.

constructIndex(idxData: {external: ExternalResourcesDataStructure, dict: DictionaryDataStructure, labValues: Array<LabValueEntry>, handbook: HandbookDataStructure, tools: ToolsListDataStructure, nutrition: NutritionDataStructure, externallyIndexed: ExternallyIndexedList, quickref: HandbookDataStructure, indexer: LunrObject, quizData: QuizDataContainer})
Parameters
idxData ({external: ExternalResourcesDataStructure, dict: DictionaryDataStructure, labValues: Array<LabValueEntry>, handbook: HandbookDataStructure, tools: ToolsListDataStructure, nutrition: NutritionDataStructure, externallyIndexed: ExternallyIndexedList, quickref: HandbookDataStructure, indexer: LunrObject, quizData: QuizDataContainer})

_indexFromTools

Adds tools to the index

_indexFromTools(idx: LunrObject, tools: ToolsListDataStructure)
Parameters
idx (LunrObject)

_indexFromExternal

Adds externally indexed items to the index

_indexFromExternal(idx: LunrObject, indexList: ExternallyIndexedList)
Parameters
idx (LunrObject)
indexList (ExternallyIndexedList)

_indexFromNutriData

Adds nutrition data to the index

_indexFromNutriData(idx: LunrObject, nutrition: NutritionDataStructure)
Parameters
idx (LunrObject)

_recursiveLunrIndexFromHandbook

Recursively indexes the handbook datastructure

_recursiveLunrIndexFromHandbook(idx: LunrObject, handbook: (HandbookDataEntry | HandbookDataStructure), idxType: ("handbook" | "quickref"))
Parameters
idx (LunrObject)
idxType (("handbook" | "quickref"))

indexFromSource

Adds a single data source to the index, based upon the fields provided.

indexFromSource(src: {source: (Array<ExternalResourcesEntry> | Array<DictionaryEntry> | Array<LabValueEntry>), indexer: LunrObject, titleField: string, descriptionField: string?, descriptionMarkdown: boolean?, keywordField: string?, urlField: string?, sourceName: string, alternateKeywords: string?})
Parameters
src ({source: (Array<ExternalResourcesEntry> | Array<DictionaryEntry> | Array<LabValueEntry>), indexer: LunrObject, titleField: string, descriptionField: string?, descriptionMarkdown: boolean?, keywordField: string?, urlField: string?, sourceName: string, alternateKeywords: string?})

_indexFromElearn

Adds tools to the index

_indexFromElearn(idx: LunrObject, quiz: QuizDataContainer)
Parameters
idx (LunrObject)
quiz (QuizDataContainer)

setCalculatorMode

Redux action that changes the mode of the calculator

setCalculatorMode(mode: ("ml/t" | "dråpar/sek")): medCalcInfusionAction
Parameters
mode (("ml/t" | "dråpar/sek"))
Returns
medCalcInfusionAction

StructuredData

This renders structured data for this entry.

new StructuredData()

Extends React.PureComponent

NutritionSearchRenderer

Component used to render results from the nutrition database in search results

new NutritionSearchRenderer()

Extends React.PureComponent

PleiarProps

Props for Pleiar

PleiarProps
Properties
store (ReduxStore<pleiarReduxState, {}>)
baseState (pleiarReduxState?)

SearchSuggestions

Renders a list of suggested search phrases

new SearchSuggestions()

Extends React.PureComponent

nutriCalcReqAction

Actions accepted by the nutriCalcReq redux reducer

nutriCalcReqAction

Type: (nutriCalcReqToggleAction | {type: "NUTRICALC_REQ_SET", field: "ageGroup", value: nutriCalcReqAgeGroup} | {type: "NUTRICALC_REQ_SET", field: "patientState", value: nutriCalcReqPatientState} | {type: "NUTRICALC_REQ_SET", field: "temp", value: number})

auth

A basic authentication helper. It stores authentication state between sessions, and performs validation of authentication (JWT) tokens. It can then be queried at any point for the actual authentication state (by calling isAuthenticated).

TODO: Verify JWT TODO: Store authentication state TODO: Whitelist bots

auth

Type: AuthObjType

Static Members
initialize()
isAuthenticated()
invalidate()
authenticate(token)
getError()

setMinimum

Redux action that changes the minimum kcal required in the nutrition calculator

setMinimum(minimum: (number | "")): nutriCalcDayAction
Parameters
minimum ((number | ""))
Returns
nutriCalcDayAction

lunrResultSnippet

A lunrResultSnippet object represents a single search result

new lunrResultSnippet(bodyString: string, metadata: lunrMetadata)
Parameters
bodyString (string)
metadata (lunrMetadata)
Instance Members
_strIsBoundaryCharacter(str)
_idxIsStartOfSentence(idx)
_idxIsEndOfSentence(from, to)
getGenericSnippet()
findSingleSnippet(start, stop, alreadyFound)
buildSnippetTree(from)
get()

AboutSystem

This provides various system information, useful for debugging

new AboutSystem()

Extends React.PureComponent

OptionSelectorSelectElement

This component is used by OptionSelector to render a set of options as a select-element. This is considered an implementation detail of OptionSelector, and you should only use OptionSelector directly, never OptionSelectorRadioButtons. You can tell OptionSelector that you only want select-element.

new OptionSelectorSelectElement()

Extends React.Component

Instance Members
render()

pulseValuesType

Type for pulse values

pulseValuesType

Type: $Keys<any>

ExternalResourcesDataStructure

The external resources data structure

ExternalResourcesDataStructure

Type: Array<ExternalResourcesEntry>

appInstall

Object that handles platform detection, support for and triggering of app installation events.

App installation, or "add to homescreen" functionality is not in any way standardized. As such it differs from browser to browser. Chrome exposes an API for triggering it, while Firefox on Android as well as Safari require the user to do so themselves. Therefore, on those browsers, the user has to be presented with installation instructions. See the docs for trigger.

appInstall

Type: appInstallMembers

Static Members
listen(cb)
mode()
init()
canInstall()
canInstallWithAppInstallEvent()
trigger()

MarkdownTable

A

generator that uses reactstrap instead of bare
tags

new MarkdownTable()

Extends React.PureComponent

ReadMoreEntry

Renders a single "read more" entry. It takes a URL and returns a link to that URL with the link text being the name of the site. The names are hardcoded.

new ReadMoreEntry()

Extends React.PureComponent

PleiarState

State for Pleiar

PleiarState
Properties
updateIsAvailable (boolean)

NutriCalcBMI

Calculates the required calories per day for a patient

new NutriCalcBMI()

Extends React.PureComponent

Instance Members
getResult()
render()

FoodLine

This represents a single entry of food

It lets a user modify it at will.

The props are: entry - the line number, used for keying items - how many of this food item the user has chosen kcal - how many kcal per item food - string, the name of the food onLineUpdate - the callback to call when something changes onLineRemove - the callback to call when the whole line should be removed custom - a boolean, true if this is a custom entry by the user

new FoodLine(props: any)

Extends React.PureComponent

Parameters
props (any)
Instance Members
changeValue(key, ev)
removeLine()
renderSelect()
renderCustom()

calcReturnType

The return type from the calculation method on the NEWS class. Score is the numeric score, itemsWithScore3 is (maybe) an array with a list of fields that have a score of 3, while explanation is an array of NEWSExplanationLines

calcReturnType
Properties
score (number)
itemsWithScore3 (Array<string>?)
explanation (Array<React.Node>?)

setNewsTemp

Redux action. Sets the BP value for the NEWS calculator

setNewsTemp(temp: string): newsAction
Parameters
temp (string)
Returns
newsAction

toggleAdditionalCalculationsVisibility

Redux action that toggles the visibility of "additional calculations"

toggleAdditionalCalculationsVisibility(): medCalcInfusionAction
Returns
medCalcInfusionAction

getAuthURL

Generates an authentication URL that can be used to log in

getAuthURL(): string
Returns
string

ToolsIndex

This builds the graphical index of tools

new ToolsIndex()

Extends React.PureComponent

Pleiar

The root handler. Renders the menu and passes control off to the rendering component.

new Pleiar(props: PleiarProps)

Extends React.Component

Parameters
props (PleiarProps)
Instance Members
offlineManager()
render()

reset

Redux action that resets the entire nutrition calculator

Returns
nutriCalcDayAction

LabValueEntry

A single lab value

LabValueEntry
Properties
navn (string)
materiale (("B" | "E" | "P" | "PT" | "S"))
ref (string)
category (string)
merknad (string?)

NEWSExplanationLineProps

The props for the NEWSExplanationLine

NEWSExplanationLineProps

Type: ({score: number, explanation: string} | {left: string, right: (string | number), rightStyle: string?, style: string})

MedCalcInfWrapperUnconnected

Wrapping container around the infusion calculators, used to render trekant.svg in the correct location

new MedCalcInfWrapperUnconnected()

Extends React.PureComponent

QuickRefEntry

Represents a single entry in the quickref. Use this instead of referencing the quickref data structure directly, whenever possible. It makes looking up prev/next entries etc. much easier.

new QuickRefEntry()

Extends HandbookEntry

Instance Members
_rootDatastructure()
_newHandbookIndex(path)
_newHandbookEntry(path)
_rootPath()

SysInfo

A collection of helper functions that can be used to identify the device or mode that we're running in

SysInfo
Static Members
getSystemInfo()
featureDetection()
getSearcherState(searcher)

A link renderer that builds a <Link> for local links, and <ExternalLink> for external ones.

new MarkdownBasicLink()

Extends React.PureComponent

tempValuesList

This is an object that is used to build the union in tempValuesType. It is also used to build tempValues, which is probably what you're after.

tempValuesList

MedSearcher

MedSearcher is the search wrapper for the medication synonyms data. This is different from PleiarSearcher. PleiarSearcher uses lunr to index everything on the site, except for medications. This class uses a fairly dumb method of searching through the medication list.

MedSearcher

Type: MedSearcherType

Static Members
fest
_performAsyncImport()
_loadedData(data)
_getFEST()
looksLikeATC(thing)
search(str)
atcSearch(atc)
_searchMatch(elements, item)

NutriCalcReqProps

Props for NutriCalcReq

NutriCalcReqProps
Properties
(any)
(any)
(any)

Authenticator

Handler for /auth

This handles passing JWT's to the auth object, and preforming redirects as needed.

new Authenticator()

Extends React.PureComponent

Instance Members
redirect()

TopSearchProps

Props for TopSearch

TopSearchProps
Properties
(any)
(any)
(any)

QuickRef

The QuickRef app component. Renders pages or the index. Reuses HandbookRender from handbook.js for rendering

new QuickRef()

Extends React.Component

LabValueDataStructure

The data structure used to store lab values

LabValueDataStructure
Properties
values (Array<LabValueEntry>)
index ({})

Question

Renders a single question

new Question()

Extends React.Component

Instance Members
componentDidMount()

setNewsRF

Redux action. Sets the RF value for the NEWS calculator

setNewsRF(RF: string): newsAction
Parameters
RF (string)
Returns
newsAction

MedicationSynonymsRenderSingleResult

Renders a single result entry

new MedicationSynonymsRenderSingleResult()

Extends React.PureComponent

WordDefinitionFromDictionary

This is a variant of WordDefinition that lets you provide the name of an entry in the dictionary instead of providing the definition yourself.

Props:

  • content: The content
  • lookupKey: The lookupKey from Dictionary.yml to display
  • id: An id for the element
new WordDefinitionFromDictionary()

Extends React.PureComponent

HandbookSearchResult

A rendering component that can render a HandbookEntry with a searchSnippet, which is an array of searchSnippetComponents that helper.lunrSnippet has built.

new HandbookSearchResult()

Extends React.PureComponent

tempValuesType

Type for temp values

tempValuesType

Type: $Keys<any>

NutriCalcReq

Calculates the required calories per day for a patient

new NutriCalcReq()

Extends React.PureComponent

Instance Members
renderAdditionalValues()
getResult()
render()

quizManagerHandler

Quiz manager. All of the logic for a quiz.

new quizManagerHandler(quiz: string)
Parameters
quiz (string)
Instance Members
possiblePoints()
next()
isDone()
reset()
registerCorrect()
registerIncorrect(question)
listen(cb)
notifyListeners()
getEndSlide()

WhateverResult

The datatype that WhateverRenderer accepts as its result prop

WhateverResult

Type: (string | {dictionary: DictionaryEntryType} | {externalResources: ExternalResourcesEntryType} | {labValues: LabValueEntryType} | {quickref: QuickRefEntry} | {handbook: HandbookEntry})

NEWSOptionItem

An item that descibes an option for a NEWS entry.

This is explicitly not exact, so that an array can contain both NEWSOptionItem's and OptionSelectorEntry items.

NEWSOptionItem

Type: ({key: any, name: string?, score: number, explanation: string} | {key: any, name: string?, score: 0} | {key: any, name: string?, resultCalculator: function (boolean): {score: number, explanation: string?}})

LabValueEntryCleartextElement

A single element (field) for a cleartext rendering of a lab value

new LabValueEntryCleartextElement()

Extends React.PureComponent

SeeAlsoEntry

Renders a single "see also" dictionary entry through DictionaryLink.

new SeeAlsoEntry()

Extends React.PureComponent

RoutingAssistantInit

Initializes the routing assistant. Only required once during the lifetime of the app, and should only be placed once.

new RoutingAssistantInit()

Extends React.Component

The renderer of the top menu

new Menu(props: {})

Extends React.PureComponent

Parameters
props ({})
Instance Members

SearchReducer

The signature required from a reducer function provided to PleiarSearcher.search

SearchReducer

Type: function (accumulator: Array<lunrResult>, result: lunrResult): Array<lunrResult>

NutritionInfoEntry

A single element of nutritional info

NutritionInfoEntry
Properties
kcal (number)
name (string)
fluidML (number?)
protein (number?)

HandbookIndexRenderer

The Pleiar.no handbook index/list renderer

new HandbookIndexRenderer()

Extends React.PureComponent

Instance Members
recursiveRender(entry, suppressTitle)
renderWithAccordion(index, skipToplevelArticles, alwaysOpen)
renderAsUlList(index)

RFValuesList

This is an object that is used to build the union in RFValuesType. It is also used to build RFValues, which is probably what you're after.

RFValuesList

MarkdownExtendedLinkError

Error message handler for MarkdownExtendedLink

new MarkdownExtendedLinkError()

Extends React.PureComponent

TopSearch

The search bar on the top of all pages

new TopSearch(props: TopSearchProps)

Extends React.PureComponent

Parameters
props (TopSearchProps)
Instance Members
onChanged(ev)

Handle404

A 404 handler. Should be the last element of a <Switch></Switch>-block. Will slurp up anything that hasn't been handled by any of the Routes above it and display a 404 message.

new Handle404()

Extends React.Component

ToolsSection

Toplevel handler and router of everything under /verktoy

new ToolsSection()

Extends React.PureComponent

setNewsSpO2

Redux action. Sets the SpO2 value for the NEWS calculator

setNewsSpO2(SpO2: (string | null)): newsAction
Parameters
SpO2 ((string | null))
Returns
newsAction

PleiarSearcher

PleiarSearcher is the indexer for the entire site. It wraps lunr, performs indexing and lets you search this index. It also adds some automatic fuzzyness to the searcher, which gets applied if the search has no hits as-written.

PleiarSearcher
Static Members
_index()
_performAsyncImport()
_loadedData(data)
getResultFromRef(ref, metadata?)
search(expression, reducer?)
_safeSearch(expression, reducer?, expressionPreparer?)
_safeFuzzySearch(expression, reducer?)
_mkFuzzySearch(expression, fuzzyness)
safePartialSearch(expression, reducer?)

NutritionGroupsDataStructure

The data structrue for basicGroups

NutritionGroupsDataStructure

SomeDictEntries

Renders an array of elink erntries through a component, generating a nice readable list with either , or " og " separating the items, depending on where in the line they appear.

new SomeDictEntries()

Extends React.PureComponent

BPOptionList

A list of NEWSOptionItems

BPOptionList

Type: Array<NEWSOptionItem<BPValuesType>>

CalcExplanationDescription

The description of a calculation

new CalcExplanationDescription()

Extends React.PureComponent

ExternalResourcesProps

The props for ExternalResources

ExternalResourcesProps
Properties
search (string)
location (Location?)
onSearchUpdate (function (string): void)
onlyNorwegian (boolean)
onOnlyNorwegianToggle (function (): void)
onPageUpdate (function (number): void)

RFValuesType

Type for RF values

RFValuesType

Type: $Keys<any>

LabValueEntryCleartext

A component that renders a single lab value to a text box

new LabValueEntryCleartext()

Extends React.PureComponent

Instance Members
getMerknad()
expandMaterial()

ScrollToTopHelperProps

Props for ScrollToTopHelper

ScrollToTopHelperProps
Properties
location (Location)

NutritionDataStructure

The data structure for the entire datastructure

NutritionDataStructure
Properties
customLabel (string)

A special markdown link renderer that handles the special !component syntax. This syntax is fully documented in docs/ExtendedMarkdown.md

new MarkdownExtendedLink()

Extends React.PureComponent

Instance Members
extendedLinkNode()
extendedTypeLabValues(params)
extendedTypeDict(params)
extendedTypeHandbookIndexOpen(params)
extendedTypeHandbookIndexPlain(params)
extendedTypeYoutube(params)
extendedTypeVimeo(params)
internalLinkNode()

BPOptions

The options, score and explanation for the blood pressure parameter

BPOptions

Type: BPOptionList

OptionSelectorRadioButtons

This component is used by OptionSelector to render a set of options as radio buttons. This is considered an implementation detail of OptionSelector, and you should only use OptionSelector directly, never OptionSelectorRadioButtons. You can tell OptionSelector that you only want radio buttons.

new OptionSelectorRadioButtons()

Extends React.Component

Instance Members
render()

RoutingAssistantSyncRoutes

Helper component for the RoutingAssistant that handles updating the state for a single route. You should add this inside a <Route> for any route that you want to apply the routing assistant to

new RoutingAssistantSyncRoutes()

Extends React.Component

ScrollToTopHelper

A helper component that calls window.scrollTo(0,0) whenever the URL is updated. This is needed because the browser won't on its own scroll to the top. Note that his element accepts no children.

new ScrollToTopHelper()

Extends React.Component

Instance Members
componentDidUpdate(prevProps)

ExternalResources

Renders the full external resources page. Complete with a search field and infinite scroll.

new ExternalResources(props: ExternalResourcesProps)

Extends React.Component

Parameters
Instance Members
onChanged(str, forcedPush?)
getResources()

SpO2ValuesList

This is an object that is used to build the union in SpO2ValuesType. It is also used to build SpO2Values, which is probably what you're after.

SpO2ValuesList

HandbookPath

Represents a single path in the handbook. An array of path component strings.

HandbookPath

Type: Array<string>

MobileAbbrWordDefinition

This is a variant of WordDefinition that combines it with some of the functionality from MobileAbbreviation.

This will show "mobileText" on mobile, and "fullText" on larger screens. Both variants will use "definition" as their word definition.

Props:

  • mobileText: the text to display on small screens
  • fullText: the text to display on larger screens
  • definition: the definition, as you would have passed to WordDefinition
  • id: An id for the element
new MobileAbbrWordDefinition()

Extends React.PureComponent

ToolsSearchRenderer

Component that renders an entry from our ToolsList as a search result for global search. Used by WhateverRenderer

new ToolsSearchRenderer()

Extends React.PureComponent

setNewsConsciousness

Redux action. Sets the consciousness state value for the NEWS calculator

setNewsConsciousness(consciousness: string): newsAction
Parameters
consciousness (string)
Returns
newsAction

HandbookDataEntry

A single handbook page. Should generally not be referenced directly, but go through the HandbookEntry object.

HandbookDataEntry
Properties
toc (Array<string>)
content (string)
title (string)
path (HandbookPath)
public (boolean)
hideTOC (boolean?)
customURL (string?)
previous (HandbookPath?)
next (HandbookPath?)

AuthOverlay

Renders an authentication overlay, which requests that the user log in.

new AuthOverlay()

Extends React.PureComponent

CalcExplanationCalculation

The description of a calculation

new CalcExplanationCalculation()

Extends React.PureComponent

MedicationSynonymsResultUnconnected

The result renderer for medication synonyms

new MedicationSynonymsResultUnconnected()

Extends React.PureComponent

foundExchangeGroups

This is used to make sure we don't display a single exchangeGroup more than once

foundExchangeGroups

Type: Array<boolean>

SpO2ValuesType

Type for SpO2 values

SpO2ValuesType

Type: $Keys<any>

results

The list of matching medications with synonyms

results

Type: medSynonymResultList

RoutingAssistant

This is a helper object that assists with synchronizing state between the URL and the application

RoutingAssistant
Static Members
stateReset()
isManagedChange()
syncToStore(settings)
getAutoRenderElements()
_constructURL(root, search, renderElements, filter)
generatePush(root, search, renderElements, filter?)
generateReplace(root, search, renderElements, filter?)
generateReplaceNOW(root, search, renderElements, filter?)
push(URL)
replace(URL)
replaceNOW(URL)

resultsWithoutSynonyms

The list of matching medications without synonyms

resultsWithoutSynonyms

Type: medSynonymResultList

ConditionalRenderLoading

The component rendered while ConditionalRender waits for its condition to resolve.

new ConditionalRenderLoading()

Extends React.PureComponent

searchStr

The search string in lower case

searchStr

Type: string

HandbookDataStructure

The datastructure used to store the entire handbook

HandbookDataStructure
Properties
order (Array<string>)
title (string)
displayIndexLink (boolean?)
article (HandbookDataEntry?)
tree ({})

getTimeAsDecimal

Performs conversion of a set of minutes and hours to a decimal number. Also returns the s to describe the calculation, IF calculations are needed.

Returns: { description: Array, result: Number }

getTimeAsDecimal(hours: number, minutes: number, round: boolean): CalcResultWithExplanationLines
Parameters
hours (number)
minutes (number)
round (boolean)
Returns
CalcResultWithExplanationLines

MobileAbbreviationProps

Props for MobileAbbreviation

  • abbrev is the abbreviated string
  • full is the full string
  • id is a string to append to the ID we're going to use, it is completely optional
MobileAbbreviationProps
Properties
abbrev (string)
full (string)
id (string?)

searchElements

The search string split on whitespace into an array

searchElements

Type: Array<string>

toggleNewsAlternateO2Table

Redux action. Toggles use of the alternate O2 table for NEWS

toggleNewsAlternateO2Table(): newsAction
Returns
newsAction

fest

The FEST datastructure

fest

fest

The FEST datastructure

fest

pulseOptions

The options, score and explanation for the pulse parameter

pulseOptions

Type: pulseOptionList

hit

Iterate over all entries in FEST

hit

hit

hit is true if _searchMatch matched

hit

hit

A boolen that gets set to true if this entry matched

hit

Type: boolean

consciousnessValuesList

This is an object that is used to build the union in consciousnessValuesType. It is also used to build consciousnessValues, which is probably what you're after.

consciousnessValuesList

drug

This is the drug entry *

drug

drug

This is the drug entry *

drug

Type: FESTDrugEntry

SearchMetaEntryRenderer

Component that renders an externally indexed item as a search result for global search. Used by WhateverRenderer

new SearchMetaEntryRenderer()

Extends React.PureComponent

InlineAuthBlock

Renders a block of text usable as an "inline" paywall

new InlineAuthBlock()

Extends React.Component

MobileAbbreviation

This is an <abbr>-like component, which functions like <abbr> on steroids on mobile, while simply outputting the full text on desktops.

new MobileAbbreviation(props: MobileAbbreviationProps)

Extends React.PureComponent

Parameters
Instance Members
onToggleTooltip()

match

Perform the match to see if it hits

match

toggleNewsO2

Redux action. Toggles the O2 state for NEWS.

toggleNewsO2(): newsAction
Returns
newsAction

ToolListEntry

A single tool entry

ToolListEntry
Properties
path (string)
title (string)
description (string?)
keywords (string?)

exchangeGroup

Exchange groups for drug, if any

exchangeGroup

exchangeGroup

If we have no ATC code directly on the drug, fetch it from the synonyms list

exchangeGroup

exchangeGroup

Exchange groups for drug, if any

exchangeGroup

CalcExplanationFormula

The description of a calculation

new CalcExplanationFormula()

Extends React.PureComponent

OptionSelector

This renders a generic "option selector" element. This can be either a set of radio buttons, or a