Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphTermServiceProvider should be more resilient to missing display names #2179

Open
lmsurpre opened this issue Mar 31, 2021 · 1 comment
Open
Labels
P3 Priority 3 - Nice To Have terminology

Comments

@lmsurpre
Copy link
Member

Is your feature request related to a problem? Please describe.
After a botched import, I had term content in the graph with no display name. This resulted in runtime errors like the following:

[2021-03-30T21:33:08.978+0000] 00000020 FHIRResource  E   An error occurred during the CodeSystem lookup operation
                                 com.ibm.fhir.exception.FHIROperationException: An error occurred during the CodeSystem lookup operation  [probeId=7f-0-0-1-a6a2c6c3-d13f-4937-9ea7-79c93c9f4a5c]
	at com.ibm.fhir.operation.term.LookupOperation.doInvoke(LookupOperation.java:52)
	at com.ibm.fhir.server.operation.spi.AbstractOperation.invoke(AbstractOperation.java:56)
	at com.ibm.fhir.server.util.FHIRRestHelper.doInvoke(FHIRRestHelper.java:1119)
	at com.ibm.fhir.server.resources.Operation.invoke(Operation.java:212)
	...
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: ele-1: All FHIR elements must have a @value or children
	at com.ibm.fhir.model.util.ValidationSupport.requireValueOrChildren(ValidationSupport.java:378)
	at com.ibm.fhir.model.type.String.<init>(String.java:30)
	at com.ibm.fhir.model.type.String$Builder.build(String.java:197)
	at com.ibm.fhir.model.type.String.string(String.java:58)
	at com.ibm.fhir.term.graph.provider.GraphTermServiceProvider.createConcept(GraphTermServiceProvider.java:558)
	at com.ibm.fhir.term.graph.provider.GraphTermServiceProvider.createConcept(GraphTermServiceProvider.java:546)
	at com.ibm.fhir.term.graph.provider.GraphTermServiceProvider.getConcept(GraphTermServiceProvider.java:601)
	at com.ibm.fhir.term.graph.provider.GraphTermServiceProvider.getConcept(GraphTermServiceProvider.java:122)
	at com.ibm.fhir.term.service.FHIRTermService.lookup(FHIRTermService.java:289)
	at com.ibm.fhir.operation.term.LookupOperation.doInvoke(LookupOperation.java:48)
	... 59 more

Describe the solution you'd like
Be more resilient to missing display codes.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Acceptance Criteria

Additional context
John mentioned that the lookup operation is already resilient to missing display values:

                    return LookupOutcome.builder()
                            .name((codeSystem.getName() != null) ? codeSystem.getName() : STRING_DATA_ABSENT_REASON_UNKNOWN)
                            .version(codeSystem.getVersion())
                            .display((concept.getDisplay() != null) ? concept.getDisplay() : STRING_DATA_ABSENT_REASON_UNKNOWN)
                            .property(concept.getProperty().stream()
                                .map(property -> Property.builder()
                                    .code(property.getCode())
                                    .value(property.getValue())
                                    .build())
                                .collect(Collectors.toList()))
                            .designation(concept.getDesignation().stream()
                                .map(designation -> Designation.builder()
                                    .language(designation.getLanguage())
                                    .use(designation.getUse())
                                    .value(designation.getValue())
                                    .build())
                                .collect(Collectors.toList()))
                            .build();

so I think we should just be more resilient in the GraphTermServiceProvider

@JohnTimm
Copy link
Collaborator

GraphTermServiceProvider is making some assumptions about what's in the graph. We can put in some logic to ensure that we don't attempt to set a display value if it isn't in the elementMap.

@JohnTimm JohnTimm self-assigned this Mar 31, 2021
@lmsurpre lmsurpre added the P3 Priority 3 - Nice To Have label Jun 7, 2021
@lmsurpre lmsurpre added this to the Sprint 2021-08 milestone Jun 7, 2021
@lmsurpre lmsurpre removed this from the Sprint 2021-09 milestone Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 Priority 3 - Nice To Have terminology
Projects
None yet
Development

No branches or pull requests

3 participants