Skip to content

Commit ce09d83

Browse files
author
Johan van Soest
committed
Array_shift only pops the first location from the stack, therefore randomly selecting a location where the trial was executed. Converted into a loop which parses all locations
1 parent 3d21e00 commit ce09d83

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

clinicaltrials/clinicaltrials.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -762,11 +762,12 @@ function process_file($infile) {
762762
# location of facility doing the testing
763763
##############################################################
764764
try {
765-
$location = @array_shift($root->xpath('//location'));
766-
if($location){
765+
$locations = $root->xpath('//location');
766+
foreach($locations AS $location) {
767767
$location_uri = parent::getRes().md5($location->asXML());
768-
$name = $this->getString('//facility/name',$location);
769-
$address = @array_shift($location->xpath('//facility/address'));
768+
$facility = $location->facility;
769+
$name = $facility->name[0];
770+
$address = $facility->address;//@array_shift($location->xpath('//facility/address'));
770771
$contact = @array_shift($location->xpath('//contact'));
771772
$backups = @array_shift($location->xpath('//contact_backup'));
772773
$investigators = @array_shift($location->xpath('//investigator'));

0 commit comments

Comments
 (0)