Skip to content

Commit

Permalink
Merge pull request #1152 from NFDI4Chem/sample-relatedidentifiers
Browse files Browse the repository at this point in the history
fix: add related identifiers to the doi metadata of separate samples.
  • Loading branch information
CS76 authored Aug 1, 2024
2 parents 8536c26 + 7268148 commit 5d09836
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion app/Jobs/ProcessSubmission.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public function handle(AssignIdentifier $assigner, UpdateDOI $updater, PublishPr
$studyPublisher->publish($study);
}
}

$updater->update($_studies);
//Notification::send($this->prepareSendList($project), new StudyPublishNotification($_studies));
event(new StudyPublish($_studies, $this->prepareSendList($project)));

Expand Down
29 changes: 17 additions & 12 deletions app/Models/HasDOI.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,14 @@ public function addRelatedIdentifiers($doiService)
$this->save();

} elseif ($this instanceof Study) {
$relatedIdentifier = [
'relatedIdentifier' => $this->project->doi,
'relatedIdentifierType' => 'DOI',
'relationType' => 'IsPartOf',
];
array_push($attributes['relatedIdentifiers'], $relatedIdentifier);
if ($this->project) {
$relatedIdentifier = [
'relatedIdentifier' => $this->project->doi,
'relatedIdentifierType' => 'DOI',
'relationType' => 'IsPartOf',
];
array_push($attributes['relatedIdentifiers'], $relatedIdentifier);
}
foreach ($this->datasets as &$dataset) {
$relatedIdentifier = [
'relatedIdentifier' => $dataset->doi,
Expand All @@ -291,12 +293,15 @@ public function addRelatedIdentifiers($doiService)
$this->datacite_schema = $doiResponse;
$this->save();
} elseif ($this instanceof Dataset) {
$relatedIdentifier = [
'relatedIdentifier' => $this->project->doi,
'relatedIdentifierType' => 'DOI',
'relationType' => 'IsPartOf',
];
array_push($attributes['relatedIdentifiers'], $relatedIdentifier);
if ($this->project) {
$relatedIdentifier = [
'relatedIdentifier' => $this->project->doi,
'relatedIdentifierType' => 'DOI',
'relationType' => 'IsPartOf',
];
array_push($attributes['relatedIdentifiers'], $relatedIdentifier);
}

$relatedIdentifier = [
'relatedIdentifier' => $this->study->doi,
'relatedIdentifierType' => 'DOI',
Expand Down

0 comments on commit 5d09836

Please sign in to comment.