HL7 ADT^A40 do not affect on document PatiendID and SourcePatientID

Primary tabs

Hi everyone, 

I am currently performing a patient merge thorug ADT^40 HL7 messages. In order to do that, I am following this guide which I found on the ducumentation: http://10.41.11.210:57772/csp/docbook/DocBook.UI.Page.cls?KEY=HESUP_ch_IHE#HESUP_IHE_configuring_registry_PIX
My main issue regards the fact that I can't update the PatientID and the SourcePatientID of the HS_Registry.Document table of the prior patient, wheras, I find only the new anagraphic on the HS_Registry.Patient table.

To do that I have created a process in my BUS prodaction which create the MergePatietRequest to send to the HUB Business Operation. Below the code: 

set tMergeRequest = ##class(HS.Message.MergePatientRequest).%New()
set tMergeRequest.PriorAssigningAuthority = IdTenantId
set tMergeRequest.PriorMRN = IdMpi
set tMergeRequest.Facility = sendingFac
set tMergeRequest.AssigningAuthority = IdTenantId
set tMergeRequest.MRN = NewIdMpi
    #dim tMergeResponse As HS.Message.MergePatientResponse
set sc=..SendRequestSync("HUB",tMergeRequest,.tMergeResponse)
if $$$ISERR(sc) quit sc set tIDUpdtNotifRequest = ##class(HS.Message.IDUpdateNotificationRequest).%New()
set tIDUpdtNotifRequest.PriorMPIID  = LombardiaMPIID
set priorIdentifier=##class(HS.Types.Identifier).%New()
set priorIdentifier.AssigningAuthorityName = "1"
do tIDUpdtNotifRequest.PriorIdentifiers.Insert(priorIdentifier)
set identifier=##class(HS.Types.Identifier).%New()
set identifier.AssigningAuthorityName = "1"
do tIDUpdtNotifRequest.Identifiers.Insert(identifier)
set tIDUpdtNotifRequest.MPIID = NewLombardiaMPIID
    #dim tIDUpdtNotifResponse As HS.Message.IDUpdateNotificationRequest
set sc=..SendRequestSync("HUB",tIDUpdtNotifRequest,.tIDUpdtNotifResponse)
if $$$ISERR(sc) quit sc

I have also implmented the IDUpdateNotificationRequest since it is not automatically generated, as written in the table. 

I also provide the visual trace of MergeRequest and IDUpdateRequest of the Registry production.

 

 

I am not sure the guide is up to date as I am not sure I have all the registry Business  services processes and operations involved are configured in the right way.

Thanks in advice to everyone will spend sometimes to help me. 

Kind regards,

Federico