@@ -238,6 +238,7 @@ function parse_dir(){
238
238
function process_file ($ infile ) {
239
239
$ indir = parent ::getParameterValue ('indir ' );
240
240
$ xml = new CXML ($ infile );
241
+
241
242
$ this ->setCheckPoint ('file ' );
242
243
while ($ xml ->Parse ("clinical_study " ) == TRUE ) {
243
244
$ this ->setCheckPoint ('record ' );
@@ -364,16 +365,18 @@ function process_file($infile) {
364
365
######################################################################################
365
366
try {
366
367
$ oversight = @array_shift ($ root ->xpath ('//oversight_info ' ));
367
- $ oversight_id = parent ::getRes ().md5 ($ oversight ->asXML ());
368
+ if ($ oversight !== null ) {
369
+ $ oversight_id = parent ::getRes ().md5 ($ oversight ->asXML ());
368
370
369
- $ authority = $ this ->getString ('//authority ' , $ oversight );
370
- $ authority_id = parent ::getRes ().md5 ($ authority );
371
- parent ::addRDF (
372
- parent ::describeIndividual ($ oversight_id ,$ authority ,parent ::getVoc ()."Organization " ).
373
- parent ::triplify ($ study_id ,$ this ->getVoc ()."oversight " ,$ oversight_id ).
374
- parent ::triplify ($ study_id ,$ this ->getVoc ()."authority " ,$ authority_id ).
375
- parent ::triplifyString ($ oversight_id , parent ::getVoc ()."has-dmc " , $ this ->getString ('//has_dmc ' , $ oversight ))
376
- );
371
+ $ authority = $ this ->getString ('//authority ' , $ oversight );
372
+ $ authority_id = parent ::getRes ().md5 ($ authority );
373
+ parent ::addRDF (
374
+ parent ::describeIndividual ($ oversight_id ,$ authority ,parent ::getVoc ()."Organization " ).
375
+ parent ::triplify ($ study_id ,$ this ->getVoc ()."oversight " ,$ oversight_id ).
376
+ parent ::triplify ($ study_id ,$ this ->getVoc ()."authority " ,$ authority_id ).
377
+ parent ::triplifyString ($ oversight_id , parent ::getVoc ()."has-dmc " , $ this ->getString ('//has_dmc ' , $ oversight ))
378
+ );
379
+ }
377
380
} catch (Exception $ e ){
378
381
echo "There was an error in the oversight info element: $ e \n" ;
379
382
0 commit comments