ProblemService
The ProblemService is used to retrieve problems and problem comments from Cerner.
Import
The ProblemService should be imported and initialized in the component source that is responsible for displaying data from the service. Alternatively, if you have your required payload information available, you can initialize the loading of your data in the app.component.ts source.
V4+ import { ProblemService } from '@clinicaloffice/clinical-office-mpage-core'; < V3 import { ProblemService } from '@clinicaloffice/clinical-office-mpage';
Initialization
Once you have imported the ProblemService, you need to inject it into your component and assign it to a variable. This is done through the constructor of your component (or the app.component.ts file).
export class myComponent implements OnInit { constructor(public problemService: ProblemService) { } }
Initialization can be performed one of three ways.
-
In the ngOnInit() method of your app.component.ts or component file through a payload tag and direct
call to the mPageService executeCCL method.
ngOnInit() { this.mpage.executeCCL({ payload: { patientSource: [{personId: 0, encntrId: 0}], problem: {} } } }
-
Call the ProblemService load method from the ngOnInit() method of your app.component.ts or component file.
ngOnInit() { problem.load(); }
-
Executed dynamically from your HTML with the ProblemService get method.
<p>Patient Problems:</p> <ol *ngFor="let prob of problem.get();" > <li>{{ prob.annotatedDisplay }}</li> </ol>
Methods
clear(
personId: number = this.mpage.personId): void
Clears problems from memory for a specific personId. If 0 is passed as the personId, all problems are
removed from memory.
get(
personId: number = this.mpage.personId,
payload: any = 'PROBLEM_ACTIVE'): IProblem[]
Returns problems for the specified personId. If the problems for the person have not been loaded, they will
be queued up and loaded.
load(
payload: any = 'PROBLEM_ACTIVE',
patientSource: any[] = [{personId:0, encntrId:0}]): void
Loads problem information for the provided patientSource. The payload can be
any valid payload string or default payload (see payload tab).
putLog(message: string): void
Outputs the content of the message parameter to the activity log component.
typeList Filtering
You can limit the amount of data collected in CCL by optionally adding a typeList object to your payload. For example, if you only wanted to load "ACTIVE" problems for patients and you never plan on using the other types, simply add a typeList entry for code set 12030 to your payload. Simply include the codeSet value, type or typeCd where type represents a cdf_meaning or display_key value and typeCd represents the actual code value you want to filter by. Additionally you can also filter on code set 400 to limit the problems to specific nomenclature source vocabularies.
{ payload: { patientSource: [{personId: 0, encntrId: 0}], problem: {}, typeList: [{codeSet: 12030, type: 'ACTIVE', typeCd: 0}] } }
Public Variables
The ProblemService exposes the following variable that can be useful in the development of your MPages.
- problems: iProblems[] - Array containing patient problem values.
Payload
The following payload options represent all available payload values for the ProblemService.
{ payload: { patientSource:[ {personId: value, encntrId:value} ], problem: { comments: true }, typeList: [ {codeSet: 400, type: 'value', typeCd: value}, {codeSet: 12030, type: 'value', typeCd: value} ] } }
Default Payload Tags
The following default payload tags have been defined for use in your MPages.
PROBLEM_ALL
problem: { comments: true }
PROBLEM_ACTIVE
problem: { comments: true } typeList: [ {codeSet: 12030, type: 'ACTIVE', typeCd: 0} ]
Interfaces
IProblem
export interface IProblem { personId: number; problemInstanceId: number; problemId: number; nomenclatureId: number; probSourceString: string; probSourceIdentifier: number; probSourceVocab: string; problemFtDesc: string; estimatedResolutionDtTm: Date; actualResolutionDtTm: Date; classification: string; persistence: string; confirmationStatus: string; lifeCycleStatus: string; lifeCycleStatusMeaning: string; lifeCycleDtTm: Date; onsetDt: string; onsetDtTm: Date; ranking: string; certainty: string; probability: number; personAware: string; prognosis: string; personAwarePrognosis: string; familyAware: string; sensitivity: number; course: string; cancelReason: string; onsetDtFlag: number; statusUpdtPrecision: string; statusUpdtFlag: number; statusUpdtDtTm: Date; qualifier: string; annotatedDisplay: string; severityClass: string; severity: string; severityFtDesc: string; lifeCycleDt: string; lifeCycleDtFlag: number; problemTypeFlag: number; laterality: string; originatingNomenclature: number; origProbSourceString: string; origProbSourceIdentifier: number; origProbSourceVocab: string; probSourceVocabCd: number; classificationCd: number; persistenceCd: number; confirmationStatusCd: number; lifeCycleStatusCd: number; onsetDtCd: number; rankingCd: number; certaintyCd: number; personAwareCd: number; prognosisCd: number; personAwarePrognosisCd: number; familyAwareCd: number; courseCd: number; cancelReasonCd: number; statusUpdtPrecisionCd: number; qualifierCd: number; severityClassCd: number; severityCd: number; lifeCycleDtCd: number; lateralityCd: number; origProbSourceVocabCd: number; comments: IProblemComment[]; }
IProblemComment
export interface IProblemComment { commentDtTm: Date; commentPrsnlId: number; comment: string; }