FHIR POST Person error using basic example

I am trying to make a basic FHIR POST to create a Person resource using this URL (just to show I’m posting to the correct place): http://localhost:8081/openmrs-standalone/ws/fhir2/R4/Person/

based on the example straight from: https://www.hl7.org/FHIR/person-example.json.html

This is my JSON:

{
	"resourceType": "Person",
	"name": [
		{
			"use": "official",
			"family": [
				"Chalmers"
			],
			"given": [
				"Peter",
				"James"
			]
		},
		{
			"use": "usual",
			"given": [
				"Jim"
			]
		}
	],
	"gender": "male",
	"birthDate": "1974-12-25",
	"address": [
		{
			"use": "home",
			"line": [
				"534 Erewhon St"
			],
			"city": "PleasantVille",
			"state": "Vic",
			"postalCode": "3999"
		}
	],
	"active": true,
	"link": [
		{
			"target": {
				"reference": "RelatedPerson/peter",
				"display": "Peter Chalmers"
			}
		},
		{
			"target": {
				"reference": "Patient/example",
				"display": "Peter Chalmers"
			}
		}
	]
}

The response I get:

failed to validate with reason: voidReason: Cannot be empty or null

And in my server log:

Failure during REST processing: ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException: ‘Person(personId=null)’ failed to validate with reason: voidReason: Cannot be empty or null

I have searched the OpenMRS documentation and Google to no avail. Please advise.

Share the full server side via pastebin.com

@dkayiwa Thank-you for the message. I don’t know how far back you want me to go but I pasted the tomcat server log for today here.

It’s just a test server using the current referenceapplication-standalone-2.11.0 so there is nothing going on on it and I think there are only 2 relevant lines, pasted here also for reference:

INFO - SerializationServiceImpl.getDefaultSerializer(73) |2021-06-22 14:54:11,974| No default serializer specified - using builtin SimpleXStreamSerializer.
WARN - ExceptionHandlingInterceptor.createOperationOutcome(147) |2021-06-22 14:54:11,983| Failure during REST processing: ca.uhn.fhir.rest.server.exceptions.UnprocessableEntityException: 'Person(personId=null)' failed to validate with reason: voidReason: Cannot be empty or null

Thank-you

Are you able to reproduce it here? https://qa-refapp.openmrs.org/

Thanks for this. That’s definitely a bug in the module. I’ve created an issue to fix it here.

1 Like