template.addPatientID(new PatientIDWithTraceStatuses()
.setPatientID("9932541280")
.setNHSNoTraceStatus(NHSNumberTraceStatus.TraceNeedsToBeResolved.code)
.setPatientIDType(PatientIDType.UnverifiedNHSNumber.code));
template.addAddress(new Address()
.setAddressUse(AddressType.Home.code)
.addAddressLine("Appleton House")
.addAddressLine("Lanchester Road")
.addAddressLine("Grimsby")
.setPostcode("DN3 1UJ"));
template.addName(new PersonName()
.setGivenName("Mark")
.setFamilyName("Smith"));
template.setGender(Sex._Male);
template.setDateOfBirth(new DateValue("20120728"));
// Guardian
Guardian guardian = new Guardian();
guardian.addId(new PatientIDWithTraceStatuses()
.setPatientID("K12344")
.setPatientIDType(PatientIDType.LocalID.code)
.setAssigningOrganisation("V396A:Medway PCT"));
guardian.addId(new PatientIDWithTraceStatuses()
.setPatientID("993254127")
.setPatientIDType(PatientIDType.VerifiedNHSNumber.code)
.setNHSNoTraceStatus(NHSNumberTraceStatus.Traced.code));
guardian.setRole(GuardianRoleType._Mother);
guardian.addAddress(new Address()
.setAddressUse(AddressType.Home.code)
.addAddressLine("Appleton House")
.addAddressLine("Lanchester Road")
.addAddressLine("Grimsby")
.setPostcode("DN3 1UJ"));
guardian.addTelephoneNumber(new Telecom()
.setTelecom("tel:01634111678")
.setTelecomType(TelecomUseType.HomeAddress.code));
guardian.setGuardianDetails(new GuardianPerson()
.setGuardianName(new PersonName("Mrs", "Shelly", "Smith")));
template.addGuardian(guardian);
// Provider Organisation
template.setOrganisationId(new OrgID().setID("V396F"));
template.setOrganisationName("Dr De Hopper and Partners");
template.addOrganisationTelephone(new Telecom()
.setTelecom("tel:01634111222")
.setTelecomType(TelecomUseType.WorkPlace.code));
template.setOrganisationAddress(new Address()
.addAddressLine("Freshney Green PCC")
.addAddressLine("Grimsby")
.setPostcode("DN34 4GB")
.setAddressUse(AddressType.WorkPlace.code));
template.setOrganisationType(CDAOrganizationProviderType._GPPractice);