loadList Details
The EncounterService loadList method has been designed to offer the MPage developer a simple way of loading multiple encounters regardless of if the encounters being loaded are associated to the current patient being viewed in PowerChart.
The goal is to allow the developer complete flexibility in loading encounters while at the same time offering a solution that is simple to implement.
Required Parameters
-
script: string
Represents the name of the CCL script responsible for collecting encounters. The script name should be fully qualified with the group it was compiled with. It is recommended that all scripts be compiled as group1. (e.g. "1co_mpage_enc_list:group1")
-
parameters: any
A required JavaScript object that is unique to each CCL script. Please see the specific documenation for each script further down on this page.
-
clearPatientSource: boolean
A boolean value indicating whether the patientSource record structure should be cleared before executing the CCL script. The documentation shown below for each CCL script will indicate if the clearPatientSource will be used to restrict data collection to only personId records loaded in the patientSource object.
clearPatientSource limits results to personId values in patientSource if false. If set to true, only the date field type and date range along with any typeList values will be used for filtering.
Optional Parameters with Defaults
-
customId: string = ''
Represents a unique identification field used by the CustomService data service. If this field is populated with a value other than '' and you have an instance of CustomService running on the same page as the EncounterService, the CustomService Map will be loaded with data from the CCL script.
-
typeList: ITypeList = [{codeSet: 0, type: '', typeCd: 0}]
Contains an array of TypeList code values. The typeList parameter allows you the ability to pass additional TypeList values to the loadList method. These TypeList values will be appended to any typeList entries found in the payload being passed to the loadList method. A list of available typeList values are shown in the documentation for each CCL script discussed below.
-
payload: any = 'ENCOUNTER_LIST_MIN'
The payload field will accept any default payload tag name or a fully qualified JavaScript payload object. For information on formulating your own payload object, please see the mPageService documentation.
Please take note that the loadList method will create the appropriate "customScript" payload variable and append it to any payload being passed in the payload parameter.
The structure of the ENCOUNTER_LIST_MIN payload tag is:
{ payload: { encounter: {aliases: true}, person: {aliases: true}, typeList: [{codeSet: 4, type: 'MRN', typeCd: 0}] } }
If you wish to have the person data loaded into your MPage, you must also have the PersonService data service instantiated on your MPage.
-
patientSource: IPatientSource = [{personId: 0, encntrId: 0}]
The patientSource parameter defaults the current patient if the MPage is running from the chart level. If being run from the organizer level, no patient data is passed in the default. You can send multiple personId/encntrId object pairs in your patientSource.
Depending on the CCL script being executed, the patientSource may be erased if the the clearPatientSource parameter has been set to true.
Results
The following patientSource object is returned to the CustomService object if customId has been populated in the optional parameters.
{ visits: [{ personId: value, encntrId: value}] }
Available CCL Scripts
1CO_MPAGE_ENC_LIST:GROUP1Collect encounters by date range.
Parameters (Required unless specified below)
{ dateField: 'name of encounter date field (e.g. REG_DT_TM)', fromDate: Date, toDate: Date, organizations: [ {orgName: 'name of organization'} ] (Optional) }
Available typeList filtering value types
[ {codeSet: 19, type: 'EXPIRED', typeCd: 0}, // Discharge Disposition {codeSet: 69, type: 'INPATIENT', typeCd: 0}, // Encounter Type Class {codeSet: 71, type: 'INPATIENT', typeCd: 0}, // Encounter Type {codeSet: 34, type: 'CARDIOLOGY', typeCd: 0}, // Medical Service {codeSet: 220, type: 'SOUTH-1', typeCd: 0} // Nurse Unit ]1CO_MPAGE_CENSUS_LIST:GROUP1
Collect encounters by census. Will include only non-discharged patients.
Available typeList filtering value types
[ {codeSet: 69, type: 'INPATIENT', typeCd: 0}, // Encounter Type Class {codeSet: 220, type: 'SOUTH-1', typeCd: 0} // Nurse Unit ]