File tree Expand file tree Collapse file tree 3 files changed +21
-9
lines changed
api/producer/deleteDocumentReference Expand file tree Collapse file tree 3 files changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -40,9 +40,7 @@ def handler(
4040
4141 if not (core_model := repository .get_by_id (pointer_id )):
4242 logger .log (LogReference .PRODELETE002 , pointer_id = pointer_id )
43- return SpineErrorResponse .NO_RECORD_FOUND (
44- diagnostics = "The requested DocumentReference could not be found" ,
45- )
43+ return NRLResponse .RESOURCE_DOES_NOT_EXIST_DELETE ()
4644
4745 repository .delete (core_model )
4846
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ def test_delete_document_reference_not_exists(repository: DocumentPointerReposit
140140 body = result .pop ("body" )
141141
142142 assert result == {
143- "statusCode" : "404 " ,
143+ "statusCode" : "200 " ,
144144 "headers" : default_response_headers (),
145145 "isBase64Encoded" : False ,
146146 }
@@ -150,14 +150,14 @@ def test_delete_document_reference_not_exists(repository: DocumentPointerReposit
150150 "resourceType" : "OperationOutcome" ,
151151 "issue" : [
152152 {
153- "severity" : "error " ,
154- "code" : "not-found " ,
153+ "severity" : "information " ,
154+ "code" : "informational " ,
155155 "details" : {
156156 "coding" : [
157157 {
158- "code" : "NO_RECORD_FOUND " ,
159- "display" : "No record found " ,
160- "system" : "https://fhir.nhs.uk/ValueSet/Spine-ErrorOrWarningCode-1 " ,
158+ "code" : "RESOURCE_DELETED " ,
159+ "display" : "Resource deleted " ,
160+ "system" : "https://fhir.nhs.uk/ValueSet/NRL-ResponseCode " ,
161161 }
162162 ]
163163 },
Original file line number Diff line number Diff line change @@ -117,6 +117,20 @@ def RESOURCE_DELETED(cls):
117117 statusCode = "200" ,
118118 )
119119
120+ @classmethod
121+ def RESOURCE_DOES_NOT_EXIST_DELETE (cls ):
122+ return cls .from_issues (
123+ issues = [
124+ producer_model .OperationOutcomeIssue (
125+ severity = "information" ,
126+ code = "informational" ,
127+ details = NRLResponseConcept .from_code ("RESOURCE_DELETED" ),
128+ diagnostics = "The requested DocumentReference could not be found" ,
129+ )
130+ ],
131+ statusCode = "200" ,
132+ )
133+
120134
121135class SpineErrorResponse (Response ):
122136 @classmethod
You can’t perform that action at this time.
0 commit comments