Skip to content

Commit 095c244

Browse files
committed
Merge pull request #70 from mohadesz/data_integrity
Data integrity
2 parents f78ee63 + e19a04f commit 095c244

File tree

8 files changed

+615
-6
lines changed

8 files changed

+615
-6
lines changed

SQL/0000-00-00-schema.sql

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ CREATE TABLE `permissions` (
10131013

10141014
LOCK TABLES `permissions` WRITE;
10151015
/*!40000 ALTER TABLE `permissions` DISABLE KEYS */;
1016-
INSERT INTO `permissions` VALUES (1,'superuser','There can be only one Highlander','1'),(2,'user_accounts','User management','2'),(3,'user_accounts_multisite','Across all sites create and edit users','2'),(4,'context_help','Edit help documentation','2'),(5,'bvl_feedback','Behavioural QC','1'),(6,'mri_feedback','Edit MRI feedback threads','2'),(7,'mri_efax','Edit MRI Efax files','2'),(8,'send_to_dcc','Send to DCC','2'),(9,'unsend_to_dcc','Reverse Send from DCC','2'),(10,'access_all_profiles','Across all sites access candidate profiles','2'),(11,'data_entry','Data entry','1'),(12,'certification','Certify examiners','2'),(13,'certification_multisite','Across all sites certify examiners','2'),(14,'timepoint_flag','Edit exclusion flags','2'),(15,'timepoint_flag_evaluate','Evaluate overall exclusionary criteria for the timepoint','2'),(16,'mri_safety','Review MRI safety form for accidental findings','2'),(17,'conflict_resolver','Resolving conflicts','2'),(18,'data_dict','Parameter Type description','2'),(19,'violated_scans','Violated Scans','2'),(20,'violated_scans_modifications','Editing the MRI protocol table (Violated Scans moduleiolated Scans)','2');
1016+
INSERT INTO `permissions` VALUES (1,'superuser','There can be only one Highlander','1'),(2,'user_accounts','User management','2'),(3,'user_accounts_multisite','Across all sites create and edit users','2'),(4,'context_help','Edit help documentation','2'),(5,'bvl_feedback','Behavioural QC','1'),(6,'mri_feedback','Edit MRI feedback threads','2'),(7,'mri_efax','Edit MRI Efax files','2'),(8,'send_to_dcc','Send to DCC','2'),(9,'unsend_to_dcc','Reverse Send from DCC','2'),(10,'access_all_profiles','Across all sites access candidate profiles','2'),(11,'data_entry','Data entry','1'),(12,'certification','Certify examiners','2'),(13,'certification_multisite','Across all sites certify examiners','2'),(14,'timepoint_flag','Edit exclusion flags','2'),(15,'timepoint_flag_evaluate','Evaluate overall exclusionary criteria for the timepoint','2'),(16,'mri_safety','Review MRI safety form for accidental findings','2'),(17,'conflict_resolver','Resolving conflicts','2'),(18,'data_dict','Parameter Type description','2'),(19,'violated_scans','Violated Scans','2'),(20,'violated_scans_modifications','Editing the MRI protocol table (Violated Scans module)','2'),(21,'data_integrity_flag','Data Integrity Flag','2');
10171017

10181018
/*!40000 ALTER TABLE `permissions` ENABLE KEYS */;
10191019
UNLOCK TABLES;
@@ -1640,9 +1640,6 @@ UNLOCK TABLES;
16401640

16411641
-- Dump completed on 2012-08-21 16:13:53
16421642

1643-
--
1644-
-- Table structure for table `parameter_type_override`
1645-
--
16461643

16471644
-- This table needs to be MyISAM because InnoDB doesn't
16481645
-- support full text indexes
@@ -1667,6 +1664,50 @@ CREATE TABLE `help_related_links` (
16671664

16681665
INSERT INTO help (helpID, topic, content) VALUES ('1','LORIS HELP: Using the Database','Welcome to LORIS database. The help section provides you with guidelines for adding and updating information in the database'), ('2','HOW TO - Guide','Under Construction.Please visit us later'), ('3','Guidelines','Under Construction.Please visit us later'), ('5','Instruments - Guide','Under Construction.Please visit us later');
16691666

1667+
1668+
1669+
--
1670+
-- Table structure for table `data_integrity_flag`
1671+
--
1672+
1673+
DROP TABLE IF EXISTS `data_integrity_flag`;
1674+
/*!40101 SET @saved_cs_client = @@character_set_client */;
1675+
/*!40101 SET character_set_client = utf8 */;
1676+
CREATE TABLE `data_integrity_flag` (
1677+
`dataflag_id` int(11) NOT NULL AUTO_INCREMENT,
1678+
`dataflag_visitlabel` varchar(255) NOT NULL,
1679+
`dataflag_instrument` varchar(255) NOT NULL,
1680+
`dataflag_date` date NOT NULL,
1681+
`dataflag_status` int(11) NOT NULL,
1682+
`dataflag_comment` text,
1683+
`latest_entry` tinyint(1) NOT NULL DEFAULT '1',
1684+
`dataflag_fbcreated` int(11) NOT NULL DEFAULT '0',
1685+
`dataflag_fbclosed` int(11) NOT NULL DEFAULT '0',
1686+
`dataflag_fbcomment` int(11) NOT NULL DEFAULT '0',
1687+
`dataflag_fbdeleted` int(11) NOT NULL DEFAULT '0',
1688+
`dataflag_userid` varchar(255) NOT NULL,
1689+
PRIMARY KEY (`dataflag_id`)
1690+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1691+
/*!40101 SET character_set_client = @saved_cs_client */;
1692+
1693+
--
1694+
-- Dumping data for table `data_integrity_flag`
1695+
--
1696+
1697+
LOCK TABLES `data_integrity_flag` WRITE;
1698+
/*!40000 ALTER TABLE `data_integrity_flag` DISABLE KEYS */;
1699+
/*!40000 ALTER TABLE `data_integrity_flag` ENABLE KEYS */;
1700+
UNLOCK TABLES;
1701+
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
1702+
1703+
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
1704+
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
1705+
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
1706+
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
1707+
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
1708+
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
1709+
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
1710+
16701711
CREATE TABLE `final_radiological_review` (
16711712
`CommentID` varchar(255) NOT NULL,
16721713
`Review_Done` tinyint(1) DEFAULT NULL,
@@ -1686,3 +1727,4 @@ CREATE TABLE `final_radiological_review` (
16861727
`Finalized` tinyint(1) DEFAULT NULL,
16871728
PRIMARY KEY (`CommentID`)
16881729
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1730+
-- Dump completed on 2012-10-05 10:49:10
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
CREATE TABLE `data_integrity_flag` (
2+
`dataflag_id` int(11) NOT NULL AUTO_INCREMENT,
3+
`dataflag_visitlabel` varchar(255) NOT NULL,
4+
`dataflag_instrument` varchar(255) NOT NULL,
5+
`dataflag_date` date NOT NULL,
6+
`dataflag_status` int(11) NOT NULL,
7+
`dataflag_comment` text,
8+
`latest_entry` tinyint(1) NOT NULL DEFAULT '1',
9+
`dataflag_fbcreated` int(11) NOT NULL DEFAULT '0',
10+
`dataflag_fbclosed` int(11) NOT NULL DEFAULT '0',
11+
`dataflag_fbcomment` int(11) NOT NULL DEFAULT '0',
12+
`dataflag_fbdeleted` int(11) NOT NULL DEFAULT '0',
13+
`dataflag_userid` varchar(255) NOT NULL,
14+
PRIMARY KEY (`dataflag_id`)
15+
);
16+
17+
INSERT INTO permissions (code, description,type,categoryID) VALUES ('data_integrity_flag','Data Integrity Flag','permission','2');

docs/config/config.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,17 @@
255255
</permissions>
256256
<visible>1</visible>
257257
</tab>
258+
<tab>
259+
<link>data_integrity_flag</link>
260+
<label>Data Integrity Flag</label>
261+
<access>all</access>
262+
<permissions>
263+
<perm>
264+
data_integrity_flag
265+
</perm>
266+
</permissions>
267+
<visible>1</visible>
268+
</tab>
258269
<ConflictResolver>
259270
<MaxConflicts>500</MaxConflicts>
260271
</ConflictResolver>

htdocs/GetInstruments.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111
$client->initialize();
1212

1313
require_once "Utility.class.inc";
14+
15+
1416
//gets the given visit_label and returns the instrument
1517

1618

1719

1820
$instruments = Utility::getVisitInstruments($_REQUEST['visit_label']);
1921

20-
print "All Instruments\n";
2122
foreach($instruments as $instrument){
2223
print $instrument['Test_name_display'] . "\n";
2324
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*global document: false, $: false, window: false, unescape: false, Option: false*/
2+
3+
function getQueryVariable(variable) {
4+
"use strict";
5+
var query = window.location.search.substring(1),
6+
vars = query.split("&"),
7+
i,
8+
pair;
9+
for (i = 0; i < vars.length; i += 1) {
10+
pair = vars[i].split("=");
11+
if (pair[0] === variable) {
12+
return unescape(pair[1]);
13+
}
14+
}
15+
}
16+
17+
function changeVisitLabels() {
18+
"use strict";
19+
//get the value for the visit selected
20+
var instrument_dropdown = document.getElementById('instrument'),
21+
visit_label_dropdown = document.getElementById('visit_label'),
22+
visit_label_value = visit_label_dropdown.value,
23+
request = getQueryVariable("visit_label"),
24+
instrument_dropdown_value,
25+
temp_array = ["All Instruments"],
26+
instruments;
27+
if ($.trim(visit_label_value) === 'All Visits') {visit_label_value = ''; }
28+
if (request !== undefined) {
29+
request = request.replace(/\+/g, ' ');
30+
}
31+
instrument_dropdown_value = getQueryVariable("instrument");
32+
if (instrument_dropdown_value !== undefined) {
33+
instrument_dropdown_value = instrument_dropdown_value.replace(/\+/g, ' ');
34+
}
35+
$.get("GetInstruments.php?visit_label=" + visit_label_value,
36+
function (data) {
37+
instruments = data.split("\n");
38+
instruments = temp_array.concat(instruments); //adds 'All instruments to the array'
39+
instrument_dropdown.options.length = 0;
40+
var i, numInstruments = instruments.length, val;
41+
for (i = 0; i < numInstruments; i += 1) {
42+
val = instruments[i];
43+
if (val !== '') {
44+
instrument_dropdown.options[i] = new Option(val, val);
45+
if ((instrument_dropdown_value === val) && (instrument_dropdown_value !== '')) {
46+
instrument_dropdown.options[i].selected = "selected";
47+
}
48+
}
49+
}
50+
//jQuery('#visits').change();
51+
});
52+
}
53+
54+
55+
//runs the function when the page is loaded..
56+
$(function () {
57+
"use strict";
58+
changeVisitLabels();
59+
$('#instrument,#visit_label,#users').bind('change', function () { $("#filter").trigger('click'); }); //The form is automatically loaded when the instrument dropdown is changed
60+
$('#update_data').bind('change', function () { $("#filter").trigger('click'); }); //The form is automatically loaded when the dropdown is changed
61+
});
62+

0 commit comments

Comments
 (0)