Skip to content

Commit

Permalink
MAT-8080: When retrieving Code System data from VSAC, ignore the HCPC…
Browse files Browse the repository at this point in the history
…S Level 1 OID.
  • Loading branch information
jkotanchik-SB committed Jan 7, 2025
1 parent af474de commit 3775ae6
Showing 1 changed file with 19 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -371,13 +371,6 @@ private void recursiveRetrieveCodeSystems(
.forEach(
entry -> {
var codeSystem = (org.hl7.fhir.r4.model.CodeSystem) entry.getResource();
String codeSystemValue = "";
for (Identifier identifier : codeSystem.getIdentifier()) {
if (identifier.getValue() != null && !identifier.getValue().isEmpty()) {
codeSystemValue = identifier.getValue();
break;
}
}
codeSystemsPage.add(
CodeSystem.builder()
.id(codeSystem.getTitle() + codeSystem.getVersion())
Expand All @@ -386,7 +379,7 @@ private void recursiveRetrieveCodeSystems(
.name(codeSystem.getName())
.version(codeSystem.getVersion())
.versionId(codeSystem.getMeta().getVersionId())
.oid(codeSystemValue)
.oid(parseOidFromIdentifier(codeSystem.getIdentifier()))
.lastUpdated(Instant.now())
.lastUpdatedUpstream(codeSystem.getMeta().getLastUpdated())
.build());
Expand All @@ -408,6 +401,24 @@ private void recursiveRetrieveCodeSystems(
});
}

private String parseOidFromIdentifier(List<Identifier> identifiers) {
for (Identifier identifier : identifiers) {
if (identifier.getValue() != null && !identifier.getValue().isEmpty()) {
// HCPCS contains two OIDs, which VSAC returns as comma delimited String.
// MADiE is only concerned with the Level 2 OID ending in .285 as it
// CMS's custom codes. Level 1 is a duplicate of CPT, and
// users should be utilizing CPT directly.
if (StringUtils.equalsIgnoreCase(
StringUtils.deleteWhitespace(identifier.getValue()),
"urn:oid:2.16.840.1.113883.6.14,2.16.840.1.113883.6.285")) {
return "2.16.840.1.113883.6.285";
}
return identifier.getValue();
}
}
return "";
}

// one to call only, one to mutate and build
private Bundle retrieveCodeSystemsPage(UmlsUser umlsUser, Integer offset, Integer count) {
IParser parser = fhirContext.newJsonParser();
Expand Down

0 comments on commit 3775ae6

Please sign in to comment.