{{#if (contains (toString (toJsonString msg)) '2.16.840.1.113883.10.20.22.2.56')}} {{#with (getFirstCdaSectionsByTemplateId msg '2.16.840.1.113883.10.20.22.2.56')}} {{#each (toArray 2_16_840_1_113883_10_20_22_2_56.entry) as |mentalEntry|}} {{#if mentalEntry.observation}} {{>Resources/Observation.hbs observationEntry=mentalEntry.observation ID=(generateUUID (toJsonString mentalEntry.observation))}}, {{#with (evaluate 'Utils/GeneratePatientId.hbs' obj=../../msg.ClinicalDocument.recordTarget.patientRole) as |patientId|}} {{>References/Observation/subject.hbs ID=(generateUUID (toJsonString mentalEntry.observation)) REF=(concat 'Patient/' patientId.Id)}}, {{/with}} {{#if mentalEntry.observation.author.assignedAuthor}} {{#with (evaluate 'Utils/GeneratePractitionerId.hbs' obj=mentalEntry.observation.author.assignedAuthor) as |practitionerId|}} {{>Resources/Practitioner.hbs practitioner=mentalEntry.observation.author.assignedAuthor ID=practitionerId.Id}}, {{>References/Observation/performer.hbs ID=(generateUUID (toJsonString mentalEntry.observation)) REF=(concat 'Practitioner/' practitionerId.Id)}}, {{/with}} {{/if}} {{/if}} {{#if mentalEntry.organizer}} {{#each (toArray this.organizer.component) as |mentalComp|}} {{>Resources/Observation.hbs observationEntry=mentalComp.observation ID=(generateUUID (toJsonString mentalComp.observation))}}, {{#with (evaluate 'Utils/GeneratePatientId.hbs' obj=../../../msg.ClinicalDocument.recordTarget.patientRole) as |patientId|}} {{>References/Observation/subject.hbs ID=(generateUUID (toJsonString mentalComp.observation)) REF=(concat 'Patient/' patientId.Id)}}, {{/with}} {{#if mentalComp.observation.author.assignedAuthor}} {{#with (evaluate 'Utils/GeneratePractitionerId.hbs' obj=mentalComp.observation.author.assignedAuthor) as |practitionerId|}} {{>Resources/Practitioner.hbs practitioner=mentalComp.observation.author.assignedAuthor ID=practitionerId.Id}}, {{>References/Observation/performer.hbs ID=(generateUUID (toJsonString mentalComp.observation)) REF=(concat 'Practitioner/' practitionerId.Id)}}, {{/with}} {{/if}} {{/each}} {{/if}} {{/each}} {{/with}} {{/if}}