TODO

Example

TODO

Hierarchy

  • DB

Constructors

  • Returns DB

Properties

FieldDataType: typeof FieldDataType

The [[FieldDataType]].

Propagation: typeof Propagation

The [[Propagation]].

SortDirection: typeof SortDirection

The [[SortDirection]].

session: Session

The [[Session]].

Methods

  • A restricted function that clears a [[Lock]] given its name. The result is a boolean value indicating success.

    Parameters

    • name: string

    Returns boolean

    Example

    const didClear = B.clearLock('myLock');
    
  • Find a drug by it's product identification.

    Parameters

    • productID: string

      Product id of the drug being looked up

    Returns Drug

    Example

    const drug = B.drug('3432445');
    
  • This method executes a custom SQL query defined in Org Admin->Super. The callback function will return provide a [[Java.SQL.ResultSet]] for each row. For an updateable query, this method returns the number of rows modified.

    Parameters

    • id: string

      The id of the custom query to be executed.

    • Optional params: any[]

      A list of parameters to pass to the custom query. The number of parameters and the types of the parameters are defined by the custom query. Possible parameter types which may be used in a custom query are: BYTE, SHORT, INT, LONG, FLOAT, DOUBLE, VARCHAR, ORACLECLOB, DATE, TIME, TIMESTAMP, BOOLEAN, RAW and SCHEMA. Arguments passed are converted to their SQL specific types by Bluestep and internal conversions. For instance, TIMESTAMP values are first converted to Calendar values then to java.sql.TimeStamp values internally. All parameters have null value logic and are set via PreparedStatement setType() methods (where 'Type' is the actual type name) except RAW and SCHEMA. These two types are set via QueryString by calling setRawString() and setSubject() respectively. The two special types are set beginning from the last occurance and preceeding backward to the first, eliminating the parameters from the list as it goes thus preserving correct indexing. Then remaining parameters are set via PreparedStatement, first to last.

    • Optional rowConsumer: ((id, rowSet) => void)
        • (id, rowSet): void
        • Parameters

          Returns void

    Returns number

  • This method executes a custom SQL query defined in Org Admin->Super. The callback function will return provide a [[Java.SQL.ResultSet]] for each row. For an updateable query, this method returns the number of rows modified.

    Parameters

    • id: string

      The id of the custom query to be executed.

    • Optional params: any[]

      A list of parameters to pass to the custom query. The number of parameters and the types of the parameters are defined by the custom query. Possible parameter types which may be used in a custom query are: BYTE, SHORT, INT, LONG, FLOAT, DOUBLE, VARCHAR, ORACLECLOB, DATE, TIME, TIMESTAMP, BOOLEAN, RAW and SCHEMA. Arguments passed are converted to their SQL specific types by Bluestep and internal conversions. For instance, TIMESTAMP values are first converted to Calendar values then to java.sql.TimeStamp values internally. All parameters have null value logic and are set via PreparedStatement setType() methods (where 'Type' is the actual type name) except RAW and SCHEMA. These two types are set via QueryString by calling setRawString() and setSubject() respectively. The two special types are set beginning from the last occurance and preceeding backward to the first, eliminating the parameters from the list as it goes thus preserving correct indexing. Then remaining parameters are set via PreparedStatement, first to last.

    • Optional objs: string[]

      TODO

    • Optional rowConsumer: ((id, rowSet) => void)
        • (id, rowSet): void
        • Parameters

          Returns void

    Returns number

  • Use lookup service

    Parameters

    • lookup: string

      Service name

    • search: string

      What to search for

    • Optional params: {
          [key: string]: any;
      }

      Custom params for this search.

      • [key: string]: any

    Returns EList<{
        [key: string]: string;
    }>

    Example

    const results = B.lookup('drug','tylenol');
    
  • This method the current user's recent records list to be inspected and modified. When inspecting recent records it is possible to get each record's name, id, unit, record type and current categories. Recent records can be read and manipulated. See also [[User.recentRecords]] and [[Relate.BaseRecord.recentRecords]]

    Returns Optional<RecentRecords>

  • User transaction management

    Parameters

    Returns Transaction

    Example

    const message = B.userTransaction({propagationBehavior: B.Propagation.NESTED})
    .optCommitIf( () => { return true;})
    .flatMap(nextTrans => nextTrans.optCommitIf(() => { return true;}))
    .flatMap(nextTrans => nextTrans.optCommitIf(() => { return true;}))
    .flatMap(nextTrans => nextTrans.optCommitIf(() => { return true;}))
    .map(nextTrans => "All Transactions Successful")
    .orElse("A transaction failed");

Generated using TypeDoc