Importing Concepts into Openmrs from OCL Term Browser

I’m currently having some difficulties importing mappings from the OCL term browser into Openmrs.

The concepts which i have mapped with the mapped type CONCEPT-SET don’t import with the related concepts. I have noticed that there is no CONCEPT-SET mapping in openmrs, not sure if that could be the issue.

1 Like

So CONCEPT-SET is a “special” mapping type for OpenMRS. It gets processed into an OpenMRS ConceptSet. In OpenMRS ConceptSets are not implemented as mappings but as full domain objects. The other special case is Q-AND-A for mapping question answers.

The problem here is that you have a mapping that references a concept but the concept that the mapping is from doesn’t exist in your exported collection. From the error messages, it looks like your collection is missing BAH-00081, presumably defined in your custom source. If you add that concept to your collection those errors should go away, though you may have others.

@paynejd @jamlung Would OCL be able to support a rule that for CONCEPT-SET and Q-AND-A mappings in a collection the concept referenced on either side of the mapping needs to be included in the collection? This would be another OpenMRS-specific rule.

2 Likes

The collection does contain the concept BAH-00081 which is why i’m wondering why it is giving me this error.

Are you able to post the export file for your collection? I don’t think I have access to it.

Do you have OpenMRS custom validation schema enabled for your source?

Currently, setting this after a source has concepts in it can takes a while (for a small dictionary with a few hundred concepts, applying this schema should only take a few seconds; for a large dictionary like CIEL, it can take 20-30 minutes). This is because the concept validation rules are checked for all concepts before the custom schema is actually changed. The UI is currently designed as if it’s an instant change (change the dropdown for schema and click the save button), but the operation takes a while. So, you have to edit your source, select the OpenMRS custom validation schema, save the change and then patiently wait (I’d suggest 15-30 minutes) before checking to see if the change to the new schema was successful. If the OpenMRS custom validation schema setting does not persist (reverts to None), it means there were validation errors and you’ll need to reach out to the OCL team via Slack to get the report (a JSON output listing specific validation errors encountered), address those issues, and try again.

If there are validation errors in the source, the OCL module in its current state will probably not provide very gracious/informative hints into the errors. If you have the OpenMRS custom validation schema set on your source, it will ensure none of the errors are validation issues and prevent you from introducing new ones in OCL.

Would you have to reach out to the OCL team for a new report every time you try again?

CC @suruchi

AFAIK, the results from trying to apply the custom validation schema aren’t (yet) available through the UI. If these become frequent requests, I imagine that might change. :wink:

Ian- Good idea to include this rule in the OpenMRS Validation Schema. Created a ticket here: https://github.com/OpenConceptLab/ocl_issues/issues/1341