Skip to content

Commit

Permalink
Merge pull request #509 from BioKIC/Hotfix-20240614
Browse files Browse the repository at this point in the history
Translates sex values for all but mammal voucher collections, corrects individual counts
  • Loading branch information
kyule authored Jul 17, 2024
2 parents d1e3cc4 + b1869a1 commit 9160c57
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions neon/classes/OccurrenceHarvester.php
Original file line number Diff line number Diff line change
Expand Up @@ -667,9 +667,14 @@ private function getDarwinCoreArr($sampleArr){
if(!empty($sampleArr['preservative_type'])) $prepArr[] = 'preservative type: '.$sampleArr['preservative_type'];
if(!empty($sampleArr['preservative_volume'])) $prepArr[] = 'preservative volume: '.$sampleArr['preservative_volume'];
if(!empty($sampleArr['preservative_concentration'])) $prepArr[] = 'preservative concentration: '.$sampleArr['preservative_concentration'];
if(!in_array($dwcArr['collid'], array(19,28,42))){
if(!in_array($dwcArr['collid'], array(19,28,42,17,64))){
if(!empty($sampleArr['sample_mass']) && strpos($sampleArr['symbiotaTarget'],'sample mass') === false) $prepArr[] = 'sample mass: '.$sampleArr['sample_mass'];
if(!empty($sampleArr['sample_volume']) && strpos($sampleArr['symbiotaTarget'],'sample volume') === false) $prepArr[] = 'sample volume: '.$sampleArr['sample_volume'];
if(!empty($sampleArr['sex'])){
if($sampleArr['sex'] == 'M') $dwcArr['sex'] = 'Male';
elseif($sampleArr['sex'] == 'F') $dwcArr['sex'] = 'Female';
elseif($$sampleArr['sex'] == 'U') $dwcArr['sex'] = 'Unknown';
}
}
if($prepArr) $dwcArr['preparations'] = implode(', ',$prepArr);
$dynProp = array();
Expand Down Expand Up @@ -991,7 +996,7 @@ private function applyCustomAdjustments(&$dwcArr){
$dwcArr['lifeStage'] = 'Nymph';
$dwcArr['sex'] = '';
}
elseif($dwcArr['collid'] == 29 || $dwcArr['collid'] == 39){
elseif($dwcArr['collid'] == 29 || $dwcArr['collid'] == 39 || $dwcArr['collid'] == 44 || $dwcArr['collid'] == 82 || $dwcArr['collid'] == 95){
$dwcArr['individualCount'] = 1;
}
}
Expand Down

0 comments on commit 9160c57

Please sign in to comment.