Skip to content

Commit

Permalink
Make sure all child artifacts get marked as isOwned, not just the mai…
Browse files Browse the repository at this point in the history
…n library
  • Loading branch information
elsaperelli committed Mar 21, 2024
1 parent db80380 commit 4f051a8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions service/scripts/dbSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,18 @@ async function uploadBundleResources(filePath: string) {
// that library's entry in the relatedArtifacts of the measure
const { modifiedEntry, url } = addIsOwnedExtension(ent);
if (url) ownedUrls.push(url);
// check if there are other isOwned urls but already in the relatedArtifacts
if (ent.resource?.resourceType === 'Measure' || ent.resource?.resourceType === 'Library') {
ent.resource.relatedArtifact?.forEach(ra => {
if (ra.type === 'composed-of') {
if (ra.extension?.some(e => e.url === 'http://hl7.org/fhir/StructureDefinition/artifact-isOwned')) {
if (ra.resource) {
ownedUrls.push(ra.resource);
}
}
}
});
}
return modifiedEntry;
});
const uploads = modifiedEntries.map(async entry => {
Expand Down

0 comments on commit 4f051a8

Please sign in to comment.