src/main/java/ch/bfh/ti/i4mi/mag/mhd/iti65/Iti65RequestConverter.java
/**
	 * ITI-65: process ListResource resource from Bundle
	 * @param manifest
	 * @param submissionSet
	 */
ITI-65: process ListResource resource from Bundle
@param manifest
@param submissionSet
ITI - 65 : process ListResource resource from Bundle @param manifest @param submissionSet
private  void processDocumentManifest(ListResource manifest, SubmissionSet submissionSet) {
		for (Identifier id : manifest.getIdentifier()) {
			if (id.getUse() == null ||  id.getUse().equals(Identifier.IdentifierUse.OFFICIAL)) {
			} else if (id.getUse().equals(Identifier.IdentifierUse.USUAL)) {
				String uniqueId = noPrefix(id.getValue());				
				submissionSet.setUniqueId(uniqueId);	
			}
		}
		submissionSet.assignEntryUuid();
		manifest.setId(submissionSet.getEntryUuid());
		Extension designationType = manifest.getExtensionByUrl("http://profiles.ihe.net/ITI/MHD/StructureDefinition/ihe-designationType");
		if (designationType != null && designationType.getValue() instanceof CodeableConcept) {
			submissionSet.setContentTypeCode(transformCodeableConcept((CodeableConcept) designationType.getValue()));
		}
		DateTimeType created = manifest.getDateElement();
		submissionSet.setSubmissionTime(timestampFromDate(created));
		Reference ref = manifest.getSubject();
		submissionSet.setPatientId(transformReferenceToIdentifiable(ref, manifest));
        Extension authorRoleExt = manifest.getExtensionByUrl("http://fhir.ch/ig/ch-epr-mhealth/StructureDefinition/ch-ext-author-authorrole");
		if (manifest.hasSource() || (authorRoleExt!=null)) {
		    Identifiable identifiable = null;
			Reference author = manifest.getSource();
            if (authorRoleExt!=null) {
                Coding coding = authorRoleExt.castToCoding(authorRoleExt.getValue());
                if (coding !=null) {
                    identifiable = new Identifiable(coding.getCode(), new AssigningAuthority(noPrefix(coding.getSystem())));
                }
            }
			submissionSet.setAuthor(transformAuthor(author, manifest.getContained(), identifiable));
		}
		for (Extension recipientExt : manifest.getExtensionsByUrl("http://profiles.ihe.net/ITI/MHD/StructureDefinition/ihe-intendedRecipient")) {
			Reference recipientRef = (Reference) recipientExt.getValue();		
			Resource res = findResource(recipientRef, manifest.getContained());
			if (res instanceof Practitioner) {
				Recipient recipient = new Recipient();
				recipient.setPerson(transform((Practitioner) res));
				recipient.setTelecom(transform(((Practitioner) res).getTelecomFirstRep()));
				submissionSet.getIntendedRecipients().add(recipient);
			} else if (res instanceof Organization) {
				Recipient recipient = new Recipient();
				recipient.setOrganization(transform((Organization) res));
				recipient.setTelecom(transform(((Organization) res).getTelecomFirstRep()));
				submissionSet.getIntendedRecipients().add(recipient);
			} else if (res instanceof PractitionerRole) {
				Recipient recipient = new Recipient();
				PractitionerRole role = (PractitionerRole) res;
				recipient.setOrganization(transform((Organization) findResource(role.getOrganization(), manifest.getContained())));
				recipient.setPerson(transform((Practitioner) findResource(role.getPractitioner(), manifest.getContained())));
				recipient.setTelecom(transform(role.getTelecomFirstRep()));
				submissionSet.getIntendedRecipients().add(recipient);
			} else if (res instanceof Patient) {
				Recipient recipient = new Recipient();
				recipient.setPerson(transform((Patient) res));
				recipient.setTelecom(transform(((Patient) res).getTelecomFirstRep()));
			} else if (res instanceof RelatedPerson) {
				Recipient recipient = new Recipient();
				recipient.setPerson(transform((RelatedPerson) res));
				recipient.setTelecom(transform(((RelatedPerson) res).getTelecomFirstRep()));
			}								
		}
		Extension source = manifest.getExtensionByUrl("http://profiles.ihe.net/ITI/MHD/StructureDefinition/ihe-sourceId");
		if (source != null && source.getValue() instanceof Identifier) {
		  submissionSet.setSourceId(noPrefix(((Identifier) source.getValue()).getValue()));
		}
		String title = manifest.getTitle();		
		if (title!=null) submissionSet.setTitle(localizedString(title));		  
		Annotation note = manifest.getNoteFirstRep();
		if (note != null && note.hasText()) {			
		  submissionSet.setComments(localizedString(note.getText()));
		}
	}
private void processDocumentManifest ( ListResource manifest , SubmissionSet submissionSet ) { for ( Identifier id : manifest . getIdentifier ( ) ) { if ( id . getUse ( ) == null || id . getUse ( ) . equals ( Identifier . IdentifierUse . OFFICIAL ) ) { } else if ( id . getUse ( ) . equals ( Identifier . IdentifierUse . USUAL ) ) { String uniqueId = noPrefix ( id . getValue ( ) ) ; submissionSet . setUniqueId ( uniqueId ) ; } } submissionSet . assignEntryUuid ( ) ; manifest . setId ( submissionSet . getEntryUuid ( ) ) ; Extension designationType = manifest . getExtensionByUrl ( "http://profiles.ihe.net/ITI/MHD/StructureDefinition/ihe-designationType" ) ; if ( designationType != null && designationType . getValue ( ) instanceof CodeableConcept ) { submissionSet . setContentTypeCode ( transformCodeableConcept ( ( CodeableConcept ) designationType . getValue ( ) ) ) ; } DateTimeType created = manifest . getDateElement ( ) ; submissionSet . setSubmissionTime ( timestampFromDate ( created ) ) ; Reference ref = manifest . getSubject ( ) ; submissionSet . setPatientId ( transformReferenceToIdentifiable ( ref , manifest ) ) ; Extension authorRoleExt = manifest . getExtensionByUrl ( "http://fhir.ch/ig/ch-epr-mhealth/StructureDefinition/ch-ext-author-authorrole" ) ; if ( manifest . hasSource ( ) || ( authorRoleExt != null ) ) { Identifiable identifiable = null ; Reference author = manifest . getSource ( ) ; if ( authorRoleExt != null ) { Coding coding = authorRoleExt . castToCoding ( authorRoleExt . getValue ( ) ) ; if ( coding != null ) { identifiable = new Identifiable ( coding . getCode ( ) , new AssigningAuthority ( noPrefix ( coding . getSystem ( ) ) ) ) ; } } submissionSet . setAuthor ( transformAuthor ( author , manifest . getContained ( ) , identifiable ) ) ; } for ( Extension recipientExt : manifest . getExtensionsByUrl ( "http://profiles.ihe.net/ITI/MHD/StructureDefinition/ihe-intendedRecipient" ) ) { Reference recipientRef = ( Reference ) recipientExt . getValue ( ) ; Resource res = findResource ( recipientRef , manifest . getContained ( ) ) ; if ( res instanceof Practitioner ) { Recipient recipient = new Recipient ( ) ; recipient . setPerson ( transform ( ( Practitioner ) res ) ) ; recipient . setTelecom ( transform ( ( ( Practitioner ) res ) . getTelecomFirstRep ( ) ) ) ; submissionSet . getIntendedRecipients ( ) . add ( recipient ) ; } else if ( res instanceof Organization ) { Recipient recipient = new Recipient ( ) ; recipient . setOrganization ( transform ( ( Organization ) res ) ) ; recipient . setTelecom ( transform ( ( ( Organization ) res ) . getTelecomFirstRep ( ) ) ) ; submissionSet . getIntendedRecipients ( ) . add ( recipient ) ; } else if ( res instanceof PractitionerRole ) { Recipient recipient = new Recipient ( ) ; PractitionerRole role = ( PractitionerRole ) res ; recipient . setOrganization ( transform ( ( Organization ) findResource ( role . getOrganization ( ) , manifest . getContained ( ) ) ) ) ; recipient . setPerson ( transform ( ( Practitioner ) findResource ( role . getPractitioner ( ) , manifest . getContained ( ) ) ) ) ; recipient . setTelecom ( transform ( role . getTelecomFirstRep ( ) ) ) ; submissionSet . getIntendedRecipients ( ) . add ( recipient ) ; } else if ( res instanceof Patient ) { Recipient recipient = new Recipient ( ) ; recipient . setPerson ( transform ( ( Patient ) res ) ) ; recipient . setTelecom ( transform ( ( ( Patient ) res ) . getTelecomFirstRep ( ) ) ) ; } else if ( res instanceof RelatedPerson ) { Recipient recipient = new Recipient ( ) ; recipient . setPerson ( transform ( ( RelatedPerson ) res ) ) ; recipient . setTelecom ( transform ( ( ( RelatedPerson ) res ) . getTelecomFirstRep ( ) ) ) ; } } Extension source = manifest . getExtensionByUrl ( "http://profiles.ihe.net/ITI/MHD/StructureDefinition/ihe-sourceId" ) ; if ( source != null && source . getValue ( ) instanceof Identifier ) { submissionSet . setSourceId ( noPrefix ( ( ( Identifier ) source . getValue ( ) ) . getValue ( ) ) ) ; } String title = manifest . getTitle ( ) ; if ( title != null ) submissionSet . setTitle ( localizedString ( title ) ) ; Annotation note = manifest . getNoteFirstRep ( ) ; if ( note != null && note . hasText ( ) ) { submissionSet . setComments ( localizedString ( note . getText ( ) ) ) ; } }
ITI-65: process ListResource resource from Bundle
 @param manifest
 @param submissionSet
ITI - 65 : process ListResource resource from Bundle @param manifest @param submissionSet
//  subject	SubmissionSet.patientId // Author // recipient	SubmissionSet.intendedRecipient		