}
public static EventNotification createNotification() throws Exception {
EventNotification document;
document = new EventNotification();
document.setTime(new DateValue("20121127151500+0000"));
document.setNotificationID("1A97FCE0-389F-11E2-81C1-0800200C9A66");
// ********** ORIGINATING SYSTEM ********************************
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();
recipient.setRecipientAddress(new Address("St. Elsewhere's Practice, Leeds, LS1 4HY"));
recipient.setJobRoleName(JobRoleName._NR0260);
recipient.setTelephone("tel:01132111112");
recipient.setOrgName("St. Elsewhere's Practice");
document.addRecipient(recipient);
// ********** PATIENT *********************************************
Patient patient = new Patient();
patient.setPatientAddress(new Address("111 St. Elsewhere's Street, Leeds, LS13 7TF"));
patient.setPatientNhsNumber(new PatientID(PatientIDType.VerifiedNHSNumber.code, "1111111111"));
patient.setPatientDOB(new DateValue("20010101"));
patient.addPatientName(new PersonName("John Smith"));
document.setPatient(patient);
return document;
}