Overview

Packages

  • Admin
  • Archive
  • Common
  • DB
  • Express
  • Form
  • Layout
  • Mailer
  • None
  • OpenHomeoDB
  • PDF
    • MC
  • Process
  • Rep
  • RevRep
  • SaveReps
  • Search
  • Session
  • SymRem
  • TreeView
  • UserDB

Classes

  • Express
  • Overview
  • Package
  • Class
  • Tree

Class Express

The Express class parses the express script and extract the containing data to the database.

The Express tool provides a powerful scripting language for inserting rubrics from repertories for example in book form into the OpenHomeopath database.

Package: Express
Category: Homeopathy
Copyright: 2007-2014 Henri Schumacher
License: GNU Affero General Public License v3
Author: Henri Schumacher <henri.hulski@gazeta.pl>
Located at include/classes/express_class.php
Methods summary
public Express
# __construct( string $sym_rem )

Class constructor

Class constructor

Parameters

$sym_rem
string
$sym_rem the script submitted by the user usually through the textarea form

Returns

Express
private
# create_temporary_express_tables( )

create_temporary_express_tables creates the temporary tables, which hold the information from the express-script.

create_temporary_express_tables creates the temporary tables, which hold the information from the express-script.

4 tables gonna be created: expess_symptoms for the entered symptoms, express_sym_rem for the rubrics with the symptom-remedy-relations, express_alias for entered aliases and express_source for provided sources or references.

private
# parse_express_script( string $sym_rem )

parse_express_script parses the submitted script and insert the data in the temporary tables.

parse_express_script parses the submitted script and insert the data in the temporary tables.

Parameters

$sym_rem
string
$sym_rem the script submitted by the user usually through the textarea form
private integer
# extract_symptom( string $symptom_string )

extract_symptom extracts the symptoms from the symptom string of a parsed record and insert them in the express_symptoms table

extract_symptom extracts the symptoms from the symptom string of a parsed record and insert them in the express_symptoms table

Parameters

$symptom_string
string
$symptom_string the symptom string of a parsed record before the colon.

Returns

integer
The ID (sympt_id) of the inserted record to the express_symptoms table.
private
# extract_remedies( string $rem_string, integer $symt_id, integer $nonclassic )

extract_remedies extracts the remedies from the remedy string of a parsed record and insert them in the express_sym_rem table

extract_remedies extracts the remedies from the remedy string of a parsed record and insert them in the express_sym_rem table

Parameters

$rem_string
string
$rem_string the remedy string of a parsed record after the colon
$symt_id
integer
$symt_id the symptom ID
$nonclassic
integer
$nonclassic 0|1 0: classic proving, 1: nonclassic proving
public
# extract_alias( string $alias_string )

extract_alias extract the alias if the record is an alias record

extract_alias extract the alias if the record is an alias record

Parameters

$alias_string
string
$alias_string the string from an alias record after the colon
private
# extract_source( string $source_string, integer $primary_src )

extract_source extract the source or reference if the record is an source or reference record

extract_source extract the source or reference if the record is an source or reference record

Parameters

$source_string
string
$source_string the string from a source or reference record after the colon
$primary_src
integer
$primary_src 0|1 0: reference, 1: primary source
public
# insert_remedy( integer $sympt_id, integer $sym_id, string $current_user, integer $is_duplicated_symptom )

insert_remedy retrieve the remedy records from the express_sym_rem table and insert in or update the sym_rem table

insert_remedy retrieve the remedy records from the express_sym_rem table and insert in or update the sym_rem table

After retrieving the remedy records they will be tested if there is a dublicate symptom, if the remedy abbreviation exists in the database and if the symptom-remedy-relation already exists in the sym_rem table.

If there is a dublicate record the remedy will be written back tu the script for correction. If the remedy abbreviation doesn't exists, the backup of the record goes in the rem_error_ar array. If the symptom-remedy-relation already exists in the sym_rem table the record will be updated. Else a new record will be created in the sym_rem table. The sym_rem_refs table will be updated, if necessary.

Parameters

$sympt_id
integer
$sympt_id The ID of the symptom-record in the temporary express_symptoms table.
$sym_id
integer
$sym_id The symptom ID in the database symptoms table.
$current_user
string
$current_user Username of the currently logged in user.
$is_duplicated_symptom
integer
$is_duplicated_symptom 0|1 0: unique symptom, 1: possible dublicated symptom
public string
# build_select_duplicated_symptoms_query( string $symptom, array & $symptom1_similar_ar, array & $symptom2_similar_ar )

build_select_duplicated_symptoms_query builds the select query to select the record that can be similar to the record inserted

build_select_duplicated_symptoms_query builds the select query to select the record that can be similar to the record inserted

Parameters

$symptom
string
$symptom The symptom extracted from the script.
$symptom1_similar_ar
array
&$symptom1_similar_ar Array which hods the symptoms extracted from the script.
$symptom2_similar_ar
array
&$symptom2_similar_ar Array which holds the similar symptom found in the database corresponding to the above array.

Returns

string
The SQL select query
private boolean
# similar_words( string $string, string $compare_string )

similar_words compare two strings and return true if the strings are similar, otherwise false

similar_words compare two strings and return true if the strings are similar, otherwise false

Parameters

$string
string
$string The given string from the script.
$compare_string
string
$compare_string The string to compare from the database.

Returns

boolean
private array
# build_clean_words_array( string $string )

build_clean_words_array builds a word array for comparison from a given string and filter the words with a blacklist and whitelist

build_clean_words_array builds a word array for comparison from a given string and filter the words with a blacklist and whitelist

Parameters

$string
string
$string The given string.

Returns

array
public string
# build_possible_duplication_table( resource $result )

build_possible_duplication_table builds an HTML table for displaying possible dublications of symptoms

build_possible_duplication_table builds an HTML table for displaying possible dublications of symptoms

Parameters

$result
resource
$result Parameter description (if any) ...

Returns

string
The resulting HTML-table.
Properties summary
public string $script ""
#

The output in the scripting textarea containing the previous sent records prepared for correction

The output in the scripting textarea containing the previous sent records prepared for correction

public string $src_id ""
#

The ID of the source from which we're inserting the rubrics.

The ID of the source from which we're inserting the rubrics.

public string $src_lang ""
#

The ID of the source language

The ID of the source language

public integer $rubric_id -1
#

The ID of the main rubric from which we're inserting rubrics.

The ID of the main rubric from which we're inserting rubrics.

If -1 the main rubric must be defined within the script as part of the symptom (like "main rubric >> symptom").

public string $rubric_name ""
#

The name of the main rubric in the language of the source.

The name of the main rubric in the language of the source.

public array $ref_not_found_ar array()
#

Array with given references which were not found in the sources table

Array with given references which were not found in the sources table

public array $rem_error_ar array()
#

Array of remedy-backups from given remedy abbreviations which were not found in the remedies or alias table.

Array of remedy-backups from given remedy abbreviations which were not found in the remedies or alias table.

public array $count_ar array()
#

Array of different counters (details see the class constructor)

Array of different counters (details see the class constructor)

OpenHomeopath PHP code documentation API documentation generated by ApiGen 2.8.0