@@ -0,0 +1,2101 @@
+package gov.va.oia.terminology.converters.sharedUtils;%0A%0Aimport gov.vha.isaac.metadata.source.IsaacMetadataAuxiliaryBinding;%0Aimport java.io.DataInputStream;%0Aimport java.io.File;%0Aimport java.io.FileInputStream;%0Aimport java.io.IOException;%0Aimport java.util.HashMap;%0Aimport java.util.UUID;%0Aimport org.ihtsdo.otf.tcc.dto.TtkConceptChronicle;%0Aimport org.ihtsdo.otf.tcc.dto.component.identifier.TtkIdentifier;%0A%0Apublic class SCTInfoProvider%0A%7B%0A%09public static HashMap%3CLong, UUID%3E readSCTIDtoUUIDMapInfo(File snomedLocation) throws ClassNotFoundException, IOException%0A%09%7B%0A%09%09File snomedJbinFile = null;%0A%09%09if (snomedLocation.isDirectory())%0A%09%09%7B%0A%09%09%09for (File f : snomedLocation.listFiles())%0A%09%09%09%7B%0A%09%09%09%09if (f.isFile() && f.getName().toLowerCase().endsWith(%22.jbin%22))%0A%09%09%09%09%7B%0A%09%09%09%09%09snomedJbinFile = f;%0A%09%09%09%09%09break;%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%0A%09%09else%0A%09%09%7B%0A%09%09%09snomedJbinFile = snomedLocation;%0A%09%09%7D%0A%09%09if (snomedJbinFile == null)%0A%09%09%7B%0A%09%09%09throw new IOException(%22Couldn't find sct data file in %22 + snomedLocation);%0A%09%09%7D%0A%09%09%0A%09%09UUID sctIDType = IsaacMetadataAuxiliaryBinding.SNOMED_INTEGER_ID.getPrimodialUuid();%0A%09%09// Read in the SCT data%0A%09%09HashMap%3CLong, UUID%3E sctConcepts = new HashMap%3C%3E();%0A%09%09ConsoleUtil.println(%22Reading %22 + snomedJbinFile.getName());%0A%09%09DataInputStream in = new DataInputStream(new FileInputStream(snomedJbinFile));%0A%0A%09%09while (in.available() %3E 0)%0A%09%09%7B%0A%09%09%09if (sctConcepts.size() %25 1000 == 0)%0A%09%09%09%7B%0A%09%09%09%09ConsoleUtil.showProgress();%0A%09%09%09%7D%0A%09%09%09TtkConceptChronicle concept = new TtkConceptChronicle(in);%0A%0A%09%09%09if (concept.getConceptAttributes() != null && concept.getConceptAttributes().getAdditionalIdComponents() != null)%0A%09%09%09%7B%0A%09%09%09%09for (TtkIdentifier id : concept.getConceptAttributes().getAdditionalIdComponents())%0A%09%09%09%09%7B%0A%09%09%09%09%09if (sctIDType.equals(id.getAuthorityUuid()))%0A%09%09%09%09%09%7B%0A%09%09%09%09%09%09//Store these by SCTID, because there is no reliable way to generate a UUID from a SCTID.%0A%09%09%09%09%09%09sctConcepts.put(Long.parseLong(id.getDenotation().toString()), concept.getPrimordialUuid());%0A%09%09%09%09%09%09break;%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%0A%09%09%7D%0A%09%09in.close();%0A%09%09ConsoleUtil.println(%22Read UUIDs from SCT file - read %22 + sctConcepts.size() + %22 concepts%22);%0A%09%09return sctConcepts;%0A%09%7D%0A%7D%0A

add a utility class for making a UUID to SCTID map from SCT content