cdd_updateForm

Purpose:

Updates the Form record

Service Parameters (json array)

  • serviceName (string) = “dictionary”
  • function (string) = “cdd_updateForm”

Parameters

  • mode (string) = update, create
  • dataElement (string ) = column name to update (not required for create)
  • value (string) = value (not required for create)

  • Results (json array)

    • Status (string).  (“0″=Success, “1”=Not Successful)
    • statusMessage (string) (“Empty”,”Results”)
    • data (json array) (the results if not empty)

    Example

    Click here for an example.

ccb_mkDataGridControl

Purpose:

For a given scope defined by the Keys parameters, this service generates a page through multiple calls to the cdd_makeDataControl service to render all the forms from the resulting query.

When a form is 1 to 1 (ie: only one occurrence, for example Contact Info), the service renders a update-able form as defined in the configuration.

When a form is 1 to many (ie: repeating occurrences, for example Dependents), the service renders a read only sort-able table where any row can be expanded to an update-able detail form.
array)

Service Parameters

  • serviceName (string) = “ux”
  • function (string) = “ccb_mkDataGridControl”

Key Parameters (json array)

Defines the scope of the query to the client data. For example, if only the ClientID key was provided, the query will return all the client’s active forms. If the ClientID and FileID’s were provided, only the active forms the client’s file will be returned. If the ClientID, FileID an ID was provided, only that single form will be returned.

  • ClientID (string) Mandatory
  • FileID (string)
  • FormID (string)
  • ID and/or FollowupID. Unique id of the form (string)

Search Parameters (json array)

  • Saved for future use

Plugin Directory Parameter

  • Directory of the plugin so the the server can generate links to the css/images folder

UX Parameters (json array)

Refer to the  cdd_makeDataControl for the key value pairs of available UX Parameters but preface the parameter key with an ID and a “;” .

  • For a specific data element, inspect the default form and preface the UX parameter key with the data element name.
  • For a form, inspect the default form for the form id (usually found as found by inspecting the Field Set’s ID.
  • For a specific 1 to many form (sortable table), inspect the default form and preface the UX Parameter key with the table number portion of the fieldset’s ID.

The following parameters are the most commonly used cdd_makeDataControl ux parameters .

  • allow_update
  • code_lookup_type
  • js_function
  • css_class
  • css_style
  • label_type
  • other_label

Notes:

Place the custom javascript functions in the plugin’s ajax.js file.

Place the custom css classes in the plugin’s style.css file.

To meet a given requirement, where there no ID on the default form, tell the back end developer where you want the span to start and to end, and refresh the form to get it’s ID.

Results (json array)

  • Status (string).  (“0″=Success, “1”=Not Successful)
  • statusMessage (string) (“Empty”,”Results”)
  • data (json array) (the results if not empty)

ccb_uxWebControl_v0.1

Purpose:

Generate the applicable data control for data element based on it’s content value from the CDD (ie: saved to the data base and not value on the web page) , dictionary settings and developer’s UX parameters.

Service Parameters (json array)

  • serviceName (string) = “ccbUX”
  • function (string) = “ccb_uxWebControl_v0.1”

Data Element Parameter (json array)

  • The CDD name of the Data Element

Data Value Parameter (json array)

  • If the allow_update parameter is set to True, provide  value from the Pages’s POST values.

Key Parameters (json array)

Content Scope

Scope Required Parameters
No content
  • null
Client
  • clientID (string)
Specific Event
  • clientID (string)
  • FollowupID (string)
  • FollowupFormID (string)

Notes regarding Content Scope

  • If the page has multiple forms, one of the following combinations are required: FollowupFormID  or the unique_id parameters (see below) is required.
  • To reduce the number of times cdd_getDataElements is called per page, for performance reasons, if the web page has more than one control based on the same data, it is preferable for the developer to call cdd_getDataElements once per page and pass the results as Data Parameter for each control.
  • If Key Parameters are provided, the function uses cdd_getDataElements to retrieve the key value pairs of the data elements and sets the controls data value accordingly.
  • If Key Parameters are not provided, the function does not set the value.

Data Values (json array)

  • Key Value pairs of DataElements and it’s value.

UX Parameters (json array)

Parameter Name Purpose Type Default Options Purpose
allow_update  Allows update Boolean False True Creates a control that allows user input.
return_oldest_value Override the CCB’s default to return the most recent value. Boolean False True To return the first value of the element.
code_lookup_type  To set the type of HTML control when the dataelement isCodeLookup = True String text  option Option list
    String   select Select list
    String   radio radio button group
    String   buttonarea  
    String   checkbox  
num_cols  If the code_lookup_type is set to a radio or checkbox, controls are horizontal. Number 1  2,3,4,… Arranges the control horizontally.
add_zero_row   Boolean      
js_function  javascript String null  Custom java script  
css_class   String      
css_label css_label String label_1 Custom CSS  
css_data CSS name for the data portion of the control String data_1 Custom CSS  
css_style Style for the control String null Custom style  
bold_label_ind   Boolean      
label_type  Override label/data left to right String none No label  
other_label  Override the default Label_Med value in the dictionary String Custom label    
textarea_cols   Number      
textarea_rows   Number      
textarea_nl2lf   Boolean      
in_widget_ind  overrides the default 600ox width of a text area Boolean False True Width=350
img_height   Number      
is_id_name_unique Handles web pages with more than 1 dataset and possible name collisions with javascript and jquery references to it’s ID and Name Boolean False True Provide an optional id_name (below)
 id_name Overrides the default unique ID name String      

Notes

Results (json array)

  • Status (string).  (“0″=Success, “1”=Not Successful)
  • statusMessage (string) (“Empty”,”Results”)
  • data (json array) (the results if not empty)

Example

Click here for an example.

cdd_getProcessList

Purpose:

Gets a list of processes.

Parameters (json array)

  • serviceName (string) = “dataDictionary”
  • function (string) = “cdd_getProcessList”

Notes

  • O

Results (json array)

  • Status (string).  (“0″=Success, “1”=Not Successful)
  • statusMessage (string) (“Empty”,”Results”)
  • data (json array) (the results if not empty)

Example

Click here for an example.

cdd_getDatasetELementList

Purpose:

Gets a list of elements in a dataset.

Parameters (json array)

  • serviceName (string) = “dataDictionary”
  • function (string) = “cdd_getDatasetELementList”
  • Dataset ID (string)

Notes

  • O

Results (json array)

  • Status (string).  (“0″=Success, “1”=Not Successful)
  • statusMessage (string) (“Empty”,”Results”)
  • data (json array) (the results if not empty)

Example

Click here for an example.

ccb_getDatasetList

Purpose:

Gets a list of data sets.

Parameters (json array)

  • serviceName (string) = “dataDictionary”
  • function (string) = “cdd_getDatasetList”
  • codeID(string)

Notes

  • O

Results (json array)

  • Status (string).  (“0″=Success, “1”=Not Successful)
  • statusMessage (string) (“Empty”,”Results”)
  • data (json array) (the results if not empty)

Example

Click here for an example.

cdd_getCodeValue

The webServiceURL= The worksheetURL=https://contentbroker.ca/api-example/ Press here to see an example.

Purpose:

Gets the value of a given codeValueID.

Service Parameters (json array)

  • serviceName (string) = “content”
  • function (string) = “ccb_getCodeValue”

Key Parameters

  • codeValueid (string) Required

Notes

  • If a FollowupID is provided, the service returns the elements for that event only.
  • Data Parameters

    A the value of the codeValueID.

  • Results (json array)

    • Status (string).  (“0″=Success, “1”=Not Successful)
    • statusMessage (string) (“Empty”,”Results”)
    • data (json array) (the results if not empty)
function getCodeValue_example(){ 
       $rm_options = get_option('ccb_option_name');    
  ?>
        <br><strong><a href="<?php echo $_GET['returnURL'];?>">Back</a></strong><p>
      <?php  
      
    try {  
        
        // old way 
        $endPointURL = $webserviceURL ;
 
            
        // new way 
        $endPointURL = $webserviceURL ;
        $postParameters = array(
            "serviceName" => "dataDictionary", 
            "function" => "cdd_getCodeValue"
          ) ;
          
         $data_ar = array(   
             "CodeValueID" => "278" // 
          );  
      
        util_dump_var($postParameters, "Post Parameters") ;
        util_dump_var($data_ar, "Data Parameters") ;
        $transData_json = json_encode($data_ar); 
        $response = wp_remote_post( $rm_options['webservice_url'], array(
            'method'      => 'POST',
            'timeout'     => 45,
            'redirection' => 5,
            'httpversion' => '1.0',
            'blocking'    => true,
            'headers'     => array(),
            'body'        => array(
                "serviceName" => $postParameters["serviceName"], 
                "function" =>  $postParameters["function"], 
                "transData" => $transData_json  
            ),
            'cookies'     => array()
            )
        ); 
        if ( is_wp_error( $response ) ) {
            $error_message = $response->get_error_message();
            util_log("Web service error in:" . $postParameters["service"]  . " " .  $postParameters["function"] . " " .  $error_message);
        } else { 
        }  
  
        $obj = json_decode($response['body'], true); 
        $responseData = $obj["data"] ; 
        util_dump_var($responseData, "wp_remote_post response") ;
        return $responseData ;  
        
        
    }
    
    catch (Exception $e) {
          return "<br>searchImportTables_example Error: " . $e->getMessage();
    } 
}  

cdd_getCodePossibleValues

Purpose:

For a given code table, the function gets it’s possible values. MaritalStatusCd is given in the example. Gets and array of codeValueIDs and possible values (label_med) of a given codeID.

Parameters (json array)

  • serviceName (string) = “dataDictionary”
  • function (string) = “cdd_getCodePossibleValues”
  • CodeID (string) required

Results (json array)

  • Status (string).  (“0″=Success, “1”=Not Successful)
  • statusMessage (string) (“Empty”,”Results”)
  • data (json array) (the results if not empty)

ccb_getCommentLog

Purpose:

Gets a list of the comments from events for a given client’s file.

Service Parameters (json array)

  • serviceName (string) = “content”
  • function (string) = “ccb_getCommentLog”

Key Parameters

  • clientID (string) Required
  • FollowupID (string) optional
  • Notes

    • If a FollowupID is provided, the service returns the elements for that event only.
    • Data Parameters

      A key value pair of the data element and it’s value.

    Results (json array)

    • Status (string).  (“0″=Success, “1”=Not Successful)
    • statusMessage (string) (“Empty”,”Results”)
    • data (json array) (the results if not empty)

    Example

    Click here for an example.

ccb_getElementValues

Purpose:

Gets all the element values for a given client ID, or only the element values for a particular event ID.

Service Parameters (json array)

  • serviceName (string) = “content”
  • function (string) = “ccb_getElementValues”

Key Parameters

  • clientID (string) Required
  • FollowupID (string) optional
  • Notes

    • If a FollowupID is provided, the service returns the elements for that event only.
    • Data Parameters

      A key value pair of the data element and it’s value.

    Results (json array)

    • Status (string).  (“0″=Success, “1”=Not Successful)
    • statusMessage (string) (“Empty”,”Results”)
    • data (json array) (the results if not empty)

    Example

    Click here for an example.