Skip to content

Conversation

@ibacher
Copy link
Member

@ibacher ibacher commented Nov 15, 2021

…e concept exists

This includes one of the key features from #84 but in a slightly different way (instead of using ConceptService#getConceptByMapping() this includes a custom implementation that depends on the SAME-AS mapping).

@ibacher ibacher requested a review from mseaton November 15, 2021 22:26
@ibacher
Copy link
Member Author

ibacher commented Nov 15, 2021

I'll be honest, I don't understand the compilation failure. I'll look into it tomorrow.

Copy link
Member

@mseaton mseaton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few comments @ibacher - if there are build failures I can try to build locally and see what I find...

*/
@Transactional(readOnly = true)
@Authorized(PrivilegeConstants.VIEW_CONCEPTS)
Concept getDuplicateConceptByMapping(String conceptId, String source);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find this method name confusing. Can we just call it "getConceptWithSameAsMapping"? And name "conceptId" -> "code"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, the name arose because I was planning on eventually including Burke's "CODE" mapping if / when that comes about, but yeah, I suppose that's more accurate.

<ref bean="openconceptlab.conceptService"/>
</list>
</property>
</bean>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to list this twice, or can we list it once and have the two services in the list?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably something we should fix at some point, but the setModuleServiceMethod() only processes the first two arguments, so it's necessary to invoke this twice.

if (cacheService.getConceptByMapping(oclConcept.getSource(), oclConcept.getId()) != null) {
return new Item(thisImport, oclConcept, ItemState.UP_TO_DATE);
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain this block? I may need to see it better in context, but might this prevent updates from happening?

Copy link
Member Author

@ibacher ibacher Nov 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs an extra guard, but the idea is this: If I have a concept in my dictionary marked SAME-AS CIEL:1066, then we shouldn't load the concept CIEL:1066 into the concept dictionary. The extra guard is to make sure that that item isn't the same as the item we're importing (based on the OCL URL).

Originally, I had this written to return an ItemState.DUPLICATE, but I wasn't sure it was worth the effort to add a new ItemState for this. I can add that back in, though, if it would make things clearer.

@mseaton
Copy link
Member

mseaton commented Nov 16, 2021

I'll be honest, I don't understand the compilation failure. I'll look into it tomorrow

I had a weird experience the other day with a build failure I couldn't explain. I ended up fixing it by removing the Maven cache step from the github action. It had ended up with a bad artifact in the cache and was causing it to fail...

@mseaton
Copy link
Member

mseaton commented Nov 16, 2021

I had a weird experience the other day with a build failure I couldn't explain. I ended up fixing it by removing the Maven cache step from the github action. It had ended up with a bad artifact in the cache and was causing it to fail...

Looks like you just tried this @ibacher and it didn't fix it. Weird. I'm running locally on Ubuntu 20 with Maven 3.6.3 and OpenJDK 1.8.0_292 and things work. Looks like GA is using a JDK from Azul Systems, version 1.8.0_212 and Maven 3.8.3. I suppose that might be where the issue lies?

Copy link
Member

@mseaton mseaton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, assuming we can get it to pass the build in github :)

@ibacher
Copy link
Member Author

ibacher commented Nov 16, 2021

Yeah... it works for me on AdoptOpenJDK 1.8.0_292 and Maven 3.8.1 locally. I've tried adjusting the build to use a simpler workflow and AdoptOpenJDK so it's as close to my environment as possible.

@ibacher ibacher changed the title OCLOMRS-1008: Don't load a concept when a SAME-AS mapping to that sam… OCLOMRS-1008: Use existing mapped concepts instead of creating new ones Nov 16, 2021
@ibacher ibacher merged commit 7664e37 into master Nov 16, 2021
@ibacher ibacher deleted the OCLOMRS-1008 branch November 16, 2021 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants