/** * @return Returns true if this Obs is complex. * @since 1.5 * @should return true if the concept is complex */ public boolean isComplex() { if (getConcept() != null) { return getConcept().isComplex(); } return false; }
private void handleExistingObsWithComplexConcept(Obs obs) { ComplexData complexData = obs.getComplexData(); Concept concept = obs.getConcept(); if (null != concept && concept.isComplex() && null != complexData && null != complexData.getData()) { // save or update complexData object on this obs // this is done before the database save so that the obs.valueComplex // can be filled in by the handler. ComplexObsHandler handler = getHandler(obs); if (null != handler) { handler.saveObs(obs); } else { throw new APIException("unknown.handler", new Object[] {concept}); } } }
/** * @see org.openmrs.api.ObsService#getHandler(org.openmrs.Obs) */ @Override @Transactional(readOnly = true) public ComplexObsHandler getHandler(Obs obs) throws APIException { if (obs.getConcept().isComplex()) { // Get the ConceptComplex from the ConceptService then return its // handler. if (obs.getConcept() == null) { throw new APIException("Obs.error.unable.get.handler", new Object[] { obs }); } String handlerString = Context.getConceptService().getConceptComplex(obs.getConcept().getConceptId()) .getHandler(); if (handlerString == null) { throw new APIException("Obs.error.unable.get.handler.and.concept", new Object[] { obs, obs.getConcept() }); } return this.getHandler(handlerString); } return null; }
if (!concept.isComplex()) { deleteSubclassConcept("concept_complex", concept.getConceptId());
if (concept != null && concept.isComplex()) { ComplexObsHandler handler = Context.getObsService().getHandler(((ConceptComplex) concept).getHandler()); if (handler instanceof SerializableComplexObsHandler) {
} else if (concept.isComplex()) { valueWidget = new UploadWidget(); String lookFor = existingObs == null ? null : existingObs.getValueComplex();