Skip to content

Commit 43a7bcd

Browse files
authored
Merge pull request #30 from NHSDigital/validation/RemoveIsUKCoreCheck
Remove isUKCore check
2 parents 9016ad8 + 6cec998 commit 43a7bcd

2 files changed

Lines changed: 9 additions & 29 deletions

File tree

src/common.js.ts

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -695,10 +695,7 @@ export function buildCapabilityStatement(dir: string, file, api: any | void) {
695695
}
696696
}
697697

698-
699-
700-
701-
export function testFile( folderName: string, fileName: string, failOnWarning :boolean, isUKore: boolean)
698+
export function testFile( folderName: string, fileName: string, failOnWarning :boolean)
702699
{
703700
let client: AxiosInstance;
704701
let file = folderName + "/" + fileName;
@@ -813,27 +810,14 @@ export function testFile( folderName: string, fileName: string, failOnWarning :b
813810
}
814811
}
815812
if (validate) {
816-
if (!isUKore) {
817-
test('FHIR Validation', async () => {
818-
const response = await client.post('/$validate', resource).catch(function (error) {
819-
return error.response
820-
})
821-
expect(response.status === 200 || response.status === 400).toBeTruthy()
822-
resourceChecks(response, failOnWarning)
823-
expect(response.status).toEqual(200)
824-
});
825-
} else {
826-
827-
test('FHIR Validation - UKCore', async () => {
828-
const response = await client.post('/$validate?profile=https://fhir.hl7.org.uk/StructureDefinition/UKCore-' + json.resourceType, resource).catch(function (error) {
829-
return error.response
830-
})
831-
expect(response.status === 200 || response.status === 400).toBeTruthy()
832-
resourceChecks(response, failOnWarning)
833-
expect(response.status).toEqual(200)
813+
test('FHIR Validation', async () => {
814+
const response = await client.post('/$validate', resource).catch(function (error) {
815+
return error.response
834816
})
835-
}
836-
817+
expect(response.status === 200 || response.status === 400).toBeTruthy()
818+
resourceChecks(response, failOnWarning)
819+
expect(response.status).toEqual(200)
820+
});
837821
}
838822
}
839823
)

src/validate.test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ const args = require('minimist')(process.argv.slice(2))
1818
let source = '../'
1919
let examples: string
2020

21-
let isUKCore = false
22-
2321
let failOnWarning = false;
2422

2523
if (args!= undefined) {
@@ -38,9 +36,7 @@ const args = require('minimist')(process.argv.slice(2))
3836
if (resource != undefined) {
3937
let pkg = JSON.parse(resource)
4038
if (pkg.name.startsWith('fhir.r4.ukcore') || pkg.name.startsWith('UKCore')) {
41-
isUKCore = true;
4239
gitHubSummary += 'Detected UKCore ' + NEW_LINE;
43-
4440
}
4541
if (pkg.dependencies != undefined) {
4642
for (let key in pkg.dependencies) {
@@ -116,7 +112,7 @@ function testFolderContent(dir : string, source: string) {
116112

117113
} else {
118114
if (!isIgnoreFile(dir,file)) {
119-
testFile( dir, file, failOnWarning, isUKCore)
115+
testFile( dir, file, failOnWarning)
120116
}
121117
}
122118
})

0 commit comments

Comments
 (0)