File

src/lib/services/sz-datamart.service.ts

Description

Service class used to get data from the poc server using the datamart api(s). Stores state of responses and provides getters and setters to create and manage parameters for an instance of #SzStatSampleSet Largely used for statistics charts like the record count Donut Graph and the #SzCrossSourceStatistics component used to browse sampleset results in a data table format.

Index

Properties
Methods
Accessors

Constructor

constructor(http: HttpClient, prefs: SzPrefsService, dataSourcesService: SzDataSourcesService, entityDataService: EntityDataService, statsService: SzStatisticsService)
Parameters :
Name Type Optional
http HttpClient No
prefs SzPrefsService No
dataSourcesService SzDataSourcesService No
entityDataService EntityDataService No
statsService SzStatisticsService No

Methods

Public createNewSampleSetFromParameters
createNewSampleSetFromParameters(statType: SzCrossSourceSummaryCategoryType, dataSource1?: string | undefined, dataSource2?: string | undefined, matchKey?: string, principle?: string, bound?: number, sampleSize?: number, pageSize?: number, unfilteredCount?: number)

Request a new sampleset from the parameters passed to the method. sampleset is initialized and kept in a local reference

Parameters :
Name Type Optional
statType SzCrossSourceSummaryCategoryType No
dataSource1 string | undefined Yes
dataSource2 string | undefined Yes
matchKey string Yes
principle string Yes
bound number Yes
sampleSize number Yes
pageSize number Yes
unfilteredCount number Yes
Returns : any
Public getCrossSourceStatistics
getCrossSourceStatistics(dataSource1?: string | undefined, dataSource2?: string | undefined, matchKey?: string)

get cross source summary statistics for datasource vs datasource from the api surface.

Parameters :
Name Type Optional
dataSource1 string | undefined Yes
dataSource2 string | undefined Yes
matchKey string Yes
Returns : any
Public getCrossSourceStatisticsByStatTypeFromData
getCrossSourceStatisticsByStatTypeFromData(statType: SzCrossSourceSummaryCategoryType, data: SzCrossSourceSummary)

get the type of stat matching the type from the cross source stat data response.

Parameters :
Name Type Optional
statType SzCrossSourceSummaryCategoryType No
data SzCrossSourceSummary No
Returns : Array | Array
Public getDataSourceDetails
getDataSourceDetails()

get the list of datasources with their datasource code and id's from the api surface

Returns : any
Public getDataSources
getDataSources()

get the list of datasources from the api surface

Returns : any
Public getLoadedStatistics
getLoadedStatistics()

get number of entity and records per datasource for each datasource from the api surface

Public getSummaryStatistics
getSummaryStatistics()
Returns : any
Public refreshSampleSet
refreshSampleSet()

refresh the sampleset data

Returns : void

Properties

Public _onSampleResultChange
Type : BehaviorSubject<[] | [] | undefined>
Default value : new BehaviorSubject<SzEntityData[] | undefined>(undefined)
Public onCountStats
Type : BehaviorSubject<SzLoadedStats | undefined>
Default value : new BehaviorSubject<SzLoadedStats>(undefined)

count stats are changes when a new sample set has responded and been scanned for how many records per column are present. If the result for a column is "0" then the column is displayed in a "collapsed" state.

Public onCrossSourceSummaryStats
Type : Subject<SzCrossSourceSummary | undefined>
Default value : new BehaviorSubject<SzCrossSourceSummary>(undefined)

when the count stats for a specific combination of "datasource1" vs "datasource2" are made available.

Public onDataSource1Change
Type : BehaviorSubject<string | undefined>
Default value : new BehaviorSubject<string | undefined>(undefined)

when the "from" data source selection changes in the preferences. the preference may change without changing the value of "datasource1" in the sampleset.

Public onDataSource2Change
Type : BehaviorSubject<string | undefined>
Default value : new BehaviorSubject<string | undefined>(undefined)

when the "to" data source selection changes in the preferences. the preference may change without changing the value of "datasource1" in the sampleset.

Public onDataSourceSelected
Default value : this._onDataSourceSelected.asObservable()

when either data source selection changes in the preferences. the preference may change without changing the value of "datasource1" in the sampleset.

Public onSampleDataSourceChange
Type : BehaviorSubject<sampleDataSourceChangeEvent | undefined>
Default value : new BehaviorSubject<sampleDataSourceChangeEvent | undefined>(undefined)

when "datasource1" or "datasource2" are changed for the sampleset.

Public onSampleMatchLevelChange
Type : BehaviorSubject<number | undefined>
Default value : new BehaviorSubject<number>(undefined)

when "matchLevel" for the sampleset is changed.

Public onSampleNoResults
Default value : this._onSampleNoResults.asObservable().pipe( filter((res) => { return res !== undefined; }), tap((res) => { console.log(`DataMartService._onSampleNoResults`, res); }) )

when the sampleset requested returns no results

Public onSamplePageChange
Default value : this._onSamplePageChange.asObservable().pipe( filter(r => r !== undefined), tap((r) => { //console.log(`the fuck? onSampleResultChange: `, r) }) )

when a page from the sample set has been updated or parameters have changed

Public onSampleRequest
Default value : this._onSampleRequest.asObservable().pipe( filter((res) => { return res !== undefined; }), distinctUntilChanged((prev, current) => { return prev !== current; }), tap((res) => { //console.warn(`DataMartService._onSampleRequest`, res); }) )

on new sample request being made.

Public onSampleResultChange
Default value : this._onSampleResultChange.asObservable().pipe( filter(r => r !== undefined), tap((r) => { //console.log(`the fuck? onSampleResultChange: `, r) }) )

when a new sample set has completed

Public onSampleTypeChange
Type : BehaviorSubject<SzCrossSourceSummaryCategoryType | undefined>
Default value : new BehaviorSubject<SzCrossSourceSummaryCategoryType>(undefined)

when "type" for the sampleset is changed. possible values are "MATCHES" | "AMBIGUOUS_MATCHES" | "POSSIBLE_MATCHES" | "POSSIBLE_RELATIONS" | "DISCLOSED_RELATIONS"

Public onSummaryStats
Type : BehaviorSubject<SzSummaryStats | undefined>
Default value : new BehaviorSubject<SzSummaryStats>(undefined)

when "matchLevel" for the sampleset is changed.

Public prefs
Type : SzPrefsService

Accessors

dataSource1
getdataSource1()

get the "from" datasource assigned from the pulldowns

setdataSource1(value: string)

set the "to" datasource assigned from the pulldowns

Parameters :
Name Type Optional
value string No
Returns : void
dataSource2
getdataSource2()

get the "from" datasource assigned from the pulldowns

setdataSource2(value: string)

get the "to" datasource assigned from the pulldowns

Parameters :
Name Type Optional
value string No
Returns : void
doNotFetchSampleSetOnParameterChange
setdoNotFetchSampleSetOnParameterChange(value: boolean)

whether or not the sampleset object automatically creates a new request when primary(datasources, matchLevel) or filtering(pageIndex, principle) parameters change

Parameters :
Name Type Optional
value boolean No
Returns : void
loadedStatistics
getloadedStatistics()

get the statistics for how many records from which datasources have beeen loaded

Returns : SzLoadedStats | undefined
summaryStatistics
getsummaryStatistics()
dataSources
getdataSources()
dataSourceDetails
getdataSourceDetails()
matchKeyCounts
getmatchKeyCounts()

we store the last known match key counts for present selection for filtering menu

setmatchKeyCounts(value: SzCrossSourceCount[])

we store the last known match key counts for present selection for filtering menu

Parameters :
Name Type Optional
value SzCrossSourceCount[] No
Returns : void
sampleDataSource1
getsampleDataSource1()

get the "from" datasource name assigned to the sample set instance

setsampleDataSource1(value: string)

set the "from" datasource name assigned to the sample set instance

Parameters :
Name Type Optional
value string No
Returns : void
sampleDataSource2
getsampleDataSource2()

get the "to" datasource name assigned to the sample set instance

setsampleDataSource2(value: string)

set the "to" datasource name assigned to the sample set instance

Parameters :
Name Type Optional
value string No
Returns : void
sampleMatchLevel
getsampleMatchLevel()

get the matchLevel assigned to the sample set instance

setsampleMatchLevel(value: number)

set the matchLevel assigned to the sample set instance. will trigger new sampleset request if different from current one.

Parameters :
Name Type Optional
value number No
Returns : void
sampleSetPageSize
getsampleSetPageSize()

get the page size assigned to the sample set instance

setsampleSetPageSize(value: number)

set the page size assigned to the sample set instance

Parameters :
Name Type Optional
value number No
Returns : void
sampleSetBound
getsampleSetBound()

get the bound assigned to the sample set instance. this is either the "{entityId}" OR the combo "{entityId}:{relatedId}" that the sampleset ends/begins with.

Returns : string
setsampleSetBound(value: string)

set the bound assigned to the sample set instance. this is either the "{entityId}" OR the combo "{entityId}:{relatedId}" to start/end at.

Parameters :
Name Type Optional
value string No
Returns : void
sampleSetBoundType
getsampleSetBoundType()

get the boundType assigned to the sample set instance. possible values are "INCLUSIVE_LOWER" | "EXCLUSIVE_LOWER" | "INCLUSIVE_UPPER" | "EXCLUSIVE_UPPER"

Returns : SzBoundType
setsampleSetBoundType(value: SzBoundType)

set the boundType assigned to the sample set instance. possible values are "INCLUSIVE_LOWER" | "EXCLUSIVE_LOWER" | "INCLUSIVE_UPPER" | "EXCLUSIVE_UPPER"

will trigger new sampleset request if different from current one.

Parameters :
Name Type Optional
value SzBoundType No
Returns : void
sampleSetMatchKey
getsampleSetMatchKey()

get the matchKey assigned to the sample set instance

Returns : string
setsampleSetMatchKey(value: string)

set the matchKey assigned to the sample set instance. will trigger new sampleset request if different from current one.

Parameters :
Name Type Optional
value string No
Returns : void
sampleSetPage
setsampleSetPage(value: number)

set the current page index assigned to the sample set instance

Parameters :
Name Type Optional
value number No
Returns : void
sampleSetPrinciple
getsampleSetPrinciple()

get the principle assigned to the sample set instance

Returns : string
setsampleSetPrinciple(value: string)

set the principle assigned to the sample set instance

Parameters :
Name Type Optional
value string No
Returns : void
sampleStatType
getsampleStatType()

get the statType assigned to the sample set instance possible values are "MATCHES" | "AMBIGUOUS_MATCHES" | "POSSIBLE_MATCHES" | "POSSIBLE_RELATIONS" | "DISCLOSED_RELATIONS"

setsampleStatType(value: SzCrossSourceSummaryCategoryType)

set the statType assigned to the sample set instance possible values are "MATCHES" | "AMBIGUOUS_MATCHES" | "POSSIBLE_MATCHES" | "POSSIBLE_RELATIONS" | "DISCLOSED_RELATIONS"

Parameters :
Name Type Optional
value SzCrossSourceSummaryCategoryType No
Returns : void
sampleSetUnfilteredCount
getsampleSetUnfilteredCount()

the number of results in the sampleset prior to filter parameters being applied.

Returns : number
setsampleSetUnfilteredCount(value: number)

the number of results in the sampleset prior to filter parameters being applied.

Parameters :
Name Type Optional
value number No
Returns : void

results matching ""

    No results matching ""