From 1a54caeeaa7d8ad2efb0c101a99308326e81f605 Mon Sep 17 00:00:00 2001 From: Danielle Tavares-Rixon Date: Mon, 27 Jun 2022 15:21:50 +1000 Subject: [PATCH] Corrected invariant FHIRPath to match design Invariants that drive behaviour from claim type have only included one element. The existing invariants need to be refactored to include the use of both elements. Fixes https://github.com/AuDigitalHealth/ci-medicare-records/issues/4 --- resources/explanationofbenefit-medicare.xml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/resources/explanationofbenefit-medicare.xml b/resources/explanationofbenefit-medicare.xml index 5f8fc72..63d47d8 100644 --- a/resources/explanationofbenefit-medicare.xml +++ b/resources/explanationofbenefit-medicare.xml @@ -2,7 +2,7 @@ - + <status value="active"/> @@ -31,16 +31,14 @@ <severity value="error"/> <human value="A PBS or RPBS claim SHALL include a prescription."/> <expression - value="(item.category.coding.code='pbs' or item.category.coding.code='rpbs') implies prescription.exists()" + value="prescription.exists() implies (subType.coding.code='pbs' or subType.coding.code='rpbs' or item.category.coding.code='pbs' or item.category.coding.code='rpbs')" /> </constraint> <constraint> <key value="inv-dh-eob-02"/> <severity value="error"/> <human value="A MBS or DVABS claim SHALL NOT include a prescription."/> - <expression - value="(item.category.coding.code='mbs' or item.category.coding.code='dva') implies prescription.exists().not()" - /> + <expression value="prescription.empty() implies (subType.coding.code='mbs' or subType.coding.code='dva' or item.category.coding.code='mbs' or item.category.coding.code='dva')"/> </constraint> <constraint> <key value="inv-dh-eob-03"/> @@ -51,8 +49,8 @@ <constraint> <key value="inv-dh-eob-04"/> <severity value="error"/> - <human value="A PBS claim (subType='pbs') SHALL be of type 'Pharmacy' (type='pharmacy')."/> - <expression value="subType.coding.code='pbs' implies type.coding.code='pharmacy'"/> + <human value="A PBS claim SHALL be of type 'Pharmacy' (type='pharmacy')."/> + <expression value="prescription.exists() implies type.coding.code='pharmacy'"/> </constraint> <constraint> <key value="inv-dh-eob-05"/>