Here are some examples of what I’m talking about. I commented the warnings in the code below.
/**
* @properties={typeid:24,uuid:"2D692FDE-141C-4B8F-9D3D-AD794133FFB4"}
*/
function Batch_Master()
{
//Declare Variables
var rowCount;
var selectedNodes;
var nextID;
var row;
forms.Dev_charge_transactions.encounter_id = forms.Ledger_List.encounterID;
forms.Dev_charge_transactions.ledger_id = forms.Ledger_List.ledgerID;
forms.Dev_charge_transactions.ledger_charge_id
forms.Dev_charge_transactions.ledger_code
forms.Dev_charge_transactions.ledger_type
forms.Dev_charge_transactions.transaction_amount
forms.Dev_charge_transactions.transaction_type
forms.Dev_charge_transactions.transaction_description
forms.Dev_charge_transactions.transaction_date
// get the selected encounter and add the charge
selectedNodes = forms.Ledger_List.elements.treeview.getSeletedNodes(); //Warning: The function getSeletedNodes() is undefined in this script
rowCount = globals.g_Ledger_Tree_DS.getMaxRowIndex(); //Warning: The function getMaxRowIndex() is undefined in this script
if(selectedNodes.length > 0)
{
nextID = rowCount + 1;
globals.g_Ledger_Tree_DS.addRow([nextID, selectedNodes[0], utils.dateFormat(new Date(),'MM/dd/yyyy'), //Warning: The function addRow() is undefined in this script
forms.CPT_Add_Charge_Results.ledger_code, forms.CPT_Add_Charge_Results.description, 'INS',
forms.CPT_Add_Charge_Results.cost, null, (forms.CPT_Add_Charge_Results.fee * units), null, null, null,
dataset.getValue(1,1), forms.CPT_Add_Charge_Results.cpt_code, 'resultset_next.png',false]);
//Update the total charges for the encounter
row = globals.getRowForId(selectedNodes[0]);
}
}
/**
* @properties={typeid:24,uuid:"45AF5061-DC5D-4995-836E-8866CC65D16B"}
*/
function onNodeExpanded()
{
//Change the width of column 4 when the node is expanded
elements.treeview.setColumnWidth('column4', 350); //Warning: The function setColumnWidth() is undefined in this script
//clear selected node because when nodes are expanded the selected node doesn't change correctly
elements.treeview.setSelectedNodes(null); //Warning: The function setSelectedNodes() is undefined in this script
encounterID = null;
ledgerID = null;
}
In the next example snippet I pass values to a form created in the solution model.
/**
* Perform the element default action.
*
* @param {JSEvent} event the event that triggered the action
*
* @properties={typeid:24,uuid:"C80BB915-3BE3-4086-96E9-61390F916347"}
*/
function Select_Check(event)
{
//Declare Variables
var query;
var dataset;
var bID = batch_id;
var bcIns;//Batch check insurance
var chIns;//charge insurance
var pressedButton;
var test;
//Pass the insurances from the batch check and the charge
bcIns = carrier_code;
chIns = forms["Charge1"].applicable_ins_code;
//If the insurances don't match, show dialog to confirm whether or not to continue
if(bcIns != chIns)
{
//Dialog
pressedButton = plugins.dialogs.showQuestionDialog("Insurance Mismatch","The insurance code for the batch check and the primary insurance code for the \
encounter do not match.","OK","Cancel");
//If the mismatch is OK
if(pressedButton === "OK")
{
//query to see if unposted_amount is populated for the selected batch
query = "Select unposted_amount from batch where batch_id = ?";
dataset = databaseManager.getDataSetByQuery(databaseManager.getDataSourceServerName(controller.getDataSource()),query,[bID],1);
//Pass values to Payment Detail form
forms["Detail_Body"].batchAmount = check_amount; //Warning: The property batchAmount is undefined for the type Form
forms["Detail_Body"].batchCheckNum = check_number; //Warning: The property batchCheckNum is undefined for the type Form
forms["Detail_Body"].batchCkIns = carrier_code; //Warning: The property batchCkIns is undefined for the type Form
forms["Detail_Body"].batchDate = date_received; //Warning: The property batchDate is undefined for the type Form
forms["Detail_Body"].batchID = bID; //Warning: The property batchID is undefined for the type Form
I know I need to declare strings, numbers, etc like so:
/**
* @param {JSEvent} event the event that triggered the action
* @param {String} test1
* @param {Number} test2
*
* @properties={typeid:24,uuid:"BA550780-2730-456A-A4B9-19009909582A"}
*/
function My_Function(event,test1,test2)
{
}
When you type @param {} and hit Ctrl+Space for code completion between the the brackets({}), the list is quite long. Is there a reference for that list? I want to make sure I’m doing things correctly.I also would like to know when and how to correctly use /** @type {JSComponent}/, /** @type {BaseComponent}/, etc.
Thanks for your help