use of org.hl7.fhir.r4b.model.Observation in project beneficiary-fhir-data by CMSgov.
the class DMEClaimTransformerV2Test method shouldHaveLineHctHgbRsltNumSupInfo.
@Test
public void shouldHaveLineHctHgbRsltNumSupInfo() {
SupportingInformationComponent sic = TransformerTestUtilsV2.findSupportingInfoByCode("https://bluebutton.cms.gov/resources/variables/line_hct_hgb_rslt_num", 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/line_hct_hgb_rslt_num", "Hematocrit / Hemoglobin Test Results")));
compare.setValue(new Reference("#line-observation-1"));
assertTrue(compare.equalsDeep(sic));
}
use of org.hl7.fhir.r4b.model.Observation in project beneficiary-fhir-data by CMSgov.
the class CarrierClaimTransformerV2Test method shouldHaveSupportingInfoListForClaimReceivedDate2.
@Test
public void shouldHaveSupportingInfoListForClaimReceivedDate2() {
SupportingInformationComponent sic = TransformerTestUtilsV2.findSupportingInfoByCode("info", 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/line_hct_hgb_rslt_num", "Hematocrit / Hemoglobin Test Results")));
compare.setValue(new Reference("#line-observation-6"));
assertTrue(compare.equalsDeep(sic));
}
use of org.hl7.fhir.r4b.model.Observation in project beneficiary-fhir-data by CMSgov.
the class TransformerUtilsV2 method findOrCreateContainedObservation.
static Observation findOrCreateContainedObservation(ExplanationOfBenefit eob, String id) {
Optional<Resource> observation = eob.getContained().stream().filter(r -> r.getId() == id).findFirst();
// If it isn't there, add one
if (!observation.isPresent()) {
observation = Optional.of(new Observation().setId(id));
eob.getContained().add(observation.get());
}
// At this point `observation.get()` will always return
if (!Observation.class.isInstance(observation.get())) {
throw new BadCodeMonkeyException();
}
return (Observation) observation.get();
}
use of org.hl7.fhir.r4b.model.Observation in project kindling by HL7.
the class PageProcessor method generateToc.
private String generateToc() throws Exception {
// return breadCrumbManager.makeToc();
List<String> entries = new ArrayList<String>();
entries.addAll(toc.keySet());
Collections.sort(entries, new SectionSorter());
Set<String> pages = new HashSet<String>();
HierarchicalTableGenerator gen = new HierarchicalTableGenerator(folders.dstDir, false, true);
TableModel model = gen.new TableModel("toc", true);
model.getTitles().add(gen.new Title(null, model.getDocoRef(), "Table of Contents", "Table of Contents", null, 0));
Deque<TocItem> stack = new ArrayDeque<TocItem>();
for (String s : entries) {
TocEntry t = toc.get(s);
if (!t.isIg() && !s.startsWith("?")) {
String nd = s;
while (nd.endsWith(".0")) nd = nd.substring(0, nd.length() - 2);
int d = Utilities.charCount(nd, '.');
if (d < 4 && !pages.contains(t.getLink())) {
String np = getNormativePackageForPage(t.getLink());
pages.add(t.getLink());
while (!stack.isEmpty() && stack.getFirst().depth >= d) stack.pop();
Row row = gen.new Row();
row.setIcon("icon_page.gif", null);
String td = t.getText();
if (!stack.isEmpty()) {
if (td.startsWith(stack.getFirst().entry.getText() + " - "))
td = td.substring(stack.getFirst().entry.getText().length() + 3);
else if (td.startsWith(stack.getFirst().entry.getText()))
td = td.substring(stack.getFirst().entry.getText().length());
}
Cell cell = gen.new Cell(null, t.getLink(), nd + " " + td, t.getText() + " ", null);
row.getCells().add(cell);
if (np != null) {
cell.addPiece(gen.new Piece(null, " ", null));
cell.addPiece(gen.new Piece("versions.html#std-process", "basic".equals(np) ? "(Normative)" : "(Normative / " + Utilities.capitalize(np) + ")", null).addStyle("color: #008000"));
if (np.equals("infrastructure"))
row.setIcon("icon_page_n_i.gif", null);
else if (np.equals("conformance"))
row.setIcon("icon_page_n_c.gif", null);
else if (np.equals("patient"))
row.setIcon("icon_page_n_p.gif", null);
else if (np.equals("observation"))
row.setIcon("icon_page_n_o.gif", null);
else
row.setIcon("icon_page_n.gif", null);
} else {
cell.addPiece(gen.new Piece(null, " ", null));
cell.addPiece(gen.new Piece("versions.html#std-process", "(Trial Use)", null).addStyle("color: #b3b3b3"));
}
if (stack.isEmpty())
model.getRows().add(row);
else
stack.getFirst().row.getSubRows().add(row);
stack.push(new TocItem(t, row, d));
}
}
}
return new XhtmlComposer(XhtmlComposer.HTML).compose(gen.generate(model, "", 0, null));
}
use of org.hl7.fhir.r4b.model.Observation in project kindling by HL7.
the class PageProcessor method profileDictionaryLink.
private String profileDictionaryLink(ConstraintStructure profile) {
String uri = ToolingExtensions.readStringExtension(profile.getResource(), "http://hl7.org/fhir/StructureDefinition/datadictionary");
if (Utilities.noString(uri))
return "<!-- no uri -->";
Dictionary dict = definitions.getDictionaries().get(uri);
if (dict == null)
return "<p>This profile specifies that the value of the " + profile.getResource().getSnapshot().getElement().get(0).getPath() + " resource must be a valid Observation as defined in the data dictionary (Unknown? - " + uri + ").</p>";
else
return "<p>This profile specifies that the value of the " + profile.getResource().getSnapshot().getElement().get(0).getPath() + " resource must be a valid Observation as defined in the data dictionary <a href=\"" + uri + ".html\">" + dict.getName() + "</a>.</p>";
}
Aggregations