Skip to content

Commit 1806ec8

Browse files
committed
Fixed issue with SHIC erroring because they did not have entries with a resource.section
Now we simply check if there are at least one entry in the fhir bundle. If not we error as empty fhir bundle.
1 parent 65b0cdc commit 1806ec8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lib/SHX.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,11 @@ async function _verifySHX(shx, passcode) {
169169
}
170170
// Check if the 'section' field is missing or empty in each FHIR bundle
171171
statusObj.bundles.forEach(bundle => {
172-
if (!bundle.fhir || !bundle.fhir.entry || !bundle.fhir.entry.some(entry => entry.resource && entry.resource.section)) {
173-
throw new DataMissingError("The provided Smart Health Link does not contain any healthcare data.");
172+
if (!bundle.fhir || !bundle.fhir.entry) {
173+
throw new DataMissingError("The provided Smart Health Link does not contain any data.");
174174
}
175175
});
176+
176177
// build up our organized resources
177178
const labelCounters = { };
178179
for (const i in statusObj.bundles) {

0 commit comments

Comments
 (0)