Developing the "OCL for OpenMRS" Application

Hello Community

As per the recently concluded call, please see below a copy of the OCL Subscription traceback error

ERROR - ImportTask$1.run(77) |2019-04-24 19:05:02,973| Failed to import concept org.openmrs.module.openconceptlab.client.OclConcept@2c016d29[externalId=<null>]
org.openmrs.module.openconceptlab.importer.ImportException: Cannot create concept https://api.demo.openconceptlab.org/users/admin/sources/Run/concepts/b12fd941-fd51-431e-aad7-28a5a4059cdd/5cc087feb8059c0056629b67/
	at org.openmrs.module.openconceptlab.importer.Saver.saveConcept(Saver.java:105)
	at org.openmrs.module.openconceptlab.importer.ImportTask$1.run(ImportTask.java:73)
	at org.openmrs.api.context.Daemon$5.run(Daemon.java:286)
Caused by: java.lang.NullPointerException
INFO - LoggingAdvice.invoke(115) |2019-04-24 19:05:02,975| In method ImportService.saveItems. Arguments: Iterable=[org.openmrs.module.openconceptlab.Item@5f353ce5[itemId=<null>,uuid=<null>]], 
INFO - LoggingAdvice.invoke(155) |2019-04-24 19:05:02,979| Exiting method saveItems

cc: @c.antwi @dkayiwa

Can you share the full log via pastebin.com? If you are using the standalone version, it is in the tomcat logs folder in a file with today’s date.

I think there were errors specifically associated with the class filters (that might be MVP 2). Not sure what MVP 3 means. I think the critical bug was then when I add a concept to my collection which is a SET or QUESTION, all the dependent concepts need to be added to the collection as well.

1 Like

For future reference, since the demo server is reset every day, the concept it failed on is:

{
   "type":"Concept",
   "uuid":"5cc087feb8059c0056629b67",
   "id":"b12fd941-fd51-431e-aad7-28a5a4059cdd",
   "external_id":null,
   "concept_class":"drug",
   "datatype":"None",
   "display_name":"Run",
   "display_locale":"en",
   "names":[
      {
         "uuid":"8cb2f7ea619a4afd94f61fea8e2549ce",
         "external_id":null,
         "name":"Run",
         "locale":"en",
         "locale_preferred":true,
         "name_type":"Fully Specified",
         "type":"ConceptName"
      }
   ],
   "descriptions":[
      {
         "uuid":"707504238c5040e5bc3e2e80d5aa3e3a",
         "external_id":null,
         "description":"Run",
         "locale":"en",
         "locale_preferred":false,
         "description_type":null,
         "type":"ConceptDescription"
      }
   ],
   "retired":false,
   "source":"Run",
   "source_url":"/users/admin/sources/Run/",
   "owner":"admin",
   "owner_type":"User",
   "owner_url":"/users/admin/",
   "version":"5cc087feb8059c0056629b67",
   "created_on":"2019-04-24T11:59:58.499",
   "updated_on":"2019-04-24T11:59:58.541",
   "version_created_on":"2019-04-24T11:59:58.499",
   "version_created_by":"admin",
   "extras":null,
   "mappings":null,
   "is_latest_version":true,
   "locale":null,
   "version_url":"/users/admin/sources/Run/concepts/b12fd941-fd51-431e-aad7-28a5a4059cdd/5cc087feb8059c0056629b67/",
   "url":"/users/admin/sources/Run/concepts/b12fd941-fd51-431e-aad7-28a5a4059cdd/"
}

PS- @dkayiwa I suspect what they shared plus this json is enough to debug and we don’t need the full log, but of course they should share it anyway.

Hello @dkayiwa

Here is the Pastebin link

Hello Community,

We shall be having our demo call this week on Friday. Please install zoom in preparation for the call.

cc: @dkayiwa @cintiadr @akanter @darius @karuhanga @danuluma @alexkayabula @madraja18

The call will be at 15:00 UTC. Please confirm availability

cc: @akanter, @dkayiwa @c.antwi @madraja18 @darius

I’m not able to make that time on Friday (I have a standing meeting then), but I am typically available at 15:00 UTC on Wednesdays moving forward.

I plan to attend at 10am CDT/8am PDT

Yes, I’ll be there.

@paulk Please ensure that this meeting is captured in the calendar

Hello @c.antwi,

From my end, It seems like the meeting is captured on the calendar. Is this not the case from your end?

@raff I’d like some clarification on this. When adding a reference to a collection, here(https://github.com/OpenConceptLab/oclapi/wiki/collections#add-a-reference-to-a-collection)

My understanding is this query param;
cascade (optional) (default=none) string - It takes none or sourcemappings as a value.
is supposed to add references to each mapping to a collection i.e cascade when used. Is this correct? And if this is the intended behavior, it does not appear to be functioning correctly. The result says they were added, but they do not appear to be.

Additionally, it would be helpful if someone took a look at these issue on github.

Hi Lincoln-

cascade=sourcemappings will include mappings for which the referenced concept is set as a mapping’s “from_concept”. Meaning, it cascades to “direct mappings” only, not “indirect mappings”.

If this does not resolve the issue, please provide an example of a request that you are doing that is not working and detail the results (e.g. what is actually added to the collection compared to what should have been added)

Hey @paynejd,

I understood cascade to mean, if you add a reference to this concept to your collection, references to concepts in direct mappings will also be added. Is this the correct way of looking at it?

However,
If the cascade means ‘add references to this concept’s direct mappings as well’, then this parameter does work correctly(querying a collection’s references shows the cascaded mappings) and if this indeed is the case, then from a user’s point of view, what is the benefit of adding references to mappings only without adding references to the concept in the mapping to their collection?

Update: I’ve come to understand that mappings are independent entities entirely.

Basically, this boils down to; Is such a scenario supported by the api, or would this have to be done manually?
The expectation is when a question concept is added, its corresponding answer concepts should be added too

Hello Community

Just a simple reminder, we shall be having our demo call at 15:00 UTC today. We shall share a zoom link 1 hour to time but it is also on the OCL calendar

cc: @darius, @alexkayabula @dkayiwa, @karuhanga @c.antwi @danuluma @akanter @paynejd @madraja18

@paynejd, is there an automatic way that when you add a concept to a collection, is direct mappings are added and the concepts referenced by those concepts are recursively added?

For example you add a CIEL concept that’s a coded question and it should also add the (CIEL) answers.

1 Like

Very succinct, thanks @darius!

Hello @darius Just to give you the whole picture, we do have a workaround for this issue, however, an endpoint supporting this functionality would improve the performance of the app.

cc: @karuhanga @paynejd

Hello community here is the Zoom link for today’s check-in/demo at 15:00 UTC

https://andela.zoom.us/j/872155337

cc: @darius , @alexkayabula @dkayiwa, @karuhanga @c.antwi @danuluma @akanter @paynejd @madraja18