public static EncompassingEncounter createEncounter() {
EncompassingEncounter template = new EncompassingEncounter();
template.setId("3D3B95B5-24AA-42ED-9F77-BE7ECEB78C3E");
template.setCode(new CodedValue("11429006", "Consultation", "2.16.840.1.113883.2.1.3.2.4.15"));
template.setEffectiveTime(
new DateRange(new DateValue("201105191945+01"),
new DateValue("201105192015+01")));
// Responsible Party
PersonWithOrganizationUniversal responsible = new PersonWithOrganizationUniversal();
responsible.addPersonId(new PersonID().setNullFlavour(NullFlavour.NI.code));
responsible.setJobRoleName(JobRoleName._MedicalDirector);
responsible.setPersonName(new PersonName()
.setGivenName("Dave")
.setFamilyName("Cornwell"));
responsible.setOrgId(new OrgID()
.setID("VDE232323")
.setType(OrgIDType.ODSOrgID.code));
responsible.setOrgName("Medway South Walk-in Centre");
template.setResponsibleParty(responsible);
// Healthcare Facility
template.setEncounterCareSettingType(new CodedValue("313161000000107", "Example Care Setting", "2.16.840.1.113883.2.1.3.2.4.15"));
return template;
}