{{#with msg.ClinicalDocument}} {{>Resources/Composition.hbs composition=this ID=(generateUUID (toJsonString this))}}, {{#with (evaluate 'Utils/GeneratePatientId.hbs' obj=this.recordTarget.patientRole) as |patientId|}} {{>References/Composition/subject.hbs ID=(generateUUID (toJsonString ..)) REF=(concat 'Patient/' patientId.Id)}}, {{/with}} {{#if this.legalAuthenticator}} {{#with (evaluate 'Utils/GeneratePractitionerId.hbs' obj=this.legalAuthenticator.assignedEntity) as |practitionerId|}} {{>Resources/Practitioner.hbs practitioner=../legalAuthenticator.assignedEntity ID=practitionerId.Id}}, {{/with}} {{/if}} {{#if this.componentOf.encompassingEncounter}} {{>Resources/Encounter.hbs encounter=this.componentOf.encompassingEncounter ID=(generateUUID (toJsonString this.componentOf.encompassingEncounter))}}, {{>References/Composition/encounter.hbs ID=(generateUUID (toJsonString this)) REF=(concat 'Encounter/' (generateUUID (toJsonString this.componentOf.encompassingEncounter)))}}, {{#if this.componentOf.encompassingEncounter.location}} {{>Resources/Location.hbs location=this.componentOf.encompassingEncounter.location ID=(generateUUID (toJsonString this.componentOf.encompassingEncounter.location))}}, {{>References/Encounter/location.location.hbs ID=(generateUUID (toJsonString this.componentOf.encompassingEncounter)) REF=(concat 'Location/' (generateUUID (toJsonString this.componentOf.encompassingEncounter.location)))}}, {{/if}} {{/if}} {{#if this.custodian.assignedCustodian.representedCustodianOrganization.name._}} {{>Resources/Organization.hbs org=this.custodian.assignedCustodian.representedCustodianOrganization ID=(generateUUID (toJsonString this.custodian.assignedCustodian.representedCustodianOrganization))}}, {{>References/Composition/custodian.hbs ID=(generateUUID (toJsonString this)) REF=(concat 'Organization/' (generateUUID (toJsonString this.custodian.assignedCustodian.representedCustodianOrganization)))}}, {{/if}} {{/with}} {{#if msg.ClinicalDocument.author.assignedAuthor.assignedAuthoringDevice}} {{>Resources/Device.hbs author=msg.ClinicalDocument.author.assignedAuthor ID=(generateUUID (toJsonString msg.ClinicalDocument.author))}}, {{>References/Composition/author.hbs ID=(generateUUID (toJsonString msg.ClinicalDocument)) REF=(concat 'Device/' (generateUUID (toJsonString msg.ClinicalDocument.author)))}}, {{#if msg.ClinicalDocument.author.assignedAuthor.representedOrganization}} {{>Resources/Organization.hbs org=msg.ClinicalDocument.author.assignedAuthor.representedOrganization ID=(generateUUID (toJsonString msg.ClinicalDocument.author.assignedAuthor.representedOrganization))}}, {{>References/Device/owner.hbs ID=(generateUUID (toJsonString msg.ClinicalDocument.author)) REF=(concat 'Organization/' (generateUUID (toJsonString msg.ClinicalDocument.author.assignedAuthor.representedOrganization)))}}, {{/if}} {{/if}} {{#if msg.ClinicalDocument.author.assignedAuthor}} {{#with (evaluate 'Utils/GeneratePractitionerId.hbs' obj=msg.ClinicalDocument.author.assignedAuthor) as |practitionerId|}} {{>Resources/Practitioner.hbs practitioner=../msg.ClinicalDocument.author.assignedAuthor ID=practitionerId.Id}}, {{>References/Composition/author.hbs ID=(generateUUID (toJsonString ../msg.ClinicalDocument)) REF=(concat 'Practitioner/' practitionerId.Id)}}, {{/with}} {{/if}} {{#with msg.ClinicalDocument.recordTarget.patientRole}} {{#with (evaluate 'Utils/GeneratePatientId.hbs' obj=this) as |patientId|}} {{>Resources/Patient.hbs patientRole=.. ID=patientId.Id}}, {{#if ../patient.guardian}} {{>Resources/RelatedPerson.hbs relatedPerson=../patient.guardian ID=(generateUUID (toJsonString ../patient.guardian))}}, {{>References/RelatedPerson/patient.hbs ID=(generateUUID (toJsonString ../patient.guardian)) REF=(concat 'Patient/' patientId.Id)}}, {{/if}} {{/with}} {{/with}}