Skip to content

Commit

Permalink
Merge branch 'release/1.9.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ChemiKyle committed Jun 21, 2021
2 parents ee18651 + 79b806c commit fb9f8a7
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 7 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ All notable changes to the Imagemap module will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).


## [1.9.0] - 2021-06-21
### Added
- Add Dermatology photo upload body image (Jae Lee)

## Changed
- fix issue causing limit to number of imagemaps per page (Andrew Martin)
- partially fixes issues with checkbox fields (Andrew Martin)
- updated citation for painmap (Andrew Martin)


## [1.8.0] - 2021-03-16
### Added
- add option to use api urls (Andrew Martin)
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ French Region 2020 : to localize in one click a region - Région Française 2020
This is a Patient self-report figure for the Assessment of Fibromyalgia.
![FIBROMYALGIA_BODY](./img/fibromyalgia.png)

**`DERM_PHOTO_BODY`**

This is a body rendering developed at Stanford for a specific project -- no attributions required.
![DERM_PHOTO_BODY](./img/derm_photo_body.png)


## Usage
To display one of the images above in a survey or data entry form, add a new field of type **Text Box** and include one of the following options in the **Action Tags / Field Annotation (optional)** field:

Expand Down Expand Up @@ -155,6 +161,12 @@ This project includes an [Example Instrument](docs/Instrument\ Example.zip) that

## Acknowledgements & Copyright
* The original body was devised by Dr. Ming-Chih J Kao and Professor Sean Mackey at Stanford University as part of [CHOIR](choir.stanford.edu). Use of the 'bodymap' images requires that the CHOIR attribution remains intact.
* Use of the 'PAINMAP_MALE' or 'PAINMAP_FEMALE' images for publication must include the following [citation](https://pubmed.ncbi.nlm.nih.gov/33490848/):
```Scherrer, Kristen Hymel,; Ziadni, Maisa S.; Kong, Jiang-Ti; Sturgeon, John A.;
Salmasi, Vafi; Hong, Juliette; Cramer, Eric; Chen, Abby L.; Pacht, Teresa; Olson, Garrick;
Darnall, Beth D.; Kao, Ming-Chih; Mackey, Sean. Development and validation of the Collaborative
Health Outcomes Information Registry body map, PAIN Reports:
January/February 2021 - Volume 6 - Issue 1 - p e880 doi: 10.1097/PR9.0000000000000880
* The imagemap plugin/hook was written at Stanford by Andrew Martin and converted to an external module in collaboration with CTS-IT - University of Florida.
* The 5-face pain image and map was included by Lewisa2.
* The odontogram maps were contributed by Bas de Veer and collaborators at the ITHS and Christy McKinney at the University of Washington and Seattle Children’s Research Institute.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.8.0
1.9.0
12 changes: 12 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,18 @@
"hideInput": true,
"map": "maps/va_chart.html"
},
"DERM_PHOTO_BODY": {
"name": "derm_photo_body",
"alt": "Dermatology Body Photo Map",
"desc": "Body Part Diagram for Photo Upload",
"options": "f01,f02,f03,f04,f05,f06,r02",
"data_dict_default": "f01, Face | f02, Chest | f03, Right Arm | f04,Left Arm | f05,Right Leg | f06, Left Leg | r02, Back",
"image": "img/derm_photo_body.png",
"width": 750,
"height": 820,
"hideInput": true,
"map": "maps/derm_photo_body.html"
},
"66SWOLLEN_68TENDER_JOINT_COUNT": {
"name": "66swollen_68tender_joint_count",
"alt": "SJC66_TJC68",
Expand Down
Binary file added img/derm_photo_body.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 27 additions & 6 deletions js/imagemap.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ imageMapEM.render = function(params) {
imageMapEM.loadAreaList(params.field);

// If bound to a checkbox, handle checking the checkbox inputs directly to update the map
$('input[type=checkbox]', tr).parent().bind('click', function() {
$('input[type=checkbox]', tr).parent().bind('click', function(event) {
// Prevent this code from happening twice when the event is fired from a click
// on the imageMap
if(event.isTrusted) {
if (event.isTrusted) {
// imageMapEM.log(this, event);
var tr = $(this).closest('tr');
//imageMapEM.log(tr);
Expand All @@ -191,7 +191,18 @@ imageMapEM.render = function(params) {
}
});


// Handle change in checkboxes with later redcap versions
$('input[type=checkbox]', tr).bind('click', function(event) {
if (event.isTrusted) {
// imageMapEM.log("Clicked Box!", this);
let checkbox = $(this);
var code = checkbox.attr('code');
//imageMapEM.log(code);
var checked = checkbox.is(":checked");
//imageMapEM.log(checked);
$(img).mapster('set', checked, code);
}
});

// If bound to radio, capture radio changes and update imageMap
$('input[type=radio]', tr).bind('click', function() {
Expand Down Expand Up @@ -221,10 +232,10 @@ imageMapEM.render = function(params) {
imageMapEM.loadAreaList = function(field_name) {
// Get TR for question
var tr = $('tr[sq_id='+field_name+']');
//imageMapEM.log ('tr');imageMapEM.log(tr);
// imageMapEM.log ('tr');imageMapEM.log(tr);

img = $('img[field="'+field_name+'"]', tr).not(".mapster_el");
//imageMapEM.log ('img');imageMapEM.log(img);
// imageMapEM.log ('img');imageMapEM.log(img);

// If checkboxes are used, then update imagemap from values
$('input[type=checkbox]:checked', tr).each(function() {
Expand All @@ -235,14 +246,24 @@ imageMapEM.loadAreaList = function(field_name) {
});

// If text - then process from list
// imageMapEM.log("TEXT");
$('input[type=text][name="'+field_name+'"]', tr).each(function() {
$(img).mapster('set',true,$(this).val());
});

// For radio button questions, the main input is here - use it to set value
// imageMapEM.log("RADIO");
$('input[name="'+field_name+'"]', tr).each(function() {
let val = $(this).val();
if ( $(img).mapster('get') != val ) { // avoid infinite loop

// This was causing an error for text storage in newer redcap versions -- so I'm wrapping it.
let mapVal = null;
try {
mapVal = $(img).mapster('get');
} catch (errror) {
imageMapEM.log("caught get val exception for " + field_name);
}
if ( mapVal != val ) { // avoid infinite loop
$(img).mapster('set',true,val);
};
});
Expand Down
11 changes: 11 additions & 0 deletions maps/derm_photo_body.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

<area data-key="f01" alt="Face" title="Face" href="face" coords="156,27,140,32,127,42,119,52,113,63,110,76,110,87,110,101,113,115,117,130,125,144,132,155,139,163,146,168,152,170,158,169,165,167,171,161,177,154,183,148,188,137,193,126,196,113,198,99,198,82,196,66,190,52,181,40,170,31" shape="poly">
<area data-key="f02" alt="Chest" title="Chest" href="chest" coords="177,193,140,193,126,200,119,203,111,206,102,212,97,217,96,225,96,233,96,242,97,251,99,258,106,270,114,277,116,287,118,300,122,312,123,319,132,320,145,321,162,323,175,323,182,321,189,320,193,309,195,295,198,283,204,272,210,264,212,254,213,244,212,233,213,216,202,209,189,200,181,195,177,193" shape="poly">
<area data-key="f03" alt="Right Arm" title="Right Arm" href="right_arm" coords="100,214,96,228,97,237,97,246,98,252,91,258,83,264,76,272,72,275,66,279,69,285,72,290,77,296,82,302,87,310,92,316,98,319,105,320,116,323,119,327,116,335,115,341,116,346,111,350,103,344,92,337,83,328,74,319,64,309,52,301,45,291,41,283,39,275,60,251,80,230" shape="poly">
<area data-key="f04" alt="Left Arm" title="Left Arm" href="left_arm" coords="213,216,211,233,212,243,211,257,219,259,239,280,227,297,219,309,213,318,198,326,196,336,195,346,198,351,204,351,217,339,223,329,231,319,245,310,255,303,267,289,269,278,258,264,235,239" shape="poly">
<area data-key="f05" alt="Right Leg" title="Right Leg" href="right_leg" coords="117,348,108,369,103,386,97,407,93,440,95,470,97,493,97,500,93,510,88,531,84,554,80,577,78,596,74,608,81,613,92,618,95,606,100,573,109,563,117,545,119,517,120,498,126,486,133,446,149,404,154,377,146,371,136,360" shape="poly">
<area data-key="f06" alt="Left Leg" title="Left Leg" href="left_leg" coords="195,348,213,389,219,407,224,431,226,450,226,463,226,491,227,497,233,514,244,556,252,586,258,604,252,609,241,610,228,567,218,556,208,539,205,502,195,486,186,451,170,412,161,375,167,372,176,360" shape="poly">
<area data-key="r02" alt="Back" title="Back" href="back" coords="444,161,481,161,481,170,484,183,488,191,500,198,514,204,525,207,525,229,524,243,522,251,517,262,510,270,502,284,497,307,495,323,482,319,465,318,449,319,438,321,428,325,427,308,420,284,413,269,407,263,402,249,400,231,403,204,417,199,434,194,439,189,443,181,444,166" shape="poly">



0 comments on commit fb9f8a7

Please sign in to comment.