Personnel Service
Overview
The personnel service is responsible for retrieving records from the PRSNL table.
To use this service, you must import the service, assign it to an object, execute a data collection operation (either with the load method on this or any other MPage Developer service, or with the MPage Service executeCCL method). Finally, you need to do something with the data you have retrieved.
Import
import {Component, inject, OnInit, ...etc...} from '@angular/core';
import {PrsnlService} from '@clinicaloffice/mpage-developer';
Object Assignment
Using the Angular inject command, assign the PrsnlService to a new object. It is recommended that you scope your object as "protected" to allow access to your component HTML.
@Component({...
...})
export class YourComponent implements OnInit {
protected prsnlService = inject(PrsnlService);
....remaining code...
Data Collection
The examples below demonstrate data collection methods you can use.
// Load the person record for the current patient default payload of "PERSON_MIN"
this.prsnlService.load('PRSNL_ALL', [{personId: 123456789}, {personId: 987654321}]);
// Use the MPage Service to load multiple payload items
// The loadExtendedPersons parameter on the person load will add the id's to be picked up by the prsnl service.
this.MPageService.executeCCL({
payload: {
patientSource: [{personId: 0, encntrId: 0}],
person: {
aliases: true,
prsnlReltn: true,
loadExtendedPersons: true
},
prsnl: {
aliases: true
}
});
Payload Options
The personnel service offers several payload options described in the following table.
| Property Name | Description |
|---|---|
| aliases | Collect information from the PRSNL_ALIAS table. |
| credential | Collect prsnl credential information. |
| loadExtendedPersons | If set to true, any personId found during the prsnl collection will be added to the prsnl source and the prsnl records for those associated persons will be collected. |
| orgReltn | Collect information from the PRSNL_ORG_RELTN table along with the organization name from the ORGANIZATION table. |
| prsnlGroup | Collect information from the PRSNL_GROUP_RELTN and PRSNL_GROUP tables. |
| prsnlPrsnlReltn | Collect information from the PRSNL_PRSNL_RELTN and PRSNL tables. |
| skipJSON | The skipJSON option allows skipping generating JSON output. This functionality is useful if you are creating a custom CCL script after everything else has run where you want to summarize specific information. |
Default Payload Tags that Reference the Personnel Service
| PRSNL_MIN | {
prsnl: true
}
|
| PRSNL_ALL | {
prsnl: {
aliases: true,
credential: true,
prsnlGroup: true,
orgReltn: true,
prsnlPrsnlReltn: true
}
}
|
| PRSNL_ALL_PLUS | {
prsnl: {
aliases: true,
credential: true,
prsnlGroup: true,
orgReltn: true,
prsnlPrsnlReltn: true,
loadExtendedPersons: true
}
}
|
Using Callbacks
Both the service load method and MPageService executeCCL methods offer a callback parameter as the final parameter. You can use this callback or another option of your choosing to work with the data returned from Cerner.
this.MPageService.executeCCL({
payload: {
...
}
}, () => { ...do something here... }
Accessing from HTML
The prsnl() or get() methods in the problem service can be accessed directly from HTML. The prsnl() method will return all loaded prsnl information for all personnel where the get() method returns a specific personnel record
<b>Attending:</b> {{ prsnlService.get(123456789)?.nameFullFormatted }}
Methods / Usable Objects
clear(personId: number): voidClears problems from memory for a specific personId. If 0 is passed as the personId, all problems for all patients are removed from memory.
get(personId: number): IPrsnl | undefinedIf loaded, the get method will return an IPrsnl record for the specified personId value.
has(personId: number): booleanDetermines if the personnel record has been loaded for a specific personId value.
length(): numberReturns a count containing the number of personnel values loaded in memory.
load( payload: any = 'PROBLEM_ACTIVE', patientSource: IPatientSource[] = [{personId: 0, encntrId: 0}], callback: any = undefined ): voidLoads problem information for patients identified in the patientSource array. The payload can be any valid payload string or default payload (see payload tab).
putLog(text: string, type: string = 'info', processId: number = -1, statusText: string = ''): voidWrites a line of text to the MPage Developer log. Valid values for type include 'info', 'error', 'payload', and 'debug'. You should only use the values 'info' or 'error' as 'payload' and 'debug' are reserved for system use. The processId and statusText values can safely be ignored.
prsnl(): Map<number, IPrsnl>Direct reference to the prsnl Map object.
values(): IterableIterator<IPrsnl>Returns an iterable iterator representation of all loaded personnel values.
Interfaces
IPrsnlSource {
personId: number;
}
IPrsnl {
personId: number,
begEffectiveDtTm: Date;
endEffectiveDtTm: Date;
prsnlType: string;
prsnlTypeCd: number;
nameFullFormatted: string;
email: string;
physicianInd: number;
position: string;
positionCd: number;
department: string;
departmentCd: number;
section: string;
sectionCd: number;
nameLast: string;
nameFirst: string;
username: string;
primAssignLoc: string;
primAssignLocCd: number;
physicianStatus: string;
physicianStatusCd: number;
logicalDomainGrpId: number;
logicalDomainId: number;
externalInd: number;
aliases: IPrsnlAlias[];
credential: IPrsnlCredential[],
prsnlGroup: IPrsnlGroup[],
prsnlPrsnlReltn: IPrsnlPrsnlReltn[],
prsnlOrgReltn: IPrsnlOrgReltn[]
}
IPrsnlAlias {
aliasPool: string;
aliasPoolCd: number;
prsnlAliasType: string;
prsnlAliasTypeCd: number;
alias: string;
aliasFormatted: string;
prsnlAliasSubType: string;
prsnlAliasSubTypeCd: number;
}
IPrsnlCredential {
credential: string;
credentialCd: number;
credentialType: string;
credentialTypeCd: number;
displaySeq: number;
idNumber: string;
renewalDtTm: Date;
state: string;
stateCd: number;
validFor: string;
validForCd: number;
}
IPrsnlGroup {
prsnlGroupId: number;
prsnlGroupR: string;
prsnlGroupRCd: number;
prsnlGroupType: string;
prsnlGroupTypeCd: number;
prsnlGroupName: string;
prsnlGroupDesc: string;
serviceResource: string;
serviceResourceCd: number;
prsnlGroupClass: string;
prsnlGroupClassCd: number;
}
IPrsnlPrsnlReltn {
prsnlPrsnlReltn: string;
prsnlPrsnlReltnCd: number;
relatedPersonId: number;
relatedPersonName: string;
relatedPersonPositionCd: number;
relatedPersonPosition: string;
}
IPrsnlOrgReltn {
organizationId: number;
confidLevel: string;
confidLevelCd: number;
orgName: string;
}