Skip to content

Commit

Permalink
Allow pedigree editor to be in surveys
Browse files Browse the repository at this point in the history
  • Loading branch information
dconlan committed Jun 23, 2020
1 parent 6735dd1 commit 16a90fb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
13 changes: 11 additions & 2 deletions PedigreeEditorExternalModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,18 @@ public function validateSettings($settings){
}
return $errors;
}


function redcap_survey_page ( $project_id, $record, $instrument, $event_id, $group_id, $survey_hash, $response_id, $repeat_instance) {
$this->add_pedigree_to_form($project_id, $instrument);
}


function redcap_data_entry_form ($project_id, $record, $instrument, $event_id, $group_id, $repeat_instance) {

$this->add_pedigree_to_form($project_id, $instrument);
}

function add_pedigree_to_form ($project_id, $instrument) {

// At one stage these things were going to be in the settings for the editor
// maybe in the future they will be exposed.
$hpoEditorPage = 'open-pedigree/localEditor.html?mode=HPO';
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ Alternatively you can clone the git repository and generate your own distributio
```
git clone https://github.com/aehrc/redcap_pedigree_editor.git
cd redcap_pedigree_editor
git archive --format=zip --prefix=redcap_pedigree_editor_v0.1/ -o ../redcap_pedigree_editor_v0.1.zip HEAD
git archive --format=zip --prefix=redcap_pedigree_editor_v0.1.1/ -o ../redcap_pedigree_editor_v0.1.1.zip HEAD
```

This will give you a file redcap_pedigree_editor_v0.1.zip
This will give you a file redcap_pedigree_editor_v0.1.1.zip

# Install the distribution

The distribution is installed by unzipping the distribution file into the `redcap/modules/` directory of the redcap installation.

This should result in the new directory `'redcap_pedigree_editor_v0.1'`. The external module directory name must meet a strict naming
This should result in the new directory `'redcap_pedigree_editor_v0.1.1'`. The external module directory name must meet a strict naming
convention, if the directory is missing the `'v'` before the version number then the module won't be picked up by redcap, so rename
the directory to match the form `'<module name>_v<version number>'`.

Expand Down Expand Up @@ -91,4 +91,4 @@ system uses a naming convention to distinguish the two, otherwise it tries to ma
if the observation represents a Phenotype or Candidate gene.

Life status - This can be 'unborn', 'stillborn' and 'aborted' with an associated gestation age. This will be written into
the deceasedString field on the family history resource in a form like 'stillborn 34 weeks'.
the deceasedString field on the family history resource in a form like 'stillborn 34 weeks'.
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
],
"permissions": [
"redcap_data_entry_form"
"redcap_data_entry_form", "redcap_survey_page"
],
"system-settings" : [
{
Expand Down

0 comments on commit 16a90fb

Please sign in to comment.