FHIR Chat · Profile with slice · hapi

Stream: hapi

Topic: Profile with slice


view this post on Zulip Binu DGIT (Jan 09 2017 at 06:27):

I am struggling to send data according to a profile with slice definition for "location"
I have sliced location in encounter to "locationDept","locationBed" and "locatonClinic" and assigned 1.* cardinality for "locationDept".
I tried to send the location data as follows and still it is not recognized and giving me the error "diagnostics": "Element '/f:Encounter.location': minimum required = 1, but only found 0". Can someone help me out in formatting the json data. Profile definition is attached

"location":[{
    "locationDept":[{
        "location" :{
            "reference":"Location/51.20068.jdn.577",
            "display":"GASTROENTEROLOGY"
            },
            "status":"completed",
            "period":{
                "start":"2011-03-24T19:25:00Z",
                "end":"2011-06-19T12:25:47Z"
            }
    }]      
}][OmEncounter.structuredefinition.xml](/user_uploads/10155/52LAH6nPry7mreJPRL8lr-Hh/OmEncounter.structuredefinition.xml) [MohLocationDept.structuredefinition.xml](/user_uploads/10155/0V0cwPYA2pfw0Ugl4ZUieuff/MohLocationDept.structuredefinition.xml) [MohLocationBed.structuredefinition.xml](/user_uploads/10155/Z1j_OoENUSmcP3rB3mQJ2Y5U/MohLocationBed.structuredefinition.xml)

view this post on Zulip Grahame Grieve (Jan 09 2017 at 06:43):

what do you do to get the error?

view this post on Zulip Binu DGIT (Jan 09 2017 at 06:44):

{
  "severity": "error",
  "code": "processing",
  "diagnostics": "Element '/f:Encounter.location': minimum required = 1, but only found 0",
  "location": [
    "/f:Encounter"
  ]
},

view this post on Zulip Binu DGIT (Jan 09 2017 at 07:44):

Dear James,
Can you please explain how the following codes functions..?

  if (discriminator.equals("url") && criteria.getPath().equals("Extension.url")) {
      System.out.print("First condition is over , going to check second ...");
      System.out.print("element.getAttribute(url) is--> " + element.getAttribute("url"));
      //System.out.print("((UriType) criteria.getFixed()).asStringValue())--> " + (((UriType) criteria.getFixed()).asStringValue())));

      System.out.println("second part.....");
      System.out.println(criteria.getFixed());

    if (!element.getAttribute("url").equals(((UriType) criteria.getFixed()).asStringValue()))                   
        return false;
  } else {
    Element value = getValueForDiscriminator(element, discriminator, criteria);
    if (!valueMatchesCriteria(value, criteria))
      return false;
  }

view this post on Zulip Grahame Grieve (Jan 09 2017 at 11:05):

so you are getting this error calling $validate on a HAPI server?

view this post on Zulip Grahame Grieve (Jan 09 2017 at 11:05):

which version?

view this post on Zulip Binu DGIT (Jan 09 2017 at 11:29):

I have tried slicing on identifiers as well. I can upload profiles but not able to send message successfully.
Here I tried discriminator as "system" and a fixed value ..
I have HAPI 2.0 available as FHIR server..

view this post on Zulip James Agnew (Feb 07 2017 at 11:52):

Hi @Binu DGIT . one thing to note, it would probably be worth upgrading to the latest HAPI (2.2). There are a lot of validator fixes between 2.0 and 2.2.

view this post on Zulip Binu DGIT (Feb 08 2017 at 05:03):

Thank you James for the update. Hope it is included with validation for slicing..


Last updated: Apr 12 2022 at 19:14 UTC