OriginatingSystem originator = new OriginatingSystem();
originator.setSystemID(new SystemID()
.setType(SystemIDType.LocalSystemID.code)
.setAssigningOrganisation("RA8:St Elsewhere's Hospital")
.setID("112YT"));
originator.setOrgID(new OrgID()
.setType(OrgIDType.ODSOrgID.code)
.setID("RA8"));
originator.setOrgName("St Elsewhere's Hospital");
document.setOriginatingSystem(originator);
// ********** EVENT *********************************************
Event event = new Event();
event.setEventID("1A97FCE1-389F-11E2-81C1-0800200C9A66");
event.setEventTime(new DateValue("20121127130000+0000"));
event.setEventType(NotificationEventType._01);
event.setDocumentType(NotificationDocumentType._861421000000109);
event.setDocumentFormat("text/xml");
event.setDocumentProfileID("urn:nhs-en:profile:EndofLifeRecordCDADocument-v1-0");
event.setEventSubtype(NotificationDocumentEvent._01);
document.setEvent(event);
// ********** CONTACT PERSON ************************************
ContactPerson contact = new ContactPerson();
contact.setPersonAddress(new Address("St. Elsewhere's Hostpital,Leeds, LS13 6YP"));
contact.setJobRoleName(JobRoleName._NR0050);
contact.setTelephone("tel:01132111111");
contact.setName(new PersonName("Dr. Smith"));
contact.setOrgID(new OrgID(OrgIDType.ODSOrgID.code, "RA8"));
contact.setOrgName("St. Elsewhere's Hospital");
event.setContactPerson(contact);
// ********** RECIPIENT *****************************************
Recipient recipient = new Recipient();