fix(abdm): section.entry should only hold Invoice and DocumentReference without Binary so PHR carousel renders document card
This commit is contained in:
parent
c54cde814c
commit
2f0595a3a3
|
|
@ -12552,12 +12552,19 @@ class AbdmGateway extends BaseController
|
|||
'status' => 'current',
|
||||
'docStatus' => 'final',
|
||||
'type' => [
|
||||
'coding' => [[
|
||||
'system' => 'http://snomed.info/sct',
|
||||
'code' => '725458005',
|
||||
'display' => 'Receipt',
|
||||
]],
|
||||
'text' => 'Invoice Record',
|
||||
'coding' => [
|
||||
[
|
||||
'system' => 'http://snomed.info/sct',
|
||||
'code' => '725458005',
|
||||
'display' => 'Receipt',
|
||||
],
|
||||
[
|
||||
'system' => 'http://snomed.info/sct',
|
||||
'code' => '419891008',
|
||||
'display' => 'Record artifact',
|
||||
],
|
||||
],
|
||||
'text' => 'Invoice Receipt PDF',
|
||||
],
|
||||
'subject' => ['reference' => $patientRef, 'display' => $patientName],
|
||||
'date' => $issuedAt,
|
||||
|
|
@ -12652,12 +12659,6 @@ class AbdmGateway extends BaseController
|
|||
'type' => 'DocumentReference',
|
||||
];
|
||||
}
|
||||
if ($pdfBinary !== null) {
|
||||
$sectionEntries[] = [
|
||||
'reference' => 'urn:uuid:' . $pdfBinaryId,
|
||||
'type' => 'Binary',
|
||||
];
|
||||
}
|
||||
|
||||
$composition = [
|
||||
'resourceType' => 'Composition',
|
||||
|
|
|
|||
|
|
@ -422,7 +422,7 @@ final class FhirGeneratorsTest extends CIUnitTestCase
|
|||
$composition['section'][0]['entry'][0]['type'] ?? null,
|
||||
'NRCeS InvoiceRecord 6.5.0 requires Reference.type to be Invoice'
|
||||
);
|
||||
$this->assertCount(3, $composition['section'][0]['entry'] ?? []);
|
||||
$this->assertCount(2, $composition['section'][0]['entry'] ?? []);
|
||||
$this->assertNotEmpty($composition['author'][0]['reference'] ?? '');
|
||||
$this->assertNotEmpty($composition['custodian']['reference'] ?? '');
|
||||
$this->assertContains('https://nrces.in/ndhm/fhir/r4/StructureDefinition/Patient', $patient['meta']['profile'] ?? []);
|
||||
|
|
@ -479,8 +479,6 @@ final class FhirGeneratorsTest extends CIUnitTestCase
|
|||
static fn (array $entry): bool => ($entry['resource']['resourceType'] ?? '') === 'Binary'
|
||||
));
|
||||
$this->assertCount(1, $binaries);
|
||||
$this->assertSame('Binary', $composition['section'][0]['entry'][2]['type'] ?? null);
|
||||
$this->assertSame($fullUrlByResourceType['Binary'][0] ?? null, $composition['section'][0]['entry'][2]['reference'] ?? null);
|
||||
$this->assertSame('application/pdf', $binaries[0]['resource']['contentType'] ?? null);
|
||||
$this->assertSame($attachment['data'] ?? null, $binaries[0]['resource']['data'] ?? null);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user