Recently, we changed ConceptSource such that hl7_code is nullable. See discussions around this topic here: http://n2.nabble.com/concept-map-method-hl7-code-td3695522.html#a3698357
Along these lines, I have been trying to use ConceptMap as a means for managing Concept requirements within my module, and in doing so, created a new ConceptSource, with name="org.openmrs.module.pihhaiti" and hl7_code = null. I then registered a bunch of ConceptMap entries for this ConceptSource.
I expected to be able to retrieve these Concepts using the following service method: ConceptService.getConceptByMapping(String conceptCode, String mappingCode);
However, this does not work. Looking at the implementation, I can see that HibernateConceptDAO.getConceptByMapping only matches mappingCode to ConceptSource.hl7_code, and does not check ConceptSource.name.
Perhaps this is by design. If it is by design, we should probably rename this service method to "getConceptByHL7Code()", otherwise, we should change the implementation such that it also looks at ConceptSource.name (patch attached for this fix).
It would also be useful to have methods that retrieved Concepts given a ConceptSource. Something like the following:
ConceptService.getConceptByMapping(ConceptSource source, String mapping);