protected void setObservation(Observation observation) { int conceptColor = observationController.getConceptColor(observation.getConcept().getUuid()); String observationConceptType = observation.getConcept().getConceptType().getName(); if (StringUtil.equals(observationConceptType, "Complex")) { observationValue.setVisibility(View.GONE); observationComplex.setVisibility(View.VISIBLE); } else { observationValue.setVisibility(View.VISIBLE); observationComplex.setVisibility(View.GONE); observationValue.setTypeface(Fonts.roboto_medium(getContext())); observationValue.setTextColor(conceptColor); observationValue.setText(observation.getValueAsString()); } divider.setBackgroundColor(conceptColor); observationDate.setText( DateUtils.getMonthNameFormattedDate(observation.getObservationDatetime())); observationDate.setTypeface(Fonts.roboto_light(getContext())); observationDate.setTextColor(conceptColor); conceptQuestion.setBackgroundColor(conceptColor); conceptQuestion.setText(observation.getConcept().getName()); }
@Override protected List<Observation> doInBackground(String... params) { List<Observation> observations = null; try { observations = new ArrayList<Observation>(); List<Observation> observationsByPatient = observationController.getObservationsByPatient(encounter.getPatient().getUuid()); for (Observation obs : observationsByPatient) { if (obs.getEncounter().getUuid().equals(encounter.getUuid())) { observations.add(obs); } } } catch (ObservationController.LoadObservationException e) { Log.e(this.getClass().getSimpleName(), "Could not get Observations", e); } return observations; }