Validator error at Encounter resource - Encounter status

Hi,

I am getting the following error when validating my bundles with hl7 fhir validator jar.

Error @ Bundle.entry[269].resource.status (line 7120, col30) : The value provi
ded (‘finished’) is not in the value set http://hl7.org/fhir/ValueSet/encounter-
status|4.1.0 (…, and a code is required from this value set)

The bundle looks like this:


{
“fullUrl”: “urn:uuid:Encounter_p70-3666666”,
“resource”: {
“resourceType”: “Encounter”,
“id”: “fnp70-1111111111”,
“meta”: {
“profile”: [
http://hl7.org/fhir/StructureDefinition/Encounter
]
},
“status”: “finished”,
“class”: {
“code”: “AMB”
},
“subject”: {
“reference”: “Patient/20000000”
},
“period”: {
“start”: “2011-08-28T00:00:00+02:00”,
“end”: “2011-08-28T00:00:00+02:00”
}
},
“request”: {
“method”: “PUT”,
“url”: “Encounter/fnp70-1111111111”
}
},

I create the resource using the HAPI API.

Encounter enc=new Encounter();
enc.setId(“fn”+cEncounterId);
enc.getClass_().setCode(“AMB”);

	Meta m= new Meta();
	m.addProfile("http://hl7.org/fhir/StructureDefinition/Encounter");
	enc.setMeta(m);
	
	enc.setStatus(Encounter.EncounterStatus.FINISHED);
	
	Period per=new Period();
	if(date1!=null)
		per.setStart(date1);
	if(date2!=null)
		per.setEnd(date2);
	if(date1!=null||date2!=null)
		enc.setPeriod(per);
	
	
	enc.setSubject(new Reference("Patient/"+patientMap.get(cPatId).getId()));    	

I don’t have an idea what is going on here. The version 4.1.0 mentioned in the error message from the validator looks strange though.

Thank you,

Marko

exe

The validator assumes that you’re validating against the current build (4.1.0) rather than 4.0. Try passing a -version parameter.

Thanks you. I passed “-version 4.0.0” and the error is gone.