Skip to content

Commit

Permalink
MAT-6654 fixed fhir terminology validation
Browse files Browse the repository at this point in the history
  • Loading branch information
sb-prateekkeerthi committed Feb 1, 2024
1 parent 4e9d93b commit 4a9d2ea
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/validations/editorValidation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ describe("Editor Validation Test", () => {
"include FHIRHelpers version '4.0.1' \n" +
"codesystem \"ActPriority:HL7V3.0_2021-03\": 'http://terminology.hl7.org/CodeSystem/v3-ActPriority' version 'HL7V3.0_2021-03' \n" +
"code \"preop\": 'p' from \"ActPriority:HL7V3.0_2021-03\" display 'preop' \n" +
'valueset "ONC Administrative Sex": "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1" "url": \'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.\' \n';
'valueset "ONC Administrative Sex": "http://cts.nlm.nih.gov/fhirother/ValueSet/2.16.840.1.113762.1.4.1" "url": \'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.\' \n';

const elmTranslationWithValuesetError: ElmTranslation = {
externalErrors: [],
Expand Down
13 changes: 13 additions & 0 deletions src/validations/valuesetValidation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ const GetValueSetErrors = async (
valuesetsArray.map(async (valueSet) => {
const oid = getOidFromCqlValueSet(valueSet, model);
const locator = getLocatorFromCqlValueSet(valueSet);
if (model === "QICore") {
const splitValuesetUrl = valueSet?.url?.split("ValueSet/");
if (
splitValuesetUrl &&
splitValuesetUrl[0] !== "'http://cts.nlm.nih.gov/fhir/"
) {
const errorString = processValueSetErrorForElmTranslationError(

Check warning on line 24 in src/validations/valuesetValidation.ts

View check run for this annotation

Codecov / codecov/patch

src/validations/valuesetValidation.ts#L24

Added line #L24 was not covered by tests
`"valueset url(${valueSet.url}) is not in the correct format"`,
locator
);
valuesetsErrorArray.push(errorString);

Check warning on line 28 in src/validations/valuesetValidation.ts

View check run for this annotation

Codecov / codecov/patch

src/validations/valuesetValidation.ts#L28

Added line #L28 was not covered by tests
}
}
await terminologyServiceApi
.getValueSet(oid, locator, loggedInUMLS)
.then((response) => {
Expand Down

0 comments on commit 4a9d2ea

Please sign in to comment.