Precision Healthcare Solutions
CLINICAL OFFICE MPAGE SUITE DEVELOPER REPORTS DESIGNER shopping_cart mail
SALES CONTACT US
Getting StartedCerner SetupDeveloper PC SetupGitHub Project TemplatesFull Page DeploymentWorkflow ComponentsComponents & DirectivesButtonConfirm DialogDate Range PickerDrop-DownEmbedded WorkflowIconInputLogOptional TitlePatient SearchPrevent ScrollRadio ButtonsRemaining Screen SpaceResize ObserverScroll BarSelectTabbed MenuTableTreeModels & ServicesAddressAllergyCerner FunctionsCode ValueConfigCustom Custom Data DMInfoDiagnosisDialogEncounterLicenseMPageOrganizationPersonPersonnelPhoneProblemReferenceUtility

Diagnosis Service

Overview

The DiagnosisService is used to retrieve visit diagnosis data from Cerner.

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 {DiagnosisService} from '@clinicaloffice/mpage-developer';

Object Assignment

Using the Angular inject command, assign the ProblemService 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 diagnosisService = inject(DiagnosisService);
    ....remaining code...

Data Collection

The examples below demonstrate data collection methods you can use.

// Load the diagnosis for the current patient default payload of "DIAGNOSIS_FINAL"
this.diagnosisService.load();

// Use the MPage Service to load multiple payload items
this.MPageService.executeCCL({
    payload: {
        patientSource: [{personId: 0, encntrId: 0}],
        person: true,
        diagnosis: true
});

Payload Options

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.

{
    diagnosis: {
        skipJSON: true
    }
}

Default Payload Tags that Reference the Diagnosis Service

DIAGNOSIS_ALL
{
    diagnosis: true
}
DIAGNOSIS_FINAL
{
    diagnosis: true,
    typeList: [
        {codeSet: 17, type: 'FINAL', typeCd: 0}
    ]
}

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 diagnoses() or get() methods in the diagnosis service can be accessed directly from HTML. The diagnoses() method will return all loaded diagnosis information for all patients where the get() method returns an array of diagnosis values for a specific person id.

<b>Diagnosis:</b>
<ul>
@for (diagnosis of diagnosisService.get(); track diagnosis) {
    <li>{{ diagnosis.dxSourceString }}</li>
}
</ul>

Methods / Usable Objects

clear(encntrId: number): void

Clears diagnosis from memory for a specific encntrId. If 0 is passed as the encntrId, all problems for all visits are removed from memory.

diagnoses(): IDiagnosis[]

Returns and array of all loaded IDiagnosis values.

get(encntrId: number): IDiagnosis[]

Returns array of diagnosis values by encntrId.

length(): number

Returns a count containing the number of diagnosis values loaded in memory.

load( payload: any = 'DIAGNOSIS_FINAL', patientSource: IPatientSource[] = [{personId: 0, encntrId: 0}], callback: any = undefined ): void

Loads diagnosis 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 = ''): void

Writes 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.

values(): IterableIterator<IDiagnosis>

Returns an iterable iterator representation of all loaded diagnosis values.

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 only "FINAL" diagnoses for visits and, you never plan on using the other types, simply add a typeList entry for code set 17 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 nomenclature to a specific source vocabulary.

{
    payload: {
        patientSource [{personId: 0, encntrId: 0}],
        diagnosis: true,
        typeList: [
            {codeSet: 400, type: 'CPT4', typeCd: 0}
            {codeSet: 12030, type: 'ACTIVE', typeCd: 0}
        ]
    }
}

Interfaces

IDiagnosis {
  personId: number;
  encntrId: number;
  diagnosisId: number;
  nomenclatureId: number;
  dxSourceString: string;
  dxSourceIdentifier: string;
  dxSourceVocab: string;
  diagDtTm: Date;
  diagType: string;
  diagTypeMeaning: string;
  diagnosticCategory: string;
  diagPriority: number;
  diagPrsnlId: number;
  diagPrsnlName: string;
  diagClass: string;
  confidLevel: string;
  attestationDtTm: Date;
  diagFtDesc: string;
  modNomenclatureId: number;
  modSourceString: string;
  modSourceIdentifier: string;
  modVocab: string;
  diagNote: string;
  conditionalQual: string;
  clinicalService: string;
  confirmationStatus: string;
  classification: string;
  severityClass: string;
  certainty: string;
  probability: number;
  diagnosisDisplay: string;
  severityFtDesc: string;
  longBlobId: number;
  ranking: string;
  severity: string;
  diagnosisGroup: number;
  clinicalDiagPriority: number;
  presentOnAdmit: string;
  hacInd: number;
  laterality: string;
  originatingNomenclatureId: number;
  origDxSourceString: string;
  origDxSourceIdentifier: number;
  origDxSourceVocab: string;
  dxVocabCd: number;
  diagTypeCd: number;
  diagnosticCategoryCd: number;
  diagClassCd: number;
  confidLevelCd: number;
  modVocabCd: number;
  conditionalQualCd: number;
  clinicalServiceCd: number;
  confirmationStatusCd: number;
  classificationCd: number;
  severityClassCd: number;
  certaintyCd: number;
  rankingCd: number;
  severityCd: number;
  presentOnAdmitCd: number;
  lateralityCd: number;
  origDxSourceVocabCd: number;
}
<< Prev:  DMInfo
Next: Dialog >>
Copyright © 2026 Precision Healthcare Solutions