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

ITI-65 returns error when handling PADV with comments #27

Closed
arhuberg opened this issue Jan 12, 2023 · 8 comments
Closed

ITI-65 returns error when handling PADV with comments #27

arhuberg opened this issue Jan 12, 2023 · 8 comments
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@arhuberg
Copy link

{
"resourceType": "OperationOutcome",
"issue": [ {
"severity": "warning",
"code": "invalid",
"details": {
"coding": [ {
"code": "EXTRA_METADATA_NOT_SAVED"
} ],
"text": "DocumentEntry.sourcePatientInfo has not been saved"
}
}, {
"severity": "error",
"code": "invalid",
"details": {
"coding": [ {
"code": "REGISTRY_ERROR"
} ],
"text": "The PMP has encountered an internal error while aggregating the CDA document '5f8dd3db-ccb7-432b-84c3-06727d4f0cf8', item: 'efd21f98-69d9-4b38-9a1d-7af7043240b9'"
}
} ]
}

@arhuberg
Copy link
Author

arhuberg commented Jan 12, 2023

Not sure if this is the associated trace message:

[2023-01-12 18:25:28] [info] 2023-01-12 18:25:28.421 DEBUG [io-8080-exec-33] c.l.PatientWriteOpLockRegistry: Acquiring patient write operation lock for 64370848-bed5-46c4-972f-05b410b59235
[2023-01-12 18:25:28] [info] 2023-01-12 18:25:28.421 DEBUG [io-8080-exec-33] t.p.p.ProvideDocumentProcessor: Route: ProvideDocumentProcessor
[2023-01-12 18:25:28] [info] 2023-01-12 18:25:28.421 WARN [io-8080-exec-33] hir.parser.LenientErrorHandler: Unknown element 'id' found while parsing
[2023-01-12 18:25:28] [info] 2023-01-12 18:25:28.800 INFO [io-8080-exec-33] ProvideEmedDocumentCoprocessor: The document is invalid
[2023-01-12 18:25:28] [info] 2023-01-12 18:25:28.801 INFO [io-8080-exec-33] ProvideEmedDocumentCoprocessor: SingleValidationMessage[col=287,row=1,locationString=Bundle.entry[0],message=This element does not match any known slice defined in the profile http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-document-pharmaceuticaladvice,severity=information]
[2023-01-12 18:25:28] [info] 2023-01-12 18:25:28.801 INFO [io-8080-exec-33] ProvideEmedDocumentCoprocessor: SingleValidationMessage[col=2,row=1,locationString=Bundle,message=Bundle.entry:Composition: minimum required = 1, but only found 0 (from http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-document-pharmaceuticaladvice),severity=error]
[2023-01-12 18:25:28] [info] 2023-01-12 18:25:28.801 INFO [io-8080-exec-33] ProvideEmedDocumentCoprocessor: SingleValidationMessage[col=1326,row=1,locationString=Bundle.entry[0].resource.ofType(Composition).confidentiality.extension[0].value.ofType(CodeableConcept),message=None of the codings provided are in the value set 'DocumentEntry.confidentialityCode' (http://fhir.ch/ig/ch-epr-term/ValueSet/DocumentEntry.confidentialityCode), and a coding from this value set is required) (codes = http://snomed.info/sct#17621005),severity=error]
[2023-01-12 18:25:28] [info] 2023-01-12 18:25:28.801 INFO [io-8080-exec-33] ProvideEmedDocumentCoprocessor: SingleValidationMessage[col=1943,row=1,locationString=Bundle.entry[2],message=Entry 'urn:uuid:63c9323d-9220-4f5f-a99d-e62ff28b0dde' isn't reachable by traversing from first Bundle entry,severity=error]
[2023-01-12 18:25:28] [info] 2023-01-12 18:25:28.801 INFO [io-8080-exec-33] ProvideEmedDocumentCoprocessor: SingleValidationMessage[col=2,row=1,locationString=Bundle.meta.profile[0],message=Profile reference 'http://example.com/StructureDefinition/padvDoc' has not been checked because it is unknown,severity=error]
[2023-01-12 18:25:28] [info] 2023-01-12 18:25:28.801 INFO [io-8080-exec-33] ProvideEmedDocumentCoprocessor: SingleValidationMessage[col=1943,row=1,locationString=Bundle.entry[2],message=Entry 'urn:uuid:63c9323d-9220-4f5f-a99d-e62ff28b0dde' isn't reachable by traversing from first Bundle entry,severity=error]
[2023-01-12 18:25:28] [info] 2023-01-12 18:25:28.801 INFO [io-8080-exec-33] ProvideEmedDocumentCoprocessor: SingleValidationMessage[col=2,row=1,locationString=Bundle.meta.profile[0],message=Profile reference 'http://example.com/StructureDefinition/padvDoc' has not been checked because it is unknown,severity=error]
[2023-01-12 18:25:28] [info] 2023-01-12 18:25:28.813 ERROR [io-8080-exec-33] c.PublishingNewEmedCoprocessor: Unexpected exception while building the medication treatment
[2023-01-12 18:25:28] [info] java.lang.IllegalArgumentException: Passed resource is not a supported author
[2023-01-12 18:25:28] [info] at org.projecthusky.fhir.emed.ch.epr.model.common.Author.(Author.java:65)
[2023-01-12 18:25:28] [info] at ch.qligier.hug.pmp.emed.aggregators.PadvCommentAggregator.aggregate(PadvCommentAggregator.java:51)
[2023-01-12 18:25:28] [info] at ch.qligier.hug.pmp.emed.aggregators.PadvAggregator.aggregate(PadvAggregator.java:110)
[2023-01-12 18:25:28] [info] at ch.qligier.hug.pmp.emed.aggregators.ItemAggregator.aggregate(ItemAggregator.java:125)
[2023-01-12 18:25:28] [info] at ch.qligier.hug.pmp.transactions.pmp.provide.coprocessors.PublishingNewEmedCoprocessor.process(PublishingNewEmedCoprocessor.java:170)
[2023-01-12 18:25:28] [info] at ch.qligier.hug.pmp.transactions.pmp.provide.coprocessors.ProvideEmedDocumentCoprocessor.process(ProvideEmedDocumentCoprocessor.java:245)
[2023-01-12 18:25:28] [info] at ch.qligier.hug.pmp.transactions.pmp.provide.ProvideDocumentProcessor.process(ProvideDocumentProcessor.java:127)
[2023-01-12 18:25:28] [info] at ch.qligier.hug.pmp.transactions.pmp.ProcessorForAuthorizedRequest.process(ProcessorForAuthorizedRequest.java:26)
[2023-01-12 18:25:28] [info] 2023-01-12 18:25:28.816 INFO [io-8080-exec-33] xds-iti41-consumer : ITI-41 route: responding early: There were errors in the processing
[2023-01-12 18:25:28] [info] 2023-01-12 18:25:28.816 DEBUG [io-8080-exec-33] p.t.c.i.Iti41ResponseConverter: ITI-41 route: Iti41ResponseConverter processor
[2023-01-12 18:25:28] [info] 2023-01-12 18:25:28.817 INFO [io-8080-exec-33] p.t.c.i.Iti41ResponseConverter: Uncaught exception while processing ITI-41 transaction
[2023-01-12 18:25:28] [info] ch.qligier.hug.pmp.common.errors.exceptions.GoToResponseCreationException: There were errors in the processing
[2023-01-12 18:25:28] [info] at ch.qligier.hug.pmp.transactions.pmp.provide.ProvideDocumentProcessor.process(ProvideDocumentProcessor.java:144)
[2023-01-12 18:25:28] [info] at ch.qligier.hug.pmp.transactions.pmp.ProcessorForAuthorizedRequest.process(ProcessorForAuthorizedRequest.java:26)
[2023-01-12 18:25:28] [info] at org.apache.camel.component.bean.AbstractBeanProcessor.process(AbstractBeanProcessor.java:108)
[2023-01-12 18:25:28] [info] at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:81)
[2023-01-12 18:25:28] [info] at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.doRun(RedeliveryErrorHandler.java:812)
[2023-01-12 18:25:28] [info] at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$RedeliveryTask.run(RedeliveryErrorHandler.java:720)
[2023-01-12 18:25:28] [info] at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:193)
[2023-01-12 18:25:28] [info] at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:64)
[2023-01-12 18:25:28] [info] 2023-01-12 18:25:28.817 DEBUG [ async-1] tDemographicsEncounterListener: Processing demographics encounter for patient MPI-PID 64370848-bed5-46c4-972f-05b410b59235
[2023-01-12 18:25:28] [info] 2023-01-12 18:25:28.822 DEBUG [io-8080-exec-33] p.t.c.i.Iti41ResponseConverter: Sending response: Response(status=FAILURE, errors=[ErrorInfo[codeContext=DocumentEntry.sourcePatientInfo has not been saved,customErrorCode=,errorCode=EXTRA_METADATA_NOT_SAVED,location=,severity=WARNING], ErrorInfo[codeContext=The PMP has encountered an internal error while aggregating the CDA document '9d3b7bda-2898-449b-91c2-9c7047f088c6', item: '552b20d5-22c5-4bc8-ae2c-373a32aca68e',customErrorCode=,errorCode=REGISTRY_ERROR,location=,severity=ERROR]])
[2023-01-12 18:25:28] [info] 2023-01-12 18:25:28.822 DEBUG [io-8080-exec-33] c.l.PatientWriteOpLockRegistry: Releasing patient write operation lock for 64370848-bed5-46c4-972f-05b410b59235
[2023-01-12 18:25:28] [info] 2023-01-12 18:25:28.823 ERROR [ async-1] eAsyncUncaughtExceptionHandler: Unexpected exception occurred invoking async method: public void ch.qligier.hug.pmp.application.listeners.PatientDemographicsEncounterListener.onApplicationEvent(ch.qligier.hug.pmp.common.models.events.PatientDemographicsEncounterEvent)
[2023-01-12 18:25:28] [info] org.hibernate.NonUniqueObjectException: A different object with the same identifier value was already associated with the session : [ch.qligier.hug.pmp.storage.entities.PatientDemographicEntity#64370848-bed5-46c4-972f-05b410b59235]
[2023-01-12 18:25:28] [info] at org.hibernate.engine.internal.StatefulPersistenceContext.checkUniqueness(StatefulPersistenceContext.java:696)
[2023-01-12 18:25:28] [info] at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.performUpdate(DefaultSaveOrUpdateEventListener.java:287)
[2023-01-12 18:25:28] [info] at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.entityIsDetached(DefaultSaveOrUpdateEventListener.java:230)
[2023-01-12 18:25:28] [info] at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:95)
[2023-01-12 18:25:28] [info] at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:75)
[2023-01-12 18:25:28] [info] at org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:107)
[2023-01-12 18:25:28] [info] at org.hibernate.internal.SessionImpl.fireSaveOrUpdate(SessionImpl.java:652)
[2023-01-12 18:25:28] [info] at org.hibernate.internal.SessionImpl.saveOrUpdate(SessionImpl.java:645)
[2023-01-12 18:25:28] [info] 2023-01-12 18:25:28.824 INFO [io-8080-exec-33] MemoryAuditMessageTransmission: Saving a new ATNA mess

@arhuberg
Copy link
Author

Example for this morning

padvwithcomment.zip

@arhuberg arhuberg changed the title Failed to export PADV with comment ITI-65 returns error when handling PADV with comments Jan 13, 2023
@qligier
Copy link
Member

qligier commented Jan 13, 2023

The PMP is not handling the Observation.note.author properly. I'll fix this bug next week!

@qligier qligier self-assigned this Jan 13, 2023
@qligier qligier added bug Something isn't working documentation Improvements or additions to documentation labels Jan 13, 2023
@qligier
Copy link
Member

qligier commented Jan 16, 2023

I've redeployed with a fix.

@arhuberg
Copy link
Author

When I sent a new PADV, I received this response:
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "warning",
"code": "invalid",
"details": {
"coding": [
{
"code": "EXTRA_METADATA_NOT_SAVED"
}
],
"text": "DocumentEntry.sourcePatientInfo has not been saved"
}
},
{
"severity": "error",
"code": "invalid",
"details": {
"coding": [
{
"code": "REGISTRY_ERROR"
}
],
"text": "The PMP has encountered an internal error while aggregating the eMed document 'bd779117-070b-4e32-8c2c-051965b918f3', item: '1c950959-a20c-4b6b-a41c-4506786cd462'"
}
}
]
}

@arhuberg
Copy link
Author

When I check the logs, I saw this error now maybe related to: #32

[2023-01-17 16:38:05] [info] java.lang.NullPointerException: Cannot invoke "java.util.Date.toInstant()" because the return value of "org.hl7.fhir.r4.model.Annotation.getTime()" is null

@qligier
Copy link
Member

qligier commented Jan 18, 2023

Redeployed with a fix.

@arhuberg
Copy link
Author

arhuberg commented Jan 18, 2023

Tested Fix 10:57 EST Jan 18 PADV saved successfully

I noticed the Medication Card for this same patient is not generated now - I will open a different issue.

@qligier qligier closed this as completed Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants