# How to set value to obs when creating an encounter

**URL:** <https://talk.openmrs.org/t/how-to-set-value-to-obs-when-creating-an-encounter/24470>\
**Category:** Development\
**Created:** [August 25, 2019, 5:10am UTC](https://talk.openmrs.org/t/how-to-set-value-to-obs-when-creating-an-encounter/24470 "2019-08-25T05:10:36Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![anatoleabe](https://talk.openmrs.org/letter_avatar/anatoleabe/32/5_5575768a8748004e209b776fc1b2916d.png) [@anatoleabe](https://talk.openmrs.org/u/anatoleabe)\
**Post date:** [August 25, 2019, 5:10am UTC](https://talk.openmrs.org/t/how-to-set-value-to-obs-when-creating-an-encounter/24470/1 "2019-08-25T05:10:36Z")

</div>

Hello, I am developping on the old version of OpenMRS 1.9.11 and Rest web service OMOD 2.25 for some project and I am having issue when attempting to create an encounter.

I can create the encounter if I don’t enter a value in groupMembers but what I wan is to enter some value to my groupMembers. Could you let me know what is the correct value forma that I should be passing?

This is my code and I am using Postman

[https://pastebin.com/PAgPrCL1](https://pastebin.com/PAgPrCL1)

And this is the error I got:

[https://pastebin.com/DLfXimFf](https://pastebin.com/DLfXimFf)

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![mozzy](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mozzy/32/11815_2.png) [@mozzy](https://talk.openmrs.org/u/mozzy)\
**Post date:** [August 25, 2019, 5:37am UTC](https://talk.openmrs.org/t/how-to-set-value-to-obs-when-creating-an-encounter/24470/2 "2019-08-25T05:37:37Z")

</div>

Hello @anatoleabe, can you use [pastebin](https://pastebin.com/) , to paste your data content and also the error logs??

---

<div class="post-metadata">

**Author:** ![anatoleabe](https://talk.openmrs.org/letter_avatar/anatoleabe/32/5_5575768a8748004e209b776fc1b2916d.png) [@anatoleabe](https://talk.openmrs.org/u/anatoleabe)\
**Post date:** [August 25, 2019, 5:56am UTC](https://talk.openmrs.org/t/how-to-set-value-to-obs-when-creating-an-encounter/24470/3 "2019-08-25T05:56:36Z")

</div>

Hello @mozzy, thanks for your advice. I did it. Can you help me please? or do you know some one who can help me?

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [August 25, 2019, 7:19am UTC](https://talk.openmrs.org/t/how-to-set-value-to-obs-when-creating-an-encounter/24470/4 "2019-08-25T07:19:21Z")

</div>

What is the Datatype of the concept whose value you are trying to set? That is the concept with uuid 3cd9b05c-26fe-102b-80cb-0017a47871b2

---

<div class="post-metadata">

**Author:** ![mozzy](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mozzy/32/11815_2.png) [@mozzy](https://talk.openmrs.org/u/mozzy)\
**Post date:** [August 25, 2019, 7:43am UTC](https://talk.openmrs.org/t/how-to-set-value-to-obs-when-creating-an-encounter/24470/5 "2019-08-25T07:43:01Z")

</div>

@anatoleabe the **concept class** for the concept of the **parent obs** should be a set , and then the concept for the GroupMember your trying to add ,should be one of the concepts in the concept set of the parent obs.

in other words the parent obs should have a concept that have a set of concepts

---

<div class="post-metadata">

**Author:** ![anatoleabe](https://talk.openmrs.org/letter_avatar/anatoleabe/32/5_5575768a8748004e209b776fc1b2916d.png) [@anatoleabe](https://talk.openmrs.org/u/anatoleabe)\
**Post date:** [August 25, 2019, 8:00am UTC](https://talk.openmrs.org/t/how-to-set-value-to-obs-when-creating-an-encounter/24470/6 "2019-08-25T08:00:22Z")

</div>

@dkayiwa This is the Datatype: [https://pastebin.com/Y13Jb03G](https://pastebin.com/Y13Jb03G)

---

<div class="post-metadata">

**Author:** ![mozzy](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mozzy/32/11815_2.png) [@mozzy](https://talk.openmrs.org/u/mozzy)\
**Post date:** [August 25, 2019, 8:05am UTC](https://talk.openmrs.org/t/how-to-set-value-to-obs-when-creating-an-encounter/24470/7 "2019-08-25T08:05:49Z")

</div>

@anatoleabe does that concept contain a set of concepts?

---

<div class="post-metadata">

**Author:** ![anatoleabe](https://talk.openmrs.org/letter_avatar/anatoleabe/32/5_5575768a8748004e209b776fc1b2916d.png) [@anatoleabe](https://talk.openmrs.org/u/anatoleabe)\
**Post date:** [August 25, 2019, 8:29am UTC](https://talk.openmrs.org/t/how-to-set-value-to-obs-when-creating-an-encounter/24470/8 "2019-08-25T08:29:58Z")

</div>

Yes @mozzy, this concept contain a set of concepts. I want to set one of them HIV VIRAL LOAD.

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [August 25, 2019, 8:46am UTC](https://talk.openmrs.org/t/how-to-set-value-to-obs-when-creating-an-encounter/24470/9 "2019-08-25T08:46:59Z")

</div>

Your uuid does not match with the one i asked.

---

<div class="post-metadata">

**Author:** ![anatoleabe](https://talk.openmrs.org/letter_avatar/anatoleabe/32/5_5575768a8748004e209b776fc1b2916d.png) [@anatoleabe](https://talk.openmrs.org/u/anatoleabe)\
**Post date:** [August 25, 2019, 8:55am UTC](https://talk.openmrs.org/t/how-to-set-value-to-obs-when-creating-an-encounter/24470/10 "2019-08-25T08:55:14Z")

</div>

Yes, it is the Datatype you asked. This is the whole with father [https://pastebin.com/KWHgtCL3](https://pastebin.com/KWHgtCL3)

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [August 25, 2019, 9:05am UTC](https://talk.openmrs.org/t/how-to-set-value-to-obs-when-creating-an-encounter/24470/11 "2019-08-25T09:05:20Z")

</div>

You are setting a value of “7” to concept of datatype “N/A” which is not allowed. I would have expected the concept datatype to be something like “Numeric”

---

<div class="post-metadata">

**Author:** ![anatoleabe](https://talk.openmrs.org/letter_avatar/anatoleabe/32/5_5575768a8748004e209b776fc1b2916d.png) [@anatoleabe](https://talk.openmrs.org/u/anatoleabe)\
**Post date:** [August 25, 2019, 9:44am UTC](https://talk.openmrs.org/t/how-to-set-value-to-obs-when-creating-an-encounter/24470/12 "2019-08-25T09:44:26Z")

</div>

I understand. But On this screen I see Numeric type and this is the field I wan to set up. May be I am not doing what is expected.

 ![16](https://talk.openmrs.org/uploads/default/original/2X/6/614215deb0f874f02a64cf527fb231896e53a065.png)

---

<div class="post-metadata">

**Author:** ![anatoleabe](https://talk.openmrs.org/letter_avatar/anatoleabe/32/5_5575768a8748004e209b776fc1b2916d.png) [@anatoleabe](https://talk.openmrs.org/u/anatoleabe)\
**Post date:** [August 25, 2019, 10:24am UTC](https://talk.openmrs.org/t/how-to-set-value-to-obs-when-creating-an-encounter/24470/13 "2019-08-25T10:24:48Z")

</div>

Hello @mozzy, by reading again and again your comment, I understood my mistake and I think I found the solution as you can see here: [https://pastebin.com/qWB6YQpk](https://pastebin.com/qWB6YQpk)

I put the parent concept in the obs, then in the groupMember I put the concept that is the one of parent concept set and I can now set the value as I want.

Thank you very much @dkayiwa and @mozzy for your help.
