Search in sources :

Example 61 with Patient

use of org.hl7.fhir.r4.model.Patient in project beneficiary-fhir-data by CMSgov.

the class PartDEventTransformerV2Test method shouldHavePtntRsdncCdSupInfo.

@Test
public void shouldHavePtntRsdncCdSupInfo() {
    SupportingInformationComponent sic = TransformerTestUtilsV2.findSupportingInfoByCode("https://bluebutton.cms.gov/resources/variables/ptnt_rsdnc_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/ptnt_rsdnc_cd", "Patient Residence Code")), // Code
    new Coding("https://bluebutton.cms.gov/resources/variables/ptnt_rsdnc_cd", "02", "Skilled Nursing Facility"));
    assertTrue(compare.equalsDeep(sic));
}
Also used : SupportingInformationComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.SupportingInformationComponent) Coding(org.hl7.fhir.r4.model.Coding) Test(org.junit.jupiter.api.Test)

Example 62 with Patient

use of org.hl7.fhir.r4.model.Patient in project beneficiary-fhir-data by CMSgov.

the class PartDEventTransformerV2Test method shouldHaveLineItemAdjudicationPlroAmt.

@Test
public void shouldHaveLineItemAdjudicationPlroAmt() {
    AdjudicationComponent adjudication = TransformerTestUtilsV2.findAdjudicationByCategory("https://bluebutton.cms.gov/resources/variables/plro_amt", eob.getItemFirstRep().getAdjudication());
    AdjudicationComponent compare = new AdjudicationComponent().setCategory(new CodeableConcept().setCoding(Arrays.asList(new Coding("http://hl7.org/fhir/us/carin-bb/CodeSystem/C4BBAdjudication", "priorpayerpaid", "Prior payer paid"), new Coding("https://bluebutton.cms.gov/resources/codesystem/adjudication", "https://bluebutton.cms.gov/resources/variables/plro_amt", "Reduction in patient liability due to payments by other payers (PLRO)")))).setAmount(new Money().setValue(42.42).setCurrency(TransformerConstants.CODED_MONEY_USD));
    assertTrue(compare.equalsDeep(adjudication));
}
Also used : Money(org.hl7.fhir.r4.model.Money) Coding(org.hl7.fhir.r4.model.Coding) AdjudicationComponent(org.hl7.fhir.r4.model.ExplanationOfBenefit.AdjudicationComponent) CodeableConcept(org.hl7.fhir.r4.model.CodeableConcept) Test(org.junit.jupiter.api.Test)

Example 63 with Patient

use of org.hl7.fhir.r4.model.Patient 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));
}
Also used : ArrayList(java.util.ArrayList) HierarchicalTableGenerator(org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator) ArrayDeque(java.util.ArrayDeque) ContactPoint(org.hl7.fhir.r5.model.ContactPoint) XhtmlComposer(org.hl7.fhir.utilities.xhtml.XhtmlComposer) Row(org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Row) Cell(org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.Cell) TableModel(org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.TableModel) HashSet(java.util.HashSet)

Example 64 with Patient

use of org.hl7.fhir.r4.model.Patient in project kindling by HL7.

the class PageProcessor method compResourceMap.

private String compResourceMap(String name) throws Exception {
    String n = name.split("\\-")[1];
    StringBuilder in = new StringBuilder();
    StringBuilder out = new StringBuilder();
    Map<ResourceDefn, String> map = definitions.getCompartmentByName(n).getResources();
    for (String rn : definitions.sortedResourceNames()) {
        ResourceDefn rd = definitions.getResourceByName(rn);
        String rules = map.get(rd);
        if (Utilities.noString(rules)) {
            out.append(" <li><a href=\"").append(rd.getName().toLowerCase()).append(".html\">").append(rd.getName()).append("</a></li>\r\n");
        } else if (!rules.equals("{def}")) {
            in.append(" <tr><td><a href=\"").append(rd.getName().toLowerCase()).append(".html\">").append(rd.getName()).append("</a></td><td>").append(rules.replace("|", "or")).append("</td></tr>\r\n");
        }
    }
    return "<p>\r\nThe following resources may be in this compartment:\r\n</p>\r\n" + "<table class=\"grid\">\r\n" + " <tr><td><b>Resource</b></td><td><b>Inclusion Criteria</b></td></tr>\r\n" + in.toString() + "</table>\r\n" + "<p>\r\nA resource is in this compartment if the nominated search parameter (or chain) refers to the patient resource that defines the compartment.\r\n</p>\r\n" + "<p>\r\n\r\n</p>\r\n" + "<p>\r\nThe following resources are never in this compartment:\r\n</p>\r\n" + "<ul>\r\n" + out.toString() + "</ul>\r\n";
}
Also used : CommaSeparatedStringBuilder(org.hl7.fhir.utilities.CommaSeparatedStringBuilder) ResourceDefn(org.hl7.fhir.definitions.model.ResourceDefn)

Example 65 with Patient

use of org.hl7.fhir.r4.model.Patient in project kindling by HL7.

the class PatternFinder method generateReport.

public String generateReport() throws FHIRException {
    StringBuilder output = new StringBuilder();
    Map<String, List<ReferenceElement>> set = new HashMap<>();
    for (ReferenceElement e : list) {
        String n = sortRefs(e.focus);
        if (!set.containsKey(n))
            set.put(n, new ArrayList<>());
        set.get(n).add(e);
    }
    List<String> sorted = new ArrayList<>();
    for (String n : set.keySet()) sorted.add(n);
    Collections.sort(sorted);
    output.append("<p>Participation type Patterns</p>\r\n");
    output.append("<table class=\"grid\">\r\n");
    // <b>RIM Classes</b>
    output.append("<tr><td><b>Resources</b></td><td><b>Pattern</b> (or candidates)</td><td><b>Locations</b></td></tr>\r\n");
    for (String s : sorted) {
        if (s.contains(",") && (s.contains("Patient") || s.contains("Practitioner") || s.contains("Organization"))) {
            addPatternToTable(s, set.get(s), output);
        }
    }
    output.append("</table>\r\n");
    output.append("<p>Other Patterns</p>\r\n");
    output.append("<table class=\"grid\">\r\n");
    output.append("<tr><td><b>Resources</b></td><td><b>Pattern</b> (or candidates)</td><td><b>Locations</b></td></tr>\r\n");
    for (String s : sorted) if (s.contains(",") && !(s.contains("Patient") || s.contains("Practitioner") || s.contains("Organization")))
        addPatternToTable(s, set.get(s), output);
    output.append("</table>\r\n");
    return output.toString();
}
Also used : CommaSeparatedStringBuilder(org.hl7.fhir.utilities.CommaSeparatedStringBuilder) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

Test (org.junit.Test)576 Test (org.junit.jupiter.api.Test)442 Patient (org.hl7.fhir.r4.model.Patient)437 IBaseResource (org.hl7.fhir.instance.model.api.IBaseResource)255 HashMap (java.util.HashMap)251 Patient (org.hl7.fhir.dstu3.model.Patient)249 IBundleProvider (ca.uhn.fhir.rest.api.server.IBundleProvider)228 Bundle (org.hl7.fhir.r4.model.Bundle)203 Path (javax.ws.rs.Path)188 Date (java.util.Date)171 Produces (javax.ws.rs.Produces)163 ArrayList (java.util.ArrayList)156 JsonObject (javax.json.JsonObject)141 SearchParameterMap (org.openmrs.module.fhir2.api.search.param.SearchParameterMap)140 MockHttpServletResponse (org.springframework.mock.web.MockHttpServletResponse)138 ReferenceParam (ca.uhn.fhir.rest.param.ReferenceParam)137 ReferenceAndListParam (ca.uhn.fhir.rest.param.ReferenceAndListParam)128 ReferenceOrListParam (ca.uhn.fhir.rest.param.ReferenceOrListParam)128 BaseModuleContextSensitiveTest (org.openmrs.test.BaseModuleContextSensitiveTest)125 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)120