Stream: implementers
Topic: Error For Patient Resource
Shahzeb Jadoon (Oct 24 2019 at 17:36):
Dear All,
When i check my patient resource on sandbox then in response an error is returned. The error is:
"The system could not parse the JSON response. Verify that the JSON provided is valid".
I am parsing the below JSON:
{
"resourceType": "Patient",
"id": "12345678",
"meta": {
"lastUpdated": "2019-09-04T15:02:49+05:00"
},
"extension": [
{
"url": ""
},
{
"url": ""
}
],
"identifier": [
{
"use": "official",
"type": {
"coding": [
{
"system": "https://www.hl7.org/fhir/v2/0203/index.html",
"code": "MR"
}
],
"text": "Medical record number"
},
"system": "urn:oid:2.16.840.1.113883.4.642.3.45",
"value": "12345678",
"period": {
"start": "9/4/2019 11:55:48 AM"
},
"assigner": {
"reference": "ABC",
"display": "ABC Assigned the identifier to Patient."
}
}
],
"active": true,
"name": [
{
"use": "official",
"text": "Doe John",
"given": [
"John",
""
],
"prefix": [
"J"
],
"period": {
"start": "9/4/2019 11:55:48 AM"
}
}
],
"telecom": [
{
"system": "phone",
"value": "2342342342",
"use": "home",
"rank": 2,
"period": {
"start": "9/4/2019 11:55:48 AM"
}
},
{
"system": "phone",
"use": "mobile",
"rank": 1,
"period": {
"start": "9/4/2019 11:55:48 AM"
}
},
{
"system": "email",
"value": "JOHNDOE@abc.COM",
"use": "work",
"rank": 1,
"period": {
"start": "9/4/2019 11:55:48 AM"
}
}
],
"gender": "male",
"birthDate": "8/1/1962 12:00:00 PM",
"deceasedBoolean": false,
"address": [
{
"use": "home",
"type": "physical",
"text": "123 jump st. Somerset, NJ 08873",
"line": [
"123 jump st. Somerset, NJ 08873",
""
],
"city": "SOMERSET",
"district": "",
"state": "NJ",
"postalCode": "08873",
"country": "",
"period": {
"start": "9/4/2019 11:55:48 AM"
}
}
],
"maritalStatus": {
"coding": [
{
"system": "https://www.hl7.org/fhir/v3/MaritalStatus/cs.html",
"code": "UNK"
}
],
"text": "Unknown"
},
"communication": [
{
"language": {
"coding": [
{
"system": "urn:ietf:bcp:47",
"code": "E"
}
],
"text": ""
},
"preferred": true
}
],
"managingOrganization": {
"reference": "ManagingOrganization/1011163",
"display": "PATRICIA CONKLING, CNP, LLC"
},
"link": [
{
"other": {
"reference": "https://www.hl7.org/fhir/v2/0203/index.html/",
"display": ""
},
"type": "replace"
}
]
}
Grahame Grieve (Oct 24 2019 at 17:43):
well, you would have to start by identifying which of the many servers you are asking about. Did you get the content-type header right?
Michele Mottini (Oct 24 2019 at 17:48):
Try to remove pieces to identify which one is bad
This is most likely bad:
"extension": [
{
"url": ""
},
{
"url": ""
}
],
Shahzeb Jadoon (Oct 24 2019 at 17:53):
@Grahame Grieve All other resources working fine but for Patient resource i am facing this problem. We are using application/json+fhir as content-type header.
Shahzeb Jadoon (Oct 24 2019 at 18:12):
@Michele Mottini as you said i remove "extension", but issue is still same.
Michele Mottini (Oct 24 2019 at 18:17):
Keep removing until you find out the one that cause the problem
Lloyd McKenzie (Oct 24 2019 at 19:12):
Empty elements should be valid JSON, but they're definitely not valid FHIR. Have you tried sticking your instance into a we - based JSON validator?
Shahzeb Jadoon (Oct 25 2019 at 14:32):
@Lloyd McKenzie i verified my JSON with online JSON validator, and its said its a valid JSON.
Lloyd McKenzie (Oct 25 2019 at 14:36):
Did you remove the empty nodes?
Shahzeb Jadoon (Oct 26 2019 at 11:13):
@Lloyd McKenzie yes i tried but Problem remains same
Lloyd McKenzie (Oct 26 2019 at 17:21):
Can you post your current corrected resource? Also, which sandbox are you posting to?
Shahzeb Jadoon (Oct 28 2019 at 17:44):
@Lloyd McKenzie I am posting it on Apple Ehr Gateway Sandbox. The current correct Resource (Patient) is:
{
"resourceType": "Patient",
"id": "12345678",
"meta": {
"lastUpdated": "2019-09-04T15:02:49+05:00"
},
"identifier": [{
"use": "official",
"type": {
"coding": [{
"system": "https://www.hl7.org/fhir/v2/0203/index.html",
"code": "MR"
}],
"text": "Medical record number"
},
"system": "urn:oid:2.16.840.1.113883.4.642.3.45",
"value": "12345678",
"period": {
"start": "9/4/2019 11:55:48 AM"
},
"assigner": {
"reference": "ABC",
"display": "ABC Assigned the identifier to Patient."
}
}],
"active": true,
"name": [{
"use": "official",
"text": "Doe John",
"given": [
"John"
],
"prefix": [
"J"
],
"period": {
"start": "9/4/2019 11:55:48 AM"
}
}],
"telecom": [{
"system": "phone",
"value": "2342342342",
"use": "home",
"rank": 2,
"period": {
"start": "9/4/2019 11:55:48 AM"
}
},
{
"system": "phone",
"use": "mobile",
"rank": 1,
"period": {
"start": "9/4/2019 11:55:48 AM"
}
},
{
"system": "email",
"value": "JOHNDOE@abc.COM",
"use": "work",
"rank": 1,
"period": {
"start": "9/4/2019 11:55:48 AM"
}
}
],
"gender": "male",
"birthDate": "8/1/1962 12:00:00 PM",
"deceasedBoolean": false,
"address": [{
"use": "home",
"type": "physical",
"text": "123 jump st. Somerset, NJ 08873",
"line": [
"123 jump st. Somerset, NJ 08873"
],
"city": "SOMERSET",
"state": "NJ",
"postalCode": "08873",
"period": {
"start": "9/4/2019 11:55:48 AM"
}
}],
"maritalStatus": {
"coding": [{
"system": "https://www.hl7.org/fhir/v3/MaritalStatus/cs.html",
"code": "UNK"
}],
"text": "Unknown"
},
"communication": [{
"language": {
"coding": [{
"system": "urn:ietf:bcp:47",
"code": "E"
}]
},
"preferred": true
}],
"managingOrganization": {
"reference": "ManagingOrganization/1011163",
"display": "PATRICIA CONKLING, CNP, LLC"
},
"link": [{
"other": {
"reference": "https://www.hl7.org/fhir/v2/0203/index.html/"
},
"type": "replace"
}]
}
Lloyd McKenzie (Oct 28 2019 at 17:56):
A few issues I see, though none that would obviously cause a complaint about invalid JSON:
- identifier.assigner.reference isn't valid - should be Organization/ABC (if the organization lives on the same server)
-your period start times (identifiers, telecoms and address) are not valid. They must have the format yyyy-mm-ddThh:mm:ss.ssss+zz:zz
- Your Patient.name has text that indicates a family name, but you don't list one
- address.line shouldn't include the city, state or postal code
- system URL for marital status is incorrect
- Communication.language.code isn't valid (should be EN)
- Managing organization reference should be Organation/1011163, not ManagingOrganization/1011163
- link.other.reference needs to be to a valid FHIR resource
Shahzeb Jadoon (Oct 28 2019 at 18:00):
@Lloyd McKenzie I am working on it and will back you soon
Shahzeb Jadoon (Oct 30 2019 at 17:56):
@Lloyd McKenzie As you said i made changes in my resource but still got same error. The current corrected Resource (Patient) is:
{
"resourceType": "Patient",
"id": "101116356514573",
"meta": {
"lastUpdated": "2019-09-04T15:02:49+05:00"
},
"identifier": [
{
"use": "official",
"type": {
"coding": [
{
"system": "http://hl7.org/fhir/ValueSet/identifier-type",
"code": "MR",
"display": "Medical record number"
}
]
},
"system": "urn:oid:2.16.840.1.113883.4.642.3.45",
"value": "101116356514573",
"period": {
"start": "2019-55-04T11:55:48.48++05:+05"
},
"assigner": {
"reference": "Organization/ABCD"
}
}
],
"active": true,
"name": [
{
"use": "official",
"text": "Doe John",
"family": [
"Doe"
],
"given": [
"John",
""
],
"prefix": [
"J"
],
"period": {
"start": "2019-55-04T11:55:48.48++05:+05"
}
}
],
"telecom": [
{
"system": "phone",
"value": "2342342342",
"use": "home",
"rank": 2,
"period": {
"start": "2019-55-04T11:55:48.48++05:+05"
}
},
{
"system": "phone",
"use": "mobile",
"rank": 1,
"period": {
"start": "2019-55-04T11:55:48.48++05:+05"
}
},
{
"system": "email",
"value": "JOHNDOE@ABCD.COM",
"use": "work",
"rank": 1,
"period": {
"start": "2019-55-04T11:55:48.48++05:+05"
}
}
],
"gender": "male",
"birthDate": "1962-08-01",
"deceasedBoolean": false,
"address": [
{
"use": "home",
"type": "physical",
"text": "123 jump st. Somerset, NJ 08873",
"line": [
"123 jump st. Somerset"
],
"city": "SOMERSET",
"state": "NJ",
"postalCode": "08873",
"period": {
"start": "2019-55-04T11:55:48.48++05:+05"
}
}
],
"maritalStatus": {
"coding": [
{
"system": "http://hl7.org/fhir/marital-status",
"code": "M",
"display": "Married"
}
],
"text": "Married"
},
"communication": [
{
"language": {
"coding": [
{
"system": "urn:ietf:bcp:47",
"code": "EN",
"display": "ENGLISH"
}
],
"text": "ENGLISH"
},
"preferred": true
}
],
"managingOrganization": {
"reference": "Organization/1011163",
"display": "PATRICIA CONKLING, CNP, LLC"
}
}
Lloyd McKenzie (Oct 30 2019 at 18:36):
You've still got an empty string - empty strings (and empty objects) are prohibited
Shahzeb Jadoon (Oct 31 2019 at 06:21):
@Lloyd McKenzie According to my knowledge i am not sending an empty string, make the Highlighted that empty strings except asssssssssssssssssss.png
Lloyd McKenzie (Oct 31 2019 at 16:00):
"" is an empty string. That's not permitted.
Lloyd McKenzie (Oct 31 2019 at 16:00):
If you don't have a middle name, just send ["John"]
Shahzeb Jadoon (Nov 02 2019 at 11:36):
@Lloyd McKenzie Thank you :blush:
Shahzeb Jadoon (Nov 04 2019 at 18:15):
@Lloyd McKenzie
As you said i made changes in my resource but still got same error, i am stucked in this error. The current corrected Resource (Patient) is:
{
"resourceType": "Patient",
"id": "101116356514573",
"meta": {
"lastUpdated": "2019-09-04T15:02:49+05:00"
},
"identifier": [
{
"use": "official",
"type": {
"coding": [
{
"system": "http://hl7.org/fhir/ValueSet/identifier-type",
"code": "MR",
"display": "Medical record number"
}
]
},
"system": "urn:oid:2.16.840.1.113883.4.642.3.45",
"value": "101116356514573",
"period": {
"start": "2019-55-04T11:55:48.48++05:+05"
},
"assigner": {
"reference": "Organization/ABCD"
}
}
],
"active": true,
"name": [
{
"use": "official",
"text": "Doe John",
"family": [
"Doe"
],
"given": [
"John",
"John"
],
"prefix": [
"J"
],
"period": {
"start": "2019-55-04T11:55:48.48++05:+05"
}
}
],
"telecom": [
{
"system": "phone",
"value": "2342342342",
"use": "home",
"rank": 2,
"period": {
"start": "2019-55-04T11:55:48.48++05:+05"
}
},
{
"system": "phone",
"use": "mobile",
"rank": 1,
"period": {
"start": "2019-55-04T11:55:48.48++05:+05"
}
},
{
"system": "email",
"value": "JOHNDOE@ABCD.COM",
"use": "work",
"rank": 1,
"period": {
"start": "2019-55-04T11:55:48.48++05:+05"
}
}
],
"gender": "male",
"birthDate": "1962-08-01",
"deceasedBoolean": false,
"address": [
{
"use": "home",
"type": "physical",
"text": "123 jump st. Somerset, NJ 08873",
"line": [
"123 jump st. Somerset"
],
"city": "SOMERSET",
"state": "NJ",
"postalCode": "08873",
"period": {
"start": "2019-55-04T11:55:48.48++05:+05"
}
}
],
"maritalStatus": {
"coding": [
{
"system": "http://hl7.org/fhir/marital-status",
"code": "M",
"display": "Married"
}
],
"text": "Married"
},
"communication": [
{
"language": {
"coding": [
{
"system": "urn:ietf:bcp:47",
"code": "EN",
"display": "ENGLISH"
}
],
"text": "ENGLISH"
},
"preferred": true
}
],
"managingOrganization": {
"reference": "Organization/1011163",
"display": "PATRICIA CONKLING, CNP, LLC"
}
}
Lloyd McKenzie (Nov 04 2019 at 18:31):
The instance is valid JSON and appears to be valid FHIR. Only slightly odd thing left is that 'J' seems an unusual name prefix. You'll have to talk to the people running the server you're trying to communicate with. @Pascal Pfiffner ?
David Hay (Nov 04 2019 at 19:04):
POSTing to a hapi $validate gives this error:
{
"resourceType": "OperationOutcome",
"text": {
"status": "generated",
"div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Operation Outcome</h1><table border=\"0\"><tr><td style=\"font-weight: bold;\">ERROR</td><td>[]</td><td><pre>Failed to parse request body as JSON resource. Error was: Invalid attribute value \"2019-55-04T11:55:48.48++05:+05\": Invalid date/time format: \"2019-55-04T11:55:48.48++05:+05\"</pre></td>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t</tr>\n\t\t</table>\n\t</div>"
},
"issue": [
{
"severity": "error",
"code": "processing",
"diagnostics": "Failed to parse request body as JSON resource. Error was: Invalid attribute value \"2019-55-04T11:55:48.48++05:+05\": Invalid date/time format: \"2019-55-04T11:55:48.48++05:+05\""
}
]
}
Lloyd McKenzie (Nov 04 2019 at 19:18):
What month has a number 55?
Lloyd McKenzie (Nov 04 2019 at 19:18):
Are you trying to create even more issues with FHIRPath date math @David Hay ? ;)
David Pyke (Nov 04 2019 at 19:30):
Sepnovctober.
Lloyd McKenzie (Nov 04 2019 at 19:52):
That sounds like a month that'd be a good time to visit Germany - they're sure to have a festival of some sort... :)
Pascal Pfiffner (Nov 04 2019 at 20:31):
@Shahzeb Jadoon , your dates are a bit mangled, this is not a valid dateTime instance: "2019-55-04T11:55:48.48++05:+05"
David Hay (Nov 04 2019 at 20:41):
it's not my fault! :)
Shahzeb Jadoon (Nov 06 2019 at 10:08):
@Pascal Pfiffner @Lloyd McKenzie Thank You
Vivek (Nov 06 2019 at 13:14):
Try to remove pieces to identify which one is bad
This is most likely bad:
"extension": [
{
"url": ""
},
{
"url": ""
}
],
Does it make sense to create an extension element with just url? I understand here the url is an empty string but even if we provide a valid url, does it make sense to create an extension element without value and just a url?
Lloyd McKenzie (Nov 07 2019 at 00:28):
Extensions generally mandate either a value or child extensions.
Last updated: Apr 12 2022 at 19:14 UTC