# Will two studies be merged if they have same patientid and accession number ?

**URL:** https://discourse.orthanc-server.org/t/will-two-studies-be-merged-if-they-have-same-patientid-and-accession-number/1358
**Category:** Google Groups archive
**Created:** [February 27, 2019, 11:36pm UTC](https://discourse.orthanc-server.org/t/will-two-studies-be-merged-if-they-have-same-patientid-and-accession-number/1358 "2019-02-27T23:36:14Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ranasrule](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/r/3e96dc/32.png) [@ranasrule](https://discourse.orthanc-server.org/u/ranasrule)
#### Post date: [February 27, 2019, 11:36pm UTC](https://discourse.orthanc-server.org/t/will-two-studies-be-merged-if-they-have-same-patientid-and-accession-number/1358/1 "2019-02-27T23:36:14Z")

</div>

Hello,  
Will Orthanc merge two studies if they have same patient-id and accession number ? What about if they have same patient-id and study-id?

![]( "Right click to shift")

---

<div class="post-metadata">

### Author: ![Alain\_Mazy3](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/a/eb9ed0/32.png) [@Alain\_Mazy3](https://discourse.orthanc-server.org/u/Alain_Mazy3)
#### Post date: [February 28, 2019, 7:42am UTC](https://discourse.orthanc-server.org/t/will-two-studies-be-merged-if-they-have-same-patientid-and-accession-number/1358/2 "2019-02-28T07:42:38Z")

</div>

You might consider that studies will be “merged” if they share the same Orthanc id. Check how Orthanc ids are computed to predict how they will be “merged” ([http://book.orthanc-server.com/faq/orthanc-ids.html](http://book.orthanc-server.com/faq/orthanc-ids.html)).

---

<div class="post-metadata">

### Author: ![jodogne](https://discourse.orthanc-server.org/user_avatar/discourse.orthanc-server.org/jodogne/32/1511_2.png) [@jodogne](https://discourse.orthanc-server.org/u/jodogne)
#### Post date: [February 28, 2019, 8:07am UTC](https://discourse.orthanc-server.org/t/will-two-studies-be-merged-if-they-have-same-patientid-and-accession-number/1358/3 "2019-02-28T08:07:42Z")

</div>

As explained in the FAQ pointed out by Alain, accession number is not taken into account by Orthanc to group studies. The decision rule is the following:

- Different patient IDs =\> studies not grouped
- Same patient IDs, different StudyInstanceUIDs =\> studies not grouped
- Same patient IDs, same StudyInstanceUIDs =\> studies grouped

---

<div class="post-metadata">

### Author: ![ranasrule](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/r/3e96dc/32.png) [@ranasrule](https://discourse.orthanc-server.org/u/ranasrule)
#### Post date: [February 28, 2019, 3:38pm UTC](https://discourse.orthanc-server.org/t/will-two-studies-be-merged-if-they-have-same-patientid-and-accession-number/1358/4 "2019-02-28T15:38:09Z")

</div>

Thank you for clearing things up.
