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

Custom Service - Custom Data

Overview

The custom data service has been designed to allow simple access to read and write functionality of the CUST_CO_REFERENCE table, or an optional custom table of your design.

CUST_CO_REFERENCE

The CUST_CO_REFERENCE table has been designed to allow the storage of virtually any size of data content. Using a zvc32000 field called ref_text, the CCL code supporting CUST_CO_REFERENCE dynamically sizes, splits and joins data rows to make storage and retrieval of large content simple. You can store any reference content you wish from complex JSON documents to images.

The CUST_CO_REFERENCE table must be created in your domain before usage. Coverage of creating the CUST_CO_REFERENCE table in your Cerner domain can be found in our Cerner Setup documentation.

CUST_CO_REFERENCE Table Definition

ref_id              = f8
ref_name            = vc40
ref_task            = vc40
description         = vc100
parent_entity_id    = f8
parent_entity_name  = vc32
sequence            = i4
ref_text            = zvc32000
active_ind          = i4
create_prsnl_id     = f8
create_dt_tm        = dq8
updt_id             = f8
updt_dt_tm          = dq8
beg_effective_dt_tm = dq8
end_effective_dt_tm = dq8

CUST_CO_REFERENCE Indexes

  • ref_id (primary key, unique)
  • ref_name, ref_task, parent_entity_id, sequence
  • updt_dt_tm, updt_id

Import

import {Component, inject, OnInit, ...etc...} from '@angular/core';
import {CustomService} from '@clinicaloffice/mpage-developer';

Object Assignment

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

Methods / Usable Objects

executeCustomDataAction(id: string, actionType: string, action: string, data: ICustomReference | ICustomReference[], callback: any = undefined): void

Executes a read/write/delete action on the CUST_CO_REFERENCE table or your own custom table.

  • id: string

    The id parameter represents the name which your data will be stored under in the CustomService service. Passing a value of '' will result in no data being returned back to the MPage. Omitting this value will typically only be used during a write or delete action if you do not desire to have data returned.

  • actionType: string

    Action type must have a value of 'reference' if using the CUST_CO_REFERENCE table. If using your own table, pass in the name of your table driver script (e.g. '1my_custom_table_script:group1').

  • action: string

    There are five possible action values which are:

    • r - read
    • ra - read all including inactive
    • w - write
    • i - inactivate
    • d - delete
  • data: ICustomReference | ICustomReference[]

    The data parameter represents the data being applied to your custom data call.

    interface ICustomReference {
      refName: string;
      refTask: string;
      description?: string;
      parentEntityId?: number;
      parentEntityName?: string;
      refText?: string;
    }
  • callback: any = undefined

    The optional callback method allows calling code immediately after execution of the IO action has occurred.

  • Usage Examples

    Read Example

    This example issues a read request to the CUST_CO_REFERENCE table that will return an array of ICustomReferenceData objects for any row that contains a ref_name value of 'My Custom Project Name' and a ref_task value of 'lab tests'. The callback simply sends the output to the console.

    this.customService.executeCustomDataAction('labtests', 'reference', 'r', { refName: 'My Custom Project Name', refTask: 'lab tests' }, (() => {
        console.log(this.customService.get('labtests'))
    }));

    Write Example

    In this example, we are writing two rows of preference data specific to the current user.

    this.customService.executeCustomDataAction('userprefs', 'reference', 'w',
            [
                { refName: 'My Custom Project Name',
                  refTask: 'pref colors',
                  description: 'User Colors',
                  parentEntityId: this.MPage.prsnlId,
                  parentEntityName: 'PRSNL',
                  refText: JSON.stringify(this.userColors)
                },
                { refName: 'My Custom Project Name',
                  refTask: 'favourites',
                  description: 'Favourite Forms',
                  parentEntityId: this.MPage.prsnlId,
                  parentEntityName: 'PRSNL',
                  refText: JSON.stringify(this.forms)
                }
            ],
            (() => { }));

    Using your own custom tables

    If you wish to make use of executeCustomDataAction method with your own custom tables, you will need to create your own CCL script to handle the read, write and delete operations. Triggering your script is handled by passing in your executable script name in place of the word "reference" in the actionType parameter.

    The CCL script that supports the CO_CUSTOM_REF table is called 1co5_mpage_ref_data. It makes use of another script called 1co5_mpage_ref_data_lib which is responsible for the database actions.

    Your custom table will have a completely different layout from CO_CUSTOM_REF, however the basic logic needed to perform these actions can be derived from the scripts above.

    Interfaces

    ICustomReference {
      refName: string;
      refTask: string;
      description?: string;
      parentEntityId?: number;
      parentEntityName?: string;
      refText?: string;
    }
    ICustomReferenceActions {
      id: string;
      action: string;
      data: ICustomReference[];
    }
    ICustomReferenceData extends ICustomReference {
      createPrsnlId: number;
      createPrsnlName: string;
      createDtTm: Date;
      activeInd: boolean;
      updtId: number;
      updtName: string;
      updtDtTm: Date;
      begEffectiveDtTm: Date;
      endEffectiveDtTm: Date;
    }
    << Prev: Custom
    Next:  DMInfo >>
Copyright © 2026 Precision Healthcare Solutions