Example usage for org.apache.commons.collections4 MapUtils getString

List of usage examples for org.apache.commons.collections4 MapUtils getString

Introduction

In this page you can find the example usage for org.apache.commons.collections4 MapUtils getString.

Prototype

public static <K> String getString(final Map<? super K, ?> map, final K key) 

Source Link

Document

Gets a String from a Map in a null-safe manner.

Usage

From source file:org.rippleosi.patient.laborders.search.LabOrderSummaryTransformer.java

@Override
public LabOrderSummary transform(Map<String, Object> input) {

    Date orderDate = DateFormatter.toDate(MapUtils.getString(input, "order_date"));

    LabOrderSummary labOrder = new LabOrderSummary();
    labOrder.setSource("Marand");
    labOrder.setSourceId(MapUtils.getString(input, "uid"));
    labOrder.setName(MapUtils.getString(input, "name"));
    labOrder.setOrderDate(orderDate);/* w w w  .j a v  a  2 s .c  o m*/

    return labOrder;
}

From source file:org.rippleosi.patient.labresults.search.EtherCISLabResultDetailsTransformer.java

@Override
public LabResultDetails transform(Map<String, Object> input) {

    Date sampleTaken = DateFormatter.toDate(MapUtils.getString(input, "sample_taken"));
    Date dateCreated = DateFormatter.toDate(MapUtils.getString(input, "date_created"));

    LabResultDetails labResult = new LabResultDetails();
    labResult.setSource("EtherCIS");
    labResult.setSourceId(MapUtils.getString(input, "uid"));
    labResult.setTestName(MapUtils.getString(input, "test_name"));
    labResult.setSampleTaken(sampleTaken);
    labResult.setDateCreated(dateCreated);
    labResult.setAuthor(MapUtils.getString(input, "author"));
    labResult.setConclusion(MapUtils.getString(input, "conclusion"));
    labResult.setStatus(MapUtils.getString(input, "status"));

    List<TestResult> testResults = extractTestResults(input);
    labResult.setTestResults(testResults);

    return labResult;
}

From source file:org.rippleosi.patient.labresults.search.EtherCISLabResultDetailsTransformer.java

private List<TestResult> extractTestResults(Map<String, Object> input) {

    TestResult testResult = new TestResult();
    testResult.setResult(MapUtils.getString(input, "result_name"));
    testResult.setValue(MapUtils.getString(input, "result_value"));
    testResult.setUnit(MapUtils.getString(input, "result_unit"));
    testResult.setComment(MapUtils.getString(input, "result_comment"));

    String lower = MapUtils.getString(input, "normal_range_lower");
    String upper = MapUtils.getString(input, "normal_range_upper");
    testResult.setNormalRange(lower + " > " + upper);

    List<TestResult> testResults = new ArrayList<>();
    testResults.add(testResult);/*from  w w w. ja  v  a  2 s.c o  m*/

    return testResults;
}

From source file:org.rippleosi.patient.labresults.search.EtherCISLabResultSummaryTransformer.java

@Override
public LabResultSummary transform(Map<String, Object> input) {

    Date sampleTaken = DateFormatter.toDate(MapUtils.getString(input, "sample_taken"));
    Date dateCreated = DateFormatter.toDate(MapUtils.getString(input, "date_created"));

    LabResultSummary labResult = new LabResultSummary();
    labResult.setSource("EtherCIS");
    labResult.setSourceId(MapUtils.getString(input, "uid"));
    labResult.setTestName(MapUtils.getString(input, "test_name"));
    labResult.setSampleTaken(sampleTaken);
    labResult.setDateCreated(dateCreated);

    return labResult;
}

From source file:org.rippleosi.patient.labresults.search.LabResultDetailsTransformer.java

@Override
public LabResultDetails transform(Map<String, Object> input) {

    Date sampleTaken = DateFormatter.toDate(MapUtils.getString(input, "sample_taken"));
    Date dateCreated = DateFormatter.toDate(MapUtils.getString(input, "date_created"));

    LabResultDetails labResult = new LabResultDetails();
    labResult.setSource("Marand");
    labResult.setSourceId(MapUtils.getString(input, "uid"));
    labResult.setTestName(MapUtils.getString(input, "test_name"));
    labResult.setSampleTaken(sampleTaken);
    labResult.setDateCreated(dateCreated);
    labResult.setAuthor(MapUtils.getString(input, "author"));
    labResult.setConclusion(MapUtils.getString(input, "conclusion"));
    labResult.setStatus(MapUtils.getString(input, "status"));

    List<LabResultDetails.TestResult> testResults = createTestResults(input);

    labResult.setTestResults(testResults);

    return labResult;
}

From source file:org.rippleosi.patient.labresults.search.LabResultSummaryTransformer.java

@Override
public LabResultSummary transform(Map<String, Object> input) {

    Date sampleTaken = DateFormatter.toDate(MapUtils.getString(input, "sample_taken"));
    Date dateCreated = DateFormatter.toDate(MapUtils.getString(input, "date_created"));

    LabResultSummary labResult = new LabResultSummary();
    labResult.setSource("Marand");
    labResult.setSourceId(MapUtils.getString(input, "uid"));
    labResult.setTestName(MapUtils.getString(input, "test_name"));
    labResult.setSampleTaken(sampleTaken);
    labResult.setDateCreated(dateCreated);

    return labResult;
}

From source file:org.rippleosi.patient.mdtreports.search.MDTReportDetailsTransformer.java

@Override
public MDTReportDetails transform(Map<String, Object> input) {

    Date dateOfRequest = DateFormatter.toDate(MapUtils.getString(input, "date_created"));
    Date dateOfMeeting = DateFormatter.toDateOnly(MapUtils.getString(input, "meeting_date"));
    Date timeOfMeeting = DateFormatter.toTimeOnly(MapUtils.getString(input, "meeting_date"));

    MDTReportDetails mdtReport = new MDTReportDetails();
    mdtReport.setSource("Marand");
    mdtReport.setSourceId(MapUtils.getString(input, "uid"));
    mdtReport.setServiceTeam(MapUtils.getString(input, "service_team"));
    mdtReport.setDateOfRequest(dateOfRequest);
    mdtReport.setDateOfMeeting(dateOfMeeting);
    mdtReport.setTimeOfMeeting(timeOfMeeting);
    mdtReport.setQuestion(MapUtils.getString(input, "question"));
    mdtReport.setNotes(MapUtils.getString(input, "notes"));

    return mdtReport;
}

From source file:org.rippleosi.patient.mdtreports.search.MDTReportSummaryTransformer.java

@Override
public MDTReportSummary transform(Map<String, Object> input) {

    Date dateOfRequest = DateFormatter.toDate(MapUtils.getString(input, "date_created"));
    Date dateOfMeeting = DateFormatter.toDateOnly(MapUtils.getString(input, "meeting_date"));

    MDTReportSummary mdtReport = new MDTReportSummary();
    mdtReport.setSource("Marand");
    mdtReport.setSourceId(MapUtils.getString(input, "uid"));
    mdtReport.setServiceTeam(MapUtils.getString(input, "service_team"));
    mdtReport.setDateOfRequest(dateOfRequest);
    mdtReport.setDateOfMeeting(dateOfMeeting);

    return mdtReport;
}

From source file:org.rippleosi.patient.medication.search.EtherCISMedicationDetailsTransformer.java

@Override
public MedicationDetails transform(Map<String, Object> input) {

    String startDateTimeAsString = MapUtils.getString(input, "start_date");
    String dateCreatedAsString = MapUtils.getString(input, "date_created");

    Date startDate = DateFormatter.toDateOnly(startDateTimeAsString);
    Date startTime = DateFormatter.toTimeOnly(startDateTimeAsString);
    Date dateCreated = DateFormatter.toDate(dateCreatedAsString);

    MedicationDetails medication = new MedicationDetails();
    medication.setSource("EtherCIS");
    medication.setSourceId(MapUtils.getString(input, "uid"));
    medication.setName(MapUtils.getString(input, "name"));
    medication.setDoseAmount(MapUtils.getString(input, "dose_amount"));
    medication.setDoseTiming(MapUtils.getString(input, "dose_timing"));
    medication.setDoseDirections(MapUtils.getString(input, "dose_directions"));
    medication.setRoute(MapUtils.getString(input, "route"));
    medication.setMedicationCode(MapUtils.getString(input, "medication_code"));
    medication.setMedicationTerminology(MapUtils.getString(input, "medication_terminology"));
    medication.setStartDate(startDate);//from  ww w. ja v  a  2  s .c o  m
    medication.setStartTime(startTime);
    medication.setAuthor(MapUtils.getString(input, "author"));
    medication.setDateCreated(dateCreated);

    return medication;
}

From source file:org.rippleosi.patient.medication.search.EtherCISMedicationHeadlineTransformer.java

@Override
public MedicationHeadline transform(Map<String, Object> input) {

    MedicationHeadline medication = new MedicationHeadline();
    medication.setSource("EtherCIS");
    medication.setSourceId(MapUtils.getString(input, "uid"));
    medication.setName(MapUtils.getString(input, "name"));

    return medication;
}