Hi All,
I’m having a problem importing my OCL collection to my local instance.
I have created my source(In OCL) and a collection that included a version. I have also installed the OCL module and using this I have tried to import the concept exported from the collection having all the configurations right I have this error which I don’t get what it means.
OpenMRS 2.6.1
Open Concept Lab Module 2.0.0
PS> I have tried to import by puting the exported version to into .OpenMRS/ocl/configuration/loadAtStartup/ but the error is the same
Log:
ERROR - ImportTask$1.run(80) |2024-11-26T12:46:52,415| Failed to import concept org.openmrs.module.openconceptlab.client.OclConcept@7f6d67a6[externalId=<null>]
org.openmrs.module.openconceptlab.importer.ImportException: Cannot create concept https://api.openconceptlab.org/users/psmatsinhe/sources/ps/concepts/55/6268843/
at org.openmrs.module.openconceptlab.importer.Saver.saveConcept(Saver.java:109) ~[openconceptlab.jar:?]
at org.openmrs.module.openconceptlab.importer.ImportTask$1.run(ImportTask.java:76) ~[openconceptlab.jar:?]
at org.openmrs.api.context.Daemon$6.run(Daemon.java:382) ~[openmrs-api-2.6.1.jar:?]
Caused by: java.lang.IllegalArgumentException: No enum constant org.openmrs.api.ConceptNameType.Fully-Specified
at java.lang.Enum.valueOf(Enum.java:238) ~[?:1.8.0_402]
at org.openmrs.api.ConceptNameType.valueOf(ConceptNameType.java:35) ~[openmrs-api-2.6.1.jar:?]
at org.openmrs.module.openconceptlab.importer.Saver$1.compare(Saver.java:698) ~[openconceptlab.jar:?]
at org.openmrs.module.openconceptlab.importer.Saver$1.compare(Saver.java:695) ~[openconceptlab.jar:?]
at java.util.TimSort.countRunAndMakeAscending(TimSort.java:355) ~[?:1.8.0_402]
at java.util.TimSort.sort(TimSort.java:220) ~[?:1.8.0_402]
at java.util.Arrays.sort(Arrays.java:1512) ~[?:1.8.0_402]
at java.util.ArrayList.sort(ArrayList.java:1464) ~[?:1.8.0_402]
at java.util.Collections.sort(Collections.java:177) ~[?:1.8.0_402]
at org.openmrs.module.openconceptlab.importer.Saver.sortedNames(Saver.java:695) ~[openconceptlab.jar:?]
at org.openmrs.module.openconceptlab.importer.Saver.updateOrAddNamesFromOcl(Saver.java:630) ~[openconceptlab.jar:?]
at org.openmrs.module.openconceptlab.importer.Saver.toConcept(Saver.java:252) ~[openconceptlab.jar:?]
at org.openmrs.module.openconceptlab.importer.Saver.saveConcept(Saver.java:107) ~[openconceptlab.jar:?]
Based on the error message, it appears that there might be a concept that doesn’t have a Fully Specified name on it. This may prevent OpenMRS from importing the concept correctly. You might want to check that the concept has a Fully Specified name within each locale.
Please update your version of the OCL module. 2.0.0 is 2 years old and this bug has been fixed in newer (but backwards compatible) versions of the module. The current version is 2.4.0.
Thanks for the feedback,
I have update the version and still having the other error I was having in the previous version
**externalId= null ** which from what I understand is
ERROR - ImportTask$1.run(108) |2024-11-27T13:34:42,342| Failed to import mapping org.openmrs.module.openconceptlab.client.OclMapping@40dac16a[externalId=<null>]
org.openmrs.module.openconceptlab.importer.ImportException: Cannot save mapping https://api.openconceptlab.org/users/psmatsinhe/sources/Jembi/mappings/9151068/
at org.openmrs.module.openconceptlab.importer.Saver.saveMapping(Saver.java:527) ~[openconceptlab.jar:?]
at org.openmrs.module.openconceptlab.importer.ImportTask$1.run(ImportTask.java:99) ~[openconceptlab.jar:?]
at org.openmrs.api.context.Daemon$6.run(Daemon.java:382) ~[openmrs-api-2.6.1.jar:?]
Caused by: java.lang.NullPointerException
ERROR - ImportTask$1.run(108) |2024-11-27T13:34:42,348| Failed to import mapping org.openmrs.module.openconceptlab.client.OclMapping@4541928c[externalId=<null>]
org.openmrs.module.openconceptlab.importer.ImportException: Cannot save mapping https://api.openconceptlab.org/users/psmatsinhe/sources/Jembi/mappings/9151066/
at org.openmrs.module.openconceptlab.importer.Saver.saveMapping(Saver.java:527) ~[openconceptlab.jar:?]
at org.openmrs.module.openconceptlab.importer.ImportTask$1.run(ImportTask.java:99) ~[openconceptlab.jar:?]
at org.openmrs.api.context.Daemon$6.run(Daemon.java:382) ~[openmrs-api-2.6.1.jar:?]
Caused by: java.lang.NullPointerException
ERROR - ImportTask$1.run(108) |2024-11-27T13:34:42,352| Failed to import mapping org.openmrs.module.openconceptlab.client.OclMapping@356e264b[externalId=<null>]
org.openmrs.module.openconceptlab.importer.ImportException: Cannot save mapping https://api.openconceptlab.org/users/psmatsinhe/sources/Jembi/mappings/9151064/
at org.openmrs.module.openconceptlab.importer.Saver.saveMapping(Saver.java:527) ~[openconceptlab.jar:?]
at org.openmrs.module.openconceptlab.importer.ImportTask$1.run(ImportTask.java:99) ~[openconceptlab.jar:?]
at org.openmrs.api.context.Daemon$6.run(Daemon.java:382) ~[openmrs-api-2.6.1.jar:?]
Caused by: java.lang.NullPointerException
Without the ability to see what you’re actually trying to import, I’m not really able to tell what’s going on—or even fix it so there’s a better error message. You might be able to see a different message in the Open Concept Lab view.
We require externalIds for concepts, but we generate them for mappings if they are missing (using the OCL URL of the mapping so that UUIDs are the same across systems).
What seems to be happening is some sort of failure either importing the from concept in the map or identifying the concept after it’s been imported. Haven’t really tracked down what’s happening there though.
So, this turns out to be much simpler than I thought: you have a number of concepts, e.g., 106 that don’t have an external id. Those fail to import and then the mappings that reference them also fail to import. Not sure why the error messages for those concepts don’t show up.