Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Rebase ALSFRS stuff

  • Loading branch information...
commit 3d0a136f71b0a089945e1ef6b11558fb4a6c547e 1 parent 741ff05
@k00ni k00ni authored
View
9 classes/ALSFRS.php
@@ -92,4 +92,13 @@ public function getTopicsWithOptions ( $topics, $currentLanguage = 'de' )
return $result;
}
+
+
+ /**
+ *
+ */
+ public function generateAlsfrsFormulaPredicates ()
+ {
+
+ }
}
View
54 classes/Formula.php
@@ -35,6 +35,8 @@ public function __construct($index, $selectedModel)
$this->_data ['resource'] = "";
$this->_data ['sections'] = array ();
$this->_data ['selectResourceOfType'] = '';
+ $this->_data ['formulaType'] = 'normal';
+ $this->_data ['formulaParameter'] = array ();
$this->_selectedModel = $selectedModel;
}
@@ -46,6 +48,42 @@ public function __construct($index, $selectedModel)
/**
* @return void
*/
+ public function setFormulaParameter ($value)
+ {
+ $this->_data ['formulaParameter'] = $value;
+ }
+
+
+ /**
+ * @return string
+ */
+ public function getFormulaParameter ()
+ {
+ return $this->_data ['formulaParameter'];
+ }
+
+
+ /**
+ * @return void
+ */
+ public function setFormulaType ($value)
+ {
+ $this->_data ['formulaType'] = $value;
+ }
+
+
+ /**
+ * @return string
+ */
+ public function getFormulaType ()
+ {
+ return $this->_data ['formulaType'];
+ }
+
+
+ /**
+ * @return void
+ */
public function setDescription ($value)
{
$this->_data ['description'] = $value;
@@ -332,6 +370,8 @@ public function getDataAsArrays ()
$arr = array (
'title' => $this->getTitle (),
'index' => $this->getIndex (),
+ 'formulaType' => $this->getFormulaType (),
+ 'formulaParameter' => $this->getFormulaParameter (),
'description' => $this->getDescription (),
'selectResourceOfType' => $this->getSelectResourceOfType (),
'labelparts' => $this->getLabelparts (),
@@ -408,6 +448,11 @@ public function initByArray ($formArray)
$form->setTargetClass ($formArray ['targetclass']);
$form->setXmlFile ($formArray ['xmlfile']);
+
+ $form->setFormulaType ($formArray ['formulaType']);
+
+ $form->setFormulaParameter ($formArray ['formulaParameter']);
+
foreach ($formArray ['sections'] as $entry)
{
@@ -619,13 +664,4 @@ public function replaceNamespaces($s)
return str_replace('architecture:', $namespaceUri, $s);
}
-
-
- /**
- *
- */
- public function generateAlsfrsPredicates ()
- {
-
- }
}
View
92 classes/XmlConfig.php
@@ -46,6 +46,7 @@ public function loadFile ($file, &$form)
$xmlFile = substr($xmlFile, 0, strpos ($xmlFile, '.')); // delete extension
$form->setXmlFile($xmlFile);
+ // generate a specify XML
// ReadIn all readable data from XML-Config file.
foreach ($xml as $nodeName => $nodeValue)
@@ -76,6 +77,33 @@ public function loadFile ($file, &$form)
break;
+ case 'formulaType':
+ $form->setTargetClass ((string) $nodeValue [0]);
+
+ break;
+
+
+ case 'formulaParameter':
+
+ $p = array ();
+
+ $p ['predicateToHealthState'] = (string) $xml->formulaParameter->predicateToHealthState;
+ $p ['healthState'] = (string) $xml->formulaParameter->healthState;
+
+ $p ['predicateToPropertySet'] = (string) $xml->formulaParameter->predicateToPropertySet;
+ $p ['propertySet'] = (string) $xml->formulaParameter->propertySet;
+
+ $p ['predicateToSymptomSet'] = (string) $xml->formulaParameter->predicateToSymptomSet;
+ $p ['symptomSet'] = (string) $xml->formulaParameter->predicateToSymptomSet;
+
+ $p ['predicateToPropertyOption'] = (string) $xml->formulaParameter->predicateToPropertyOption;
+ $p ['predicateToSymptomOption'] = (string) $xml->formulaParameter->predicateToSymptomOption;
+
+ $form->setFormulaParameter ( $p );
+
+ break;
+
+
case 'labelparts':
foreach ($xml->labelparts->item as $nodeValue)
@@ -109,61 +137,23 @@ public function loadFile ($file, &$form)
// set typeparameters
switch ( $type )
- {
- // ALSFRS: complex structure of relations and instances
- case 'alsfrs':
+ {
+ // a ALSFRS question with options
+ case 'alsfrsquestion':
- $typeparameter ['predicateToHealthState'] = (string)
- $predicate->typeparameter->predicateToHealthState;
+ $options = array ();
- $typeparameter ['healthState'] = $predicate->typeparameter->healthState;
-
- $typeparameter ['predicateToPropertySet'] = (string)
- $predicate->typeparameter->predicateToPropertySet;
-
- $typeparameter ['propertySet'] = $predicate->typeparameter->propertySet;
-
- $typeparameter ['predicateToSymptomSet'] = (string)
- $predicate->typeparameter->predicateToSymptomSet;
-
- $typeparameter ['symptomSet'] = $predicate->typeparameter->symptomSet;
-
- $typeparameter ['predicateToPropertyOption'] = (string)
- $predicate->typeparameter->predicateToPropertyOption;
-
- $typeparameter ['predicateToSymptomOption'] = (string)
- $predicate->typeparameter->predicateToSymptomOption;
-
- // topic
- $typeparameter ['topic'] = (string)
- $predicate->typeparameter->topic;
-
- $typeparameter ['topicLabel'] = (string)
- $predicate->typeparameter->topicLabel;
-
- $typeparameter ['topicSuggestedQuestion'] = (string)
- $predicate->typeparameter->topicSuggestedQuestion;
-
- $typeparameter ['topicHasOption'] = (string)
- $predicate->typeparameter->topicHasOption;
-
- // option
- $typeparameter ['option'] = (string)
- $predicate->typeparameter->option;
-
- $typeparameter ['optionLabel'] = (string)
- $predicate->typeparameter->optionLabel;
-
- // clear assignment which topics are SymptomOptions
- foreach ($predicate->typeparameter->pertainsToSymptomSet->item as $parameter)
- $typeparameter ['pertainsToSymptomSet'][] = (string) $parameter;
+ foreach ($predicate->typeparameter->options->item as $i)
+ $options [] = (string) $i;
+
+ $typeparameter [] = array (
+ 'topicUri' => (string) $predicate->typeparameter->topicUri,
+ 'pertainsTo' => (string) $predicate->typeparameter->pertainsTo,
+ 'options' => $options
+ );
- // clear assignment which topics are PropertyOptions
- foreach ($predicate->typeparameter->pertainsToPropertySet->item as $parameter)
- $typeparameter ['pertainsToPropertySet'][] = (string) $parameter;
-
break;
-
+
case 'date':
break;
View
41 jshtmlplugins/alsfrs.phtml
@@ -1,41 +0,0 @@
-<?php
-/**
- * @category OntoWiki
- * @package OntoWiki_extensions_formgenerator
- * @author Lars Eidam <larseidam@googlemail.com>
- * @author Konrad Abicht <konrad@inspirito.de>
- * @copyright Copyright (c) 2011
- * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)
- */
-?>
-<?php
-
-$simpleTopicList = $this->alsfrs->getSimpleTopicList ('de');
-$topicsWithOptions = $this->alsfrs->getTopicsWithOptions ( $simpleTopicList );
-
-?>
-</div>
-
-<?php foreach ( $topicsWithOptions as $topic ) { ?>
-
- <div class="content">
- <!-- question -->
- <h3><?php echo $topic ['suggestedQuestion']; ?></h3>
-
- <!-- list of options -->
- <?php foreach ( $topic['options'] as $option ) { ?>
-
- <br/>
- <input type="radio" value="" name=""/>
- &nbsp; <?php echo $option ['label']; ?>
-
- <?php } ?>
-
- </div>
-
- <div class="content">
- <div class="predicateTitle">&nbsp;</div>
- <div class="predicateValue">&nbsp;</div>
- </div>
-
-<?php } ?>
View
34 jshtmlplugins/alsfrsquestion.phtml
@@ -0,0 +1,34 @@
+<?php
+/**
+ * @category OntoWiki
+ * @package OntoWiki_extensions_formgenerator
+ * @author Lars Eidam <larseidam@googlemail.com>
+ * @author Konrad Abicht <konrad@inspirito.de>
+ * @copyright Copyright (c) 2011
+ * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)
+ */
+
+
+?>
+
+<div class="content">
+ <!-- question -->
+ <h3><?php echo 'FRAGE'; ?></h3>
+
+ <input type="radio" name="<?php echo $element ['name']; ?>"/>
+
+ <?php /*echo $topic ['suggestedQuestion']; ?></h3>
+
+ <!-- list of options -->
+ <?php foreach ( $topic['options'] as $option ) { ?>
+
+ <br/>
+ <input type="radio" value="" name=""/>
+ &nbsp; <?php echo $option ['label']; ?>
+
+ <?php }*/ ?>
+
+</div>
+
+
+<div class="content">
View
6 templates/formgenerator/form.phtml
@@ -114,9 +114,9 @@
<?php require $this->dirJsHtmlPlugins . 'resource.phtml'; ?>
- <?php } elseif ('alsfrs' == $element ['type']) { ?>
-
- <?php require $this->dirJsHtmlPlugins . 'alsfrs.phtml'; ?>
+ <?php } elseif ('alsfrsquestion' == $element ['type']) { ?>
+ </div>
+ <?php require $this->dirJsHtmlPlugins . 'alsfrsquestion.phtml'; ?>
<?php } else { ?>
View
91 xmlconfigurationfiles/alsfrs.xml
@@ -15,67 +15,48 @@
<!-- Shows a dropdown box to select an existing resource. -->
<!-- All relations and fields below are going to connect to this resource. -->
<selectResourceOfType>architecture:Patient</selectResourceOfType>
-
+
+ <!-- normal (standard), alsfrs -->
+ <formulaType>alsfrs</formulaType>
+
+ <formulaParameter>
+
+ <!-- SelectedResource has healthStateInstance -->
+ <predicateToHealthState>has</predicateToHealthState>
+ <healthState>http://als.dispedia.info/wrapperAlsfrs/c/20111105/ALSFRSHealthState</healthState>
+
+ <!-- healthStateInstance includesAffectedProperties ALSFRSPropertySet -->
+ <predicateToPropertySet>http://als.dispedia.info/architecture/c/20110827/includesAffectedProperties</predicateToPropertySet>
+ <propertySet>http://als.dispedia.info/wrapperAlsfrs/c/20111105/ALSFRSPropertySet</propertySet>
+
+ <!-- healthStateInstance includesSymptoms ALSFRSSymptomSet-Instance -->
+ <predicateToSymptomSet>http://als.dispedia.info/architecture/c/20110827/includesSymptoms</predicateToSymptomSet>
+ <symptomSet>http://als.dispedia.info/wrapperAlsfrs/c/20111105/ALSFRSSymptomSet</symptomSet>
+
+ <!-- ALSFRSPropertySet-Instance containsPropertyOption Option-Instance -->
+ <predicateToPropertyOption>http://als.dispedia.info/wrapperAlsfrs/c/20111105/containsPropertyOption</predicateToPropertyOption>
+
+ <!-- ALSFRSSymptomSet-Instance containsSymptomOption Option-Instance -->
+ <predicateToSymptomOption>http://als.dispedia.info/wrapperAlsfrs/c/20111105/containsSymptomOption</predicateToSymptomOption>
+
+ </formulaParameter>
+
<sections>
- <!-- A new section -->
<item>
- <!-- Textfield -->
<predicate>
- <type>alsfrs</type>
+ <type>alsfrsquestion</type>
<typeparameter>
-
- <!-- Patientresource has healthStateInstance -->
- <predicateToHealthState>has</predicateToHealthState>
- <healthState>http://als.dispedia.info/wrapperAlsfrs/c/20111105/ALSFRSHealthState</healthState>
-
- <!-- healthStateInstance includesAffectedProperties ALSFRSPropertySet -->
- <predicateToPropertySet>http://als.dispedia.info/architecture/c/20110827/includesAffectedProperties</predicateToPropertySet>
- <propertySet>http://als.dispedia.info/wrapperAlsfrs/c/20111105/ALSFRSPropertySet</propertySet>
-
- <!-- healthStateInstance includesSymptoms ALSFRSSymptomSet-Instance -->
- <predicateToSymptomSet>http://als.dispedia.info/architecture/c/20110827/includesSymptoms</predicateToSymptomSet>
- <symptomSet>http://als.dispedia.info/wrapperAlsfrs/c/20111105/ALSFRSSymptomSet</symptomSet>
-
- <!-- ALSFRSPropertySet-Instance containsPropertyOption Option-Instance -->
- <predicateToPropertyOption>http://als.dispedia.info/wrapperAlsfrs/c/20111105/containsPropertyOption</predicateToPropertyOption>
-
- <!-- ALSFRSSymptomSet-Instance containsSymptomOption Option-Instance -->
- <predicateToSymptomOption>http://als.dispedia.info/wrapperAlsfrs/c/20111105/containsSymptomOption</predicateToSymptomOption>
-
- <!-- Topic related stuff -->
- <topic>http://als.dispedia.info/frs/o/Topic</topic>
- <topicLabel>http://www.w3.org/2000/01/rdf-schema#label</topicLabel>
- <topicSuggestedQuestion>http://als.dispedia.info/frs/o/suggestedQuestion</topicSuggestedQuestion>
- <topicHasOption>http://als.dispedia.info/frs/o/hasOption</topicHasOption>
-
- <!-- Option related stuff -->
- <option>http://als.dispedia.info/frs/o/Option</option>
- <optionLabel>http://www.w3.org/2000/01/rdf-schema#label</optionLabel>
- <optionHasScore>http://als.dispedia.info/frs/o/hasScore</optionHasScore>
-
- <!-- clear assignment which topics are SymptomOptions -->
- <pertainsToSymptomSet>
- <item>http://als.dispedia.info/frs/i/topic/t2</item>
- <item>http://als.dispedia.info/frs/i/topic/t4</item>
- <item>http://als.dispedia.info/frs/i/topic/t8</item>
- <item>http://als.dispedia.info/frs/i/topic/t10</item>
- <item>http://als.dispedia.info/frs/i/topic/t11</item>
- </pertainsToSymptomSet>
-
- <!-- clear assignment which topics are PropertyOptions -->
- <pertainsToPropertySet>
- <item>http://als.dispedia.info/frs/i/topic/t1</item>
- <item>http://als.dispedia.info/frs/i/topic/t3</item>
- <item>http://als.dispedia.info/frs/i/topic/t5a</item>
- <item>http://als.dispedia.info/frs/i/topic/t5b</item>
- <item>http://als.dispedia.info/frs/i/topic/t6</item>
- <item>http://als.dispedia.info/frs/i/topic/t7</item>
- <item>http://als.dispedia.info/frs/i/topic/t9</item>
- <item>http://als.dispedia.info/frs/i/topic/t12</item>
- </pertainsToPropertySet>
-
+ <topicUri>http://als.dispedia.info/frs/i/topic/t1</topicUri>
+ <pertainsTo>SymptomSet</pertainsTo>
+ <options>
+ <item>http://als.dispedia.info/frs/i/option/o1_0</item>
+ <item>http://als.dispedia.info/frs/i/option/o1_1</item>
+ <item>http://als.dispedia.info/frs/i/option/o1_2</item>
+ <item>http://als.dispedia.info/frs/i/option/o1_3</item>
+ <item>http://als.dispedia.info/frs/i/option/o1_4</item>
+ </options>
</typeparameter>
</predicate>
Please sign in to comment.
Something went wrong with that request. Please try again.