use of org.hl7.fhir.utilities.validation.ValidationMessage.Source in project beneficiary-fhir-data by CMSgov.
the class InpatientClaimTransformerV2Test method shouldHaveClmSrcIpAdmsnCdSupInfo.
@Test
public void shouldHaveClmSrcIpAdmsnCdSupInfo() {
SupportingInformationComponent sic = TransformerTestUtilsV2.findSupportingInfoByCode("https://bluebutton.cms.gov/resources/variables/clm_src_ip_admsn_cd", eob.getSupportingInfo());
SupportingInformationComponent compare = TransformerTestUtilsV2.createSupportingInfo(// We don't care what the sequence number is here
sic.getSequence(), // Category
Arrays.asList(new Coding("http://terminology.hl7.org/CodeSystem/claiminformationcategory", "info", "Information"), new Coding("https://bluebutton.cms.gov/resources/codesystem/information", "https://bluebutton.cms.gov/resources/variables/clm_src_ip_admsn_cd", "Claim Source Inpatient Admission Code")), // Code
new Coding("https://bluebutton.cms.gov/resources/variables/clm_src_ip_admsn_cd", "4", null));
assertTrue(compare.equalsDeep(sic));
}
use of org.hl7.fhir.utilities.validation.ValidationMessage.Source in project beneficiary-fhir-data by CMSgov.
the class SNFClaimTransformerV2Test method shouldHaveClmSrcIpAdmsnCdSupInfo.
@Test
public void shouldHaveClmSrcIpAdmsnCdSupInfo() {
SupportingInformationComponent sic = TransformerTestUtilsV2.findSupportingInfoByCode("https://bluebutton.cms.gov/resources/variables/clm_src_ip_admsn_cd", eob.getSupportingInfo());
SupportingInformationComponent compare = TransformerTestUtilsV2.createSupportingInfo(// We don't care what the sequence number is here
sic.getSequence(), // Category
Arrays.asList(new Coding("http://terminology.hl7.org/CodeSystem/claiminformationcategory", "info", "Information"), new Coding("https://bluebutton.cms.gov/resources/codesystem/information", "https://bluebutton.cms.gov/resources/variables/clm_src_ip_admsn_cd", "Claim Source Inpatient Admission Code")), // Code
new Coding("https://bluebutton.cms.gov/resources/variables/clm_src_ip_admsn_cd", "4", null));
assertTrue(compare.equalsDeep(sic));
}
use of org.hl7.fhir.utilities.validation.ValidationMessage.Source in project kindling by HL7.
the class Publisher method stripXml.
private InputStream stripXml(InputStream source) throws Exception {
XmlParser p = new XmlParser();
Resource r = p.parse(source);
minify(r);
ByteArrayOutputStream bo = new ByteArrayOutputStream();
p.compose(bo, r);
bo.close();
return new ByteArrayInputStream(bo.toByteArray());
}
use of org.hl7.fhir.utilities.validation.ValidationMessage.Source in project kindling by HL7.
the class Publisher method minify.
private void minify(String srcFile, String dstFile) throws Exception {
CloseProtectedZipInputStream source = new CloseProtectedZipInputStream(new FileInputStream(srcFile));
ZipGenerator dest = new ZipGenerator(dstFile);
ZipEntry entry = null;
while ((entry = source.getNextEntry()) != null) {
String name = entry.getName();
if (name.endsWith(".xsd"))
dest.addStream(entry.getName(), stripXsd(source), false);
else if (name.endsWith(".json") && !name.endsWith(".schema.json"))
dest.addStream(entry.getName(), stripJson(source), false);
else if (name.endsWith(".xml"))
dest.addStream(entry.getName(), stripXml(source), false);
else
dest.addStream(entry.getName(), source, false);
}
source.actualClose();
dest.close();
}
use of org.hl7.fhir.utilities.validation.ValidationMessage.Source in project kindling by HL7.
the class Publisher method cachePage.
private void cachePage(String filename, String source, String title, boolean includeInBook) throws Exception {
try {
// page.log("parse "+filename);
XhtmlDocument src = new XhtmlParser().parse(source, "html");
scanForFragments(filename, src);
// book.getPages().put(filename, src);
page.getHTMLChecker().registerFile(filename, title, HTMLLinkChecker.XHTML_TYPE, includeInBook);
} catch (Exception e) {
throw new Exception("error parsing page " + filename + ": " + e.getMessage() + " in source\r\n" + source, e);
}
}
Aggregations